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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b98215cb1a19d5d22b4d6ffa7932f66634972fd6 | bc27749db347e1d73b37f03b54ff4f946f054be5 | /qywx-spring-boot-model/src/main/java/com/github/shuaidd/dto/externalcontact/ExternalProfile.java | 59b5cda2dea31c0c623b370d74dfae038acb003e | [
"Apache-2.0"
] | permissive | shuaidd/qywx | 163f50b72b8b260ec7ece0601274a1c6c6d4c918 | 816b49ad39311c58031154cf96b22d25b227e0e3 | refs/heads/master | 2023-08-08T14:56:13.989652 | 2022-12-28T01:33:56 | 2022-12-28T01:33:56 | 180,478,416 | 90 | 32 | Apache-2.0 | 2023-06-14T22:26:52 | 2019-04-10T01:37:07 | Java | UTF-8 | Java | false | false | 778 | java | package com.github.shuaidd.dto.externalcontact;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.shuaidd.dto.addressbook.ExtAttr;
import org.apache.commons.lang3.builder.ToStringBuilder;
import java.util.List;
/**
* 描述
*
* @author ddshuai
* date 2021-01-02 16:37
**/
public class ExternalProfile {
@JsonProperty("external_attr")
private List<ExtAttr> externalAttr;
public List<ExtAttr> getExternalAttr() {
return externalAttr;
}
public void setExternalAttr(List<ExtAttr> externalAttr) {
this.externalAttr = externalAttr;
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("externalAttr", externalAttr)
.toString();
}
}
| [
"ddshuai@shinyway.com.cn"
] | ddshuai@shinyway.com.cn |
272622225c5db0f864ae40f79730bfcb98a7fd38 | dda530fdbc9ffd31105d536df14b10b6b442b6bb | /src/edu/byu/plugins/importExport/marcxmlImport/Handle547Action.java | 954af78f3a47e245f59d90084f36afbb4e4623fd | [] | no_license | leemandell/AT-plugin-Import-Export-mult-date-extent | 2523a972cb98ca7aa4232118567776b2ff7905e9 | f5ccc37a71bf24724eeffb252f3b0708619af352 | refs/heads/master | 2020-08-27T06:02:10.701011 | 2009-12-30T16:38:40 | 2009-12-30T16:38:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 514 | java | package edu.byu.plugins.importExport.marcxmlImport;
import java.util.List;
import org.archiviststoolkit.model.Resources;
import org.archiviststoolkit.swing.InfiniteProgressPanel;
import org.archiviststoolkit.importer.MARCXML.MARCXMLAction;
public class Handle547Action implements MARCXMLAction
{
public void processElement(Resources resource, Object o, InfiniteProgressPanel progressPanel)
{
}
public List getChildren(Object element)
{
return null;
}
} | [
"lee@boswyckfarms.org"
] | lee@boswyckfarms.org |
50e4f874efdeff2f71f2b5cdd871054de5b1a495 | 663314e2b91d7a1deeb6f3069b2a03e65d67c8f4 | /guess-game-server/src/main/java/guess/dao/StateDao.java | aad16863b49a9987580ad1d86031758411c17272 | [] | no_license | dbelob/guess-game | 34b41e6d918a6ed91a56a398fa9a3f3e2187574b | a9d6827d7d199bb304bb36240f2fcdb7f11e56f0 | refs/heads/master | 2022-06-18T18:09:23.738837 | 2020-07-31T09:06:45 | 2020-07-31T09:06:45 | 196,954,564 | 13 | 5 | null | 2022-06-03T10:09:50 | 2019-07-15T08:13:12 | Java | UTF-8 | Java | false | false | 643 | java | package guess.dao;
import guess.domain.QuestionAnswersSet;
import guess.domain.StartParameters;
import guess.domain.State;
import javax.servlet.http.HttpSession;
/**
* State DAO.
*/
public interface StateDao {
State getState(HttpSession httpSession);
void setState(State state, HttpSession httpSession);
StartParameters getStartParameters(HttpSession httpSession);
void setStartParameters(StartParameters startParameters, HttpSession httpSession);
QuestionAnswersSet getQuestionAnswersSet(HttpSession httpSession);
void setQuestionAnswersSet(QuestionAnswersSet questionAnswersSet, HttpSession httpSession);
}
| [
"dbelob@users.noreply.github.com"
] | dbelob@users.noreply.github.com |
68ec245faaa2bcd6790f2b745c383f816c86b6d6 | d932fcedd25acd5c25795520fbe35b679911f3a3 | /weibo-sina/src/main/java/zx/soft/weibo/sina/example/FriendshipsFollowersActive.java | 60bfb5fd9724a572ed324c9c7c8cda2d561259dd | [] | no_license | advanced-programs/weibo-service | 9a07d4d383f0d475721811ec788c073769019451 | 1f7a44b05f8d481aba3c1e01866cd761963052d3 | refs/heads/master | 2021-01-25T04:02:59.153475 | 2015-11-10T07:21:54 | 2015-11-10T07:21:54 | 26,902,478 | 13 | 11 | null | null | null | null | UTF-8 | Java | false | false | 498 | java | package zx.soft.weibo.sina.example;
import zx.soft.utils.http.HttpClientDaoImpl;
import zx.soft.utils.json.JsonUtils;
import zx.soft.weibo.sina.api.SinaWeiboAPI;
import zx.soft.weibo.sina.domain.SinaDomain;
public class FriendshipsFollowersActive {
public static void main(String[] args) {
SinaWeiboAPI api = new SinaWeiboAPI(new HttpClientDaoImpl());
SinaDomain sinaDomain = api.friendshipsFollowersActive("2123664205", 200, 0);
System.out.println(JsonUtils.toJson(sinaDomain));
}
}
| [
"wanggang@zxisl.com"
] | wanggang@zxisl.com |
189146b701fd6b5f0611aa9f8fd42b03ad9666ce | 49b57339d939ea3f498249d3aacca1dec543163b | /jadx-snap-new/sources/com/google/android/gms/internal/zzadk.java | 0e21de7b86b41c9257ab1400a743907671ae343a | [] | no_license | 8secz-johndpope/snapchat-re | 1655036c41518c3a2aaa0c2543dc49f4acb93eaf | 04f5c5bb627d21f620088525fffcf5c99abd7ce5 | refs/heads/master | 2020-08-24T09:14:38.209745 | 2019-06-14T05:13:44 | 2019-06-14T05:13:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 737 | java | package com.google.android.gms.internal;
import android.os.Parcel;
import android.os.Parcelable.Creator;
public final class zzadk implements Creator<zzadj> {
public final /* synthetic */ Object createFromParcel(Parcel parcel) {
int zzd = zzbgm.zzd(parcel);
String str = null;
while (parcel.dataPosition() < zzd) {
int readInt = parcel.readInt();
if ((65535 & readInt) != 2) {
zzbgm.zzb(parcel, readInt);
} else {
str = zzbgm.zzq(parcel, readInt);
}
}
zzbgm.zzaf(parcel, zzd);
return new zzadj(str);
}
public final /* synthetic */ Object[] newArray(int i) {
return new zzadj[i];
}
}
| [
"blevy@protonmail.com"
] | blevy@protonmail.com |
ff2712eaa9259948307bee461fc9ec6a87318f7e | bcad1c93c7cd93e7a85e5398a1b3afdeefe35b2c | /src/main/java/runnables/Interrupt.java | a2189aeac760753105ee165db047094c240411dd | [] | no_license | kiranhari/safari-jvm-threads | c21ec6d13f32b93845bce975501b9a67b4840669 | 7c6946afa51199e47f60aba06250b32a102f1e26 | refs/heads/master | 2020-06-01T09:19:37.884790 | 2019-06-03T17:20:30 | 2019-06-03T17:20:30 | 190,729,310 | 1 | 0 | null | 2019-06-07T10:58:00 | 2019-06-07T10:58:00 | null | UTF-8 | Java | false | false | 854 | java | package runnables;
import java.util.concurrent.ThreadLocalRandom;
public class Interrupt {
private static boolean setMe = false;
private static boolean setMeToo = false;
public static void main(String[] args) throws InterruptedException {
Thread t1 = new Thread(() -> {
System.out.println("Hello!");
while (true) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
System.out.println("Value of setMeToo is " + setMeToo); // hb because of interrupt
setMe = true;
System.out.println("Thread exiting...");
return;
}
}
});
t1.start();
Thread.sleep(ThreadLocalRandom.current().nextInt(1_000, 2_000));
setMeToo = true;
t1.interrupt();
t1.join(); // allows me to see setMe
System.out.println("Set me is " + setMe);
}
}
| [
"simon@dancingcloudservices.com"
] | simon@dancingcloudservices.com |
4894ae39ba68688a504ce3eabcec1516ed1ab75f | 2c16007de25b78fa7f010cf8d471606b1bb31b2e | /aop/src/test/java/org/jboss/test/aop/basic/SomeException.java | 81c6c6818db52345a5caa62a16234261e2603946 | [] | no_license | stalep/jboss-aop | 24e1c64acb48540dca858fa3b093861b91f724eb | f9d6e15fc724f9e1c07a98aa301a52b4273a882f | refs/heads/master | 2022-07-08T04:31:18.718343 | 2009-01-28T03:01:01 | 2009-01-28T03:01:01 | 116,122 | 3 | 2 | null | 2022-07-01T22:17:50 | 2009-01-27T22:31:04 | Java | UTF-8 | Java | false | false | 1,293 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* 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.jboss.test.aop.basic;
/**
* @author <a href="mailto:bill@jboss.org">Bill Burke</a>
* @version $Revision$
*/
public class SomeException extends Exception
{
/** The serialVersionUID */
private static final long serialVersionUID = 1L;
}
| [
"kabir.khan@jboss.com@84be2c1e-ba19-0410-b317-a758671a6fc1"
] | kabir.khan@jboss.com@84be2c1e-ba19-0410-b317-a758671a6fc1 |
83a77def08190eb6ff3456ecb83a629b97d4b019 | e124c06aa37b93502a84f8931e1e792539883b9d | /divinerpg/utils/DimensionHelper.java | 6f9679ff3db4c5f3ceb41e6a606b40d1f1269d02 | [] | no_license | m-shayanshafi/FactRepositoryProjects | 12d7b65505c1e0a8e0ec3577cf937a1e3d17c417 | 1d45d667b454064107d78213e8cd3ec795827b41 | refs/heads/master | 2020-06-13T12:04:53.891793 | 2016-12-02T11:30:49 | 2016-12-02T11:30:49 | 75,389,381 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,614 | java | package net.divinerpg.utils;
import net.divinerpg.dimensions.arcana.BiomeGenArcana;
import net.divinerpg.dimensions.arcana.WorldProviderArcana;
import net.divinerpg.dimensions.iceika.BiomeGenIceika;
import net.divinerpg.dimensions.iceika.WorldProviderIceika;
import net.divinerpg.dimensions.twilight.apalachia.BiomeGenApalachia;
import net.divinerpg.dimensions.twilight.apalachia.WorldProviderApalachia;
import net.divinerpg.dimensions.twilight.eden.BiomeGenEden;
import net.divinerpg.dimensions.twilight.eden.WorldProviderEden;
import net.divinerpg.dimensions.twilight.mortum.BiomeGenMortum;
import net.divinerpg.dimensions.twilight.mortum.WorldProviderMortum;
import net.divinerpg.dimensions.twilight.skythern.BiomeGenSkythern;
import net.divinerpg.dimensions.twilight.skythern.WorldProviderSkythern;
import net.divinerpg.dimensions.twilight.wildwood.BiomeGenWildwood;
import net.divinerpg.dimensions.twilight.wildwood.WorldProviderWildwood;
import net.divinerpg.dimensions.vethea.BiomeGenVethea;
import net.divinerpg.dimensions.vethea.WorldProviderVethea;
import net.divinerpg.utils.config.ConfigurationHelper;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.DimensionManager;
public class DimensionHelper {
protected static final BiomeGenBase.Height iceikaHeight = new BiomeGenBase.Height(0.0F, 0.7F);
protected static final BiomeGenBase.Height vetheaHeight = new BiomeGenBase.Height(-1.0F, 0.0F);
protected static final BiomeGenBase.Height apalachiaHeight = new BiomeGenBase.Height(0.5F, 2.0F);
public static BiomeGenBase edenBiome = new BiomeGenEden(ConfigurationHelper.edenBiome);
public static BiomeGenBase wildwoodBiome = new BiomeGenWildwood(ConfigurationHelper.wildwoodBiome);
public static BiomeGenBase apalachiaBiome = new BiomeGenApalachia(ConfigurationHelper.apalachiaBiome);
public static BiomeGenBase skythernBiome = new BiomeGenSkythern(ConfigurationHelper.skythernBiome);
public static BiomeGenBase mortumBiome = new BiomeGenMortum(ConfigurationHelper.mortumBiome);
public static BiomeGenBase iceikaBiome = new BiomeGenIceika(ConfigurationHelper.iceikaBiome).setHeight(iceikaHeight);
public static BiomeGenBase vetheaBiome = new BiomeGenVethea(ConfigurationHelper.vetheaBiome).setHeight(vetheaHeight);
public static BiomeGenBase arcanaBiome = new BiomeGenArcana(ConfigurationHelper.arcanaBiome);
public static void init(){
addDimension(ConfigurationHelper.eden, WorldProviderEden.class, ConfigurationHelper.keepLoadingEden);
addDimension(ConfigurationHelper.wildwood, WorldProviderWildwood.class, ConfigurationHelper.keepLoadingWildwood);
addDimension(ConfigurationHelper.arcana, WorldProviderArcana.class, ConfigurationHelper.keepLoadingArcana);
addDimension(ConfigurationHelper.iceika, WorldProviderIceika.class, ConfigurationHelper.keepLoadingIceika);
addDimension(ConfigurationHelper.vethea, WorldProviderVethea.class, ConfigurationHelper.keepLoadingVethea);
addDimension(ConfigurationHelper.apalachia, WorldProviderApalachia.class, ConfigurationHelper.keepLoadingApalachia);
addDimension(ConfigurationHelper.skythern, WorldProviderSkythern.class, ConfigurationHelper.keepLoadingSkythern);
addDimension(ConfigurationHelper.mortum, WorldProviderMortum.class, ConfigurationHelper.keepLoadingMortum);
}
private static void addDimension(int id, Class<? extends WorldProvider> w, boolean keeploading){
LogHelper.debug("Registering dimension ID: " + id);
DimensionManager.registerProviderType(id, w, keeploading);
DimensionManager.registerDimension(id, id);
}
}
| [
"mshayanshafi@gmail.com"
] | mshayanshafi@gmail.com |
121ff5de7c582173cf63250164b14b362438e7bd | 83e934b83e10ec240d543b1981a9205e525a4889 | /07. 2. Open-Closed-And-Liskov-Principle-Exercises/03_Blobs_Solution/src/blobs/utility/MutableBoolean.java | 99fc48119a7b12bab87c33ffc0dc982b81ca480a | [
"MIT"
] | permissive | kostadinlambov/Java-OOP-Advanced | dca49a1b0750092cc713684403629ff9ca06d39e | 12db2a30422deef057fc25cf2947d8bc22cce77c | refs/heads/master | 2021-05-12T10:59:24.753433 | 2018-01-20T19:01:45 | 2018-01-20T19:01:45 | 117,370,385 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package blobs.utility;
public class MutableBoolean {
private boolean flag;
public MutableBoolean() {
this.flag = false;
}
public boolean isFlag() {
return this.flag;
}
public void setFlag(boolean flag) {
this.flag = flag;
}
}
| [
"valchak@abv.bg"
] | valchak@abv.bg |
ca1bf2c647deac28780768c00c54d7a17dfecf89 | cacd87f8831b02e254d65c5e86d48264c7493d78 | /pc/new/backstage/src/com/manji/backstage/vo/operation/AdvertVo.java | aa8f89d44a3d5d5b52d6246eba1056967eb1ef95 | [] | no_license | lichaoqian1992/beautifulDay | 1a5a30947db08d170968611068673d2f0b626eb2 | 44e000ecd47099dc5342ab8a208edea73602760b | refs/heads/master | 2021-07-24T22:48:33.067359 | 2017-11-03T09:06:15 | 2017-11-03T09:06:15 | 108,791,908 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 271 | java | package com.manji.backstage.vo.operation;
import com.manji.backstage.model.oper.Advert;
public class AdvertVo extends Advert{
int index;
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
}
| [
"1015598423@qq.com"
] | 1015598423@qq.com |
fcf5a5ce1742c8b48bcf1a43f6254b715383dcf8 | bebacae90aa17ad2ab4c9111a2e5cfa0f8cf13a6 | /CoreJavaProjects/CoreJavaExamples/src/com/journaldev/design/state/TVRemote1.java | 27e06fb30da80931ccab054784857a6e5ea33018 | [
"MIT"
] | permissive | ayanakshi/journaldev | 5b0d73c53bc9a5292a8629c6c0320196abeab76e | a61cba22232e8cc9c40264c31aaba0bd17ff2522 | refs/heads/master | 2020-03-27T21:52:15.081736 | 2018-08-31T11:51:28 | 2018-08-31T11:51:28 | 147,182,378 | 1 | 0 | MIT | 2018-09-03T09:28:38 | 2018-09-03T09:28:38 | null | UTF-8 | Java | false | false | 535 | java | package com.journaldev.design.state;
public class TVRemote1 {
private String state="";
public void setState(String state){
this.state=state;
}
public void doAction(){
if(state.equalsIgnoreCase("ON")){
System.out.println("TV is turned ON");
}else if(state.equalsIgnoreCase("OFF")){
System.out.println("TV is turned OFF");
}
}
public static void main(String args[]){
TVRemote1 remote = new TVRemote1();
remote.setState("ON");
remote.doAction();
remote.setState("OFF");
remote.doAction();
}
}
| [
"pankaj.0323@gmail.com"
] | pankaj.0323@gmail.com |
fccb698e3303a61848ef181315575d6d26b83b50 | 95a54e3f3617bf55883210f0b5753b896ad48549 | /java_src/com/liber8tech/tago/service/BluetoothService$discover$2.java | 27abbb29b8146bf49b9287f536034f8bea2ae947 | [] | no_license | aidyk/TagoApp | ffc5a8832fbf9f9819f7f8aa7af29149fbab9ea5 | e31a528c8f931df42075fc8694754be146eddc34 | refs/heads/master | 2022-12-22T02:20:58.486140 | 2021-05-16T07:42:02 | 2021-05-16T07:42:02 | 325,695,453 | 3 | 1 | null | 2022-12-16T00:32:10 | 2020-12-31T02:34:45 | Smali | UTF-8 | Java | false | false | 1,892 | java | package com.liber8tech.tago.service;
import android.os.SystemClock;
import com.polidea.rxandroidble2.RxBleDevice;
import io.reactivex.functions.Consumer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
/* access modifiers changed from: package-private */
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "devices", "", "Lcom/polidea/rxandroidble2/RxBleDevice;", "accept"}, k = 3, mv = {1, 1, 13})
/* compiled from: BluetoothService.kt */
public final class BluetoothService$discover$2<T> implements Consumer<List<RxBleDevice>> {
final /* synthetic */ Map $ttl;
BluetoothService$discover$2(Map map) {
this.$ttl = map;
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // io.reactivex.functions.Consumer
public /* bridge */ /* synthetic */ void accept(List<RxBleDevice> list) {
accept((List<? extends RxBleDevice>) list);
}
public final void accept(@NotNull List<? extends RxBleDevice> list) {
Intrinsics.checkParameterIsNotNull(list, "devices");
long elapsedRealtime = SystemClock.elapsedRealtime();
Iterator<T> it2 = list.iterator();
while (it2.hasNext()) {
this.$ttl.put(it2.next(), Long.valueOf(elapsedRealtime));
}
Iterator it3 = this.$ttl.entrySet().iterator();
while (it3.hasNext()) {
if (elapsedRealtime - ((Number) ((Map.Entry) it3.next()).getValue()).longValue() > 8000) {
it3.remove();
}
}
}
}
| [
"ai@AIs-MacBook-Pro.local"
] | ai@AIs-MacBook-Pro.local |
17e7cce3540b3082116801ae7c012d33338c3bef | 7b8fb3c97951cd4be702c820333d9bda505db060 | /大数据/笔记/代码/1606Hadoop-inputformat/src/cn/tarena/score/ScoreMapper.java | 7b9e80b301bcb392d1472b959f82e5ef131a1ccc | [] | no_license | pinggaimuir/Document | 12d886d580efd95c0dc482a259fdc80bfc30585d | da91004811326d48b6cec6bbff3c8ea17042d15c | refs/heads/master | 2021-01-01T16:42:04.122148 | 2018-05-11T08:41:54 | 2018-05-11T08:41:54 | 97,893,348 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 380 | java | package cn.tarena.score;
import java.io.IOException;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class ScoreMapper extends Mapper<Text, Text, Text, Text>{
@Override
protected void map(Text key, Text value, Mapper<Text, Text, Text, Text>.Context context)
throws IOException, InterruptedException {
context.write(key, value);
}
}
| [
"pinggaimuir@sina.com"
] | pinggaimuir@sina.com |
84928e55ac0c2ded8cdca400e994568ff172d554 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/mockito--mockito/83e1a6d2b756fbee7b9c9b4af175246f70d651b3/after/NumberOfInvocationsVerifier.java | 65fd3229fa60b44df9e8b518618e33cc2e5d4e08 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,110 | java | /*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.verification;
import java.util.List;
import org.mockito.exceptions.Reporter;
import org.mockito.exceptions.base.HasStackTrace;
import org.mockito.internal.invocation.Invocation;
import org.mockito.internal.invocation.InvocationMatcher;
import org.mockito.internal.invocation.InvocationsFinder;
import org.mockito.internal.progress.VerificationModeImpl;
public class NumberOfInvocationsVerifier implements Verifier {
private final Reporter reporter;
private final InvocationsFinder finder;
public NumberOfInvocationsVerifier() {
this(new Reporter(), new InvocationsFinder());
}
NumberOfInvocationsVerifier(Reporter reporter, InvocationsFinder finder) {
this.reporter = reporter;
this.finder = finder;
}
public void verify(List<Invocation> invocations, InvocationMatcher wanted, VerificationModeImpl mode) {
if (!mode.exactNumberOfInvocationsMode()) {
return;
}
List<Invocation> actualInvocations = finder.findInvocations(invocations, wanted, mode);
int actualCount = actualInvocations.size();
if (mode.tooLittleActualInvocations(actualCount)) {
HasStackTrace lastInvocation = finder.getLastStackTrace(actualInvocations);
reporter.tooLittleActualInvocations(mode.wantedCount(), actualCount, wanted, lastInvocation);
} else if (mode.neverWantedButInvoked(actualCount)) {
HasStackTrace firstUndesired = actualInvocations.get(mode.wantedCount()).getStackTrace();
reporter.neverWantedButInvoked(wanted, firstUndesired);
} else if (mode.tooManyActualInvocations(actualCount)) {
HasStackTrace firstUndesired = actualInvocations.get(mode.wantedCount()).getStackTrace();
reporter.tooManyActualInvocations(mode.wantedCount(), actualCount, wanted, firstUndesired);
}
for (Invocation i : actualInvocations) {
i.markVerified();
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
5d5cb69eb811f651ee30b07ca65a63af41cfc7bf | 616e54ed1ab3e93ad86f588b9680ab5be4e2628b | /src/main/java/irille/wxpub/js/JMOnMenuShareAppMessage.java | efaea8fceb74045a4a38b43e4661e04f792be3b7 | [] | no_license | yingjianhua/srdz | e23a278e910ecd5db05d68a1861b210400bda453 | ad491710c4bc48b5d0000561d5971ffd61c9ccdc | refs/heads/master | 2020-04-16T02:08:15.813060 | 2017-01-09T13:14:02 | 2017-01-09T13:14:02 | 61,923,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,110 | java | package irille.wxpub.js;
import irille.pub.Log;
public class JMOnMenuShareAppMessage extends JMBase<JMOnMenuShareAppMessage> {
public static final Log LOG = new Log(JMOnMenuShareAppMessage.class);
protected JsFldStr _title;
protected JsFldStr _desc;
protected JsFldStr _link;
protected JsFldStr _imgUrl;
protected JsFldStr _type;
protected JsFldStr _dataUrl;
public JsFldStr getDesc() {
return _desc;
}
public void setDesc(String desc) {
_desc = new JsFldStr(desc);
}
public JsFldStr getType() {
return _type;
}
public void setType(String type) {
_type = new JsFldStr(type);
}
public JsFldStr getDataUrl() {
return _dataUrl;
}
public void setDataUrl(String dataUrl) {
_dataUrl = new JsFldStr(dataUrl);
}
public JsFldStr getTitle() {
return _title;
}
public void setTitle(String title) {
_title = new JsFldStr(title);
}
public JsFldStr getLink() {
return _link;
}
public void setLink(String link) {
_link = new JsFldStr(link);
}
public JsFldStr getImgUrl() {
return _imgUrl;
}
public void setImgUrl(String imgUrl) {
_imgUrl = new JsFldStr(imgUrl);
}
} | [
"a86291151@163.com"
] | a86291151@163.com |
e2052fd763abca365256194d074f2322bd192b51 | 78b334abeba3c774f88e1482e4c9364ee9df5b09 | /tests/org.jboss.tools.esb.ui.bot.test/src/org/jboss/tools/esb/ui/bot/test/ListenersTest.java | 0c1929d91bfed6209d6cb5fa932ab777c05d8be8 | [] | no_license | mbaluch/jbosstools-integration-stack-tests | cf2250680dda0293862b0b3e6ee9700e6406e28c | 311817d3cbb4549d49aa9da531a6b9f572b3436f | refs/heads/master | 2020-05-20T19:28:31.180085 | 2015-01-19T08:17:43 | 2015-01-19T08:17:43 | 26,265,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,910 | java | package org.jboss.tools.esb.ui.bot.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.jboss.reddeer.eclipse.jdt.ui.ProjectExplorer;
import org.jboss.reddeer.eclipse.ui.perspectives.JavaEEPerspective;
import org.jboss.reddeer.junit.logging.Logger;
import org.jboss.reddeer.junit.runner.RedDeerSuite;
import org.jboss.reddeer.requirements.cleanworkspace.CleanWorkspaceRequirement.CleanWorkspace;
import org.jboss.reddeer.requirements.openperspective.OpenPerspectiveRequirement.OpenPerspective;
import org.jboss.reddeer.swt.api.Combo;
import org.jboss.reddeer.swt.impl.button.PushButton;
import org.jboss.reddeer.swt.impl.shell.WorkbenchShell;
import org.jboss.tools.esb.reddeer.editor.ESBEditor;
import org.jboss.tools.esb.reddeer.wizard.ESBListenerWizard;
import org.jboss.tools.esb.reddeer.wizard.ESBProjectWizard;
import org.jboss.tools.esb.ui.bot.test.util.Assertions;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
*
* @author apodhrad
*
*/
@CleanWorkspace
@OpenPerspective(JavaEEPerspective.class)
@RunWith(RedDeerSuite.class)
public class ListenersTest {
public static final String PROJECT_NAME = "esb-listeners";
public static final String ESB_FILE = "jboss-esb.xml";
public static final String NAME_SUFFIX = "-name";
public static final String SERVICE = "aaa";
public Logger log = Logger.getLogger(ListenersTest.class);
@BeforeClass
public static void createProject() {
new WorkbenchShell().maximize();
new ESBProjectWizard().openWizard().setName(PROJECT_NAME).finish();
new ProjectExplorer().getProject(PROJECT_NAME).getProjectItem("esbcontent", "META-INF", ESB_FILE).open();
new ESBEditor().addService(SERVICE, "bbb", "ccc");
new ESBEditor().save();
}
@AfterClass
public static void deleteProject() {
new ProjectExplorer().getProject(PROJECT_NAME).delete(true);
}
@Before
public void openFile() {
new ProjectExplorer().getProject(PROJECT_NAME).getProjectItem("esbcontent", "META-INF", ESB_FILE).open();
}
@After
public void saveAndCloseEditor() {
try {
new ESBEditor().save();
new ESBEditor().close();
} catch (Exception e) {
}
}
@Test
public void listenerTest() {
String type = "Listener";
String name = "listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void camelGatewayTest() {
String type = "Camel Gateway";
String name = "camel-gateway";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void fptListenerTest() {
String type = "FTP Listener";
String name = "ftp-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void fsListenerTest() {
String type = "FS Listener";
String name = "fs-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void groovyListenerTest() {
String type = "Groovy Listener";
String name = "groovy-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.setScript("test.groovy");
wizard.finish();
check(name);
}
@Test
public void hibernateListenerTest() {
String type = "Hibernate Listener";
String name = "hibernate-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void httpGatewayTest() {
String type = "HTTP Gateway";
String name = "http-gateway";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void jbrListenerTest() {
String type = "JBR Listener";
String name = "jbr-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void jmsListenerTest() {
String type = "JMS Listener";
String name = "jms-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void jcaGatewayTest() {
String type = "JCA Gateway";
String name = "jca-gateway";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.setAdapter("test.adapter");
wizard.setEndpointClass("java.lang.Object");
wizard.finish();
check(name);
}
@Test
public void scheduledListenerTest() {
String type = "Scheduled Listener";
String name = "scheduled-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void sqlListenerTest() {
String type = "SQL Listener";
String name = "sql-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.finish();
check(name);
}
@Test
public void udpListenerTest() {
String type = "UDP Listener";
String name = "udp-listener";
ESBListenerWizard wizard = new ESBEditor().addListenerToService(SERVICE, type);
assertFalse(new PushButton("Finish").isEnabled());
wizard.setName(name + NAME_SUFFIX);
wizard.setHost("localhost");
wizard.setPort("123");
wizard.finish();
check(name);
}
private void check(String name) {
String source = new ESBEditor().getSource();
String xpath = "count(//jbossesb/services/service[@name='" + SERVICE + "']/listeners/" + name + "[@name='"
+ name + NAME_SUFFIX + "'])=1";
Assertions.assertXmlContentBool(source, xpath);
Assertions.assertEmptyProblemsView("after " + name + " was added");
/*
* Added test for - https://issues.jboss.org/browse/JBQA-6527 - Add
* support for gateway messaging priority in the ESB editor
*/
if (name.contains("gateway")) {
Combo combo = new ESBEditor().getMessageFlowPriorityCombo();
assertTrue(combo.getSelectionIndex() == -1);
List<String> theItems = combo.getItems();
assertTrue(theItems.size() == 11);
assertEquals("0", theItems.get(1));
assertEquals("1", theItems.get(2));
assertEquals("2", theItems.get(3));
assertEquals("3", theItems.get(4));
assertEquals("4", theItems.get(5));
assertEquals("5", theItems.get(6));
assertEquals("6", theItems.get(7));
assertEquals("7", theItems.get(8));
assertEquals("8", theItems.get(9));
assertEquals("9", theItems.get(10));
new ESBEditor().setMessageFlowPriority("7").save();
assertEquals("7", new ESBEditor().getMessageFlowPriority());
}
}
}
| [
"apodhrad@redhat.com"
] | apodhrad@redhat.com |
c8794d353a0e97cea781db48cbc944c5b250219e | c096a03908fdc45f29574578b87662e20c1f12d4 | /com/src/main/java/lip/com/google/android/gms/drive/internal/UpdateMetadataRequest.java | 82c7966c0383ae2d80aac51e499ecb8d6f2b8e58 | [] | no_license | aboaldrdaaa2/Myappt | 3762d0572b3f0fb2fbb3eb8f04cb64c6506c2401 | 38f88b7924c987ee9762894a7a5b4f8feb92bfff | refs/heads/master | 2020-03-30T23:55:13.551721 | 2018-10-05T13:41:24 | 2018-10-05T13:41:24 | 151,718,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 987 | java | package lip.com.google.android.gms.drive.internal;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.drive.DriveId;
import com.google.android.gms.drive.metadata.internal.MetadataBundle;
public class UpdateMetadataRequest implements SafeParcelable {
public static final Creator<UpdateMetadataRequest> CREATOR = new ay();
final DriveId Iu;
final MetadataBundle Iv;
final int xM;
UpdateMetadataRequest(int versionCode, DriveId id, MetadataBundle metadataChangeSet) {
this.xM = versionCode;
this.Iu = id;
this.Iv = metadataChangeSet;
}
public UpdateMetadataRequest(DriveId id, MetadataBundle metadataChangeSet) {
this(1, id, metadataChangeSet);
}
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel dest, int flags) {
ay.a(this, dest, flags);
}
}
| [
"aboaldrdaaa2@gmail.com"
] | aboaldrdaaa2@gmail.com |
8c1e1699aac949aa7f7230177beda8f4e204f591 | 3714974b546f7fddeeea54d84b543c3b350a7583 | /myProjects/MGTV/src/com/starcor/core/domain/StarInfo.java | 183c1c13eb19d51209a3a5940bde27848efb67c4 | [] | no_license | lubing521/ideaProjects | 57a8dadea5c0d8fc3e478c7829e6897dce242bde | 5fd85e6dbe1ede8f094de65226de41321c1d0683 | refs/heads/master | 2022-01-18T23:10:05.057971 | 2018-10-26T12:27:00 | 2018-10-26T12:27:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,151 | java | package com.starcor.core.domain;
import java.io.Serializable;
public class StarInfo
implements Serializable
{
private static final long serialVersionUID = 1L;
private String alias_name = "";
private String en_name = "";
private String id = "";
private String img_h = "";
private String img_s = "";
private String img_v = "";
private String info = "";
private String label_id = "";
private String label_id_v2 = "";
private String name = "";
private String old_name = "";
private String sex = "";
private String star_type = "";
private String type = "";
public String getAliasName()
{
return this.alias_name;
}
public String getEnName()
{
return this.en_name;
}
public String getId()
{
return this.id;
}
public String getImgH()
{
return this.img_h;
}
public String getImgS()
{
return this.img_s;
}
public String getImgV()
{
return this.img_v;
}
public String getInfo()
{
return this.info;
}
public String getLabelId()
{
return this.label_id;
}
public String getLabelIdV2()
{
return this.label_id_v2;
}
public String getName()
{
return this.name;
}
public String getOldName()
{
return this.old_name;
}
public String getSex()
{
return this.sex;
}
public String getStarType()
{
return this.star_type;
}
public String getType()
{
return this.type;
}
public void setAliasName(String paramString)
{
this.alias_name = paramString;
}
public void setEnName(String paramString)
{
this.en_name = paramString;
}
public void setId(String paramString)
{
this.id = paramString;
}
public void setImgH(String paramString)
{
this.img_h = paramString;
}
public void setImgS(String paramString)
{
this.img_s = paramString;
}
public void setImgV(String paramString)
{
this.img_v = paramString;
}
public void setInfo(String paramString)
{
this.info = paramString;
}
public void setLabelId(String paramString)
{
this.label_id = paramString;
}
public void setLabelIdV2(String paramString)
{
this.label_id_v2 = paramString;
}
public void setName(String paramString)
{
this.name = paramString;
}
public void setOldName(String paramString)
{
this.old_name = paramString;
}
public void setSex(String paramString)
{
this.sex = paramString;
}
public void setStarType(String paramString)
{
this.star_type = paramString;
}
public void setType(String paramString)
{
this.type = paramString;
}
public String toString()
{
return "StarInfo==> type=" + this.type + " id=" + this.id + " name=" + this.name + " alias_name=" + this.alias_name + " img_h=" + this.img_h + " img_s=" + this.img_s + " img_v=" + this.img_v + " info=" + this.info + " label_id=" + this.label_id + " sex=" + this.sex + " old_name=" + this.old_name + " en_name=" + this.en_name;
}
}
/* Location: C:\Users\THX\Desktop\aa\aa\反编译工具包\out\classes_dex2jar.jar
* Qualified Name: com.starcor.core.domain.StarInfo
* JD-Core Version: 0.6.2
*/ | [
"hiram@finereport.com"
] | hiram@finereport.com |
626c9e570c5bf27478d9b978146d4efbc01d3f4b | f7c5e3f5834206a7b0d1dadd773d1de032f731e7 | /dmerce3/src/gui/com/wanci/dmerce/gui/tablemodel/ConstraintsTableModel.java | f6d7b3e50c3e1d871cf32266edf25fb012c6ae9e | [] | no_license | rbe/dmerce | 93d601462c50dfbbf62b577803ae697d3abde333 | 3cfcae894c165189cc3ff61e27ca284f09e87871 | refs/heads/master | 2021-01-01T17:06:27.872197 | 2012-05-04T07:22:26 | 2012-05-04T07:22:26 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 2,198 | java | /*
* Created on Jan 14, 2004
*
* To change the template for this generated file go to Window - Preferences -
* Java - Code Generation - Code and Comments
*/
package com.wanci.dmerce.gui.tablemodel;
import java.util.Iterator;
import java.util.List;
import javax.swing.table.AbstractTableModel;
import com.wanci.dmerce.forms.CONSTRAINT;
/**
* Mit diesem TableModel werden die CONSTRAINT Werte aus der forms.xml in einer
* Tabelle angezeigt.
*
* @author mm
* @version $Id: ConstraintsTableModel.java,v 1.1 2004/01/14 14:12:00 mm Exp $
*/
public class ConstraintsTableModel extends AbstractTableModel {
private List constraintList;
public ConstraintsTableModel() {
}
/**
* @param rowIndex
*/
public void setType(int rowIndex) {
constraintList.get(rowIndex);
}
/**
* @return gibt die Anzahl der Spalten zurück.
*/
public int getColumnCount() {
return 3;
}
/**
* @return gibt die Anzahl der Zeilen zurück.
*/
public int getRowCount() {
if (constraintList == null)
return 0;
else
return constraintList.size();
}
/**
* @return gibt den Wert in der entsprechenden Spalte und Zeile zurück.
*/
public Object getValueAt(int rowIndex, int columnIndex) {
CONSTRAINT constraint = null;
Iterator iterator = constraintList.iterator();
for (int i = 0; i - 1 < rowIndex; i++) {
constraint = (CONSTRAINT) iterator.next();
}
if (columnIndex == 0)
return constraint.getType();
else if (columnIndex == 1)
return constraint.getValue();
else
return constraint.getDescription();
}
/**
* @return gibt den Spaltennamen zurück.
*/
public String getColumnName(int columnIndex) {
int i = columnIndex % 3;
if (i == 0)
return "type";
else if (i == 1)
return "value";
else
return "description";
}
/**
* @param constraintList
* The constraintList to set. Informiert alle Listener, daß sich
* ein oder mehrere Werte in der Tabelle geändert haben könnten.
*/
public void setConstraintList(List constraintList) {
this.constraintList = constraintList;
fireTableDataChanged();
}
} | [
"ralf@art-of-coding.eu"
] | ralf@art-of-coding.eu |
83bbbe1a4cc15bf82d3a634137239cef3de522c4 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /ddi-20200617/src/main/java/com/aliyun/ddi20200617/models/CreateFlowCategoryRequest.java | cc7f701360fd088fb570e1da8c33a857eb8ec569 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 1,907 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.ddi20200617.models;
import com.aliyun.tea.*;
public class CreateFlowCategoryRequest extends TeaModel {
@NameInMap("ClientToken")
public String clientToken;
@NameInMap("Name")
public String name;
@NameInMap("ParentId")
public String parentId;
@NameInMap("ProjectId")
public String projectId;
@NameInMap("RegionId")
public String regionId;
@NameInMap("Type")
public String type;
public static CreateFlowCategoryRequest build(java.util.Map<String, ?> map) throws Exception {
CreateFlowCategoryRequest self = new CreateFlowCategoryRequest();
return TeaModel.build(map, self);
}
public CreateFlowCategoryRequest setClientToken(String clientToken) {
this.clientToken = clientToken;
return this;
}
public String getClientToken() {
return this.clientToken;
}
public CreateFlowCategoryRequest setName(String name) {
this.name = name;
return this;
}
public String getName() {
return this.name;
}
public CreateFlowCategoryRequest setParentId(String parentId) {
this.parentId = parentId;
return this;
}
public String getParentId() {
return this.parentId;
}
public CreateFlowCategoryRequest setProjectId(String projectId) {
this.projectId = projectId;
return this;
}
public String getProjectId() {
return this.projectId;
}
public CreateFlowCategoryRequest setRegionId(String regionId) {
this.regionId = regionId;
return this;
}
public String getRegionId() {
return this.regionId;
}
public CreateFlowCategoryRequest setType(String type) {
this.type = type;
return this;
}
public String getType() {
return this.type;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
ebb8a7413ea5bcd6bacf22258ac60296c228ea25 | bb268bc15e9dbcb4c1d330e1d99f0bfe5ee05b1e | /gooruming_소스파일/app/src/main/java/com/jmw/adaptertest/seojungwon/won_SQLite.java | 165642ed48f33cbf92ca13b7beb069b532a4fcca | [
"MIT"
] | permissive | MobileSeoul/2017seoul-94 | cb2bb8c40e6d7f12c4d783eb94f85ece0932b74f | b5ca5473c8c2aa03ce990f258e73f67e91ec48c7 | refs/heads/master | 2021-05-09T06:47:22.961662 | 2018-01-29T06:01:00 | 2018-01-29T06:01:00 | 119,338,630 | 6 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,677 | java | package com.jmw.adaptertest.seojungwon;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/**
* Created by won on 2016. 12. 4..
*/
public class won_SQLite extends SQLiteOpenHelper {
public won_SQLite(Context context){
super(context,"anna_a_db.db",null,1);
}
@Override
public void onCreate(SQLiteDatabase db){
db.execSQL("CREATE TABLE anna_board(_id INTEGER PRIMARY KEY AUTOINCREMENT ,_bbscode INTEGER, anna_title TEXT NOT NULL , anna_content TEXT NOT NULL, anna_seno INTEGER , anna_bbscode INTEGER , anna_pid INTEGER, anna_weather INTEGER, anna_tt DATE , anna_ts TIME, anna_shott INTEGER , anna_cur_im TEXT );");
/*
CREATE TABLE IF NOT EXISTS `we_bbs` (
`bbsno` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(500) DEFAULT NULL,
`content` varchar(2000) DEFAULT NULL,
`seno` int(11) DEFAULT NULL,
`bbscode` varchar(2) DEFAULT NULL,
`pid` varchar(200) DEFAULT NULL,
`wether` int(11) DEFAULT NULL,
`tt` time DEFAULT NULL,
`shott` int(11) DEFAULT NULL,
`cur_im` varchar(50) DEFAULT NULL,
PRIMARY KEY (`bbsno`)
)
*/
/*
CREATE TABLE IF NOT EXISTS `we_food` (
`_id` int(11) NOT NULL AUTO_INCREMENT,
`food_code` tinyint(4) NOT NULL,
`food_name` text NOT NULL,
`food_temp` float NOT NULL,
`food_type` tinyint(4) NOT NULL,
`person_temp` float NOT NULL,
`weather` tinyint(4) NOT NULL,
`anna_date` date NOT NULL,
`anna_time` time NOT NULL,
`bake_data` double NOT NULL,
PRIMARY KEY (`_id`)
)
*/
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
}
}
| [
"karelin208@naver.com"
] | karelin208@naver.com |
3324494cc4e2f3108592bf8bb2b8db4ea7894156 | cc0458b38bf6d7bac7411a9c6fec9bc3b8282d3f | /thirdParty/JavascriptParser/src/javascriptParser/com/digiarea/es5/Node.java | 7b043a9ec0652cea714461825bf9e127cfe6b3f8 | [] | no_license | RinatGumarov/Code-metrics | 62f99c25b072dd56e9c953d40dac7076a4376180 | 2005b6671c174e09e6ea06431d4711993a33ecb6 | refs/heads/master | 2020-07-12T04:01:47.007860 | 2017-08-08T07:19:26 | 2017-08-08T07:19:26 | 94,275,456 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,434 | java | package javascriptParser.com.digiarea.es5;
import java.io.ByteArrayOutputStream;
import java.security.MessageDigest;
import javascriptParser.com.digiarea.common.utils.SourcePrinter;
import javascriptParser.com.digiarea.es5.visitor.CloneVisitor;
import javascriptParser.com.digiarea.es5.visitor.EqualsVisitor;
import javascriptParser.com.digiarea.es5.visitor.GenericVisitor;
import javascriptParser.com.digiarea.es5.visitor.PrinterVisitor;
import javascriptParser.com.digiarea.es5.visitor.TracePrinter;
import javascriptParser.com.digiarea.es5.visitor.VoidVisitor;
/**
* The Class Node.
*/
public abstract class Node {
/**
* The JSDoc comment.
*/
protected JSDocComment jsDocComment = null;
/**
* The position begin.
*/
protected int posBegin = 0;
/**
* The position end.
*/
protected int posEnd = 0;
public JSDocComment getJsDocComment() {
return jsDocComment;
}
public void setJsDocComment(JSDocComment jsDocComment) {
this.jsDocComment = jsDocComment;
}
public int getPosBegin() {
return posBegin;
}
public void setPosBegin(int posBegin) {
this.posBegin = posBegin;
}
public int getPosEnd() {
return posEnd;
}
public void setPosEnd(int posEnd) {
this.posEnd = posEnd;
}
Node() {
super();
}
Node(JSDocComment jsDocComment, int posBegin, int posEnd) {
super();
this.jsDocComment = jsDocComment;
this.posBegin = posBegin;
this.posEnd = posEnd;
}
public abstract <C> void accept(VoidVisitor<C> v, C ctx) throws Exception;
public abstract <R, C> R accept(GenericVisitor<R, C> v, C ctx)
throws Exception;
private static final CloneVisitor<Void> CLONE = new CloneVisitor<Void>();
@Override
public final Node clone() throws CloneNotSupportedException {
try {
return accept(CLONE, null);
} catch (final Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public final boolean equals(Object obj) {
try {
return EqualsVisitor.equals(this, (Node) obj);
} catch (Exception e) {
return false;
}
}
private static final String ENCODING = "UTF-8";
private static final PrinterVisitor PRINTER = new PrinterVisitor();
@Override
public final String toString() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
String result = null;
try {
accept(PRINTER, new SourcePrinter(out, ENCODING));
result = out.toString(ENCODING);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
private static final TracePrinter TRACE_PRINTER = new TracePrinter();
@Override
public final int hashCode() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
String result = null;
try {
accept(TRACE_PRINTER, new SourcePrinter(out, ENCODING));
result = out.toString(ENCODING);
} catch (Exception e) {
e.printStackTrace();
}
return result.hashCode();
}
private static final String CRYPTO = "SHA-256";
public final String trace() {
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
accept(TRACE_PRINTER, new SourcePrinter(out, ENCODING));
MessageDigest md = MessageDigest.getInstance(CRYPTO);
md.update(out.toByteArray());
byte byteData[] = md.digest();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < byteData.length; i++) {
sb.append(Integer.toString(
(byteData[i] & 0xff) + 0x100, 16).substring(1));
}
return sb.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
| [
"tiran678@icloud.com"
] | tiran678@icloud.com |
c92ab4ce5069d9ca56c78fbf923c26423c82353c | fde12555b15598267c8042deea260e841f4b93a0 | /04 - Java OOP/src/OOP03_Encapsulation/e4/Main.java | 5773a162985a018e064073a1f2efc104ef40cbc1 | [] | no_license | elenaborisova/SoftUni-Java-Web-Developer-Path | de4cc3c0bb85784815246f23c186aff3f56cc4e8 | 49b435de458df4d89fcb88742ce96461c325270e | refs/heads/master | 2023-07-14T21:10:46.689598 | 2021-09-03T13:06:28 | 2021-09-03T13:06:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,190 | java | package OOP03_Encapsulation.e4;
import OOP03_Encapsulation.e4.pizza.Dough;
import OOP03_Encapsulation.e4.pizza.Topping;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Pizza pizza = null;
try {
scanner.next();
String name = scanner.next();
int toppingsCount = scanner.nextInt();
scanner.next();
pizza = new Pizza(name, toppingsCount);
Dough dough = new Dough(scanner.next(), scanner.next(), scanner.nextDouble());
pizza.setDough(dough);
scanner.nextLine();
String input = scanner.nextLine();
while (!input.equals("END") && pizza != null) {
String[] tokens = input.split("\\s+");
Topping topping = new Topping(tokens[1], Double.parseDouble(tokens[2]));
pizza.addTopping(topping);
input = scanner.nextLine();
}
System.out.println(pizza.toString());
} catch (IllegalArgumentException ex) {
System.out.println(ex.getMessage());
}
}
}
| [
"p.bozidarova@gmail.com"
] | p.bozidarova@gmail.com |
ca5eb7329316fa96922422f45fad53444120eac1 | 267fbab5e2fb76e2f37f759fa6c5da4a78f5d779 | /src/main/java/ivorius/reccomplex/nbt/NBTStorable.java | b14d438f1c157c4bf5b5bc369dd87aa1d0e51cff | [
"MIT"
] | permissive | Ivorforce/RecurrentComplex | 4e1caaea47e7fd6a834c092ca9233a169cda24f0 | 0a17e8d6376b8d998555220258f14bf2f77dd662 | refs/heads/master | 2023-07-22T10:48:58.962026 | 2023-07-14T09:22:04 | 2023-07-14T09:22:04 | 20,901,878 | 63 | 54 | MIT | 2023-07-14T11:18:29 | 2014-06-16T21:45:41 | Java | UTF-8 | Java | false | false | 241 | java | /*
* Copyright (c) 2014, Lukas Tenbrink.
* * http://ivorius.net
*/
package ivorius.reccomplex.nbt;
import net.minecraft.nbt.NBTBase;
/**
* Created by lukas on 30.03.15.
*/
public interface NBTStorable
{
NBTBase writeToNBT();
}
| [
"lukastenbrink@googlemail.com"
] | lukastenbrink@googlemail.com |
c1f1caffa04ca8c9f10ae3ec3f0250eae55b040b | 9a1827c26d7f2bf0ce2cecfa8b47f5466d6753fc | /interlok-core/src/main/java/com/adaptris/core/services/cache/RemoveFromCacheService.java | 90c2e73aa9ab63fe60cea462d85e92417d276eeb | [
"Apache-2.0"
] | permissive | navin010/interlok | 4e4cc4a0f11421eb25e0fa8412ab6bfae504299f | 282e63eebd217987e27787a9845de28a21092968 | refs/heads/master | 2020-04-29T00:06:38.522494 | 2019-02-21T12:18:14 | 2019-02-21T12:18:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,257 | java | /*
* Copyright 2018 Adaptris Ltd.
*
* 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.adaptris.core.services.cache;
import static org.apache.commons.lang.StringUtils.isEmpty;
import com.adaptris.annotation.AdapterComponent;
import com.adaptris.annotation.ComponentProfile;
import com.adaptris.core.AdaptrisMessage;
import com.adaptris.core.ServiceException;
import com.adaptris.core.cache.Cache;
import com.adaptris.core.util.ExceptionHelper;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* Service that retrieves an item from the cache and then removes it
*
* @config remove-from-cache
* @author stuellidge
*
*/
@XStreamAlias("remove-from-cache")
@AdapterComponent
@ComponentProfile(summary = "Retrieve values from a cache, and remove those values from the cache", tag = "service,cache")
public class RemoveFromCacheService extends RetrieveFromCacheService {
/**
* Retrieves the item from the cache, stores it against the message and then removes it from the cache
*
* @see com.adaptris.core.services.cache.RetrieveFromCacheService#doService(com.adaptris.core.AdaptrisMessage)
*/
@Override
public void doService(AdaptrisMessage msg) throws ServiceException {
try {
Cache cache = retrieveCache();
for (CacheEntryEvaluator ceg : getCacheEntryEvaluators()) {
String key = ceg.getKey(msg);
if (isEmpty(key)) {
log.warn("{} generated null values for the key, nothing to do", ceg.friendlyName());
continue;
}
addCacheValueToMessage(msg, key, ceg.valueTranslator(), !exceptionIfNotFound());
cache.remove(key);
}
}
catch (Exception e) {
throw ExceptionHelper.wrapServiceException(e);
}
}
}
| [
"lewin.chan@adaptris.com"
] | lewin.chan@adaptris.com |
fba47b3b23edc4e82c101c99385d43d12ab98ea0 | 70301ce7e1da71fccf6bdabc371189ce8880ee10 | /src/main/java/com/sda/javapoz24/solid/openclose/strategies/StrategiaWalkiŁukiem.java | 47d625be0cc7934049dcbfd58979ff5cffea850e | [] | no_license | SaintAmeN/javapoz24_powtorka | b46e0ff5faea507ef6a4dd8df19970303f3d89cf | 562ff911c898c3ac05a833f441508c14bf41387e | refs/heads/master | 2022-11-11T05:56:12.323637 | 2020-06-27T08:38:13 | 2020-06-27T08:38:13 | 275,332,131 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package com.sda.javapoz24.solid.openclose.strategies;
import com.sda.javapoz24.solid.openclose.IStrategiaWalki;
public class StrategiaWalkiŁukiem implements IStrategiaWalki {
@Override
public void walcz() {
System.out.println("Szczelam z łuku! Pew pew!");
}
}
| [
"pawel.reclaw@gmail.com"
] | pawel.reclaw@gmail.com |
ce152402e2660d15d0f472ca19b360e7fc47549b | 45472edf21e0212b1162e3c2208f0b33a1f24e1f | /integration/as7-eap6/adapter/src/main/java/org/keycloak/adapters/as7/AuthenticatedActionsValve.java | e310abf15853f8a4463abc689fa9d1e9fa792aeb | [
"Apache-2.0"
] | permissive | gunnarmorling/keycloak | 9050c4995746b5518f9f44724445115abbfcb435 | bb135adbfd3ffe2eb7c243dfc95b4f2b2c5327c6 | refs/heads/master | 2021-01-21T02:20:42.093633 | 2014-01-24T11:49:33 | 2014-01-24T11:49:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,247 | java | package org.keycloak.adapters.as7;
import org.apache.catalina.Container;
import org.apache.catalina.Session;
import org.apache.catalina.Valve;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.valves.ValveBase;
import org.jboss.logging.Logger;
import org.keycloak.SkeletonKeySession;
import org.keycloak.adapters.AdapterConstants;
import org.keycloak.representations.adapters.config.AdapterConfig;
import org.keycloak.representations.SkeletonKeyToken;
import javax.management.ObjectName;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.Set;
/**
* Pre-installed actions that must be authenticated
* <p/>
* Actions include:
* <p/>
* CORS Origin Check and Response headers
* k_query_bearer_token: Get bearer token from server for Javascripts CORS requests
*
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class AuthenticatedActionsValve extends ValveBase {
private static final Logger log = Logger.getLogger(AuthenticatedActionsValve.class);
protected AdapterConfig config;
public AuthenticatedActionsValve(AdapterConfig config, Valve next, Container container, ObjectName controller) {
this.config = config;
if (next == null) throw new RuntimeException("WTF is next null?!");
setNext(next);
setContainer(container);
setController(controller);
}
@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
log.debugv("AuthenticatedActionsValve.invoke {0}", request.getRequestURI());
SkeletonKeySession session = getSkeletonKeySession(request);
if (corsRequest(request, response, session)) return;
String requestUri = request.getRequestURI();
if (requestUri.endsWith(AdapterConstants.K_QUERY_BEARER_TOKEN)) {
queryBearerToken(request, response, session);
return;
}
getNext().invoke(request, response);
}
public SkeletonKeySession getSkeletonKeySession(Request request) {
SkeletonKeySession skSession = (SkeletonKeySession) request.getAttribute(SkeletonKeySession.class.getName());
if (skSession != null) return skSession;
Session session = request.getSessionInternal();
if (session != null) {
return (SkeletonKeySession) session.getNote(SkeletonKeySession.class.getName());
}
return null;
}
protected void queryBearerToken(Request request, Response response, SkeletonKeySession session) throws IOException, ServletException {
log.debugv("queryBearerToken {0}", request.getRequestURI());
if (abortTokenResponse(request, response, session)) return;
response.setStatus(200);
response.setContentType("text/plain");
response.getOutputStream().write(session.getTokenString().getBytes());
response.getOutputStream().flush();
}
protected boolean abortTokenResponse(Request request, Response response, SkeletonKeySession session) throws IOException {
if (session == null) {
log.debugv("session was null, sending back 401: {0}", request.getRequestURI());
response.sendError(401);
return true;
}
if (!config.isExposeToken()) {
response.setStatus(200);
return true;
}
if (!config.isCors() && request.getHeader("Origin") != null) {
response.setStatus(200);
return true;
}
return false;
}
protected boolean corsRequest(Request request, Response response, SkeletonKeySession session) throws IOException {
if (!config.isCors()) return false;
log.debugv("CORS enabled + request.getRequestURI()");
String origin = request.getHeader("Origin");
log.debugv("Origin: {0} uri: {1}", origin, request.getRequestURI());
if (session != null && origin != null) {
SkeletonKeyToken token = session.getToken();
Set<String> allowedOrigins = token.getAllowedOrigins();
if (log.isDebugEnabled()) {
for (String a : allowedOrigins) log.debug(" " + a);
}
if (allowedOrigins == null || (!allowedOrigins.contains("*") && !allowedOrigins.contains(origin))) {
if (allowedOrigins == null) {
log.debugv("allowedOrigins was null in token");
}
if (!allowedOrigins.contains("*") && !allowedOrigins.contains(origin)) {
log.debugv("allowedOrigins did not contain origin");
}
response.sendError(403);
return true;
}
log.debugv("returning origin: {0}", origin);
response.setHeader("Access-Control-Allow-Origin", origin);
response.setHeader("Access-Control-Allow-Credentials", "true");
} else {
log.debugv("session or origin was null: {0}", request.getRequestURI());
}
return false;
}
}
| [
"bburke@redhat.com"
] | bburke@redhat.com |
eff2e967f0fe84ef590e7b543a8a229efbca2a79 | 594aea066d8e69fb49eeea9cbf5853918236a714 | /app/src/main/java/com/shushan/manhua/mvp/utils/SoftKeyboardUtil.java | 14aee3c325c718cf44477bd1693c3a9b8ce010f8 | [] | no_license | llxqb/ManHua | 6e321b6c87bdb024290b8d4730cb315badbaa93c | 2c0c48e7e878c20ec3dfd325f9c828d87d137cdb | refs/heads/master | 2022-04-14T15:33:52.430942 | 2020-03-17T04:18:32 | 2020-03-17T04:18:32 | 221,603,576 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,536 | java | package com.shushan.manhua.mvp.utils;
import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import java.util.List;
public class SoftKeyboardUtil {
/**
* 隐藏软键盘(只适用于Activity,不适用于Fragment)
*/
public static void hideSoftKeyboard(Activity activity) {
View view = activity.getCurrentFocus();
if (view != null) {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
/**
* 隐藏软键盘(可用于Activity,Fragment)
*/
public static void hideSoftKeyboard(Context context, List<View> viewList) {
if (viewList == null) return;
InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE);
for (View v : viewList) {
inputMethodManager.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
/**
* (如果输入法在窗口上已经显示,则隐藏,反之则显示)
*/
public static void autoSoftKeyboard(Context context){
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}
}
| [
"liuli7168165"
] | liuli7168165 |
c1ae43889b43040624bf7a2eb4ae6c1c9c557c76 | b78f4e4fb8689c0c3b71a1562a7ee4228a116cda | /JFramework/crypto/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP256R1Field.java | 57c442aa5b6aa4c555a1897ec43a8e0301bc0236 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"Apache-2.0"
] | permissive | richkmeli/JFramework | 94c6888a6bb9af8cbff924e8a1525e6ec4765902 | 54250a32b196bb9408fb5715e1c677a26255bc29 | refs/heads/master | 2023-07-24T23:59:19.077417 | 2023-05-05T22:52:14 | 2023-05-05T22:52:14 | 176,379,860 | 5 | 6 | Apache-2.0 | 2023-07-13T22:58:27 | 2019-03-18T22:32:12 | Java | UTF-8 | Java | false | false | 7,290 | java | package org.bouncycastle.math.ec.custom.sec;
import org.bouncycastle.math.raw.Nat;
import org.bouncycastle.math.raw.Nat256;
import java.math.BigInteger;
public class SecP256R1Field {
private static final long M = 0xFFFFFFFFL;
// 2^256 - 2^224 + 2^192 + 2^96 - 1
static final int[] P = new int[]{0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000,
0x00000001, 0xFFFFFFFF};
static final int[] PExt = new int[]{0x00000001, 0x00000000, 0x00000000, 0xFFFFFFFE, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFE, 0x00000001, 0xFFFFFFFE, 0x00000001, 0xFFFFFFFE, 0x00000001, 0x00000001, 0xFFFFFFFE,
0x00000002, 0xFFFFFFFE};
private static final int P7 = 0xFFFFFFFF;
private static final int PExt15s1 = 0xFFFFFFFE >>> 1;
public static void add(int[] x, int[] y, int[] z) {
int c = Nat256.add(x, y, z);
if (c != 0 || (z[7] == P7 && Nat256.gte(z, P))) {
addPInvTo(z);
}
}
public static void addExt(int[] xx, int[] yy, int[] zz) {
int c = Nat.add(16, xx, yy, zz);
if (c != 0 || ((zz[15] >>> 1) >= PExt15s1 && Nat.gte(16, zz, PExt))) {
Nat.subFrom(16, PExt, zz);
}
}
public static void addOne(int[] x, int[] z) {
int c = Nat.inc(8, x, z);
if (c != 0 || (z[7] == P7 && Nat256.gte(z, P))) {
addPInvTo(z);
}
}
public static int[] fromBigInteger(BigInteger x) {
int[] z = Nat256.fromBigInteger(x);
if (z[7] == P7 && Nat256.gte(z, P)) {
Nat256.subFrom(P, z);
}
return z;
}
public static void half(int[] x, int[] z) {
if ((x[0] & 1) == 0) {
Nat.shiftDownBit(8, x, 0, z);
} else {
int c = Nat256.add(x, P, z);
Nat.shiftDownBit(8, z, c);
}
}
public static void multiply(int[] x, int[] y, int[] z) {
int[] tt = Nat256.createExt();
Nat256.mul(x, y, tt);
reduce(tt, z);
}
public static void multiplyAddToExt(int[] x, int[] y, int[] zz) {
int c = Nat256.mulAddTo(x, y, zz);
if (c != 0 || ((zz[15] >>> 1) >= PExt15s1 && Nat.gte(16, zz, PExt))) {
Nat.subFrom(16, PExt, zz);
}
}
public static void negate(int[] x, int[] z) {
if (Nat256.isZero(x)) {
Nat256.zero(z);
} else {
Nat256.sub(P, x, z);
}
}
public static void reduce(int[] xx, int[] z) {
long xx08 = xx[8] & M, xx09 = xx[9] & M, xx10 = xx[10] & M, xx11 = xx[11] & M;
long xx12 = xx[12] & M, xx13 = xx[13] & M, xx14 = xx[14] & M, xx15 = xx[15] & M;
final long n = 6;
xx08 -= n;
long t0 = xx08 + xx09;
long t1 = xx09 + xx10;
long t2 = xx10 + xx11 - xx15;
long t3 = xx11 + xx12;
long t4 = xx12 + xx13;
long t5 = xx13 + xx14;
long t6 = xx14 + xx15;
long t7 = t5 - t0;
long cc = 0;
cc += (xx[0] & M) - t3 - t7;
z[0] = (int) cc;
cc >>= 32;
cc += (xx[1] & M) + t1 - t4 - t6;
z[1] = (int) cc;
cc >>= 32;
cc += (xx[2] & M) + t2 - t5;
z[2] = (int) cc;
cc >>= 32;
cc += (xx[3] & M) + (t3 << 1) + t7 - t6;
z[3] = (int) cc;
cc >>= 32;
cc += (xx[4] & M) + (t4 << 1) + xx14 - t1;
z[4] = (int) cc;
cc >>= 32;
cc += (xx[5] & M) + (t5 << 1) - t2;
z[5] = (int) cc;
cc >>= 32;
cc += (xx[6] & M) + (t6 << 1) + t7;
z[6] = (int) cc;
cc >>= 32;
cc += (xx[7] & M) + (xx15 << 1) + xx08 - t2 - t4;
z[7] = (int) cc;
cc >>= 32;
cc += n;
// assert cc >= 0;
reduce32((int) cc, z);
}
public static void reduce32(int x, int[] z) {
long cc = 0;
if (x != 0) {
long xx08 = x & M;
cc += (z[0] & M) + xx08;
z[0] = (int) cc;
cc >>= 32;
if (cc != 0) {
cc += (z[1] & M);
z[1] = (int) cc;
cc >>= 32;
cc += (z[2] & M);
z[2] = (int) cc;
cc >>= 32;
}
cc += (z[3] & M) - xx08;
z[3] = (int) cc;
cc >>= 32;
if (cc != 0) {
cc += (z[4] & M);
z[4] = (int) cc;
cc >>= 32;
cc += (z[5] & M);
z[5] = (int) cc;
cc >>= 32;
}
cc += (z[6] & M) - xx08;
z[6] = (int) cc;
cc >>= 32;
cc += (z[7] & M) + xx08;
z[7] = (int) cc;
cc >>= 32;
// assert cc == 0 || cc == 1;
}
if (cc != 0 || (z[7] == P7 && Nat256.gte(z, P))) {
addPInvTo(z);
}
}
public static void square(int[] x, int[] z) {
int[] tt = Nat256.createExt();
Nat256.square(x, tt);
reduce(tt, z);
}
public static void squareN(int[] x, int n, int[] z) {
// assert n > 0;
int[] tt = Nat256.createExt();
Nat256.square(x, tt);
reduce(tt, z);
while (--n > 0) {
Nat256.square(z, tt);
reduce(tt, z);
}
}
public static void subtract(int[] x, int[] y, int[] z) {
int c = Nat256.sub(x, y, z);
if (c != 0) {
subPInvFrom(z);
}
}
public static void subtractExt(int[] xx, int[] yy, int[] zz) {
int c = Nat.sub(16, xx, yy, zz);
if (c != 0) {
Nat.addTo(16, PExt, zz);
}
}
public static void twice(int[] x, int[] z) {
int c = Nat.shiftUpBit(8, x, 0, z);
if (c != 0 || (z[7] == P7 && Nat256.gte(z, P))) {
addPInvTo(z);
}
}
private static void addPInvTo(int[] z) {
long c = (z[0] & M) + 1;
z[0] = (int) c;
c >>= 32;
if (c != 0) {
c += (z[1] & M);
z[1] = (int) c;
c >>= 32;
c += (z[2] & M);
z[2] = (int) c;
c >>= 32;
}
c += (z[3] & M) - 1;
z[3] = (int) c;
c >>= 32;
if (c != 0) {
c += (z[4] & M);
z[4] = (int) c;
c >>= 32;
c += (z[5] & M);
z[5] = (int) c;
c >>= 32;
}
c += (z[6] & M) - 1;
z[6] = (int) c;
c >>= 32;
c += (z[7] & M) + 1;
z[7] = (int) c;
// c >>= 32;
}
private static void subPInvFrom(int[] z) {
long c = (z[0] & M) - 1;
z[0] = (int) c;
c >>= 32;
if (c != 0) {
c += (z[1] & M);
z[1] = (int) c;
c >>= 32;
c += (z[2] & M);
z[2] = (int) c;
c >>= 32;
}
c += (z[3] & M) + 1;
z[3] = (int) c;
c >>= 32;
if (c != 0) {
c += (z[4] & M);
z[4] = (int) c;
c >>= 32;
c += (z[5] & M);
z[5] = (int) c;
c >>= 32;
}
c += (z[6] & M) + 1;
z[6] = (int) c;
c >>= 32;
c += (z[7] & M) - 1;
z[7] = (int) c;
// c >>= 32;
}
}
| [
"richkmeli@gmail.com"
] | richkmeli@gmail.com |
a3724856af4e5b526a73534dbfa71670fe82b327 | 3659875802aec87a3ab191c09388d59b63869380 | /javademo/src/java0725_collection/prob/Prob006_ArrayList.java | 6bc8b1b273dbe45bf1c8624a256c73c5484b249a | [] | no_license | hongdaepyo/h1o1n1g1 | fab31dbd459dab78cb380acdec6563eb02cb2534 | 87896497a321440dff589e163cfa5a0644fad559 | refs/heads/master | 2021-06-06T17:38:46.362177 | 2016-12-20T10:47:39 | 2016-12-20T10:47:39 | 64,099,068 | 0 | 0 | null | 2021-05-07T06:13:59 | 2016-07-25T02:55:09 | Java | UTF-8 | Java | false | false | 1,266 | java | package java0725_collection.prob;
import java.util.ArrayList;
/*
* [프로그램 실행결과]
*
* 주가종목 : 삼성전자
* 현재가격 : 10000
* 등락가격 : 2000
*
* 주가종목 : JHTA
* 현재가격 : 7000
* 등락가격 : 2500
*/
public class Prob006_ArrayList {
public static void main(String[] args) {
ArrayList<Kospi> aList=new ArrayList<Kospi>();
aList.add(new Kospi("삼성전자",10000,"상승가[2000]"));
aList.add(new Kospi("현대차",8000,"하락가[-1000]"));
aList.add(new Kospi("POSCO",8500,"보합[0]"));
aList.add(new Kospi("JHTA",7000,"상승가[2500]"));
prnDisplay(aList);
}//end main()
public static void prnDisplay(ArrayList<Kospi> aList){
//상승 종목을 출력하는 프로그램을 구현하시오.
int fluc=0;
for(Kospi kospi:aList){
String str=kospi.getFluctuation();
fluc=Integer.parseInt(str.substring(str.indexOf("[")+1, str.indexOf("]")));
if(fluc>0){
System.out.println("주가종목 : "+kospi.getStock());
System.out.println("현재가격 : "+kospi.getPrice());
System.out.println("등락가격 : "+fluc);
System.out.println();
}
}
}//end prnDispaly()
}//end class
| [
"h1o1n1g1@nate.com"
] | h1o1n1g1@nate.com |
1254fc4af30db392e603139f418cfa552ccc8089 | 5e1da9684bb5d9dda590445bb95ef513147d23b4 | /zt-order/zt-order-interface/src/main/java/com/zsyc/zt/order/entity/GspLicenseType.java | 69492dbad79558998f52b439180b3d301608b742 | [] | no_license | liutaota/b2b2 | 4df87e2d3f7597bf36334112e3203bf92deba6c8 | 3d71bd4062170e5c99e5e59d7dd10f3a8c00a5fd | refs/heads/master | 2023-03-15T11:10:38.699907 | 2021-03-05T08:13:15 | 2021-03-05T08:13:15 | 344,737,055 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,800 | java | package com.zsyc.zt.order.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author peiqy
* @since 2020-08-19
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("GSP_LICENSE_TYPE")
public class GspLicenseType extends Model<GspLicenseType> {
private static final long serialVersionUID = 1L;
@TableId("LICENSETYPEID")
private Long licensetypeid;
@TableField("LICENSENAME")
private String licensename;
@TableField("CUSTOMFLAG")
private Integer customflag;
@TableField("SUPPLYFLAG")
private Integer supplyflag;
@TableField("GOODSFLAG")
private Integer goodsflag;
@TableField("RANGEFLAG")
private Integer rangeflag;
@TableField("INPUTMANID")
private Long inputmanid;
@TableField("CREDATE")
private LocalDateTime credate;
@TableField("MEMO")
private String memo;
@TableField("EARLYWARNDAYS")
private Integer earlywarndays;
@TableField("SUPERDAYS")
private Integer superdays;
@TableField("VALIDCTRL")
private Integer validctrl;
@TableField("CONTROLPRODDATE")
private Integer controlproddate;
/**
* 是否先决条件 1 表示 一定需要并且不过期 2 表示有的话 一定不能过期 3 就是不管控
*/
@TableField("IS_PREMISE")
private Integer isPremise;
@Override
protected Serializable pkVal() {
return this.licensetypeid;
}
}
| [
"liutao@qq.com"
] | liutao@qq.com |
964467b807d1b4fdd048260a06f65d47c9980fe3 | ea387e408ba211d02d9f52422c50e90715a5d2f3 | /backends/backend-headless/src/arc/backend/headless/HeadlessApplication.java | 4356aa777a7e1ecce57a19bc731b711a8c1f50c3 | [] | no_license | sk7725/Arc | e5bddaa85c69c5f158c17642ee5b1056f7c0aeaf | 5e12ee82715df10aa81012c6b9db0865d47ceb16 | refs/heads/master | 2022-11-12T19:44:38.685181 | 2020-07-02T14:20:17 | 2020-07-02T14:20:17 | 277,072,451 | 0 | 0 | null | 2020-07-04T08:42:59 | 2020-07-04T08:42:58 | null | UTF-8 | Java | false | false | 4,994 | java | package arc.backend.headless;
import arc.*;
import arc.backend.headless.mock.*;
import arc.func.*;
import arc.mock.*;
import arc.struct.*;
import arc.util.*;
import arc.util.async.*;
/**
* a headless implementation of an application primarily intended to be used in servers
* @author Jon Renner
*/
public class HeadlessApplication implements Application{
protected final HeadlessFiles files;
protected final MockAudio audio;
protected final MockInput input;
protected final MockGraphics graphics;
protected final Seq<ApplicationListener> listeners = new Seq<>();
protected final Seq<Runnable> runnables = new Seq<>();
protected final Seq<Runnable> executedRunnables = new Seq<>();
protected final Cons<Throwable> exceptionHandler;
private final long renderInterval;
protected Thread mainLoopThread;
protected boolean running = true;
public HeadlessApplication(ApplicationListener listener){
this(listener, null, t -> { throw new RuntimeException(t); });
}
public HeadlessApplication(ApplicationListener listener, HeadlessApplicationConfiguration config, Cons<Throwable> exceptionHandler){
if(config == null)
config = new HeadlessApplicationConfiguration();
addListener(listener);
this.files = new HeadlessFiles();
this.exceptionHandler = exceptionHandler;
// the following elements are not applicable for headless applications
// they are only implemented as mock objects
this.graphics = new MockGraphics();
this.audio = new MockAudio();
this.input = new MockInput();
Core.settings = new Settings();
Core.app = this;
Core.files = files;
Core.net = new Net();
Core.audio = audio;
Core.graphics = graphics;
Core.input = input;
renderInterval = config.renderInterval > 0 ? (long)(config.renderInterval * 1000000000f) : (config.renderInterval < 0 ? -1 : 0);
initialize();
}
protected void initialize(){
mainLoopThread = new Thread("HeadlessApplication"){
@Override
public void run(){
try{
HeadlessApplication.this.mainLoop();
}catch(Throwable t){
exceptionHandler.get(t);
}
}
};
mainLoopThread.start();
}
void mainLoop(){
synchronized(listeners){
for(ApplicationListener listener : listeners){
listener.init();
}
}
long t = Time.nanos() + renderInterval;
if(renderInterval >= 0f){
while(running){
final long n = Time.nanos();
if(t > n){
Threads.sleep((t - n) / 1000000);
t = Time.nanos() + renderInterval;
}else
t = n + renderInterval;
executeRunnables();
graphics.incrementFrameId();
synchronized(listeners){
for(ApplicationListener listener : listeners){
listener.update();
}
}
graphics.updateTime();
Core.settings.autosave();
// If one of the runnables set running to false, for example after an exit().
if(!running) break;
}
}
synchronized(listeners){
for(ApplicationListener listener : listeners){
listener.pause();
listener.dispose();
}
dispose();
}
}
public void executeRunnables(){
synchronized(runnables){
for(int i = runnables.size - 1; i >= 0; i--)
executedRunnables.add(runnables.get(i));
runnables.clear();
}
if(executedRunnables.size == 0) return;
for(int i = executedRunnables.size - 1; i >= 0; i--)
executedRunnables.remove(i).run();
}
@Override
public ApplicationType getType(){
return ApplicationType.headless;
}
@Override
public long getJavaHeap(){
return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
}
@Override
public String getClipboardText(){
return null;
}
@Override
public void setClipboardText(String text){
}
@Override
public Seq<ApplicationListener> getListeners(){
return listeners;
}
@Override
public void post(Runnable runnable){
synchronized(runnables){
runnables.add(runnable);
}
}
@Override
public void exit(){
post(() -> running = false);
}
public static class HeadlessApplicationConfiguration{
/** The minimum time (in seconds) between each call to the render method or negative to not call the render method at all. */
public float renderInterval = 1f / 60f;
}
}
| [
"arnukren@gmail.com"
] | arnukren@gmail.com |
146b951eef4fe5a355fbb852f79e5c95f54f2bc9 | 69011b4a6233db48e56db40bc8a140f0dd721d62 | /src/com/jshx/mobile/customer/dao/CustomerDao.java | 445d5fb2d0aa28f395d97d2511691a10478d2009 | [] | no_license | gechenrun/scysuper | bc5397e5220ee42dae5012a0efd23397c8c5cda0 | e706d287700ff11d289c16f118ce7e47f7f9b154 | refs/heads/master | 2020-03-23T19:06:43.185061 | 2018-06-10T07:51:18 | 2018-06-10T07:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,146 | java | package com.jshx.mobile.customer.dao;
import java.util.List;
import java.util.Map;
import com.jshx.core.base.dao.BaseDao;
import com.jshx.core.base.vo.Pagination;
import com.jshx.mobile.customer.entity.Customer;
public interface CustomerDao extends BaseDao
{
/**
* 分页查询
* @param page 分页信息
* @param paraMap 查询条件信息
* @return 分页信息
*/
public Pagination findByPage(Pagination page, Map<String, Object> paraMap);
/**
* 查询所有记录
* @param page 分页信息
* @param paraMap 查询条件信息
* @return 分页信息
*/
public List findCustomer(Map<String, Object> paraMap);
/**
* 根据主键ID查询信息
* @param id 主键ID
* @return 主键ID对应的信息
*/
public Customer getById(String id);
/**
* 保存信息
* @param model 信息
*/
public void save(Customer model);
/**
* 修改信息
* @param model 信息
*/
public void update(Customer model);
/**
* 物理删除信息
* @param ids 主键ID
*/
public void delete(String id);
/**
* 逻辑删除信息
* @param ids 主键ID
*/
public void deleteWithFlag(String id);
}
| [
"shellchange@sina.com"
] | shellchange@sina.com |
8ce6418e70ffd08e07c225fa9df28344703bc57e | fc77bfc0230da4259655267b6a4b35fefe8fd794 | /src/test/java/com/infy/eonservice/security/jwt/JWTFilterTest.java | cb6d386ca865c27bd5c259512de97c7522dcc3a6 | [] | no_license | don283978/eonservice | f3bf878255f380636e792d4982c8827c75ba7c0c | a385c0fec6a23ed6301f8973b4a366c73435839a | refs/heads/master | 2020-07-11T02:21:33.775319 | 2019-08-26T08:03:18 | 2019-08-26T08:03:18 | 204,426,422 | 0 | 0 | null | 2019-10-30T16:21:01 | 2019-08-26T08:03:17 | Java | UTF-8 | Java | false | false | 5,522 | java | package com.infy.eonservice.security.jwt;
import com.infy.eonservice.security.AuthoritiesConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.jsonwebtoken.io.Decoders;
import io.jsonwebtoken.security.Keys;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;
import org.springframework.mock.web.MockFilterChain;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.util.ReflectionTestUtils;
import java.util.Collections;
import static org.assertj.core.api.Assertions.assertThat;
public class JWTFilterTest {
private TokenProvider tokenProvider;
private JWTFilter jwtFilter;
@BeforeEach
public void setup() {
JHipsterProperties jHipsterProperties = new JHipsterProperties();
tokenProvider = new TokenProvider(jHipsterProperties);
ReflectionTestUtils.setField(tokenProvider, "key",
Keys.hmacShaKeyFor(Decoders.BASE64
.decode("fd54a45s65fds737b9aafcb3412e07ed99b267f33413274720ddbb7f6c5e64e9f14075f2d7ed041592f0b7657baf8")));
ReflectionTestUtils.setField(tokenProvider, "tokenValidityInMilliseconds", 60000);
jwtFilter = new JWTFilter(tokenProvider);
SecurityContextHolder.getContext().setAuthentication(null);
}
@Test
public void testJWTFilter() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication().getName()).isEqualTo("test-user");
assertThat(SecurityContextHolder.getContext().getAuthentication().getCredentials().toString()).isEqualTo(jwt);
}
@Test
public void testJWTFilterInvalidToken() throws Exception {
String jwt = "wrong_jwt";
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterMissingAuthorization() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterMissingToken() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Bearer ");
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test
public void testJWTFilterWrongScheme() throws Exception {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"test-user",
"test-password",
Collections.singletonList(new SimpleGrantedAuthority(AuthoritiesConstants.USER))
);
String jwt = tokenProvider.createToken(authentication, false);
MockHttpServletRequest request = new MockHttpServletRequest();
request.addHeader(JWTFilter.AUTHORIZATION_HEADER, "Basic " + jwt);
request.setRequestURI("/api/test");
MockHttpServletResponse response = new MockHttpServletResponse();
MockFilterChain filterChain = new MockFilterChain();
jwtFilter.doFilter(request, response, filterChain);
assertThat(response.getStatus()).isEqualTo(HttpStatus.OK.value());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
}
| [
"default"
] | default |
b57a7bf7009e62294b2de5a3d08df306dec68024 | 708571785b6bd6d4ec1c0279cfa09a2cd3859ca4 | /core-ng-test/src/main/java/core/framework/api/AbstractTestModule.java | 65e7aeb37b8f5da2c340d84250b91ea9337c73fc | [
"Apache-2.0"
] | permissive | jarvisxiong/core-ng-project | 6512276d94a425b2ab8e7a565965177940dfe55e | 9153f3b72fea87b8c817707d3206c7eb01a41102 | refs/heads/master | 2021-01-17T23:19:20.361265 | 2017-03-07T15:48:23 | 2017-03-07T15:48:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,502 | java | package core.framework.api;
import core.framework.impl.module.ModuleContext;
import core.framework.test.inject.TestBeanFactory;
import core.framework.test.module.InitDBConfig;
import core.framework.test.module.InitSearchConfig;
import core.framework.test.module.MockFactoryImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Type;
/**
* @author neo
*/
public abstract class AbstractTestModule extends Module {
private final Logger logger = LoggerFactory.getLogger(AbstractTestModule.class);
public final void configure() {
logger.info("initialize test context");
context = new ModuleContext(new TestBeanFactory(), new MockFactoryImpl());
logger.info("initialize application");
initialize();
context.config.validate();
}
public <T> T overrideBinding(Class<? super T> type, T instance) {
return overrideBinding(type, null, instance);
}
public <T> T overrideBinding(Type type, String name, T instance) {
return ((TestBeanFactory) context.beanFactory).overrideBinding(type, name, instance);
}
public <T> T create(Class<T> instanceClass) {
return context.beanFactory.create(instanceClass);
}
public InitDBConfig initDB() {
return initDB(null);
}
public InitDBConfig initDB(String name) {
return new InitDBConfig(context, name);
}
public InitSearchConfig initSearch() {
return new InitSearchConfig(context);
}
} | [
"neowu.us@gmail.com"
] | neowu.us@gmail.com |
22ca95d1c99afecbb2f75ebdada7527f86ca5ac9 | 921b73fb6a0964210b9f513b9aa08b4d1c2cf7d7 | /src/main/java/Interpreter/RomanNumbers/TerminalExpressionOther.java | abba4ccb79f989da70d6809fa6f78acdb1e2cc49 | [] | no_license | X4TKC/PatronesDeDiseno | d781ff5b4c7459f01dfe484cdc18e7a9ec89d75b | 0ccbadc36ae5355707193766cec3e71dac5830b3 | refs/heads/master | 2020-08-10T03:14:55.449201 | 2019-11-15T12:26:14 | 2019-11-15T12:26:14 | 214,243,199 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,291 | java | package Interpreter.RomanNumbers;
import java.util.Arrays;
public class TerminalExpressionOther extends AbstractExpresion {
@Override
public void interpreter(Context context) {
String[] var = context.input.trim().split("\\s+");
// System.out.println(var[0]);
if (var[0].equals("I")){
context.output = context.output + "1 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length));
//context.input = context.input.substring(1); // Elimina caracter interpretado
}
else if (var[0].equals("II")){
context.output = context.output + "2 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length)); // Elimina caracter interpretado
}
else if (var[0].equals("III")){
context.output = context.output + "3 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length));// Elimina caracter interpretado
}
else if (var[0].equals("IV")){
context.output = context.output + "4 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length));// Elimina caracter interpretado
}
else if (var[0].equals("V")){
context.output = context.output + "5 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length)); }
else if (var[0].equals("VI")){
context.output = context.output + "6 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length)); }
else if (var[0].equals("VII")){
context.output = context.output + "7 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length)); }
else if (var[0].equals("VIII")){
context.output = context.output + "8 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length)); }
else if (var[0].equals("IX")){
context.output = context.output + "9 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length)); }
else if (var[0].equals("X")){
context.output = context.output + "10 ";
context.input=String.join(" ",Arrays.copyOfRange(var,1,var.length)); }
}
}
| [
"tovilaskevin@gmail.com"
] | tovilaskevin@gmail.com |
d9e420d0f005f3b011cc2cccc2b228b99cd5654c | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/neo4j/learning/3540/NodeValueIterator.java | fed6482082840296bf451920769b2a18a006d6bf | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,656 | java | /*
* Copyright (c) 2002-2018 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.impl.index.schema;
import org.eclipse.collections.api.iterator.LongIterator;
import org.neo4j.collection.PrimitiveLongCollections;
import org.neo4j.collection.PrimitiveLongResourceIterator;
import org.neo4j.internal.kernel.api.IndexOrder;
import org.neo4j.internal.kernel.api.IndexQuery;
import org.neo4j.storageengine.api.schema.IndexDescriptor;
import org.neo4j.storageengine.api.schema.IndexProgressor;
import org.neo4j.values.storable.Value;
/**
* A {@link IndexProgressor} + {@link IndexProgressor.NodeValueClient} combo presented as a {@link LongIterator}.
*/
public class NodeValueIterator extends PrimitiveLongCollections.PrimitiveLongBaseIterator
implements IndexProgressor.NodeValueClient, PrimitiveLongResourceIterator
{
private boolean closed;
private IndexProgressor progressor;
@Override
protected boolean fetchNext()
{
// progressor.next() will progress underlying SeekCursor
// and feed result into this with node( long reference, Value... values )
if ( closed || !progressor.next() )
{
close();
return false;
}
return true;
}
@Override
public void initialize( IndexDescriptor descriptor,
IndexProgressor progressor,
IndexQuery[] query,
IndexOrder indexOrder,
boolean needsValues )
{
this.progressor = progressor;
}
@Override
public boolean acceptNode( long reference, Value... values )
{
return next( reference );
}
@Override
public boolean needsValues()
{
return false;
}
@Override
public void close()
{
if ( !closed )
{
closed = true;
progressor.close();
progressor = null;
}
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
1b5463dc3cdde414a94d6d866c50cf982be5e77a | 6848c6ca7c60121b2e22a89eec291b7a49965036 | /Custom_Dialog/src/com/andli/uitest/LoadingDialog.java | 74e174979e3e00063aa535606650fe8729c8af2c | [] | no_license | andli0626/CustomDialog | 21df055d355565ecb86e74bee7a240e2bbbc8fb6 | b8334e1e8a6d4da0ef57200d87ed7bb3498186e7 | refs/heads/master | 2020-09-10T05:18:46.332587 | 2016-09-01T08:39:44 | 2016-09-01T08:39:44 | 67,113,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,206 | java | package com.andli.uitest;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager.LayoutParams;
import android.widget.TextView;
/**
* 加载对话框控件
*
* @author liux (http://my.oschina.net/liux)
* @version 1.0
* @created 2012-3-21
*/
public class LoadingDialog extends Dialog {
private Context mContext;
private LayoutInflater inflater;
private LayoutParams layoutParam;
private TextView loadtext;
public LoadingDialog(Context context) {
super(context, R.style.Dialog);
this.mContext = context;
inflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.loadingdialog, null);
setContentView(view);
loadtext = (TextView) view.findViewById(R.id.loading_text);
// 设置window属性
layoutParam = getWindow().getAttributes();
layoutParam.gravity = Gravity.CENTER;
layoutParam.dimAmount = 0; // 去背景遮盖
layoutParam.alpha = 1.0f;
getWindow().setAttributes(layoutParam);
}
public void setLoadText(String content) {
loadtext.setText(content);
}
} | [
"ww1095@163.com"
] | ww1095@163.com |
7e949f3c924cdc868f4371fbe1da64d2a9610f35 | 12ea5463256bd7add8176c60ba0afad94100eacf | /src/main/java/presentacion/views/ErrorDialog.java | 21befd7592e0381c0d4332336e1a87d92d220149 | [] | no_license | vladimirogaston/TP_Inicial_agenda | d1ad8ff1d5f8be38fae8df3dda3413a85bf67972 | dc4166520abdd2b8195c598d776ed3292f2af4d9 | refs/heads/master | 2022-12-31T07:58:54.479232 | 2020-10-02T03:14:49 | 2020-10-02T03:14:49 | 295,036,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 416 | java | package presentacion.views;
import java.util.List;
import javax.swing.JOptionPane;
public class ErrorDialog {
public void showMessages(String message) {
JOptionPane.showMessageDialog(null, message);
}
public void showMessages(List<String> messages) {
StringBuilder builder = new StringBuilder();
for(String message : messages) builder.append(message + "\n");
showMessages(builder.toString());
}
}
| [
"vladimirogaston@gmail.com"
] | vladimirogaston@gmail.com |
c178bce12df6f97bcfc0bbcb66039790fdbba20a | f28052731543e07034729ada461bc3c42fe450be | /src/Tablice.java | 1228e8fb445082a74f6b9774b2dc7b5ada6f3da8 | [] | no_license | MagdaMyr/JavaPodstawowa_2 | de5021a9791fff922ef9a35f0734011373cb3ce6 | 3f04f844711d36384c6d63771597710bbfeeaeec | refs/heads/master | 2022-11-13T18:11:48.003286 | 2020-07-04T18:21:37 | 2020-07-04T18:21:37 | 277,163,812 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | public class Tablice {
public static void main(String[] args) {
// int[] luckyNums;
// luckyNums [0] = 7;
//luckyNums [1] = 17;
//luckyNums [2] = 27;
System.out.println();
}
}
| [
"uzytkownik@kursGIT.pl"
] | uzytkownik@kursGIT.pl |
a62bd624c7f7b7e4d9008aafb3ee36f2b6dee577 | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/branches/3.5/code/base/ui-eclipse/src/org/terracotta/dso/actions/UpdateModulesAction.java | 3871fd32e9a0eb8bb1eaba4492702d443098d516 | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,700 | java | /*
* All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright
* notice. All rights reserved.
*/
package org.terracotta.dso.actions;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.IStreamListener;
import org.eclipse.debug.core.Launch;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.JavaLaunchDelegate;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.IOConsole;
import org.eclipse.ui.console.IOConsoleOutputStream;
import org.terracotta.dso.ClasspathProvider;
import org.terracotta.dso.TcPlugin;
import org.terracotta.dso.dialogs.ExceptionDialog;
import com.tc.util.concurrent.ThreadUtil;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
public class UpdateModulesAction extends Action implements IActionDelegate, IWorkbenchWindowActionDelegate,
IJavaLaunchConfigurationConstants, IRunnableWithProgress {
private IProcess m_process;
private static final String LAUNCH_LABEL = "TIM-Get";
private static final String MAIN_TYPE = "org.terracotta.tools.cli.TIMGetTool";
private static final String CLASSPATH_PROVIDER = "org.terracotta.dso.classpathProvider";
private static final String EXCEPTION_TITLE = "Terracotta DSO";
private static final String EXCEPTION_MESSAGE = "Problem Updating Integration Modules";
public UpdateModulesAction() {
super("Update Integration Modules...");
}
public void run(IAction action) {
try {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
window.run(true, true, this);
} catch (Exception e) {
Throwable cause = e.getCause();
Shell activeShell = TcPlugin.getActiveWorkbenchShell();
if (activeShell != null) {
ExceptionDialog dialog = new ExceptionDialog(activeShell, EXCEPTION_TITLE, EXCEPTION_MESSAGE, cause);
dialog.open();
} else {
TcPlugin.getDefault().openError("Updating Integration Modules", cause);
}
}
}
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
monitor.beginTask("Updating Integration Modules...", IProgressMonitor.UNKNOWN);
doFinish(monitor);
monitor.done();
} catch (Exception e) {
throw new InvocationTargetException(e);
}
}
private void doFinish(final IProgressMonitor monitor) throws Exception {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType(ID_JAVA_APPLICATION);
ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type);
checkCancel(monitor);
monitor.subTask("Please wait...");
for (ILaunchConfiguration config : configs) {
if (config.getName().equals(LAUNCH_LABEL)) {
config.delete();
break;
}
}
ILaunchConfigurationWorkingCopy wc = type.newInstance(null, LAUNCH_LABEL);
String args = "install --all";
TcPlugin plugin = TcPlugin.getDefault();
String origVMArgs = wc.getAttribute(ATTR_VM_ARGUMENTS, "") + " ";
String vmargs;
IPath jarPath = TcPlugin.getDefault().getLibDirPath().append("tc.jar");
if (jarPath.toFile().exists()) {
String installPath = plugin.getLocation().makeAbsolute().toOSString();
vmargs = "-Dtc.install-root=\"" + installPath + "\"";
} else {
vmargs = "-Dtc.classpath=\"" + ClasspathProvider.makeDevClasspath() + "\" -Dtc.install-root=\""
+ System.getProperty("tc.install-root") + "\"";
}
wc.setAttribute(ATTR_VM_ARGUMENTS, vmargs + origVMArgs);
wc.setAttribute(ATTR_CLASSPATH_PROVIDER, CLASSPATH_PROVIDER);
wc.setAttribute(ATTR_MAIN_TYPE_NAME, MAIN_TYPE);
wc.setAttribute(ATTR_PROGRAM_ARGUMENTS, args);
String runMode = ILaunchManager.RUN_MODE;
JavaLaunchDelegate delegate = new JavaLaunchDelegate();
Launch launch = new Launch(wc, runMode, null);
checkCancel(monitor);
delegate.launch(wc, runMode, launch, null);
checkCancel(monitor);
m_process = launch.getProcesses()[0];
IStreamsProxy streamsProxy = m_process.getStreamsProxy();
IStreamMonitor outMonitor = streamsProxy.getOutputStreamMonitor();
IStreamMonitor errMonitor = streamsProxy.getErrorStreamMonitor();
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
IOConsole console = new IOConsole("Terracotta", null);
consoleManager.addConsoles(new IConsole[] { console });
final IOConsoleOutputStream outStream = console.newOutputStream();
outMonitor.addListener(new IStreamListener() {
public void streamAppended(final String text, IStreamMonitor streamMonitor) {
try {
outStream.write(text);
} catch (IOException ioe) {
/**/
}
}
});
checkCancel(monitor);
consoleManager.showConsoleView(console);
while (!m_process.isTerminated()) {
checkCancel(monitor);
ThreadUtil.reallySleep(100);
}
outStream.close();
if (!monitor.isCanceled() && m_process.getExitValue() != 0) {
m_process = null;
monitor.done();
throw new RuntimeException(errMonitor.getContents());
}
m_process = null;
}
private void checkCancel(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
try {
if (m_process != null && !m_process.isTerminated()) {
m_process.terminate();
}
} catch (Exception e) {/**/
}
}
}
public void selectionChanged(IAction action, ISelection selection) {
/**/
}
public void dispose() {
/**/
}
public void init(IWorkbenchWindow window) {
/**/
}
}
| [
"jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | jvoegele@7fc7bbf3-cf45-46d4-be06-341739edd864 |
959117adb2bb5cb180bf5fe29296418c194cd48c | 7347094b7a574abcc06a8eb207fcff2bf0b2ba0e | /hive-code/hive-core/src/edu/unc/ils/mrc/hive/api/SKOSServer.java | 70b3141e9c70a9a7a221f0dbe664f768c566a6d2 | [] | no_license | DICE-UNC/irods-hive | 776feea03d9e8e1c605e93b0bd2bc7789a9dbc62 | f9548931656eec930fe3b17ec37dbe912b8d0e9e | refs/heads/master | 2016-09-05T21:42:43.160413 | 2015-05-01T14:57:50 | 2015-05-01T14:57:50 | 17,442,815 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,399 | java | /**
* Copyright (c) 2010, UNC-Chapel Hill and Nescent
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and
* the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the UNC-Chapel Hill or Nescent nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@author Jose R. Perez-Aguera
*/
package edu.unc.ils.mrc.hive.api;
import java.util.TreeMap;
import javax.xml.namespace.QName;
/**
* SKOSServer is the high level classes that we have to instantiate to get up
* the Vocabulary server:
*
* The method's argument makes reference to the configuration file where the
* names of the thesauri to load is written. SKOSServer manages the three basic
* classes which take the work to implement the HIVE basic functionalities:
* Concept Search (SKOSSearcher), Vocabularies management (SKOSScheme) and
* indexing SKOSTagger.
*
*/
public interface SKOSServer {
public TreeMap<String, SKOSScheme> getSKOSSchemas();
public SKOSSearcher getSKOSSearcher();
// public SKOSTagger getSKOSTagger();
public SKOSTagger getSKOSTagger(String algorithm);
public String getOrigin(QName uri);
public void close();
}
| [
"michael.c.conway@gmail.com"
] | michael.c.conway@gmail.com |
351aca6a6eb79ad2b7bace331e6348548723c133 | 2a80c8f3004960d07f3461ab7f32072095fd3a67 | /src/main/java/com/tencentcloudapi/mps/v20190612/models/DescribeTasksRequest.java | 6a4a96a2e80c238c7563a2206f74934f47418028 | [
"Apache-2.0"
] | permissive | kennyshittu/tencentcloud-sdk-java-intl-en | 495a6e9cf3936406a0d95974aee666ded6632118 | 2ed6e287c3f451e3709791a3c7ac4b5316205670 | refs/heads/master | 2022-04-15T06:59:48.967043 | 2020-04-02T14:13:10 | 2020-04-02T14:13:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,313 | java | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tencentcloudapi.mps.v20190612.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class DescribeTasksRequest extends AbstractModel{
/**
* Filter: Task status. Valid values: WAITING (waiting), PROCESSING (processing), FINISH (completed).
*/
@SerializedName("Status")
@Expose
private String Status;
/**
* Number of returned entries. Default value: 10. Maximum value: 100.
*/
@SerializedName("Limit")
@Expose
private Long Limit;
/**
* Scrolling identifier which is used for pulling in batches. If a single request cannot pull all the data entries, the API will return `ScrollToken`, and if the next request carries it, the next pull will start from the next entry.
*/
@SerializedName("ScrollToken")
@Expose
private String ScrollToken;
/**
* Get Filter: Task status. Valid values: WAITING (waiting), PROCESSING (processing), FINISH (completed).
* @return Status Filter: Task status. Valid values: WAITING (waiting), PROCESSING (processing), FINISH (completed).
*/
public String getStatus() {
return this.Status;
}
/**
* Set Filter: Task status. Valid values: WAITING (waiting), PROCESSING (processing), FINISH (completed).
* @param Status Filter: Task status. Valid values: WAITING (waiting), PROCESSING (processing), FINISH (completed).
*/
public void setStatus(String Status) {
this.Status = Status;
}
/**
* Get Number of returned entries. Default value: 10. Maximum value: 100.
* @return Limit Number of returned entries. Default value: 10. Maximum value: 100.
*/
public Long getLimit() {
return this.Limit;
}
/**
* Set Number of returned entries. Default value: 10. Maximum value: 100.
* @param Limit Number of returned entries. Default value: 10. Maximum value: 100.
*/
public void setLimit(Long Limit) {
this.Limit = Limit;
}
/**
* Get Scrolling identifier which is used for pulling in batches. If a single request cannot pull all the data entries, the API will return `ScrollToken`, and if the next request carries it, the next pull will start from the next entry.
* @return ScrollToken Scrolling identifier which is used for pulling in batches. If a single request cannot pull all the data entries, the API will return `ScrollToken`, and if the next request carries it, the next pull will start from the next entry.
*/
public String getScrollToken() {
return this.ScrollToken;
}
/**
* Set Scrolling identifier which is used for pulling in batches. If a single request cannot pull all the data entries, the API will return `ScrollToken`, and if the next request carries it, the next pull will start from the next entry.
* @param ScrollToken Scrolling identifier which is used for pulling in batches. If a single request cannot pull all the data entries, the API will return `ScrollToken`, and if the next request carries it, the next pull will start from the next entry.
*/
public void setScrollToken(String ScrollToken) {
this.ScrollToken = ScrollToken;
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "Status", this.Status);
this.setParamSimple(map, prefix + "Limit", this.Limit);
this.setParamSimple(map, prefix + "ScrollToken", this.ScrollToken);
}
}
| [
"hapsyou@foxmail.com"
] | hapsyou@foxmail.com |
a1929f522291caa8d8ee69eb5b72f67772ab83fc | 8191bea395f0e97835735d1ab6e859db3a7f8a99 | /com.miui.calculator_source_from_JADX/android/support/v4/content/CursorLoader.java | 8c25b6dad7175c8a14542fcfdd884067357e4a41 | [] | no_license | msmtmsmt123/jadx-1 | 5e5aea319e094b5d09c66e0fdb31f10a3238346c | b9458bb1a49a8a7fba8b9f9a6fb6f54438ce03a2 | refs/heads/master | 2021-05-08T19:21:27.870459 | 2017-01-28T04:19:54 | 2017-01-28T04:19:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,900 | java | package android.support.v4.content;
import android.database.Cursor;
import android.net.Uri;
import android.support.v4.content.Loader.ForceLoadContentObserver;
import android.support.v4.os.CancellationSignal;
import android.support.v4.os.OperationCanceledException;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.Arrays;
public class CursorLoader extends AsyncTaskLoader<Cursor> {
final ForceLoadContentObserver f410f;
Uri f411g;
String[] f412h;
String f413i;
String[] f414j;
String f415k;
Cursor f416l;
CancellationSignal f417m;
public /* synthetic */ void m557a(Object obj) {
m559b((Cursor) obj);
}
public /* synthetic */ void m560b(Object obj) {
m556a((Cursor) obj);
}
public /* synthetic */ Object m561d() {
return m563h();
}
public Cursor m563h() {
synchronized (this) {
if (m548g()) {
throw new OperationCanceledException();
}
this.f417m = new CancellationSignal();
}
Cursor a;
try {
a = ContentResolverCompat.m552a(m525m().getContentResolver(), this.f411g, this.f412h, this.f413i, this.f414j, this.f415k, this.f417m);
if (a != null) {
a.getCount();
a.registerContentObserver(this.f410f);
}
synchronized (this) {
this.f417m = null;
}
return a;
} catch (RuntimeException e) {
a.close();
throw e;
} catch (Throwable th) {
synchronized (this) {
}
this.f417m = null;
}
}
public void m562f() {
super.m547f();
synchronized (this) {
if (this.f417m != null) {
this.f417m.m1003c();
}
}
}
public void m556a(Cursor cursor) {
if (!m528p()) {
Cursor cursor2 = this.f416l;
this.f416l = cursor;
if (m526n()) {
super.m518b((Object) cursor);
}
if (cursor2 != null && cursor2 != cursor && !cursor2.isClosed()) {
cursor2.close();
}
} else if (cursor != null) {
cursor.close();
}
}
protected void m564i() {
if (this.f416l != null) {
m556a(this.f416l);
}
if (m534v() || this.f416l == null) {
m531s();
}
}
protected void m565j() {
m530r();
}
public void m559b(Cursor cursor) {
if (cursor != null && !cursor.isClosed()) {
cursor.close();
}
}
protected void m566k() {
super.m523k();
m565j();
if (!(this.f416l == null || this.f416l.isClosed())) {
this.f416l.close();
}
this.f416l = null;
}
public void m558a(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
super.m541a(str, fileDescriptor, printWriter, strArr);
printWriter.print(str);
printWriter.print("mUri=");
printWriter.println(this.f411g);
printWriter.print(str);
printWriter.print("mProjection=");
printWriter.println(Arrays.toString(this.f412h));
printWriter.print(str);
printWriter.print("mSelection=");
printWriter.println(this.f413i);
printWriter.print(str);
printWriter.print("mSelectionArgs=");
printWriter.println(Arrays.toString(this.f414j));
printWriter.print(str);
printWriter.print("mSortOrder=");
printWriter.println(this.f415k);
printWriter.print(str);
printWriter.print("mCursor=");
printWriter.println(this.f416l);
printWriter.print(str);
printWriter.print("mContentChanged=");
printWriter.println(this.u);
}
}
| [
"eggfly@qq.com"
] | eggfly@qq.com |
7ab45e9a349d38a3e67f1ccaa04370a20bcdb5b8 | ef632fe725fe383f184c70b7874c18c50bcf6546 | /Core_Java_Practice/src/com/mkpits/java/collection/ArrayListSerializationDeserialization.java | ae46887ccd0b1d5037b9f1e79617fe44266a488e | [] | no_license | swatinavghare04/MKPITS_Swati_Navghare_Java_Nov_2020 | 5b67a4f099c57cd8a4d406aad576ecd0a8423011 | e659f0069ab506def888916c4c0d3c0615a81605 | refs/heads/main | 2023-06-13T22:13:17.696985 | 2021-07-10T04:32:01 | 2021-07-10T04:32:01 | 339,028,978 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,027 | java | // WAP to serialize an ArrayList object and then deserialize it.
package src.com.mkpits.java.collection;
import java.io.*;
import java.util.*;
public class ArrayListSerializationDeserialization {
public static void main(String[] args) {
ArrayList<String> list = new ArrayList<String>(); // creating array list
list.add("Ravi");
list.add("Vijay");
list.add("Ravi");
list.add("Ajay");
try{
//Serialization
FileOutputStream fos=new FileOutputStream("file");
ObjectOutputStream oos=new ObjectOutputStream(fos);
oos.writeObject(list);
fos.close();
oos.close();
//Deserialization
FileInputStream fis=new FileInputStream("file");
ObjectInputStream ois=new ObjectInputStream(fis);
ArrayList list1=(ArrayList)ois.readObject();
System.out.println(list1);
}
catch(Exception e){
System.out.println(e);
}
}
}
| [
"you@example.com"
] | you@example.com |
ae8cd5ed9db9a3b05fe0f23393fecee46801fabb | 982f6c3a3c006d2b03f4f53c695461455bee64e9 | /src/main/java/com/alipay/api/response/AlipaySecurityRiskCustomerriskQueryResponse.java | 1c306f919d3a6bfdc63db6413f7b40728478531b | [
"Apache-2.0"
] | permissive | zhaomain/Alipay-Sdk | 80ffc0505fe81cc7dd8869d2bf9a894b823db150 | 552f68a2e7c10f9ffb33cd8e0036b0643c7c2bb3 | refs/heads/master | 2022-11-15T03:31:47.418847 | 2020-07-09T12:18:59 | 2020-07-09T12:18:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,381 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.security.risk.customerrisk.query response.
*
* @author auto create
* @since 1.0, 2020-03-19 20:40:08
*/
public class AlipaySecurityRiskCustomerriskQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 2518956183139652842L;
/**
* risk_result:风险分析结果,主要有三种类型,分别为是否有风险(has_risk,no_risk),风险等级("rank_1"...,"rank_10"),归一化的风险评分(0-100),每一次返回,根据配置的不同,可以返回样的风险类型,也可以返回不同的风险结果类型
*/
@ApiField("risk_result")
private String riskResult;
/**
* risk_result_desc:风险结果的返回值描述,因为每次返回值不一样,因此需要给出返回值说明,避免接入方维护这种对应关系
*/
@ApiField("risk_result_desc")
private String riskResultDesc;
public void setRiskResult(String riskResult) {
this.riskResult = riskResult;
}
public String getRiskResult( ) {
return this.riskResult;
}
public void setRiskResultDesc(String riskResultDesc) {
this.riskResultDesc = riskResultDesc;
}
public String getRiskResultDesc( ) {
return this.riskResultDesc;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
017f9c0c2ddcb36765a524c7f0e5217664890ac5 | 447520f40e82a060368a0802a391697bc00be96f | /apks/banking_set2/GROUPE SOCIETE GENERALE SA/source/com/google/zxing/client/result/URIResultParser.java | 3d11bcac40eac69ad4e0dc44eb2e23edd8f8533a | [
"Apache-2.0"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 1,400 | java | package com.google.zxing.client.result;
import com.google.zxing.Result;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class URIResultParser
extends ResultParser
{
private static final String ALPHANUM_PART = "[a-zA-Z0-9\\-]";
private static final Pattern URL_WITHOUT_PROTOCOL_PATTERN = Pattern.compile("([a-zA-Z0-9\\-]+\\.)+[a-zA-Z0-9\\-]{2,}(:\\d{1,5})?(/|\\?|$)");
private static final Pattern URL_WITH_PROTOCOL_PATTERN = Pattern.compile("[a-zA-Z0-9]{2,}:");
public URIResultParser() {}
static boolean isBasicallyValidURI(CharSequence paramCharSequence)
{
Matcher localMatcher = URL_WITH_PROTOCOL_PATTERN.matcher(paramCharSequence);
if ((localMatcher.find()) && (localMatcher.start() == 0)) {}
do
{
return true;
paramCharSequence = URL_WITHOUT_PROTOCOL_PATTERN.matcher(paramCharSequence);
} while ((paramCharSequence.find()) && (paramCharSequence.start() == 0));
return false;
}
public URIParsedResult parse(Result paramResult)
{
paramResult = getMassagedText(paramResult);
if ((paramResult.startsWith("URL:")) || (paramResult.startsWith("URI:"))) {
return new URIParsedResult(paramResult.substring(4).trim(), null);
}
paramResult = paramResult.trim();
if (isBasicallyValidURI(paramResult)) {
return new URIParsedResult(paramResult, null);
}
return null;
}
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
34d180cb6004f82ea133a7a01a850f70d7c20618 | 785cb6d7bce303c3390c33c5faa45e25f3bd2932 | /8-12-桥接模式/src/com/miki/bridge/App.java | 1f91e6526179e348d715a4d5b6d4be3dea87085c | [] | no_license | arraycto/design-pattern | b78e96fbdbc8b7a4c9192cc0a4e6f9a52bddb02b | 8aecbab92f17c2ddd80fd91b108856c817ca6d8a | refs/heads/master | 2022-12-15T09:59:13.901351 | 2020-09-24T03:10:09 | 2020-09-24T03:10:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 889 | java | package com.miki.bridge;
/**
* @ClassName App
* @Description TODO 模拟打开银行卡账户的应用层代码操作
* @Author miki
* @Date 2020/2/26 23:54
* @Version 1.0
*/
public class App {
public static void main(String[] args) {
//打开中国农业银行的定期账户
ABCBank abcBank = new ABCBank(new DepositAcount());
Account account = abcBank.openAccount();
abcBank.account.showAcountType(); //abcBank.account.showAcountType()
//打开中国农业银行的活期账户
ABCBank abcBank2 = new ABCBank(new SavingAccount());
Account account1 = abcBank2.openAccount();
account1.showAcountType();
//打开中国工商银行的活期账户
ICBCBank icbcBank = new ICBCBank(new DepositAcount());
Account account2 = icbcBank.openAccount();
account2.openAccount();
}
}
| [
"1329289117@qq.com"
] | 1329289117@qq.com |
a2be95947057b37762fb91f1f387f556a39ae1f5 | f7fbc015359f7e2a7bae421918636b608ea4cef6 | /base/tags/2.2.8/test-src/org/hsqldb/lib/tar/PIFGeneratorTest.java | 220c223981f3c4bfd4d492c3560d1cca557fd8b0 | [] | no_license | svn2github/hsqldb | cdb363112cbdb9924c816811577586f0bf8aba90 | 52c703b4d54483899d834b1c23c1de7173558458 | refs/heads/master | 2023-09-03T10:33:34.963710 | 2019-01-18T23:07:40 | 2019-01-18T23:07:40 | 155,365,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,736 | java | /* Copyright (c) 2001-2011, The HSQL Development Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the HSQL Development Group nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.hsqldb.lib.tar;
import java.io.IOException;
import java.io.InputStream;
import java.io.File;
public class PIFGeneratorTest extends junit.framework.TestCase {
static protected byte[] loadResByteFile(String resPath) {
InputStream is = null;
int bytesRead = 0;
int retval;
byte[] ba = null;
try {
is = PIFGeneratorTest.class.getResourceAsStream(resPath);
if (is == null) {
throw new RuntimeException("CLASSPATH not set properly. "
+ "Res file '" + resPath + "' not accessible");
}
ba = new byte[is.available()];
while (bytesRead < ba.length &&
(retval = is.read(ba, bytesRead, ba.length - bytesRead))
> 0) {
bytesRead += retval;
}
} catch (IOException ioe) {
throw new RuntimeException(
"Unexpected resource problem with Res file '"
+ resPath + "' not accessible", ioe);
} finally {
if (is != null) try {
is.close();
} catch (IOException ioe) {
// Intentionally doing nothing
}
}
if (bytesRead != ba.length) {
throw new RuntimeException("I/O problem reading res file '"
+ resPath + "'");
}
return ba;
}
public void testXrecord() {
byte[] expectedHeaderData = PIFGeneratorTest.loadResByteFile(
"/org/hsqldb/resources/pif.data");
// Would like to load this one time with a JUnit v. 4 @BeforeClass
// method
File f = new File("build.xml");
if (!f.exists()) {
throw new RuntimeException(
"Test environment misconfigured. File 'build.xml' inaccessible");
}
PIFGenerator pif = new PIFGenerator(f);
try {
populate(pif);
} catch (IOException ioe) {
fail("Failed to populate PIF:" + ioe);
} catch (TarMalformatException tme) {
fail("Failed to populate PIF:" + tme);
}
assertTrue("Bad PIF record name", pif.getName().endsWith("/build.xml"));
//assertArrayEquals(expectedHeaderData, pif.toByteArray());
// Arg. All of the following work can be done with the single line
// above with JUnit v. 4.
byte[] pifBytes = pif.toByteArray();
assertEquals(expectedHeaderData.length, pifBytes.length);
for (int i = 0; i < expectedHeaderData.length; i++) {
assertEquals(expectedHeaderData[i], pifBytes[i]);
}
}
public void testGrecord() {
byte[] expectedHeaderData = PIFGeneratorTest.loadResByteFile(
"/org/hsqldb/resources/pif.data");
// Would like to load this one time with a JUnit v. 4 @BeforeClass
// method
PIFGenerator pif = new PIFGenerator(1);
try {
populate(pif);
} catch (TarMalformatException tme) {
fail("Failed to populate PIF:" + tme);
} catch (IOException ioe) {
fail("Failed to populate PIF:" + ioe);
}
assertTrue("Bad PIF record name",
pif.getName().indexOf("GlobalHead") > 0);
//assertArrayEquals(expectedHeaderData, pif.toByteArray());
// Arg. All of the following work can be done with the single line
// above with JUnit v. 4.
byte[] pifBytes = pif.toByteArray();
assertEquals(expectedHeaderData.length, pifBytes.length);
for (int i = 0; i < expectedHeaderData.length; i++) {
assertEquals(expectedHeaderData[i], pifBytes[i]);
}
}
protected void populate(PIFGenerator pif)
throws TarMalformatException, IOException {
pif.addRecord("o", "n"); // Shortest possible
pif.addRecord("k1", "23"); // total 8. Impossible to get total of 9.
pif.addRecord("k2", "234"); // total 10
pif.addRecord("k3", "2345"); // total 11
pif.addRecord("k4",
"2345678901234567890123456789012345678901234567890"
+ "123456789012345678901234567890123456789012"); //total 98
// Impossible to get total of 99.
pif.addRecord("k5",
"2345678901234567890123456789012345678901234567890"
+ "1234567890123456789012345678901234567890123"); //total 100
pif.addRecord("int1234", 1234);
pif.addRecord("long1234", 1234);
pif.addRecord("boolTrue", true);
pif.addRecord("boolFalse", false);
}
/**
* This method allows to easily run this unit test independent of the other
* unit tests, and without dealing with Ant or unrelated test suites.
*/
public static void main(String[] sa) {
junit.textui.TestRunner runner = new junit.textui.TestRunner();
junit.framework.TestResult result =
runner.run(runner.getTest(PIFGeneratorTest.class.getName()));
System.exit(result.wasSuccessful() ? 0 : 1);
}
}
| [
"unsaved@7c7dc5f5-a22d-0410-a3af-b41755a11667"
] | unsaved@7c7dc5f5-a22d-0410-a3af-b41755a11667 |
3fc33b100a2c513995fa6613071796ce7c025e1e | fa1408365e2e3f372aa61e7d1e5ea5afcd652199 | /src/testcases/CWE78_OS_Command_Injection/CWE78_OS_Command_Injection__getCookies_Servlet_74a.java | b3165a98e75d383a38bcd8eeb693b7f0a326cc44 | [] | no_license | bqcuong/Juliet-Test-Case | 31e9c89c27bf54a07b7ba547eddd029287b2e191 | e770f1c3969be76fdba5d7760e036f9ba060957d | refs/heads/master | 2020-07-17T14:51:49.610703 | 2019-09-03T16:22:58 | 2019-09-03T16:22:58 | 206,039,578 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,889 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE78_OS_Command_Injection__getCookies_Servlet_74a.java
Label Definition File: CWE78_OS_Command_Injection.label.xml
Template File: sources-sink-74a.tmpl.java
*/
/*
* @description
* CWE: 78 OS Command Injection
* BadSource: getCookies_Servlet Read data from the first cookie using getCookies()
* GoodSource: A hardcoded string
* Sinks: exec
* BadSink : dynamic command execution with Runtime.getRuntime().exec()
* Flow Variant: 74 Data flow: data passed in a HashMap from one method to another in different source files in the same package
*
* */
package testcases.CWE78_OS_Command_Injection;
import testcasesupport.*;
import java.util.HashMap;
import javax.servlet.http.*;
public class CWE78_OS_Command_Injection__getCookies_Servlet_74a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
data = ""; /* initialize data in case there are no cookies */
/* Read data from cookies */
{
Cookie cookieSources[] = request.getCookies();
if (cookieSources != null)
{
/* POTENTIAL FLAW: Read data from the first cookie value */
data = cookieSources[0].getValue();
}
}
HashMap<Integer,String> dataHashMap = new HashMap<Integer,String>();
dataHashMap.put(0, data);
dataHashMap.put(1, data);
dataHashMap.put(2, data);
(new CWE78_OS_Command_Injection__getCookies_Servlet_74b()).badSink(dataHashMap , request, response );
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
HashMap<Integer,String> dataHashMap = new HashMap<Integer,String>();
dataHashMap.put(0, data);
dataHashMap.put(1, data);
dataHashMap.put(2, data);
(new CWE78_OS_Command_Injection__getCookies_Servlet_74b()).goodG2BSink(dataHashMap , request, response );
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"bqcuong2212@gmail.com"
] | bqcuong2212@gmail.com |
045624e8981c8b21a94de9ffbdec6420217e1919 | 66e2f35b7b56865552616cf400e3a8f5928d12a2 | /src/main/java/com/alipay/api/domain/KoubeiItemDescription.java | 40c27a671efeeb363a4948d5d89d5691a737ef55 | [
"Apache-2.0"
] | permissive | xiafaqi/alipay-sdk-java-all | 18dc797400847c7ae9901566e910527f5495e497 | 606cdb8014faa3e9125de7f50cbb81b2db6ee6cc | refs/heads/master | 2022-11-25T08:43:11.997961 | 2020-07-23T02:58:22 | 2020-07-23T02:58:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,024 | java | package com.alipay.api.domain;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 商品描述
*
* @author auto create
* @since 1.0, 2017-09-22 18:18:37
*/
public class KoubeiItemDescription extends AlipayObject {
private static final long serialVersionUID = 3669328273285147244L;
/**
* 标题下的描述列表,列表类型,每项不得为空,最多10项,总长度不能超过2600个中文字符
*/
@ApiListField("details")
@ApiField("string")
private List<String> details;
/**
* 描述标题,不得超过40个中文字符
*/
@ApiField("title")
private String title;
public List<String> getDetails() {
return this.details;
}
public void setDetails(List<String> details) {
this.details = details;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
16f4b28e57e22f87764cf8ecc30b16b030bd8cd6 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /dt-oc-info-20220829/src/main/java/com/aliyun/dt_oc_info20220829/models/GetOcCompetitorsRequest.java | 224fcc4d3e19c4d0334a5d478496b30eea066412 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 1,162 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dt_oc_info20220829.models;
import com.aliyun.tea.*;
public class GetOcCompetitorsRequest extends TeaModel {
@NameInMap("PageNo")
public Integer pageNo;
@NameInMap("PageSize")
public Integer pageSize;
@NameInMap("SearchKey")
public String searchKey;
public static GetOcCompetitorsRequest build(java.util.Map<String, ?> map) throws Exception {
GetOcCompetitorsRequest self = new GetOcCompetitorsRequest();
return TeaModel.build(map, self);
}
public GetOcCompetitorsRequest setPageNo(Integer pageNo) {
this.pageNo = pageNo;
return this;
}
public Integer getPageNo() {
return this.pageNo;
}
public GetOcCompetitorsRequest setPageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
public Integer getPageSize() {
return this.pageSize;
}
public GetOcCompetitorsRequest setSearchKey(String searchKey) {
this.searchKey = searchKey;
return this;
}
public String getSearchKey() {
return this.searchKey;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
fa944e26d8c3db884ec580cca97352c3b59b5f9b | 704507754a9e7f300dfab163e97cd976b677661b | /src/javax/xml/ws/handler/Handler.java | 6a8a47de64ebe4aa1aba8796f640ccf194b4e4db | [] | no_license | ossaw/jdk | 60e7ca5e9f64541d07933af25c332e806e914d2a | b9d61d6ade341b4340afb535b499c09a8be0cfc8 | refs/heads/master | 2020-03-27T02:23:14.010857 | 2019-08-07T06:32:34 | 2019-08-07T06:32:34 | 145,785,700 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,714 | java | /*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.xml.ws.handler;
import javax.xml.ws.ProtocolException;
import javax.xml.ws.handler.MessageContext;
/**
* The <code>Handler</code> interface is the base interface for JAX-WS handlers.
*
* @since JAX-WS 2.0
**/
public interface Handler<C extends MessageContext> {
/**
* The <code>handleMessage</code> method is invoked for normal processing of
* inbound and outbound messages. Refer to the description of the handler
* framework in the JAX-WS specification for full details.
*
* @param context
* the message context.
* @return An indication of whether handler processing should continue for
* the current message
* <ul>
* <li>Return <code>true</code> to continue processing.</li>
* <li>Return <code>false</code> to block processing.</li>
* </ul>
* @throws RuntimeException
* Causes the JAX-WS runtime to cease handler
* processing and
* generate a fault.
* @throws ProtocolException
* Causes the JAX-WS runtime to switch to fault
* message
* processing.
**/
public boolean handleMessage(C context);
/**
* The <code>handleFault</code> method is invoked for fault message
* processing. Refer to the description of the handler framework in the
* JAX-WS specification for full details.
*
* @param context
* the message context
* @return An indication of whether handler fault processing should continue
* for the current message
* <ul>
* <li>Return <code>true</code> to continue processing.</li>
* <li>Return <code>false</code> to block processing.</li>
* </ul>
* @throws RuntimeException
* Causes the JAX-WS runtime to cease handler
* fault processing
* and dispatch the fault.
* @throws ProtocolException
* Causes the JAX-WS runtime to cease handler
* fault processing
* and dispatch the fault.
**/
public boolean handleFault(C context);
/**
* Called at the conclusion of a message exchange pattern just prior to the
* JAX-WS runtime dispatching a message, fault or exception. Refer to the
* description of the handler framework in the JAX-WS specification for full
* details.
*
* @param context
* the message context
**/
public void close(MessageContext context);
}
| [
"jianghao7625@gmail.com"
] | jianghao7625@gmail.com |
bfbe8fe1b3d9186a23e7c410ad162e58bff3ef91 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/8198c30147f2eb8a430967fea30ab28338132447/before/PyChangeSignatureHandler.java | fca7d28f9f033b6796c2a876ff7cdf02573fbd95 | [] | 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 | 5,510 | java | package com.jetbrains.python.refactoring.changeSignature;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.refactoring.RefactoringBundle;
import com.intellij.refactoring.changeSignature.ChangeSignatureHandler;
import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.impl.PyBuiltinCache;
import com.jetbrains.python.psi.resolve.PyResolveContext;
import com.jetbrains.python.psi.search.PySuperMethodsSearch;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* User : ktisha
*/
public class PyChangeSignatureHandler implements ChangeSignatureHandler {
@Nullable
@Override
public PsiElement findTargetMember(PsiFile file, Editor editor) {
PsiElement element = PyUtil.findNonWhitespaceAtOffset(file, editor.getCaretModel().getOffset());
return findTargetMember(element);
}
@Nullable
@Override
public PsiElement findTargetMember(PsiElement element) {
final PyCallExpression callExpression = PsiTreeUtil.getParentOfType(element, PyCallExpression.class);
if (callExpression != null) {
return callExpression.resolveCalleeFunction(PyResolveContext.defaultContext());
}
final PyFunction function = PsiTreeUtil.getParentOfType(element, PyFunction.class);
return function;
}
@Override
public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) {
PsiElement element = findTargetMember(file, editor);
if (element == null) {
element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
}
invokeOnElement(project, element, editor);
}
@Override
public void invoke(@NotNull Project project, @NotNull PsiElement[] elements, @Nullable DataContext dataContext) {
if (elements.length != 1) return;
Editor editor = dataContext == null ? null : PlatformDataKeys.EDITOR.getData(dataContext);
invokeOnElement(project, elements[0], editor);
}
@Nullable
@Override
public String getTargetNotFoundMessage() {
return PyBundle.message("refactoring.change.signature.error.wrong.caret.position.method.name");
}
private static void invokeOnElement(Project project, PsiElement element, Editor editor) {
if (!(element instanceof PyFunction)) return;
final PyBuiltinCache cache = PyBuiltinCache.getInstance(element);
if (cache.hasInBuiltins(element)) {
String message =
RefactoringBundle.getCannotRefactorMessage("Function is inside builtins file");
CommonRefactoringUtil.showErrorHint(project, editor, message,
REFACTORING_NAME, REFACTORING_NAME);
return;
}
final PyFunction newFunction = getSuperMethod((PyFunction)element);
if (newFunction == null) return;
if (!newFunction.equals(element)) {
invokeOnElement(project, newFunction, editor);
}
else {
final PyFunction function = (PyFunction)element;
final PyParameter[] parameters = function.getParameterList().getParameters();
for (PyParameter p : parameters) {
if (p instanceof PyTupleParameter) {
String message =
RefactoringBundle.getCannotRefactorMessage("Function contains tuple parameters");
CommonRefactoringUtil.showErrorHint(project, editor, message,
REFACTORING_NAME, REFACTORING_NAME);
return;
}
}
final PyMethodDescriptor method = new PyMethodDescriptor((PyFunction)element);
PyChangeSignatureDialog dialog = new PyChangeSignatureDialog(project, method);
dialog.show();
}
}
@Nullable
protected static PyFunction getSuperMethod(@Nullable PyFunction function) {
if (function == null) return null;
final PyClass clazz = function.getContainingClass();
if (clazz == null) {
return function;
}
final PsiElement result = PySuperMethodsSearch.search(function).findFirst();
if (result != null) {
final PyClass baseClass = ((PyFunction)result).getContainingClass();
final PyBuiltinCache cache = PyBuiltinCache.getInstance(baseClass);
String baseClassName = baseClass == null? "" : baseClass.getName();
if (cache.hasInBuiltins(baseClass))
return function;
final String message = PyBundle.message("refactoring.change.signature.find.usages.of.base.class",
function.getName(),
clazz.getName(),
baseClassName);
int choice;
if (ApplicationManagerEx.getApplicationEx().isUnitTestMode()) {
choice = 0;
}
else {
choice = Messages.showYesNoCancelDialog(function.getProject(), message, REFACTORING_NAME, Messages.getQuestionIcon());
}
switch (choice) {
case 0:
return (PyFunction)result;
case 1:
return function;
default:
return null;
}
}
return function;
}
}
| [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
5609f7875a289923335af1335f088e8588e7f2e9 | bebcc785242e96e206684aa759dbd8eb4fe96a00 | /src/main/java/io/jenkins/plugins/analysis/core/scm/BlameFactory.java | 5c89537f19512f3018990418e32ea5f0dd97cb2a | [
"MIT"
] | permissive | dimitar-petrov/warnings-ng-plugin | d5d58334e2faf934d6ab6d5104880f65722831f7 | d9f90f17976141aed45ce77d56c5c98d915383fa | refs/heads/master | 2020-04-07T23:18:08.147147 | 2018-11-08T12:24:17 | 2018-11-08T12:24:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,236 | java | package io.jenkins.plugins.analysis.core.scm;
import java.util.Collection;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import jenkins.model.Jenkins;
import hudson.FilePath;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Job;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.scm.NullSCM;
import hudson.scm.SCM;
/**
* Selects a matching SCM blamer for the specified job. Currently, only Git is supported.
*
* @author Lukas Krose
*/
public class BlameFactory {
/**
* Selects a matching SCM blamer for the specified job.
*
* @param run
* the run to get the SCM from
* @param workspace
* the workspace of the build
* @param listener
* the logger to use
*
* @return the blamer
*/
public static Blamer createBlamer(Run<?, ?> run, final FilePath workspace, final TaskListener listener) {
Jenkins instance = Jenkins.getInstance();
if (instance.getPlugin("git") != null) {
SCM scm = getScm(run);
GitChecker gitChecker = new GitChecker();
if (gitChecker.isGit(scm)) {
return gitChecker.createBlamer(run, scm, workspace, listener);
}
}
listener.getLogger().println("Skipping issues blame since Git is the only supported SCM up to now.");
return new NullBlamer();
}
private static SCM getScm(final Run<?, ?> run) {
Job<?, ?> job = run.getParent();
if (job instanceof WorkflowJob) {
Collection<? extends SCM> scms = ((WorkflowJob) job).getSCMs();
if (!scms.isEmpty()) {
return scms.iterator().next(); // TODO: what should we do if more than one SCM has been used
}
}
else if (run instanceof AbstractBuild) {
AbstractProject project = ((AbstractBuild) run).getProject();
if (project.getScm() != null) {
return project.getScm();
}
SCM scm = project.getRootProject().getScm();
if (scm != null) {
return scm;
}
}
return new NullSCM();
}
}
| [
"ullrich.hafner@gmail.com"
] | ullrich.hafner@gmail.com |
ef0d0fbd506c2cab688348a4a4fbfa9e209645a0 | 473b76b1043df2f09214f8c335d4359d3a8151e0 | /benchmark/bigclonebenchdata_partial/20717530.java | f48a41c774698a2c5dbf25c3c6eb9f04bcc782f6 | [] | no_license | whatafree/JCoffee | 08dc47f79f8369af32e755de01c52d9a8479d44c | fa7194635a5bd48259d325e5b0a190780a53c55f | refs/heads/master | 2022-11-16T01:58:04.254688 | 2020-07-13T20:11:17 | 2020-07-13T20:11:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java |
class c20717530 {
public static String toMD5String(String plainText) {
if (TextUtils.isEmpty(plainText)) {
plainText = "";
}
StringBuilder text = new StringBuilder();
for (int i = plainText.length() - 1; i >= 0; i--) {
text.append(plainText.charAt(i));
}
plainText = text.toString();
MessageDigest mDigest;
try {
mDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
return plainText;
}
mDigest.update(plainText.getBytes());
byte d[] = mDigest.digest();
StringBuffer hash = new StringBuffer();
for (int i = 0; i < d.length; i++) {
hash.append(Integer.toHexString(0xFF & d[i]));
}
return hash.toString();
}
}
| [
"piyush16066@iiitd.ac.in"
] | piyush16066@iiitd.ac.in |
1e76707faecde21f87607e1e7f9c9c5f9ecf690b | 9b4db5933b8160e7a3cfc12b937fa3fa42dbdd7b | /src/pers/caijx/uml/Person.java | f1ca0b7a81c6ef8dd18fac91a74e0887c7869615 | [] | no_license | SmileCJX/DesignPattern | 73014d9bf34b52d4089a605e980e9ee8ee0558ba | 7c5b234d76efd424820e0b1a5521e885dd606bcd | refs/heads/master | 2020-08-05T08:35:19.258006 | 2019-12-03T01:25:06 | 2019-12-03T01:25:06 | 212,466,258 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 455 | java | package pers.caijx.uml;
/**
* @ClassName Person
* @Description: TODO
* @Author Think
* @Date 2019/10/6
* @Version V1.0
**/
public class Person {
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
| [
"1092925421@qq.com"
] | 1092925421@qq.com |
9f61de75283bd623bff4168489d52616a7dc5642 | 95fa181c8a9bb16b19eb21a43b8b66bac4db0eac | /PR124-MaterialDialogFragment/app/src/main/java/es/iessaladillo/pedrojoya/pr124/adaptadores/AlumnosAdapter.java | 51502bb0a0d800e2effb5a6349a5472848db12d6 | [] | no_license | Maycon1992/studio | 4ec746b46fc2d4a2ffb5ec6f739459034d213cfc | 0eb083b259786920efbd086ab02fca4164d032e4 | refs/heads/master | 2021-01-02T09:20:10.630345 | 2016-12-21T11:40:14 | 2016-12-21T11:40:14 | 78,685,531 | 1 | 0 | null | 2017-01-11T22:25:38 | 2017-01-11T22:25:38 | null | UTF-8 | Java | false | false | 3,308 | java | package es.iessaladillo.pedrojoya.pr124.adaptadores;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
import de.hdodenhof.circleimageview.CircleImageView;
import es.iessaladillo.pedrojoya.pr124.R;
import es.iessaladillo.pedrojoya.pr124.modelos.Alumno;
public class AlumnosAdapter extends ArrayAdapter<Alumno> {
// Variables miembro.
private final ArrayList<Alumno> alumnos;
private final LayoutInflater inflador;
// Constructor.
public AlumnosAdapter(Context contexto, ArrayList<Alumno> alumnos) {
super(contexto, R.layout.activity_main_item, alumnos);
this.alumnos = alumnos;
// Se obtiene el objeto inflador de layouts.
inflador = LayoutInflater.from(contexto);
}
// Retorna la vista que se debe "dibujar" para un determinado elemento.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
// Si no se puede reciclar.
if (convertView == null) {
// Se obtiene la vista-fila inflando el layout.
convertView = inflador.inflate(R.layout.activity_main_item, parent, false);
// Se crea el contenedor de vistas para la vista-fila.
holder = new ViewHolder(convertView);
// Se almacena el contenedor en la vista.
convertView.setTag(holder);
}
// Si se puede reciclar.
else {
// Se obtiene el contenedor de vistas desde la vista reciclada.
holder = (ViewHolder) convertView.getTag();
}
// Se escriben los datos en las vistas del contenedor de vistas.
onBindViewHolder(holder, position);
// Se retorna la vista que representa el elemento.
return convertView;
}
// Cuando se deben escribir los datos en la vista del elemento.
private void onBindViewHolder(ViewHolder holder, int position) {
// Se obtiene el alumno que debe mostrar el elemento.
Alumno alumno = alumnos.get(position);
// Se escriben los datos del alumno en las vistas.
Picasso.with(getContext())
.load(alumno.getUrlFoto())
.into(holder.imgAvatar);
holder.lblNombre.setText(alumno.getNombre());
holder.lblDireccion.setText(alumno.getDireccion());
}
// Contenedor de vistas para la vista-fila.
public class ViewHolder {
// El contenedor de vistas para un elemento de la lista debe contener...
private final ImageView imgAvatar;
private final TextView lblNombre;
private final TextView lblDireccion;
// El constructor recibe la vista-fila.
public ViewHolder(View itemView) {
// Se obtienen las vistas de la vista-fila.
imgAvatar = (CircleImageView) itemView
.findViewById(R.id.imgAvatar);
lblNombre = (TextView) itemView
.findViewById(R.id.lblNombre);
lblDireccion = (TextView) itemView
.findViewById(R.id.lblDireccion);
}
}
}
| [
"pedrojoya@gmail.com"
] | pedrojoya@gmail.com |
a5d2ab28f2ee5f057d57edf78dd1718d669cbb28 | 33251de23aeeb21da21db06c928572687685f254 | /02_operator/src/com/kh/operator/G_Triple.java | 61ef4244e1306de064bd5b70ad3e9ede9d974464 | [] | no_license | ehdqkd616/Java_Study2 | b8ace1fdf533b436d99dacb5043928eb2f2590f8 | 605166a5d13eaa11c69d03cff31dfef10a449363 | refs/heads/main | 2023-02-18T01:11:13.275191 | 2021-01-07T18:51:23 | 2021-01-07T18:51:23 | 310,156,719 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package com.kh.operator;
public class G_Triple {
// 조건식 ? 식1 : 식2;
// 조건식의 결과는 항상 논리값(true/false)이 나오게 해야 함
public void method1() {
// 입력한 정수가 함수인지 아닌지 판별
// 양수면 "양수다", 양수가 아니면 "양수가 아니다"라는 문장 출력 (이 때, 0도 양수로 함께 봄)
}
}
| [
"64412357+ehdqkd616@users.noreply.github.com"
] | 64412357+ehdqkd616@users.noreply.github.com |
7e9daa31e27b31ef36d379242fae4baf014bbc4c | 9f127cd00455d665f6cea0897cbf4c8f5db6e8c3 | /DaWae/chapter4/section3/Exercise38_CostOfLaziness.java | 9f26c18b6e98b87b819d3f6961fe4d4920e94b4c | [
"MIT"
] | permissive | NoticeMeDan/algo-exercises | 9d1a218270dd47872bcc48d2ed1847a62b0a30eb | c97c4a61b19c1e75dae5f6c815bf12bbd22e1e7d | refs/heads/master | 2021-09-13T11:47:51.979263 | 2018-04-29T10:36:25 | 2018-04-29T10:36:25 | 119,688,592 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,185 | java | package chapter4.section3;
import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.Stopwatch;
/**
* Created by Rene Argento on 13/11/17.
*/
public class Exercise38_CostOfLaziness {
private void generateGraphsAndDoExperiments(int experiments, int vertices, int edges, int euclideanGraphVertices) {
StdOut.printf("%47s %18s %12s %10s %10s\n", "Edge Weighted Graph type | ", "MST Algorithm | ", "Vertices | ",
"Edges | ", "Average time spent");
String[] mstAlgorithms = {"Lazy Prim MST", "Eager Prim MST"};
double totalTimeSpentLazyPrim = 0;
double totalTimeSpentEagerPrim = 0;
// Graph model 1: Random edge weighted graphs with uniform weight distribution
String graphType = "Random graph w/ uniform weight distribution";
Exercise34_RandomSparseEdgeWeightedGraphs.RandomEdgeWeightedGraphs randomEdgeWeightedGraphs =
new Exercise34_RandomSparseEdgeWeightedGraphs().new RandomEdgeWeightedGraphs();
for(int experiment = 0; experiment < experiments; experiment++) {
EdgeWeightedGraph randomEdgeWeightedGraphUniformWeights =
randomEdgeWeightedGraphs.erdosRenyiGraphUniformWeights(vertices, edges);
for(int mstAlgorithmType = 0; mstAlgorithmType < 2; mstAlgorithmType++) {
boolean isLazyPrim = mstAlgorithmType == 0;
if(isLazyPrim) {
totalTimeSpentLazyPrim += doExperiment(randomEdgeWeightedGraphUniformWeights, true);
} else {
totalTimeSpentEagerPrim += doExperiment(randomEdgeWeightedGraphUniformWeights, false);
}
}
}
computeAndPrintResults(graphType, mstAlgorithms, experiments, vertices, edges, totalTimeSpentLazyPrim,
totalTimeSpentEagerPrim);
totalTimeSpentLazyPrim = 0;
totalTimeSpentEagerPrim = 0;
// Graph model 2: Random edge weighted graphs with gaussian weight distribution
graphType = "Random graph w/ gaussian weight distribution";
for(int experiment = 0; experiment < experiments; experiment++) {
EdgeWeightedGraph randomEdgeWeightedGraphGaussianWeights =
randomEdgeWeightedGraphs.erdosRenyiGraphGaussianWeights(vertices, edges);
for(int mstAlgorithmType = 0; mstAlgorithmType < 2; mstAlgorithmType++) {
boolean isLazyPrim = mstAlgorithmType == 0;
if(isLazyPrim) {
totalTimeSpentLazyPrim += doExperiment(randomEdgeWeightedGraphGaussianWeights, true);
} else {
totalTimeSpentEagerPrim += doExperiment(randomEdgeWeightedGraphGaussianWeights, false);
}
}
}
computeAndPrintResults(graphType, mstAlgorithms, experiments, vertices, edges, totalTimeSpentLazyPrim,
totalTimeSpentEagerPrim);
totalTimeSpentLazyPrim = 0;
totalTimeSpentEagerPrim = 0;
// Graph model 3: Random edge weighted Euclidean graphs
graphType = "Random Euclidean graph";
Exercise35_RandomEuclideanEdgeWeightedGraphs randomEuclideanEdgeWeightedGraphs =
new Exercise35_RandomEuclideanEdgeWeightedGraphs();
// Running the experiment on a complete graph
double radius = 1;
for(int experiment = 0; experiment < experiments; experiment++) {
EdgeWeightedGraphInterface randomEdgeWeightedEuclideanGraph =
randomEuclideanEdgeWeightedGraphs.randomEuclideanEdgeWeightedGraph(euclideanGraphVertices, radius);
edges = randomEdgeWeightedEuclideanGraph.edgesCount();
for(int mstAlgorithmType = 0; mstAlgorithmType < 2; mstAlgorithmType++) {
boolean isLazyPrim = mstAlgorithmType == 0;
if(isLazyPrim) {
totalTimeSpentLazyPrim += doExperiment(randomEdgeWeightedEuclideanGraph, true);
} else {
totalTimeSpentEagerPrim += doExperiment(randomEdgeWeightedEuclideanGraph, false);
}
}
}
computeAndPrintResults(graphType, mstAlgorithms, experiments, euclideanGraphVertices, edges, totalTimeSpentLazyPrim,
totalTimeSpentEagerPrim);
}
private double doExperiment(EdgeWeightedGraphInterface edgeWeightedGraph, boolean isLazyPrim) {
Stopwatch stopwatch = new Stopwatch();
if(isLazyPrim) {
new LazyPrimMST(edgeWeightedGraph);
} else {
new PrimMST(edgeWeightedGraph);
}
return stopwatch.elapsedTime();
}
private void computeAndPrintResults(String graphType, String[] mstAlgorithms, int experiments, int vertices,
int edges, double totalTimeSpentLazyPrim, double totalTimeSpentEagerPrim) {
double averageTimeSpentLazyPrim = totalTimeSpentLazyPrim / experiments;
double averageTimeSpentEagerPrim = totalTimeSpentEagerPrim / experiments;
printResults(graphType, mstAlgorithms[0], vertices, edges, averageTimeSpentLazyPrim);
printResults(graphType, mstAlgorithms[1], vertices, edges, averageTimeSpentEagerPrim);
}
private void printResults(String graphType, String mstAlgorithm, int vertices, int edges, double averageTimeSpent) {
StdOut.printf("%44s %18s %12d %10d %21.2f\n", graphType, mstAlgorithm, vertices, edges, averageTimeSpent);
}
// Parameters example: 10 100000 300000 1000
public static void main(String[] args) {
//Arguments example:
int experiments = Integer.parseInt(args[0]);
int vertices = Integer.parseInt(args[1]);
int edges = Integer.parseInt(args[2]);
// In the Euclidean graph all vertices are connected to all vertices.
// So this requires a separate number of vertices to avoid a very high number of edges while still having a dense graph.
int euclideanGraphVertices = Integer.parseInt(args[3]);
new Exercise38_CostOfLaziness().generateGraphsAndDoExperiments(experiments, vertices, edges, euclideanGraphVertices);
}
}
| [
"im.arnild@gmail.com"
] | im.arnild@gmail.com |
9a48ce89facdd72bb1f0bb01378272490e5970e5 | bc7fe6d593134d3059c7228420457a87dbaf681c | /phoneProfiles/src/main/java/sk/henrichg/phoneprofiles/ConnectToSSIDDialogPreferenceX.java | 1de9483bed0c5392df3a727736bc6c6997bf1e05 | [
"Apache-2.0"
] | permissive | qwertyrty62/PhoneProfiles | 8357676daa6f52c1e3eabeef1bf4c36d5b2eb76b | 117aae4cc7de7ec3704b55b83da8b10f211220c5 | refs/heads/master | 2022-08-29T12:57:33.650511 | 2020-05-27T19:22:58 | 2020-05-27T19:22:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,874 | java | package sk.henrichg.phoneprofiles;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import java.util.ArrayList;
import java.util.List;
import androidx.preference.DialogPreference;
public class ConnectToSSIDDialogPreferenceX extends DialogPreference {
ConnectToSSIDDialogPreferenceFragmentX fragment;
private final Context context;
String value = "";
private String defaultValue;
private boolean savedInstanceState;
//final int disableSharedProfile;
List<WifiSSIDData> ssidList;
public ConnectToSSIDDialogPreferenceX(Context context, AttributeSet attrs) {
super(context, attrs);
/*
TypedArray typedArray = context.obtainStyledAttributes(attrs,
R.styleable.ConnectToSSIDDialogPreference);
disableSharedProfile = typedArray.getInteger(
R.styleable.ConnectToSSIDDialogPreference_cDisableSharedProfile, 0); */
this.context = context;
//setWidgetLayoutResource(R.layout.applications_preference); // resource na layout custom preference - TextView-ImageView
//typedArray.recycle();
ssidList = new ArrayList<>();
}
@Override
protected Object onGetDefaultValue(TypedArray ta, int index)
{
super.onGetDefaultValue(ta, index);
return ta.getString(index);
}
@Override
protected void onSetInitialValue(Object defaultValue)
{
value = getPersistedString((String) defaultValue);
this.defaultValue = (String)defaultValue;
setSummaryCTSDP();
}
private void setSummaryCTSDP()
{
String prefSummary = context.getString(R.string.connect_to_ssid_pref_dlg_summary_text_just_any);
//if (!value.isEmpty() && value.equals(Profile.CONNECTTOSSID_SHAREDPROFILE))
// prefSummary = context.getString(R.string.array_pref_default_profile);
//else
if (!value.isEmpty() && !value.equals(Profile.CONNECTTOSSID_JUSTANY))
prefSummary = value;
setSummary(prefSummary);
}
void persistValue() {
persistString(value);
setSummaryCTSDP();
}
void resetSummary() {
if (!savedInstanceState) {
value = getPersistedString(defaultValue);
setSummaryCTSDP();
}
savedInstanceState = false;
}
@Override
protected Parcelable onSaveInstanceState()
{
savedInstanceState = true;
final Parcelable superState = super.onSaveInstanceState();
/*if (isPersistent()) {
return superState;
}*/
final ConnectToSSIDDialogPreferenceX.SavedState myState = new ConnectToSSIDDialogPreferenceX.SavedState(superState);
myState.value = value;
myState.defaultValue = defaultValue;
return myState;
}
@Override
protected void onRestoreInstanceState(Parcelable state)
{
if (!state.getClass().equals(ConnectToSSIDDialogPreferenceX.SavedState.class)) {
// Didn't save state for us in onSaveInstanceState
super.onRestoreInstanceState(state);
setSummaryCTSDP();
return;
}
// restore instance state
ConnectToSSIDDialogPreferenceX.SavedState myState = (ConnectToSSIDDialogPreferenceX.SavedState)state;
super.onRestoreInstanceState(myState.getSuperState());
value = myState.value;
defaultValue = myState.defaultValue;
setSummaryCTSDP();
}
// SavedState class
private static class SavedState extends BaseSavedState
{
String value;
String defaultValue;
SavedState(Parcel source)
{
super(source);
value = source.readString();
defaultValue = source.readString();
}
@Override
public void writeToParcel(Parcel dest, int flags)
{
super.writeToParcel(dest, flags);
dest.writeString(value);
dest.writeString(defaultValue);
}
SavedState(Parcelable superState)
{
super(superState);
}
@SuppressWarnings("unused")
public static final Creator<ConnectToSSIDDialogPreferenceX.SavedState> CREATOR =
new Creator<ConnectToSSIDDialogPreferenceX.SavedState>() {
public ConnectToSSIDDialogPreferenceX.SavedState createFromParcel(Parcel in)
{
return new ConnectToSSIDDialogPreferenceX.SavedState(in);
}
public ConnectToSSIDDialogPreferenceX.SavedState[] newArray(int size)
{
return new ConnectToSSIDDialogPreferenceX.SavedState[size];
}
};
}
}
| [
"henrich.gron@chello.sk"
] | henrich.gron@chello.sk |
0146eae12eaee2b21aec49dad8508a4f69b66249 | eb5bda214a4c3875fe911eaae3243371b8d3bd1c | /app/src/main/java/com/pc/profnavykt/CollegesProfessii/ProfessiiYhdu.java | b292826a5b71a3120c4ae4c1ea80cc0caa7f60b0 | [] | no_license | bokunoheya/Prof_Navigation_Yakutia | edc894d7d05473261d36e08bf25a6b771fa6bf13 | 9e691a17676ec49901d02bd158a1db3e47c308ad | refs/heads/master | 2022-12-06T09:01:49.228729 | 2020-08-13T01:18:53 | 2020-08-13T01:18:53 | 261,056,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,793 | java | package com.pc.profnavykt.CollegesProfessii;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import com.pc.profnavykt.R;
import androidx.fragment.app.Fragment;
import androidx.navigation.Navigation;
/**
* A simple {@link Fragment} subclass.
* Use the {@link ProfessiiYhdu#newInstance} factory method to
* create an instance of this fragment.
*/
public class ProfessiiYhdu extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public ProfessiiYhdu() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment ProfessiiApt.
*/
// TODO: Rename and change types and number of parameters
public static ProfessiiYhdu newInstance(String param1, String param2) {
ProfessiiYhdu fragment = new ProfessiiYhdu();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View root= inflater.inflate(R.layout.fragment_professii_yhdu, container, false);
Button s54_02_01=root.findViewById(R.id.button1);
s54_02_01.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.s54_02_01));
Button s54_02_02=root.findViewById(R.id.button2);
s54_02_02.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.s54_02_02));
Button s54_02_04=root.findViewById(R.id.button3);
s54_02_04.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.s54_02_04));
Button s54_02_05=root.findViewById(R.id.button4);
s54_02_05.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.s54_02_05));
return root;
}
}
| [
"ikkisuruk@gmail.com"
] | ikkisuruk@gmail.com |
a0ba21fa60aef283643d36b7467288acf85bde4f | 29f78bfb928fb6f191b08624ac81b54878b80ded | /generated_SPs_SCs/ehealth/SPs/SP_healthcareserviceprovideragent1/src/main/java/SP_healthcareserviceprovideragent1/input/InputDataClassName_1_2.java | 531f12e1253824175966b31b2ab294c520625a35 | [] | no_license | MSPL4SOA/MSPL4SOA-tool | 8a78e73b4ac7123cf1815796a70f26784866f272 | 9f3419e416c600cba13968390ee89110446d80fb | refs/heads/master | 2020-04-17T17:30:27.410359 | 2018-07-27T14:18:55 | 2018-07-27T14:18:55 | 66,304,158 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,533 | java | package SP_helicopter1.input;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "InputDataClassName_1_2")
@XmlType(name = "inputDataClassName_1_2", propOrder = { "InputName_1_2_1",
"InputName_1_2_4", "InputName_1_2_2", "InputName_1_2_3" })
public class InputDataClassName_1_2 implements Serializable {
private static final long serialVersionUID = 1L;
@XmlElement(name = "InputName_1_2_1")
protected Float InputName_1_2_1;
@XmlElement(name = "InputName_1_2_4")
protected String InputName_1_2_4;
@XmlElement(name = "InputName_1_2_2")
protected String InputName_1_2_2;
@XmlElement(name = "InputName_1_2_3")
protected Float InputName_1_2_3;
public Float getInputName_1_2_1() {
return InputName_1_2_1;
}
public String getInputName_1_2_4() {
return InputName_1_2_4;
}
public String getInputName_1_2_2() {
return InputName_1_2_2;
}
public Float getInputName_1_2_3() {
return InputName_1_2_3;
}
public void setInputName_1_2_1(Float value) {
this.InputName_1_2_1 = value;
}
public void setInputName_1_2_4(String value) {
this.InputName_1_2_4 = value;
}
public void setInputName_1_2_2(String value) {
this.InputName_1_2_2 = value;
}
public void setInputName_1_2_3(Float value) {
this.InputName_1_2_3 = value;
}
}
| [
"akram.kamoun@gmail.com"
] | akram.kamoun@gmail.com |
4aace95922d11ae56682a08f753636d31b9cca09 | d21495a096f18dbeac402e5d29ea5a5ff88d8ca9 | /src/org/acm/seguin/io/InplaceOutputStream.java | 7d2c9d98e95f806b21ef3870e15c8286e5ac3cea | [] | no_license | JavaQualitasCorpus/jrefactory-2.9.19 | 73195aa8c91b2fa6fa18f987c1d0ba586ff28582 | b6bfd3921cd7d889ee351ebaca21d4de9b6acf31 | refs/heads/master | 2023-08-12T08:41:09.402764 | 2020-06-02T18:01:42 | 2020-06-02T18:01:42 | 167,004,945 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,458 | java | /*
* Author: Chris Seguin
*
* This software has been developed under the copyleft
* rules of the GNU General Public License. Please
* consult the GNU General Public License for more
* details about use and distribution of this software.
*/
package org.acm.seguin.io;
import java.io.File;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.acm.seguin.util.FileSettings;
/**
* To the user of this object, it appears that the file is written in place.
*
*@author Chris Seguin
*@author <a href="JRefactory@ladyshot.demon.co.uk">Mike Atkinson</a>
*@version $Id: InplaceOutputStream.java,v 1.6 2003/09/01 00:25:31 mikeatkinson Exp $
*@date May 12, 1999
*/
public class InplaceOutputStream extends OutputStream {
// Instance Variables
private File finalDestination;
private File temporary;
private FileOutputStream out;
/**
* Creates an InplaceOutputStream
*
*@param dest the output file location
*@exception IOException throws an IOException
*/
public InplaceOutputStream(File dest) throws IOException {
finalDestination = dest;
String parent = dest.getPath();
if ((parent != null) && attempt(parent + File.separator + "inplace"))
{
// Things have worked out!
}
else if (attempt("." + File.separator + "inplace"))
{
// Things have worked out!
}
else if (attempt(new File(FileSettings.getRefactorySettingsRoot(), "inplace").toString()))
{
}
else
{
throw new IOException("Unable to create the output file!");
}
}
/**
* Closes the file
*
*@exception IOException throws an IOException
*/
public void close() throws IOException {
if (out == null) {
return;
}
// Close the file
out.close();
// Copy it inplace
if (temporary.exists() && (temporary.length() > 0)) {
(new FileCopy(temporary, finalDestination, false)).run();
}
// Delete the temporary file
temporary.delete();
// Note that we are done
out = null;
}
/**
* Flush the file
*
*@exception IOException throws an IOException
*/
public void flush() throws IOException {
if (out == null) {
return;
}
out.flush();
}
/**
* Write a byte to the file
*
*@param b the byte to be written
*@exception IOException throws an IOException
*/
public void write(int b) throws IOException {
if (out == null) {
return;
}
out.write(b);
}
/**
* Write a byte array to the file
*
*@param b the byte array to be written
*@exception IOException throws an IOException
*/
public void write(byte b[]) throws IOException {
if (out == null) {
return;
}
out.write(b);
}
/**
* Write a byte array to the file
*
*@param b the byte array to be written
*@param off the offset into the array
*@param len the number of bytes to write
*@exception IOException throws an IOException
*/
public void write(byte b[], int off, int len) throws IOException {
if (out == null) {
return;
}
out.write(b, off, len);
}
/**
* Make sure to clean up after itself
*/
protected void finalize() {
if (out == null) {
return;
}
try {
close();
}
catch (IOException ioe) {
}
}
/**
* Description of the Method
*
*@param prefix Description of Parameter
*@param suffix Description of Parameter
*@return Description of the Returned Value
*/
private File createTempFile(String prefix, String suffix) {
for (int ndx = 0; ndx < 1024; ndx++) {
double number = Math.random() * 1024 * 1024;
long rounded = Math.round(number);
File possible = new File(prefix + rounded + suffix);
if (!possible.exists()) {
return possible;
}
}
return null;
}
/** Attempts to determine if the file can be used for output
*@param filepath the file to open
*@return true if it worked
*/
private boolean attempt(String filepath)
{
try {
temporary = createTempFile(filepath, ".java");
temporary.delete();
if (temporary.exists())
return false;
out = new FileOutputStream(temporary);
}
catch (IOException ioe) {
return false;
}
return true;
}
}
| [
"taibi@sonar-scheduler.rd.tut.fi"
] | taibi@sonar-scheduler.rd.tut.fi |
eeabbd52808dc7f32876e290741cca607531d1c1 | f7c0e40a7fed5d8b99cd45f558a6216dabb06c95 | /scp/src/main/java/be/certipost/hudson/plugin/Entry.java | eb0bad33cc70cbf47e17b71ab8c6b1bf9a0d125e | [] | no_license | dougm/hudson-plugins | 6627bded64ae4e08f16f80b895b5292a7e16683b | d883c83bf4f558f2765c5cd488c55dd4ccda824f | refs/heads/master | 2020-06-05T01:40:04.934730 | 2010-08-09T14:57:45 | 2010-08-09T14:57:45 | 826,819 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 493 | java | package be.certipost.hudson.plugin;
/**
*
* @author Ramil Israfilov
*
*/
public final class Entry {
/**
* Destination folder for the copy. May contain macros.
*/
public String filePath;
/**
* File name relative to the workspace root to upload. If the sourceFile is
* directory then all files in that directory will be copied to remote filePath directory recursively
* <p>
* May contain macro, wildcard.
*/
public String sourceFile;
}
| [
"kohsuke@71c3de6d-444a-0410-be80-ed276b4c234a"
] | kohsuke@71c3de6d-444a-0410-be80-ed276b4c234a |
211e96936f7ce7aada9b78163a0e5cbaf749989f | 4a144a0636b225a2d4ae5dcb1a5824981f77c050 | /azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/algorithms/Aes128Cbc.java | 89a10584294dd5bf27ac6419ee065aa71299326a | [
"MIT"
] | permissive | ertwroc/azure-keyvault-java | aedadbf6a015f236e5e7d5b0fca6e8f9635e2cbd | a0a8f81e25357df5bef6bc3f33350a03e52ecd7e | refs/heads/master | 2020-04-06T09:21:53.188642 | 2018-11-02T22:47:19 | 2018-11-02T22:47:19 | 157,339,338 | 0 | 0 | MIT | 2018-11-13T07:37:18 | 2018-11-13T07:37:18 | null | UTF-8 | Java | false | false | 452 | java | /**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.keyvault.cryptography.algorithms;
public class Aes128Cbc extends AesCbc {
private static final int KEY_SIZE = 128;
public static final String ALGORITHM_NAME = "A128CBC";
public Aes128Cbc() {
super(ALGORITHM_NAME, KEY_SIZE);
}
}
| [
"jianghaolu@users.noreply.github.com"
] | jianghaolu@users.noreply.github.com |
339eb187d3224135a0c8e965f7641463bcc52ef8 | 1150f16bf7f7391ed7e3d7e1b67c4897008be532 | /pb/src/main/java/com/exc/street/light/pb/listener/RadioDeviceImportListener.java | 541c6de1931f3ab0d74fa34c7674b8f7d8eaf1a1 | [] | no_license | dragonxu/street_light_yancheng | e0c957214aae2ebbba2470438c16cd1f8bf600ec | 5d0d4fd4af0eb6b54f7e1ecef9651a3b9208d7f7 | refs/heads/master | 2023-01-15T19:36:53.113876 | 2020-11-24T07:37:34 | 2020-11-24T07:37:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,879 | java | package com.exc.street.light.pb.listener;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.exc.street.light.pb.service.RadioDeviceService;
import com.exc.street.light.resource.dto.pb.RadioDeviceImportDataDTO;
import com.exc.street.light.resource.entity.pb.RadioDevice;
import com.exc.street.light.resource.vo.resp.ImportDeviceFailVO;
import com.exc.street.light.resource.vo.resp.ImportDeviceResultVO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import java.util.*;
/**
* 广播设备模板的读取类
*
* @Author: Xiaok
* @Date: 2020/11/13 11:28
*/
public class RadioDeviceImportListener extends AnalysisEventListener<RadioDeviceImportDataDTO> {
private static final Logger log = LoggerFactory.getLogger(RadioDeviceImportListener.class);
private RadioDeviceService service;
/**
* 返回结果
*/
private ImportDeviceResultVO resultVO;
/**
* 当前用户可查看的所有灯杆信息
*/
private Map<String, Integer> lampPostInfoMap;
/**
* 当前用户可查看的已绑定广播设备的灯杆信息
*/
private Map<String, Integer> bindDeviceLampPostInfoMap;
/**
* 已存在的设备编号 用作校验
*/
private Set<String> numSet;
/**
* 已存在的设备名称 用作校验
*/
private Set<String> nameSet;
/**
* 已存在的雷托终端设备编号 用作校验
*/
private Set<Integer> termIdSet;
/**
* 广播设备集合,用于存放校验通过的广播设备信息
*/
private List<RadioDevice> radioDeviceList;
/**
* 创建时间
*/
private Date now;
/**
* excel的序号 从1开始
*/
private int count = 1;
private static final int NAME_LEN = 10;
private static final int NUM_LEN = 36;
private static final int TERM_ID_MAX_NUM = (int) Math.pow(10, 8);
private static final int LAMP_POST_NAME_LEN = 100;
private static final int MODEL_LEN = 25;
private static final int IP_LEN = 25;
private static final int MAC_LEN = 25;
private static final int FACTORY_LEN = 25;
public RadioDeviceImportListener() {
now = new Date();
}
public RadioDeviceImportListener(RadioDeviceService service, ImportDeviceResultVO resultVO, Map<String, Integer> bindDeviceLampPostInfoMap, Map<String, Integer> lampPostInfo, Set<String> numSet, Set<String> nameSet, Set<Integer> termIdSet, List<RadioDevice> radioDeviceList) {
this.service = service;
this.resultVO = resultVO;
this.bindDeviceLampPostInfoMap = bindDeviceLampPostInfoMap;
this.lampPostInfoMap = lampPostInfo;
this.numSet = numSet;
this.nameSet = nameSet;
this.termIdSet = termIdSet;
this.radioDeviceList = radioDeviceList;
now = new Date();
}
@Override
public void invoke(RadioDeviceImportDataDTO radioDeviceImportDTO, AnalysisContext analysisContext) {
boolean validRes = validate(radioDeviceImportDTO);
if (validRes) {
RadioDevice device = new RadioDevice();
BeanUtils.copyProperties(radioDeviceImportDTO, device);
device.setCreateTime(now).setLampPostId(lampPostInfoMap.get(radioDeviceImportDTO.getLampPostName()))
.setNetworkState(0);
radioDeviceList.add(device);
resultVO.setSuccessNum(resultVO.getSuccessNum() + 1);
}
count++;
}
/**
* 所有数据解析完成了 都会来调用
*
* @param analysisContext
*/
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
log.info("广播设备数据解析完成");
}
private boolean validate(RadioDeviceImportDataDTO data) {
//进行校验
ImportDeviceFailVO failVO = new ImportDeviceFailVO().setRows(String.valueOf(count));
List<String> failMsgList = new ArrayList<>();
if (StringUtils.isBlank(data.getName())) {
failMsgList.add("设备名称不得为空");
} else if (data.getName().length() > NAME_LEN) {
failMsgList.add("设备名称的长度不得超过" + NAME_LEN);
}
if (data.getTermId() == null) {
failMsgList.add("雷拓终端ID不得为空");
} else if (data.getTermId() > TERM_ID_MAX_NUM) {
failMsgList.add("雷拓终端ID的长度不得超过" + TERM_ID_MAX_NUM);
}
if (StringUtils.isBlank(data.getNum())) {
failMsgList.add("设备编号不得为空");
} else if (data.getNum().length() > NUM_LEN) {
failMsgList.add("设备编号的长度不得超过" + NUM_LEN);
}
if (StringUtils.isBlank(data.getLampPostName())) {
failMsgList.add("所属灯杆名称不得为空");
} else if (data.getLampPostName().length() > LAMP_POST_NAME_LEN) {
failMsgList.add("所属灯杆名称的长度不得超过" + LAMP_POST_NAME_LEN);
}
if (StringUtils.isBlank(data.getIp())) {
failMsgList.add("IP不得为空");
} else if (data.getIp().length() > IP_LEN) {
failMsgList.add("IP的长度不得超过" + IP_LEN);
}
if (StringUtils.isBlank(data.getMac())) {
failMsgList.add("MAC地址不得为空");
} else if (data.getMac().length() > MAC_LEN) {
failMsgList.add("MAC地址的长度不得超过" + MAC_LEN);
}
if (StringUtils.isNotBlank(data.getFactory()) && data.getFactory().length() > FACTORY_LEN) {
failMsgList.add("设备厂商的长度不得超过" + FACTORY_LEN);
}
if (StringUtils.isNotBlank(data.getModel()) && data.getModel().length() > MODEL_LEN) {
failMsgList.add("设备型号的长度不得超过" + MODEL_LEN);
}
if (nameSet.contains(data.getName())) {
failMsgList.add("设备名称已经存在");
}
if (numSet.contains(data.getNum())) {
failMsgList.add("设备编号已经存在");
}
if (termIdSet.contains(data.getTermId())) {
failMsgList.add("雷拓终端ID已经存在");
}
if (bindDeviceLampPostInfoMap.containsKey(data.getLampPostName())) {
failMsgList.add("该灯杆已绑定广播设备");
} else if (!lampPostInfoMap.containsKey(data.getLampPostName())) {
failMsgList.add("不存在该灯杆名称:" + data.getLampPostName());
}
if (!failMsgList.isEmpty()) {
failVO.setFailMsgList(failMsgList);
resultVO.setFailNum(resultVO.getFailNum() + 1);
resultVO.getFailInfoList().add(failVO);
return false;
}
return true;
}
}
| [
"605408609@qq.com"
] | 605408609@qq.com |
9cd9fe824173b2a7a7df1e89496cbaf9aa51b751 | 1921ffff0e9d3218b65e4cabd912344688d50740 | /common/src/test/java/com/box/l10n/mojito/iterators/PageFetcherOffsetAndLimitSplitIteratorTest.java | aef94ce5960912448e8f07312a5d831c20ce642e | [
"Apache-2.0"
] | permissive | patcon/mojito | d152a572428ec829b6efcecf0c616dde816e4e0f | dc73983a12019195b607d61b54c314973221dcc1 | refs/heads/master | 2022-11-18T18:27:33.063764 | 2020-06-17T01:15:35 | 2020-06-17T01:48:28 | 273,630,050 | 0 | 0 | Apache-2.0 | 2020-06-20T03:16:59 | 2020-06-20T03:16:59 | null | UTF-8 | Java | false | false | 1,472 | java | package com.box.l10n.mojito.iterators;
import org.junit.Test;
import java.util.ArrayList;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class PageFetcherOffsetAndLimitSplitIteratorTest {
@Test
public void testSplitIterator() {
PageFetcherOffsetAndLimitSplitIterator<Integer> integerPageFetcherSplitIterator = new PageFetcherOffsetAndLimitSplitIterator<>((offset, limit) -> {
// return fake paginated result
return IntStream.range(offset, offset < 50 ? offset + limit : offset + 10).boxed().collect(Collectors.toList());
}, 20);
Stream<Integer> stream = StreamSupport.stream(integerPageFetcherSplitIterator, false);
assertEquals(
IntStream.range(0, 70).boxed().collect(Collectors.toList()),
stream.collect(Collectors.toList())
);
}
@Test
public void testSplitIteratorEmpty() {
PageFetcherOffsetAndLimitSplitIterator<Integer> integerPageFetcherSplitIterator = new PageFetcherOffsetAndLimitSplitIterator<>((offset, limit) -> {
return new ArrayList<>();
}, 20);
Stream<Integer> stream = StreamSupport.stream(integerPageFetcherSplitIterator, false);
assertTrue(stream.collect(Collectors.toList()).isEmpty());
}
} | [
"aurambaj@users.noreply.github.com"
] | aurambaj@users.noreply.github.com |
f703cfbbb779ef3bc7b0134afbdd940c854ca3d0 | 3e5fca4469af37054ce3893f18597bdca42ff5c7 | /snap-compile/src/test/java/org/snapscript/compile/ImportTest.java | 61d6017f1fc350f02142bdc731a791392cda9e47 | [] | no_license | Tubbz-alt/snap | 657247ac2c6bb3ba56e3a88413170526e5ca32f9 | 1f87d13d807d974a5cfdf391bcd9f62271eb064c | refs/heads/master | 2021-10-16T09:00:53.032672 | 2019-02-09T16:21:55 | 2019-02-09T16:21:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,778 | java | package org.snapscript.compile;
import java.awt.geom.Line2D;
import java.awt.geom.Line2D.Double;
import java.awt.geom.Ellipse2D;
import junit.framework.TestCase;
public class ImportTest extends TestCase {
private static final String SOURCE_1=
"import awt.geom.Ellipse2D;\n"+
"println(new Ellipse2D.Double(1.0,2.0,3,3.8));\n";
private static final String SOURCE_2=
"import awt.geom.Ellipse2D;\n"+
"import lang.reflect.*;\n"+
"import static lang.Integer.*;\n"+
"import static util.stream.Collectors.toMap;\n"+
"import awt.geom.Line2D;\n"+
"import awt.geom.Line2D.Double;\n"+
"import awt.Color as RGB;\n"+
"class HashMap{\n"+
" static dump() {\n"+
" println('x');\n"+
" }\n"+
"}\n"+
"println(new Ellipse2D.Double(1.0,2.0,3,3.8));\n"+
"println(Field.class);\n"+
"println(new Line2D$Double());\n"+
"println(new Line2D.Double());\n"+
"println(new Double());\n"+
"println(new Line2D$Double().class);\n"+
"println(new Line2D.Double().class);\n"+
"println(new Double().class);\n"+
"HashMap.dump();\n"+
"println(RGB.black);";
public void testInnerClassImport() throws Exception {
Double d = new Double();
System.err.println(d);
System.err.println(new Ellipse2D.Double(1,2,3,4));
Compiler compiler = ClassPathCompilerBuilder.createCompiler();
Executable executable = compiler.compile(SOURCE_1);
executable.execute();
}
public void testImport() throws Exception {
Double d = new Double();
System.err.println(d);
System.err.println(new Line2D.Double());
Compiler compiler = ClassPathCompilerBuilder.createCompiler();
Executable executable = compiler.compile(SOURCE_2);
executable.execute();
}
}
| [
"gallagher_niall@yahoo.com"
] | gallagher_niall@yahoo.com |
c6ef326fde1152fdd86ee22152790fd24e8111b4 | 0042f8a75c9262c51e5e9a28999f5f09860bac5c | /src/test/java/org/scijava/util/POMTest.java | 3a6890ae9bdf0a127b40a48a1c23e5f7d0956da0 | [
"BSD-2-Clause",
"Apache-2.0"
] | permissive | yanadior9029/scijava-common | 2eb51e4b2889029de2971e17c48c076819c2ce2e | 582bafeefd85eac6a3bfcbdb1cc368a5bd21a86d | refs/heads/master | 2023-07-18T05:14:49.273992 | 2021-09-09T17:23:12 | 2021-09-09T17:24:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,696 | java | /*
* #%L
* SciJava Common shared library for SciJava software.
* %%
* Copyright (C) 2009 - 2021 SciJava developers.
* %%
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package org.scijava.util;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.xml.parsers.ParserConfigurationException;
import org.junit.Test;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
/**
* Tests methods of {@link POM}.
*
* @author Curtis Rueden
*/
public class POMTest {
@Test
public void testCompareVersions() {
// basic checks
assertTrue(POM.compareVersions("1", "2") < 0);
assertTrue(POM.compareVersions("1.0", "2.0") < 0);
assertTrue(POM.compareVersions("1.0", "1.1") < 0);
assertTrue(POM.compareVersions("1.0.0", "2.0.0") < 0);
// sanity checks for argument order
assertTrue(POM.compareVersions("2", "1") > 0);
assertTrue(POM.compareVersions("2.0", "1.0") > 0);
assertTrue(POM.compareVersions("1.1", "1.0") > 0);
assertTrue(POM.compareVersions("2.0.0", "1.0.0") > 0);
// more complex/unusual checks
assertTrue(POM.compareVersions("1.0-RC1", "1.0-RC2") < 0);
assertTrue(POM.compareVersions("1.0-RC-1", "1.0-RC-2") < 0);
assertTrue(POM.compareVersions("1.0-RC-2", "1.0-RC-10") < 0);
assertTrue(POM.compareVersions("0.4-alpha", "0.4-beta") < 0);
assertTrue(POM.compareVersions("foo", "bar") > 0);
// checks which expose bugs/limitations
assertTrue(POM.compareVersions("1.0-RC2", "1.0-RC10") > 0);
assertTrue(POM.compareVersions("1.0-rc1", "1.0-RC2") > 0);
// check that varying numbers of digits are handled properly
assertTrue(POM.compareVersions("2.0.0", "2.0.0.1") < 0);
// check that SemVer prerelease versions are handled properly
assertTrue(POM.compareVersions("2.0.0", "2.0.0-beta-1") > 0);
}
@Test
public void testAccessors() throws ParserConfigurationException,
SAXException, IOException
{
final POM pom = new POM(new File("pom.xml"));
assertEquals("org.scijava", pom.getParentGroupId());
assertEquals("pom-scijava", pom.getParentArtifactId());
assertNotNull(pom.getParentVersion());
assertEquals("org.scijava", pom.getGroupId());
assertEquals("scijava-common", pom.getArtifactId());
assertNotNull(pom.getVersion());
assertEquals("GitHub Actions", pom.getCIManagementSystem());
final String ciManagementURL = pom.getCIManagementURL();
assertEquals("https://github.com/scijava/scijava-common/actions",
ciManagementURL);
assertEquals("GitHub Issues", pom.getIssueManagementSystem());
final String issueManagementURL = pom.getIssueManagementURL();
assertEquals("https://github.com/scijava/scijava-common/issues",
issueManagementURL);
assertEquals("SciJava", pom.getOrganizationName());
assertEquals("https://scijava.org/", pom.getOrganizationURL());
assertTrue(pom.getPath().endsWith("pom.xml"));
assertTrue(pom.getProjectDescription().startsWith(
"SciJava Common is a shared library for SciJava software."));
assertEquals("2009", pom.getProjectInceptionYear());
assertEquals("SciJava Common", pom.getProjectName());
assertEquals("https://github.com/scijava/scijava-common", //
pom.getProjectURL());
final String scmConnection = pom.getSCMConnection();
assertEquals("scm:git:git://github.com/scijava/scijava-common",
scmConnection);
final String scmDeveloperConnection = pom.getSCMDeveloperConnection();
assertEquals("scm:git:git@github.com:scijava/scijava-common",
scmDeveloperConnection);
assertNotNull(pom.getSCMTag()); // won't be HEAD for release tags
assertEquals("https://github.com/scijava/scijava-common", pom.getSCMURL());
}
@Test
public void testCdata() throws ParserConfigurationException,
SAXException, IOException
{
final POM pom = new POM(new File("pom.xml"));
assertEquals("repo", pom.cdata("//project/licenses/license/distribution"));
assertEquals("https://github.com/scijava/scijava-common", //
pom.cdata("//project/url"));
}
@Test
public void testElements() throws ParserConfigurationException,
SAXException, IOException
{
final POM pom = new POM(new File("pom.xml"));
final ArrayList<Element> developers =
pom.elements("//project/developers/developer");
assertEquals(1, developers.size());
assertEquals("ctrueden", XML.cdata(developers.get(0), "id"));
}
}
| [
"ctrueden@wisc.edu"
] | ctrueden@wisc.edu |
57d5e0610cfe39e169b7fac3374b6bd6a68e3d2d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_b1fabc9e86aa5e5acdd9b605374c612f0dd522d4/Callable/11_b1fabc9e86aa5e5acdd9b605374c612f0dd522d4_Callable_s.java | bef7d3e1278ccee6a91e4b24f590347017de7a8f | [] | 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 | 190 | java | package net.cheney.motown.router;
import net.cheney.http.core.api.Request;
import net.cheney.http.core.api.Response;
public interface Callable {
Response call(Request request);
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
205ae440a6bbb5561feff996bc9a17b810ede5d8 | 53ff6c2380ad6b54f419700f808fbd40125d9cfa | /ta4j/src/main/java/eu/verdelhan/ta4j/indicators/helpers/StandardDeviationIndicator.java | 62b5715bd626064815c030b59837e689e369b9bd | [
"MIT"
] | permissive | sgrotz/ta4j | 0f981bf622944fa16624b16659a139b5abf466cd | a6b27afda564136b5b19516fb31e94c09fdbc6ab | refs/heads/master | 2020-12-24T12:14:12.256896 | 2015-02-10T06:21:00 | 2015-02-10T06:21:00 | 30,577,564 | 0 | 0 | null | 2015-02-10T06:01:20 | 2015-02-10T06:01:20 | null | UTF-8 | Java | false | false | 2,872 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2014-2015 Marc de Verdelhan & respective authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package eu.verdelhan.ta4j.indicators.helpers;
import eu.verdelhan.ta4j.Indicator;
import eu.verdelhan.ta4j.Decimal;
import eu.verdelhan.ta4j.indicators.CachedIndicator;
import eu.verdelhan.ta4j.indicators.trackers.SMAIndicator;
/**
* Standard deviation indicator.
* <p>
* @see http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:standard_deviation_volatility
*/
public class StandardDeviationIndicator extends CachedIndicator<Decimal> {
private Indicator<? extends Decimal> indicator;
private int timeFrame;
private SMAIndicator sma;
/**
* Constructor.
* @param indicator the indicator
* @param timeFrame the time frame
*/
public StandardDeviationIndicator(Indicator<? extends Decimal> indicator, int timeFrame) {
super(indicator);
this.indicator = indicator;
this.timeFrame = timeFrame;
sma = new SMAIndicator(indicator, timeFrame);
}
@Override
protected Decimal calculate(int index) {
final int startIndex = Math.max(0, index - timeFrame + 1);
final int numberOfObservations = index - startIndex + 1;
Decimal standardDeviation = Decimal.ZERO;
Decimal average = sma.getValue(index);
for (int i = startIndex; i <= index; i++) {
Decimal pow = indicator.getValue(i).minus(average).pow(2);
standardDeviation = standardDeviation.plus(pow);
}
standardDeviation = standardDeviation.dividedBy(Decimal.valueOf(numberOfObservations));
return standardDeviation.sqrt();
}
@Override
public String toString() {
return getClass().getSimpleName() + " timeFrame: " + timeFrame;
}
}
| [
"marc.deverdelhan@yahoo.com"
] | marc.deverdelhan@yahoo.com |
1d26f6979255670c48d8146199cb2563ac19b83f | b58bc628768a593d434efa55f7a24d90cd453d9e | /config/src/test/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistryAnyMatcherTests.java | de5c6683889288ab7232207a702d804b382ed934 | [
"Apache-2.0"
] | permissive | spring-operator/spring-security | 863053086592a4ffe4a80d781e080f39c806c707 | c08b36221af378e5e3c1935a33ce27d59fa683ed | refs/heads/master | 2020-04-26T06:21:31.309412 | 2019-03-01T02:10:19 | 2019-03-01T02:10:19 | 173,361,820 | 1 | 0 | Apache-2.0 | 2019-03-01T20:10:38 | 2019-03-01T20:10:38 | null | UTF-8 | Java | false | false | 3,963 | java | /*
* Copyright 2002-2019 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
*
* 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.springframework.security.config.annotation.web;
import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.mock.web.MockServletContext;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
/**
* Tests for {@link AbstractRequestMatcherRegistry}.
*
* @author Ankur Pathak
*/
public class AbstractRequestMatcherRegistryAnyMatcherTests{
@EnableWebSecurity
static class AntMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.antMatchers("/demo/**").permitAll();
}
}
@Test(expected = BeanCreationException.class)
public void antMatchersCanNotWorkAfterAnyRequest(){
loadConfig(AntMatchersAfterAnyRequestConfig.class);
}
@EnableWebSecurity
static class MvcMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.mvcMatchers("/demo/**").permitAll();
}
}
@Test(expected = BeanCreationException.class)
public void mvcMatchersCanNotWorkAfterAnyRequest() {
loadConfig(MvcMatchersAfterAnyRequestConfig.class);
}
@EnableWebSecurity
static class RegexMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.regexMatchers(".*").permitAll();
}
}
@Test(expected = BeanCreationException.class)
public void regexMatchersCanNotWorkAfterAnyRequest() {
loadConfig(RegexMatchersAfterAnyRequestConfig.class);
}
@EnableWebSecurity
static class AnyRequestAfterItselfConfig extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.anyRequest().permitAll();
}
}
@Test(expected = BeanCreationException.class)
public void anyRequestCanNotWorkAfterItself() {
loadConfig(AnyRequestAfterItselfConfig.class);
}
@EnableWebSecurity
static class RequestMatchersAfterAnyRequestConfig extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.requestMatchers(new AntPathRequestMatcher("/**")).permitAll();
}
}
@Test(expected = BeanCreationException.class)
public void requestMatchersCanNotWorkAfterAnyRequest() {
loadConfig(RequestMatchersAfterAnyRequestConfig.class);
}
private void loadConfig(Class<?>... configs) {
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
context.setAllowCircularReferences(false);
context.register(configs);
context.setServletContext(new MockServletContext());
context.refresh();
}
}
| [
"josh.cummings@gmail.com"
] | josh.cummings@gmail.com |
cca23536bffe51cb664a5a374202daa42972f119 | b879b4873a2b5b675c57f7e4cb156c5696122e76 | /src/keyboardActions/Test1.java | 25c47861342f4803d6d0d22088f6422212ab7e9e | [] | no_license | javaandselenium/seleniumus | 17a22d7a1acf0aaa527125e4f5fe57b30f5fab03 | 4a51c3c3a031eff75865148afdf897de1f8d1ed9 | refs/heads/master | 2023-04-26T21:49:05.498975 | 2021-05-29T02:54:35 | 2021-05-29T02:54:35 | 366,238,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package keyboardActions;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Test1 {
public static void main(String[] args) throws AWTException {
WebDriver driver=new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://www.google.com/");
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS);
Robot r=new Robot();
r.keyPress(KeyEvent.VK_CONTROL);
r.keyPress(KeyEvent.VK_N);
r.keyRelease(KeyEvent.VK_CONTROL);
r.keyRelease(KeyEvent.VK_N);
}
}
| [
"QSP@QSP"
] | QSP@QSP |
f1bfe1a097e102bb261f4b3d59d64542f84e319a | 8ec87f159728387b8eb31d661dda1d1e38e98ddb | /core/src/main/java/org/codehaus/enunciate/contract/jaxrs/RootResource.java | 38a55490891dac3a85b70a64e20b103be9a2793a | [
"Apache-2.0"
] | permissive | BarisDere/enunciate | dd27d81465e75f57a2a34317322855012bfed6e2 | 95d7728e169fdb597a01975565e27e1233c77649 | refs/heads/master | 2021-01-22T17:02:51.013358 | 2014-04-21T17:58:20 | 2014-04-21T17:58:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,947 | java | /*
* Copyright 2006-2008 Web Cohesion
*
* 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.codehaus.enunciate.contract.jaxrs;
import com.sun.mirror.declaration.*;
import javax.ws.rs.Path;
import java.util.*;
/**
* A JAX-RS root resource.
*
* @author Ryan Heaton
*/
public class RootResource extends Resource {
public RootResource(TypeDeclaration delegate) {
super(delegate, loadPath(delegate));
}
private static String loadPath(TypeDeclaration delegate) {
Path path = delegate.getAnnotation(Path.class);
if (path == null) {
throw new IllegalArgumentException("A JAX-RS root resource must be annotated with @javax.ws.rs.Path.");
}
return path.value();
}
/**
* @return null
*/
public Resource getParent() {
return null;
}
@Override
public boolean isInterface() {
return (getDelegate() instanceof InterfaceDeclaration);
}
@Override
public boolean isClass() {
return (getDelegate() instanceof ClassDeclaration);
}
/**
* The resource parameters for a root resource include the constructor params.
*
* @param delegate The declaration.
* @return The resource params.
*/
@Override
protected List<ResourceParameter> getResourceParameters(TypeDeclaration delegate) {
List<ResourceParameter> resourceParams = super.getResourceParameters(delegate);
if (getDelegate() == delegate && delegate instanceof ClassDeclaration) {
//root resources also include constructor params.
Collection<ConstructorDeclaration> constructors = ((ClassDeclaration) delegate).getConstructors();
ConstructorDeclaration chosen = null;
CONSTRUCTOR_LOOP : for (ConstructorDeclaration constructor : constructors) {
//the one with the most params is the chosen one.
if (chosen == null || constructor.getParameters().size() > chosen.getParameters().size()) {
//Has more constructor parameters. See if they're all Jersey-provided.
for (ParameterDeclaration param : constructor.getParameters()) {
if (!ResourceParameter.isResourceParameter(param)) {
continue CONSTRUCTOR_LOOP;
}
}
chosen = constructor;
}
}
if (chosen != null) {
for (ParameterDeclaration param : chosen.getParameters()) {
resourceParams.add(new ResourceParameter(param));
}
}
}
return resourceParams;
}
}
| [
"ryan@webcohesion.com"
] | ryan@webcohesion.com |
ddb471f9f76d9508b333085e6f6500ec8031090b | 64abd84480bfe313890a3fc2275a0242080a328d | /enterpriseSms-client/src/main/java/com/ptnetwork/enterpriseSms/client/persistence/DbChannelInstructStore.java | 67fab9c2f4513fd1b4ed318ccac1d3a615e39f9f | [] | no_license | zjordon/sm_platformnew | 6225aee7b006c49354a3abdb443e48a4bffad9cd | 56c6caa3087caf2bc7370361b46b7887e5265efc | refs/heads/master | 2020-04-06T04:36:06.835245 | 2015-06-22T12:34:14 | 2015-06-22T12:34:14 | 35,918,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,693 | java | /**
*
*/
package com.ptnetwork.enterpriseSms.client.persistence;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.ptnetwork.enterpriseSms.client.domain.ChannelInstruct;
/**
* @author jasonzhang
*
*/
public class DbChannelInstructStore extends DbBaseStore {
private static Log log = LogFactory.getLog(DbBillRequestStore.class);
private final static String GET_CHANNEL_INSTRUCT = "select id, instruct, channel_id from sm_channel_instruct";
private final static String INSERT_CHANNEL_INSTRUCT = "insert into sm_channel_instruct(id, instruct, channel_id) values(?,?,?)";
private final static String UPDATE_CHANNEL_INSTRUCT_INFO = "update sm_channel_instruct set instruct = ? where id = ?";
private final static String DELETE_CHANNEL_INSTRUCT = "delete from sm_channel_instruct where id = ?";
public void saveChannelInstruct(ChannelInstruct channelInstruct) throws DaoException {
Connection conn = null;
try {
conn = super.getConnection();
PreparedStatement pstmt = conn
.prepareStatement(INSERT_CHANNEL_INSTRUCT);
pstmt.setString(1, channelInstruct.getId());
pstmt.setString(2, channelInstruct.getInstruct());
pstmt.setString(3, channelInstruct.getChannelId());
pstmt.executeUpdate();
super.closePstmt(pstmt);
conn.commit();
} catch (SQLException e) {
super.rollbackConnection(conn);
log.error("exception when getChannelInstructList", e);
throw new DaoException(e.getMessage());
} finally {
super.closeConnction(conn);
}
}
public void updatChannelInstructInfo(String id, String instruct) throws DaoException {
Connection conn = null;
try {
conn = super.getConnection();
PreparedStatement pstmt = conn
.prepareStatement(UPDATE_CHANNEL_INSTRUCT_INFO);
pstmt.setString(1, instruct);
pstmt.setString(2, id);
pstmt.executeUpdate();
super.closePstmt(pstmt);
conn.commit();
} catch (SQLException e) {
super.rollbackConnection(conn);
log.error("exception when updatChannelInstructInfo", e);
throw new DaoException(e.getMessage());
} finally {
super.closeConnction(conn);
}
}
public void deleteChannelInstruct(String id) throws DaoException {
Connection conn = null;
try {
conn = super.getConnection();
PreparedStatement pstmt = conn
.prepareStatement(DELETE_CHANNEL_INSTRUCT);
pstmt.setString(1, id);
pstmt.executeUpdate();
super.closePstmt(pstmt);
conn.commit();
} catch (SQLException e) {
super.rollbackConnection(conn);
log.error("exception when deleteChannelInstruct", e);
throw new DaoException(e.getMessage());
} finally {
super.closeConnction(conn);
}
}
public List<ChannelInstruct> getChannelInstructList() throws DaoException {
List<ChannelInstruct> list = new ArrayList<ChannelInstruct>();
Connection conn = null;
try {
conn = super.getConnection();
PreparedStatement pstmt = conn
.prepareStatement(GET_CHANNEL_INSTRUCT);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
ChannelInstruct channelInstruct = new ChannelInstruct();
channelInstruct.setId(rs.getString(1));
channelInstruct.setInstruct(rs.getString(2));
channelInstruct.setChannelId(rs.getString(3));
list.add(channelInstruct);
}
super.closeResultSet(rs);
super.closeStmt(pstmt);
} catch (SQLException e) {
log.error("exception when getChannelInstructList", e);
throw new DaoException(e.getMessage());
} finally {
super.closeConnction(conn);
}
return list;
}
}
| [
"z_jordon@163.com"
] | z_jordon@163.com |
9d5937f90cf782163fd4f52961d10d7e9b940ddc | 01ecf055b7d0ed3fef5d008587dd10697bc57dcf | /src/main/java/com/medicineCenter/service/TaskCrudService.java | e34bdeb29b46a16606069e7abc7ce2e6342b1a0c | [] | no_license | huangsongkai/medicine_center | f4f08f7516cb9ec459c0834ac4a9845b35606fd3 | 63a2fe8873bfc15dedbb45b41ddf434438319d1a | refs/heads/master | 2019-07-15T02:29:44.864542 | 2018-05-30T08:55:09 | 2018-05-30T08:55:09 | 113,550,732 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,926 | java | package com.medicineCenter.service;
import com.medicineCenter.dao.TaskMapperExt;
import com.medicineCenter.interfaces.controller.Result;
import com.medicineCenter.model.dataObject.InspectionGroup;
import com.medicineCenter.model.dataObject.Task;
import com.medicineCenter.model.dataObject.TaskExample;
import com.medicineCenter.model.dto.SelectProviderDTO;
import com.medicineCenter.model.dto.TaskDTO;
import com.medicineCenter.util.Page;
import com.medicineCenter.util.PageUtil;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
/**
* Created by song.
*/
@Service
public class TaskCrudService extends BaseService{
@Resource
TaskMapperExt taskMapperExt;
public Result add(Task task) {
return new Result(taskMapperExt.insert(task),"",task);
}
public int update(Task task) {
return taskMapperExt.updateByPrimaryKeySelective(task);
}
public int delete(Task task) {
return taskMapperExt.deleteByPrimaryKey(task.getTaskId());
}
public Task get(int id) {
return taskMapperExt.selectByPrimaryKey(id);
}
public Page<Task> getList(int pageNum, String q, String asc, String desc, String dep,String state) {
String orderClause = "";
if(asc != null){
orderClause += asc;
}else if(desc != null){
orderClause += desc;
}else{
orderClause += "CREATE_TIME DESC";
}
Page page = new Page();
List<Task> taskList;
int totalPage;
TaskExample taskExample = new TaskExample();
//全文检索 优先使用fulltext索引 还可以利用lucence,like等
if(q != null){
if ("质量科".equals(dep)){
dep="";
}
//新建一个ProviderDTO为 Provider 传值
SelectProviderDTO selectProviderDTO = new SelectProviderDTO();
selectProviderDTO.setOffset((pageNum - 1) * PAGE_SIZE);
selectProviderDTO.setLimit(PAGE_SIZE);
selectProviderDTO.setQ(q);
selectProviderDTO.setDep(dep);
selectProviderDTO.setState(state);
taskList = taskMapperExt.selectByFullText(selectProviderDTO);
totalPage = PageUtil.getPageNum(taskMapperExt.selectCountByFullText(selectProviderDTO));
}else {
taskExample.setOrderByClause(orderClause + " " + PageUtil.genPaginationClause(pageNum));
if (!"质量科".equals(dep)){
taskExample.or().andSourceEqualTo(dep);
}
if (state != null){
taskExample.or().andStateEqualTo(state);
}
taskList = taskMapperExt.selectByExample(taskExample);
totalPage = totalPage(taskExample);
}
page.setCurrentPage(pageNum);
page.setData(taskList);
page.setTotalPage(totalPage);
page.setPageSize(PAGE_SIZE);
return page;
}
public int totalPage(TaskExample example) {
return PageUtil.getPageNum(taskMapperExt.countByExample(example));
}
public Result add(TaskDTO taskDTO) {
Task task = new Task();
try {
BeanUtils.copyProperties(task, taskDTO);//copy对象的属性
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
add(task);
InspectionGroup inspectionGroup = new InspectionGroup();
inspectionGroup.setTaskId(task.getTaskId());
//add(inspectionGroup);
try {
BeanUtils.copyProperties(inspectionGroup, taskDTO);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
public List<TaskDTO> selectByTaskOneReturnTaskDTO(int pageNum, String q){
return taskMapperExt.selectByTaskOneReturnTaskDTO((pageNum - 1) * PAGE_SIZE, PAGE_SIZE, q);
}
public void updateGroupExpertsByState(int taskId) {
taskMapperExt.updateGroupExpertsByState(taskId);
}
public int queryTaskProcessing() {
//处理中
int processing = taskMapperExt.queryTaskprocessing();
return processing;
}
public int queryTaskGenerate() {
//待生成
int generate = taskMapperExt.queryTaskgenerate();
return generate;
}
public int queryTaskChange() {
//变更中
int change = taskMapperExt.queryTaskChange();
return change;
}
//查询在任务中的专家
public List<Task> selectByEndExecutionTime(String source) {
return taskMapperExt.selectByEndExecutionTime(source);
}
} | [
"296731066@qq.com"
] | 296731066@qq.com |
934b46a53e237923aeebe1cd5c2cfea792f85430 | 000e9ddd9b77e93ccb8f1e38c1822951bba84fa9 | /java/classes/com/baidu/trace/api/fence/FenceListResponse.java | b1c38f09e32d5bdd9f1ddc015cec6db68271b242 | [
"Apache-2.0"
] | permissive | Paladin1412/house | 2bb7d591990c58bd7e8a9bf933481eb46901b3ed | b9e63db1a4975b614c422fed3b5b33ee57ea23fd | refs/heads/master | 2021-09-17T03:37:48.576781 | 2018-06-27T12:39:38 | 2018-06-27T12:41:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,596 | java | package com.baidu.trace.api.fence;
import com.baidu.trace.model.BaseResponse;
import java.util.List;
public final class FenceListResponse
extends BaseResponse
{
private int a;
private FenceType b;
private List<FenceInfo> c;
public FenceListResponse(int paramInt1, int paramInt2, String paramString, int paramInt3, FenceType paramFenceType, List<FenceInfo> paramList)
{
this(paramInt1, paramInt2, paramString, paramFenceType);
this.a = paramInt3;
this.c = paramList;
}
public FenceListResponse(int paramInt1, int paramInt2, String paramString, FenceType paramFenceType)
{
super(paramInt1, paramInt2, paramString);
this.b = paramFenceType;
}
public final List<FenceInfo> getFenceInfos()
{
return this.c;
}
public final FenceType getFenceType()
{
return this.b;
}
public final int getSize()
{
return this.a;
}
public final void setFenceInfos(List<FenceInfo> paramList)
{
this.c = paramList;
}
public final void setFenceType(FenceType paramFenceType)
{
this.b = paramFenceType;
}
public final void setSize(int paramInt)
{
this.a = paramInt;
}
public final String toString()
{
return "FenceListResponse [tag=" + this.tag + ", status=" + this.status + ", message=" + this.message + ", size=" + this.a + ", fenceType=" + this.b + ", fenceInfos=" + this.c + "]";
}
}
/* Location: /Users/gaoht/Downloads/zirom/classes-dex2jar.jar!/com/baidu/trace/api/fence/FenceListResponse.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"ght163988@autonavi.com"
] | ght163988@autonavi.com |
a97922fbf7fb631451fc12e1981ff621b6e80283 | cb36cb6c60ff1adb1ce4f87f8b325190b290712e | /com.legooframework.core/src/main/java/com/legooframework/model/core/osgi/rules/DependBundleParseRule.java | c0cf5052b8666edfdecc061bbec4f9a91e150685 | [] | no_license | haozm/legooframework | db27d1c96669e8b46cb5fd1e983a95888bef3795 | ad0f99c0344de78a37c38d4cfe4bdbbd253a6731 | refs/heads/master | 2020-03-19T07:09:00.643277 | 2019-12-07T13:47:17 | 2019-12-07T13:47:17 | 136,090,435 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,066 | java | package com.legooframework.model.core.osgi.rules;
import com.legooframework.model.core.osgi.DefaultBundleBuilder;
import com.legooframework.model.core.utils.AttributesUtil;
import org.apache.commons.lang3.StringUtils;
import org.xml.sax.Attributes;
import java.util.Optional;
class DependBundleParseRule extends BaseParseRule {
@Override
public void begin(String namespace, String name, Attributes attributes) throws Exception {
String model_name = AttributesUtil.getValue(name, attributes, "name");
Optional<String> model_version = AttributesUtil.getIfPresent(attributes, "version");
Optional<String> use_type = AttributesUtil.getIfPresent(attributes, "use");
DefaultBundleBuilder builder = getDigester().peek();
builder.setDependsItems(model_name, model_version.orElse("1.0.0"),
use_type.isPresent() && StringUtils.equals("required", use_type.get()));
}
@Override
public String[] getPatterns() {
return new String[]{"model/depends/bundle"};
}
}
| [
"xiaojie.hao@live.com"
] | xiaojie.hao@live.com |
ca7ab3b52be23224e17fdda7fbc0ffd08c0ed1d6 | a08f0c2e3e492c364f035d3b3b5fc4c29611e7c9 | /data-structure-and-algorithm/Interview-Programs/src/com/binary_decimal/DecimalToOctal.java | 02a64f8a7b42a6cebdbacfe5ba233ea2e9f146f6 | [] | no_license | chamanbharti/java-works | 9832eb8ba6a81c88250fa81a71fa9db728993cd3 | aec6b503bde515dc174b23404c936635a7f59add | refs/heads/master | 2023-04-26T16:49:48.915313 | 2021-05-31T12:44:50 | 2021-05-31T12:44:50 | 328,213,982 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 591 | java | package com.binary_decimal;
import java.util.Scanner;
public class DecimalToOctal {
public String toOctal(int n){
if(n == 0){
return "0";
}
String octal = "";
while(n>0){
int rev = n % 8;
octal = rev + octal;
n = n / 8;
}
return octal;
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter a number: ");
int decimal = scanner.nextInt();
DecimalToOctal db = new DecimalToOctal();
String binary = db.toOctal(decimal);
System.out.println("The Octal representation is: "+binary);
}
}
| [
"chaman.bharti84@gmail.com"
] | chaman.bharti84@gmail.com |
4c1b1ea577566f5a1d283a003f872209176a6c10 | 056793372e9b7b26fc77ea8fef8b26b52ed72b85 | /designer/PlatypusCodeCompletion/src/com/eas/designer/codecompletion/module/LoadModelInterceptor.java | 8e1c6947176c5868a3be00c2aef0ace28c632164 | [
"Apache-2.0"
] | permissive | Level0r0/PlatypusJS | 29685475c2c7140c43aa52131107711ad47c70e4 | d87545b23679c6a309ab340760c8d29ffecd7cdd | refs/heads/master | 2021-01-09T05:44:25.682359 | 2016-12-08T11:21:53 | 2016-12-08T11:21:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,130 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.eas.designer.codecompletion.module;
import com.eas.client.SqlQuery;
import com.eas.client.metadata.Field;
import com.eas.client.metadata.Fields;
import com.eas.client.metadata.Parameter;
import com.eas.client.metadata.Parameters;
import com.eas.client.model.application.ApplicationDbEntity;
import com.eas.client.model.application.ApplicationDbModel;
import com.eas.designer.application.module.PlatypusModuleDataObject;
import com.eas.designer.codecompletion.InterceptorUtils;
import java.util.Collection;
import java.util.regex.Pattern;
import org.netbeans.modules.csl.api.OffsetRange;
import org.netbeans.modules.javascript2.editor.model.JsObject;
import org.netbeans.modules.javascript2.editor.model.TypeUsage;
import org.netbeans.modules.javascript2.editor.spi.model.FunctionInterceptor;
import org.netbeans.modules.javascript2.editor.spi.model.ModelElementFactory;
import org.openide.filesystems.FileObject;
import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectNotFoundException;
/**
*
* @author mg
*/
@FunctionInterceptor.Registration
public class LoadModelInterceptor extends ModelInterceptor {
private static final String LOAD_MODEL_NAME = "loadModel";
private static final Pattern PATTERN = Pattern.compile(".+\\." + LOAD_MODEL_NAME);
private static final String ENTITY_MODULE_NAME = "application-platypus-entity"/*Crazy RequireJsIndexer! It should be datamodel/application-platypus-entity */;
private static final String FIELD_MODULE_NAME = "field"/*Crazy RequireJsIndexer! It should be core/field */;
private static final String PARAMETER_MODULE_NAME = "parameter"/*Crazy RequireJsIndexer! It should be core/parameter */;
private static final String SCHEMA_PROP_NAME = "schema";
private static final String LENGTH_PROP_NAME = "length";
private static final String PARAMS_PROP_NAME = "params";
public LoadModelInterceptor() {
super(LOAD_MODEL_NAME);
}
@Override
public Pattern getNamePattern() {
return PATTERN;
}
@Override
protected void fillJsModel(FileObject fo, ModelElementFactory factory, int loadModelOffset, JsObject jsModel) throws DataObjectNotFoundException, Exception {
DataObject dataObject = DataObject.find(fo);
if (dataObject instanceof PlatypusModuleDataObject) {
PlatypusModuleDataObject modelContainer = (PlatypusModuleDataObject) dataObject;
if (modelContainer.isModelRead()) {
ApplicationDbModel model = modelContainer.getModel();
TypeUsage numberType = factory.newType("Number", loadModelOffset, true);
TypeUsage arrayType = factory.newType("Array", loadModelOffset, true);
TypeUsage objectType = factory.newType("Object", loadModelOffset, true);
for (ApplicationDbEntity modelEntity : model.getEntities().values()) {
if (modelEntity.getName() != null && !modelEntity.getName().isEmpty()) {
JsObject jsEntity = factory.newObject(jsModel, modelEntity.getName(), new OffsetRange(loadModelOffset, loadModelOffset), false);
TypeUsage entityQueryType = factory.newType(modelEntity.getQueryName(), loadModelOffset, false);
TypeUsage localEntityType = factory.newType(jsModel.getFullyQualifiedName() + "." + jsEntity.getName(), loadModelOffset, true);
//
Collection<TypeUsage> apiEntityTypes = InterceptorUtils.getModuleExposedTypes(fo, loadModelOffset, factory, ENTITY_MODULE_NAME);
apiEntityTypes.stream().forEach((apiEntityType) -> {
jsEntity.addAssignment(apiEntityType, apiEntityType.getOffset());
});
//
jsEntity.addAssignment(arrayType, loadModelOffset);
jsEntity.addAssignment(entityQueryType, loadModelOffset);
jsEntity.addAssignment(localEntityType, loadModelOffset);
//
SqlQuery sqlQuery = modelEntity.getQuery();
if (sqlQuery != null) {
Fields fields = sqlQuery.getFields();
JsObject jsSchema = factory.newObject(jsEntity, SCHEMA_PROP_NAME, new OffsetRange(loadModelOffset, loadModelOffset), false);
jsSchema.addAssignment(factory.newType(jsEntity.getFullyQualifiedName() + "." + SCHEMA_PROP_NAME, loadModelOffset, true), loadModelOffset);
jsSchema.addAssignment(objectType, loadModelOffset);
JsObject jsSchemaLength = factory.newObject(jsSchema, LENGTH_PROP_NAME, new OffsetRange(loadModelOffset, loadModelOffset), false);
jsSchemaLength.addAssignment(numberType, -1);
jsSchema.addProperty(jsSchemaLength.getName(), jsSchemaLength);
Collection<TypeUsage> apiFieldTypes = InterceptorUtils.getModuleExposedTypes(fo, loadModelOffset, factory, FIELD_MODULE_NAME);
for (int i = 1; i < fields.getFieldsCount(); i++) {
Field field = fields.get(i);
JsObject jsField = factory.newObject(jsSchema, field.getName(), new OffsetRange(loadModelOffset, loadModelOffset), false);
apiFieldTypes.stream().forEach((apiFieldType) -> {
jsField.addAssignment(apiFieldType, apiFieldType.getOffset());
});
jsSchema.addProperty(jsField.getName(), jsField);
}
jsEntity.addProperty(jsSchema.getName(), jsSchema);
//
Parameters params = sqlQuery.getParameters();
JsObject jsParams = factory.newObject(jsEntity, PARAMS_PROP_NAME, new OffsetRange(loadModelOffset, loadModelOffset), false);
jsParams.addAssignment(factory.newType(jsEntity.getFullyQualifiedName() + "." + PARAMS_PROP_NAME, loadModelOffset, true), loadModelOffset);
jsParams.addAssignment(objectType, loadModelOffset);
JsObject jsParamsLength = factory.newObject(jsParams, LENGTH_PROP_NAME, new OffsetRange(loadModelOffset, loadModelOffset), false);
jsParamsLength.addAssignment(numberType, loadModelOffset);
jsParams.addProperty(jsParamsLength.getName(), jsParamsLength);
Collection<TypeUsage> apiParameterTypes = InterceptorUtils.getModuleExposedTypes(fo, loadModelOffset, factory, PARAMETER_MODULE_NAME);
for (int i = 1; i < params.getParametersCount(); i++) {
Parameter parameter = params.get(i);
JsObject jsParameter = factory.newObject(jsParams, parameter.getName(), new OffsetRange(loadModelOffset, loadModelOffset), false);
apiParameterTypes.stream().forEach((apiParameterType) -> {
jsParameter.addAssignment(apiParameterType, apiParameterType.getOffset());
});
jsParams.addProperty(jsParameter.getName(), jsParameter);
}
jsEntity.addProperty(jsParams.getName(), jsParams);
//
jsModel.addProperty(jsEntity.getName(), jsEntity);
}
}
}
}
}
}
}
| [
"mg@altsoft.biz"
] | mg@altsoft.biz |
5c767ad5e831e876e9f503c247e4d46a625f1554 | 5253dcf5b8c35f8ea1ff632f87d61d009879d8a7 | /buybeanpulp/src/main/java/com/changcai/buyer/ui/quote/PlaceClassifyMoreAdapter.java | 26ff1cce73203c0dec6b9a6131c1b6fc1f3093fd | [] | no_license | lufeisong1988/changcai | 7e682ed2de796ecfd5204c9abf9485567714a477 | cd578f8de84c8ce2e71c5537c90d808ef398e2b3 | refs/heads/master | 2021-09-10T23:14:23.028466 | 2018-04-04T01:53:46 | 2018-04-04T01:53:46 | 116,357,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,985 | java | package com.changcai.buyer.ui.quote;
import android.content.Context;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.changcai.buyer.R;
import com.changcai.buyer.ui.quote.bean.ConditionValue;
import com.changcai.buyer.ui.quote.bean.LocationValue;
import com.changcai.buyer.view.CustomFontTextView;
import java.util.List;
/**
* Created by huangjian299 on 16/6/8.
*/
public class PlaceClassifyMoreAdapter extends BaseAdapter {
private Context context;
private List<LocationValue> textList;
private int position = 0;
Holder hold;
public PlaceClassifyMoreAdapter(Context context, List<LocationValue> list) {
this.context = context;
this.textList = list;
}
public PlaceClassifyMoreAdapter(Context context) {
this.context = context;
}
public void setData(List<LocationValue> textList){
this.textList = textList;
notifyDataSetChanged();
}
public int getCount() {
if (textList == null) {
return 0;
} else {
return textList.size();
}
}
public Object getItem(int position) {
return textList.get(position);
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View view, ViewGroup viewGroup) {
if (view == null) {
view = View.inflate(context, R.layout.item_classify_morelist, null);
hold = new Holder(view);
view.setTag(hold);
} else {
hold = (Holder) view.getTag();
}
if(position < textList.size()) {
LocationValue conditionValue = textList.get(position);
if(conditionValue != null)
hold.txt.setText(conditionValue.getName());
hold.txt.setTextColor(0xFF26272A);
// hold.txt.setTextSize(TypedValue.COMPLEX_UNIT_PX,26);
hold.layout.setBackgroundColor(0xFFFFFFFF);
if (position == this.position) {
hold.txt.setTextColor(0xFF408AFF);
//hold.layout.setBackgroundColor(0xFFF5F5F5);
hold.ivSelected.setVisibility(View.VISIBLE);
}else {
hold.ivSelected.setVisibility(View.GONE);
}
}
return view;
}
public void setSelectItem(int position) {
this.position = position;
notifyDataSetChanged();
}
private static class Holder {
LinearLayout layout;
TextView txt;
ImageView ivSelected;
public Holder(View view) {
layout = (LinearLayout) view.findViewById(R.id.moreitem_layout);
txt = (CustomFontTextView) view.findViewById(R.id.moreitem_txt);
ivSelected = (ImageView) view.findViewById(R.id.iv_selected);
}
}
} | [
"735596768@qq.com"
] | 735596768@qq.com |
998d68006dbb2d018bcfbc3f091a88e2f05ba678 | 1788a71d6bec79647e53d8c1c45b0ad506d322a8 | /spectator-reg-metrics2/src/main/java/com/netflix/spectator/metrics2/MetricsTimer.java | 780ca3aa138bc60bf77c5a9af79755a23ea071ad | [
"Apache-2.0"
] | permissive | mbrukman/netflix-spectator | 95a7894d96facd830ad4bc907c28910ebf5b6ec2 | 2f6505ae2708c54f5d18d509a54e068d35d70404 | refs/heads/master | 2021-01-21T08:43:43.855496 | 2014-12-19T23:20:55 | 2014-12-19T23:20:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,287 | java | /**
* Copyright 2014 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.netflix.spectator.metrics2;
import com.netflix.spectator.api.Clock;
import com.netflix.spectator.api.Id;
import com.netflix.spectator.api.Measurement;
import com.netflix.spectator.api.Timer;
import java.util.Collections;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
/** Timer implementation for the metrics2 registry. */
class MetricsTimer implements Timer {
private final Clock clock;
private final Id id;
private final com.yammer.metrics.core.Timer impl;
/** Create a new instance. */
MetricsTimer(Clock clock, Id id, com.yammer.metrics.core.Timer impl) {
this.clock = clock;
this.id = id;
this.impl = impl;
}
@Override public Id id() {
return id;
}
@Override public boolean hasExpired() {
return false;
}
@Override public void record(long amount, TimeUnit unit) {
impl.update(amount, unit);
}
@Override public Iterable<Measurement> measure() {
final long now = clock.wallTime();
return Collections.singleton(new Measurement(id, now, impl.meanRate()));
}
@Override public <T> T record(Callable<T> f) throws Exception {
final long s = clock.monotonicTime();
try {
return f.call();
} finally {
final long e = clock.monotonicTime();
record(e - s, TimeUnit.NANOSECONDS);
}
}
@Override public void record(Runnable f) {
final long s = clock.monotonicTime();
try {
f.run();
} finally {
final long e = clock.monotonicTime();
record(e - s, TimeUnit.NANOSECONDS);
}
}
@Override public long count() {
return impl.count();
}
@Override public long totalTime() {
return (long) impl.sum();
}
}
| [
"brharrington@gmail.com"
] | brharrington@gmail.com |
5f006aa0f5948f78e0fc6883dc2d24a34959cd04 | 7898b6967273fb569d61256b7acc8da372c1326e | /LeetCode/TheSkylineProblem.java | 57102d87262f45734fa09a70a9e62ab492161ceb | [] | no_license | DavinderSinghKharoud/AlgorithmsAndDataStructures | 83d4585ebbdc9bc27529bffcadf03f49fc3d0088 | 183aeba23f51b9edea6be8afbc9ee6cd221d3195 | refs/heads/master | 2022-07-08T17:18:23.954213 | 2022-05-17T02:22:16 | 2022-05-17T02:22:16 | 229,511,418 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,219 | java |
import java.util.*;
/**
* FindGreatestCommonDivisor city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are given the locations and height of all the buildings as shown on a cityscape photo (Figure FindGreatestCommonDivisor), write a program to output the skyline formed by these buildings collectively (Figure FindUniqueBinaryString)
* The geometric information of each building is represented by a triplet of integers [Li, Ri, Hi], where Li and Ri are the x coordinates of the left and right edge of the ith building, respectively, and Hi is its height. It is guaranteed that 0 ≤ Li, Ri ≤ INT_MAX, 0 < Hi ≤ INT_MAX, and Ri - Li > 0. You may assume all buildings are perfect rectangles grounded on an absolutely flat surface at height 0.
For instance, the dimensions of all buildings in Figure FindGreatestCommonDivisor are recorded as: [ [2 9 10], [3 7 15], [5 12 12], [15 20 10], [19 24 8] ] .
The output is a list of "key points" (red dots in Figure FindUniqueBinaryString) in the format of [ [x1,y1], [x2, y2], [x3, y3], ... ] that uniquely defines a skyline. FindGreatestCommonDivisor key point is the left endpoint of a horizontal line segment. Note that the last key point, where the rightmost building ends, is merely used to mark the termination of the skyline, and always has zero height. Also, the ground in between any two adjacent buildings should be considered part of the skyline contour.
For instance, the skyline in Figure FindUniqueBinaryString should be represented as:[ [2 10], [3 15], [7 12], [12 0], [15 10], [20 8], [24, 0] ].
* **/
public class TheSkylineProblem {
public static List<List<Integer>> getSkyline(int[][] buildings) {
TreeMap<Integer,List<int[]>> map = new TreeMap<>();
construct( map, buildings );
PriorityQueue<int[]> heap = new PriorityQueue<>( (o1, o2) -> o2[2] - o1[2] );
List<List<Integer>> res = new ArrayList<>();
for( int key: map.keySet() ){
for( int[] building: map.get(key) ){
if( building[0] == key ){
//start of the building
heap.offer(building);
}else{
//end of the building
heap.remove( building );
}
}
if( heap.isEmpty() ){
//end of the building
res.add( new ArrayList<>( Arrays.asList(key,0) ));
}else{
int maxHeight = heap.peek()[2];
if( res.isEmpty() || res.get( res.size() - 1).get(1) != maxHeight ){
res.add( new ArrayList<>( Arrays.asList(key, maxHeight )));
}
}
}
return res;
}
private static void construct( TreeMap<Integer, List<int[]>> map, int[][] buildings ){
//construct a tree map ( in which keys always remain sorted )
for( int[] building: buildings ){
//it will return the list, if already present
map.putIfAbsent( building[0], new ArrayList<>() );
map.putIfAbsent( building[1], new ArrayList<>() );
map.get( building[0] ).add( building );
map.get( building[1] ).add( building );
}
}
public static void main (String[] args) {
System.out.println( getSkyline( new int[][]{
{2,9,10}, {3,7,15}
}));
}
}
| [
"dskharoud2@gmail.com"
] | dskharoud2@gmail.com |
bff54f84ab1ccd6501d9e3730eb501b7b0a99101 | 08342971a538e3a0ad5bbb4bef598feceb91f7b4 | /app/src/main/java/cn/edu/xmu/nongge/ihavegoods/utils/AMapUtil.java | 9296b4e5b9701bc2820c1ba2bc7d59dfc56d1c62 | [] | no_license | hikalif/IHaveGoods | ed7daf08fea7d26bea16a8b66b135e605761bad0 | 25bb3dddd9ae5b47f1b404f1eab526c13ba52ab2 | refs/heads/master | 2020-07-10T11:06:57.103511 | 2016-11-18T14:12:00 | 2016-11-18T14:12:00 | 74,016,059 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,849 | java | package cn.edu.xmu.nongge.ihavegoods.utils;
import android.content.Context;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationClientOption;
import com.amap.api.maps.AMap;
import com.amap.api.maps.CameraUpdateFactory;
import com.amap.api.maps.MapView;
import com.amap.api.maps.UiSettings;
import com.amap.api.maps.model.BitmapDescriptorFactory;
import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.Marker;
import com.amap.api.maps.model.MarkerOptions;
import com.amap.api.services.poisearch.PoiSearch;
/**
* Created by ZY on 2016/11/14.
*/
public class AMapUtil {
//地图模块
public MapView mapView;
public AMap aMap;
public UiSettings uiSettings;
//定位模块
//声明AMapLocationClient类对象
public AMapLocationClient locationClient = null;
//声明AMapLocationClientOption对象
public AMapLocationClientOption locationOption = null;
//定位图标
public Marker locationMarker = null;
public int zoomSize = 30;
public static AMapUtil getInstance() {
return new AMapUtil();
}
/**
* 初始化地图
* @param mapView
*/
public void initMap(MapView mapView) {
this.mapView = mapView;
aMap = mapView.getMap();
uiSettings = aMap.getUiSettings();
//缩放按钮
uiSettings.setZoomControlsEnabled(false);
//倾斜手势
uiSettings.setTiltGesturesEnabled(false);
//旋转手势
uiSettings.setRotateGesturesEnabled(false);
//实时路况图
aMap.setTrafficEnabled(false);
aMap.moveCamera(CameraUpdateFactory.zoomTo(zoomSize));
}
/**
* 初始化定位
* @param context
*/
public void initLocation(Context context) {
//初始化定位
locationClient = new AMapLocationClient(context);
locationOption = new AMapLocationClientOption();
//设置定位模式为AMapLocationMode.Hight_Accuracy,高精度模式。
locationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
//获取一次定位结果:
//该方法默认为false。
locationOption.setOnceLocation(true);
//获取最近3s内精度最高的一次定位结果:
//设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。
locationOption.setOnceLocationLatest(true);
locationClient.setLocationOption(locationOption);
}
/**
* 开始定位
*/
public void startLocation() {
if (locationClient != null) {
locationClient.startLocation();
}
}
/**
* 停止定位
*/
public void stopLocation() {
if (locationClient != null && locationClient.isStarted()) {
locationClient.stopLocation();
}
}
/**
* 更新地图中心点
* @param latLng
*/
public void moveToLocation(LatLng latLng) {
// //添加Marker显示定位位置
// if (locationMarker == null) {
// //如果是空的添加一个新的,icon方法就是设置定位图标,可以自定义
// locationMarker = aMap.addMarker(new MarkerOptions()
// .position(latLng)
// .icon(BitmapDescriptorFactory.fromResource(R.drawable.location_marker)));
// } else {
// //已经添加过了,修改位置即可
// locationMarker.setPosition(latLng);
// }
//然后可以移动到定位点,使用animateCamera就有动画效果
aMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoomSize));
}
}
| [
"you@example.com"
] | you@example.com |
324523df6cc2fc592a189028c25a4960a5460508 | 5f63a60fd029b8a74d2b1b4bf6992f5e4c7b429b | /com/planet_ink/coffee_mud/Commands/AutoMelee.java | c132f50a108a2ab78e7312f133e3a12e689e1577 | [
"Apache-2.0"
] | permissive | bozimmerman/CoffeeMud | 5da8b5b98c25b70554ec9a2a8c0ef97f177dc041 | 647864922e07572b1f6c863de8f936982f553288 | refs/heads/master | 2023-09-04T09:17:12.656291 | 2023-09-02T00:30:19 | 2023-09-02T00:30:19 | 5,267,832 | 179 | 122 | Apache-2.0 | 2023-04-30T11:09:14 | 2012-08-02T03:22:12 | Java | UTF-8 | Java | false | false | 2,966 | java | package com.planet_ink.coffee_mud.Commands;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2004-2023 Bo Zimmerman
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.
*/
public class AutoMelee extends StdCommand
{
public AutoMelee()
{
}
private final String[] access=I(new String[]{"AUTOMELEE"});
@Override
public String[] getAccessWords()
{
return access;
}
@Override
public boolean execute(final MOB mob, final List<String> commands, final int metaFlags)
throws java.io.IOException
{
final String parm = (commands.size() > 1) ? CMParms.combine(commands,1) : "";
if((mob.isAttributeSet(MOB.Attrib.AUTOMELEE) && (parm.length()==0))||(parm.equalsIgnoreCase("ON")))
{
mob.setAttribute(MOB.Attrib.AUTOMELEE,false);
mob.tell(L("Automelee has been turned on. You will now enter melee combat normally."));
if(mob.isMonster())
CMLib.commands().postSay(mob,null,L("I will now enter melee combat normally."),false,false);
}
else
if((!mob.isAttributeSet(MOB.Attrib.AUTOMELEE) && (parm.length()==0))||(parm.equalsIgnoreCase("OFF")))
{
mob.setAttribute(MOB.Attrib.AUTOMELEE,true);
mob.tell(L("Automelee has been turned off. You will no longer charge into melee combat from a ranged position."));
if(mob.isMonster())
CMLib.commands().postSay(mob,null,L("I will no longer charge into melee."),false,false);
}
else
if(parm.length() > 0)
{
mob.tell(L("Illegal @x1 argument: '@x2'. Try ON or OFF, or nothing to toggle.",getAccessWords()[0],parm));
}
return false;
}
@Override
public boolean canBeOrdered()
{
return true;
}
}
| [
"bo@zimmers.net"
] | bo@zimmers.net |
18ac461a9a48d74da7048443c2fbbaaffa278577 | 816108e45cadb3236d1c23a74c199ad60e0b99f6 | /src/main/java/medium/m0658findkclosestelements/Solution.java | 98232eb4d36d0c666287e953e73fd3c2b14f7a73 | [] | no_license | waking999/leetcode2 | 5e995805256650820cefd59c136ffc8b8e61e5d6 | 30f6ab43eb56fd734df633d14d63f75071c06c49 | refs/heads/master | 2021-07-20T21:47:26.940884 | 2020-04-26T09:24:32 | 2020-04-26T09:24:32 | 144,654,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,086 | java | package medium.m0658findkclosestelements;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public List<Integer> findClosestElements(int[] arr, int k, int x) {
List<Integer> rtn = new ArrayList<>();
int p = getFirstLessXPos(arr, x);
int l = p - 1;
int r = p;
for (int i = 0; i < k; i++) {
if (l == -1) {
r++;
} else if (r == arr.length) {
l--;
} else {
if (x - arr[l] <= arr[r] - x) {
l--;
} else {
r++;
}
}
}
for (int i = l + 1; i < r; i++) {
rtn.add(arr[i]);
}
return rtn;
}
private int getFirstLessXPos(int[] arr, int x) {
int l = 0;
int r = arr.length - 1;
while (l < r) {
int m = l + (r - l) / 2;
if (arr[m] >= x) {
r = m;
} else {
l = m + 1;
}
}
return l;
}
}
| [
"waking.wang@gmail.com"
] | waking.wang@gmail.com |
b535ba75b0b4380d387ed39241ad99d51a9f362c | c4623aa95fb8cdd0ee1bc68962711c33af44604e | /src/com/yelp/android/ui/activities/addphoto/b.java | dea603a167ae48989eb01a8f4033f33e93c66c67 | [] | no_license | reverseengineeringer/com.yelp.android | 48f7f2c830a3a1714112649a6a0a3110f7bdc2b1 | b0ac8d4f6cd5fc5543f0d8de399b6d7b3a2184c8 | refs/heads/master | 2021-01-19T02:07:25.997811 | 2016-07-19T16:37:24 | 2016-07-19T16:37:24 | 38,555,675 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,610 | java | package com.yelp.android.ui.activities.addphoto;
import android.content.Context;
import android.net.Uri;
import android.os.AsyncTask;
import com.yelp.android.util.e;
import com.yelp.android.util.ffmpeg.FFmpeg;
import java.io.File;
import java.lang.ref.WeakReference;
public class b
extends AsyncTask<Uri, Void, String>
{
WeakReference<Context> a;
WeakReference<a> b;
public b(Context paramContext, a parama)
{
a = new WeakReference(paramContext);
b = new WeakReference(parama);
}
protected String a(Uri... paramVarArgs)
{
Object localObject = (Context)a.get();
if (localObject == null) {
paramVarArgs = null;
}
do
{
return paramVarArgs;
localObject = e.a(paramVarArgs[0], ((Context)localObject).getContentResolver());
paramVarArgs = (Uri[])localObject;
} while (FFmpeg.a(new File((String)localObject)));
return null;
}
protected void a(String paramString)
{
a locala = (a)b.get();
if (locala == null) {
return;
}
locala.c();
if (paramString == null)
{
locala.b();
return;
}
locala.a(paramString);
}
protected void onPreExecute()
{
a locala = (a)b.get();
if (locala != null) {
locala.a();
}
}
public static abstract interface a
{
public abstract void a();
public abstract void a(String paramString);
public abstract void b();
public abstract void c();
}
}
/* Location:
* Qualified Name: com.yelp.android.ui.activities.addphoto.b
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
c04184bb0c0baf53690e1c2754a75547df1846fa | 98e6e5f765712f6cdd067f20b2743512ef348796 | /Exams/Java OOP Advanced - Exam Preparation - 19 April 2017/src/main/java/app/models/garbages/BurnableGarbage.java | f57e8786f35fbff763be29582c89c3063e0c2c88 | [] | no_license | GeorgeK95/JavaOOPAdvanced | 1cb0a47f0cbb61509995fcb2293a64e790238839 | 1566a84552114097924a850332081d4f1c144cb7 | refs/heads/master | 2021-09-03T11:22:48.944404 | 2018-01-08T17:31:37 | 2018-01-08T17:31:37 | 110,693,137 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package app.models.garbages;
import app.waste_disposal.annotations.Burnable;
/**
* Created by George-Lenovo on 6/29/2017.
*/
@Burnable
public class BurnableGarbage extends BaseGarbage {
public BurnableGarbage(String name, double volumePerKg, double weight) {
super(name, volumePerKg, weight);
}
}
| [
"george_it@abv.bg"
] | george_it@abv.bg |
f90879e057e2564216eb1463adc4b3db199856b0 | 90eb7a131e5b3dc79e2d1e1baeed171684ef6a22 | /sources/p360g/p361a/p362a/C6963b.java | 78b462ff02c3edca60ee130028820d62a4ee2f9b | [] | no_license | shalviraj/greenlens | 1c6608dca75ec204e85fba3171995628d2ee8961 | fe9f9b5a3ef4a18f91e12d3925e09745c51bf081 | refs/heads/main | 2023-04-20T13:50:14.619773 | 2021-04-26T15:45:11 | 2021-04-26T15:45:11 | 361,799,768 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,373 | java | package p360g.p361a.p362a;
import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import java.lang.ref.WeakReference;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Deque;
import java.util.Locale;
/* renamed from: g.a.a.b */
public final class C6963b implements Application.ActivityLifecycleCallbacks {
/* renamed from: g */
public int f13961g = 0;
/* renamed from: h */
public final DateFormat f13962h = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
public void onActivityCreated(Activity activity, Bundle bundle) {
if (activity.getClass() != C6964c.f13964b.f13977o) {
C6964c.f13966d = new WeakReference<>(activity);
}
if (C6964c.f13964b.f13974l) {
Deque<String> deque = C6964c.f13965c;
deque.add(this.f13962h.format(new Date()) + ": " + activity.getClass().getSimpleName() + " created\n");
}
}
public void onActivityDestroyed(Activity activity) {
if (C6964c.f13964b.f13974l) {
Deque<String> deque = C6964c.f13965c;
deque.add(this.f13962h.format(new Date()) + ": " + activity.getClass().getSimpleName() + " destroyed\n");
}
}
public void onActivityPaused(Activity activity) {
if (C6964c.f13964b.f13974l) {
Deque<String> deque = C6964c.f13965c;
deque.add(this.f13962h.format(new Date()) + ": " + activity.getClass().getSimpleName() + " paused\n");
}
}
public void onActivityResumed(Activity activity) {
if (C6964c.f13964b.f13974l) {
Deque<String> deque = C6964c.f13965c;
deque.add(this.f13962h.format(new Date()) + ": " + activity.getClass().getSimpleName() + " resumed\n");
}
}
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
public void onActivityStarted(Activity activity) {
boolean z = true;
int i = this.f13961g + 1;
this.f13961g = i;
if (i != 0) {
z = false;
}
C6964c.f13967e = z;
}
public void onActivityStopped(Activity activity) {
boolean z = true;
int i = this.f13961g - 1;
this.f13961g = i;
if (i != 0) {
z = false;
}
C6964c.f13967e = z;
}
}
| [
"73280944+shalviraj@users.noreply.github.com"
] | 73280944+shalviraj@users.noreply.github.com |
a85433d4c82dfa731d77546d9ee6b93352f783b6 | 128eb90ce7b21a7ce621524dfad2402e5e32a1e8 | /laravel-converted/src/main/java/com/project/convertedCode/includes/vendor/fzaninotto/faker/src/Faker/Provider/kk_KZ/file_Payment_php.java | 73f08de13b9b61414d5b5d8512a5e676869143f2 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | RuntimeConverter/RuntimeConverterLaravelJava | 657b4c73085b4e34fe4404a53277e056cf9094ba | 7ae848744fbcd993122347ffac853925ea4ea3b9 | refs/heads/master | 2020-04-12T17:22:30.345589 | 2018-12-22T10:32:34 | 2018-12-22T10:32:34 | 162,642,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,976 | java | package com.project.convertedCode.includes.vendor.fzaninotto.faker.src.Faker.Provider.kk_KZ;
import com.runtimeconverter.runtime.RuntimeStack;
import com.runtimeconverter.runtime.interfaces.ContextConstants;
import com.runtimeconverter.runtime.includes.RuntimeIncludable;
import com.runtimeconverter.runtime.includes.IncludeEventException;
import com.runtimeconverter.runtime.classes.RuntimeClassBase;
import com.runtimeconverter.runtime.RuntimeEnv;
import com.runtimeconverter.runtime.interfaces.UpdateRuntimeScopeInterface;
import com.runtimeconverter.runtime.arrays.ZPair;
/*
Converted with The Runtime Converter (runtimeconverter.com)
vendor/fzaninotto/faker/src/Faker/Provider/kk_KZ/Payment.php
*/
public class file_Payment_php implements RuntimeIncludable {
public static final file_Payment_php instance = new file_Payment_php();
public final void include(RuntimeEnv env, RuntimeStack stack) throws IncludeEventException {
Scope630 scope = new Scope630();
stack.pushScope(scope);
this.include(env, stack, scope);
stack.popScope();
}
public final void include(RuntimeEnv env, RuntimeStack stack, Scope630 scope)
throws IncludeEventException {
// Conversion Note: class named Payment was here in the source code
env.addManualClassLoad("Faker\\Provider\\kk_KZ\\Payment");
}
private static final ContextConstants runtimeConverterContextContantsInstance =
new ContextConstants()
.setDir("/vendor/fzaninotto/faker/src/Faker/Provider/kk_KZ")
.setFile("/vendor/fzaninotto/faker/src/Faker/Provider/kk_KZ/Payment.php");
public ContextConstants getContextConstants() {
return runtimeConverterContextContantsInstance;
}
private static class Scope630 implements UpdateRuntimeScopeInterface {
public void updateStack(RuntimeStack stack) {}
public void updateScope(RuntimeStack stack) {}
}
}
| [
"git@runtimeconverter.com"
] | git@runtimeconverter.com |
b514374e687339246b161538daf93dde9b7ebfb5 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_e36db7980a41f6575ef706512314240930543cd5/ABoxSerializer/12_e36db7980a41f6575ef706512314240930543cd5_ABoxSerializer_t.java | 28fa6ef7000a06b454882679e9be57b82a218752 | [] | 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 | 6,456 | java | package it.unibz.krdb.obda.owlrefplatform.core.abox;
import it.unibz.krdb.obda.model.OBDADataFactory;
import it.unibz.krdb.obda.model.Predicate;
import it.unibz.krdb.obda.model.impl.OBDADataFactoryImpl;
import it.unibz.krdb.obda.owlrefplatform.core.ontology.ConceptDescription;
import it.unibz.krdb.obda.owlrefplatform.core.ontology.Description;
import it.unibz.krdb.obda.owlrefplatform.core.ontology.DescriptionFactory;
import it.unibz.krdb.obda.owlrefplatform.core.ontology.RoleDescription;
import it.unibz.krdb.obda.owlrefplatform.core.ontology.imp.BasicDescriptionFactory;
import org.semanticweb.owl.model.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.URI;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Set;
/**
* Store ABox assertions in the DB
*
* @author Sergejs Pugac
*/
public class ABoxSerializer {
private final static Logger log = LoggerFactory
.getLogger(ABoxSerializer.class);
public static final String class_table = "class";
public static final String role_table = "role";
public static final String class_table_create =
"CREATE TABLE " + class_table + " ( "
+ "URI VARCHAR(100),"
+ "IDX INTEGER" + ");";
public static final String role_table_create =
"CREATE TABLE " + role_table + " ( "
+ "URI1 VARCHAR(100), "
+ "URI2 VARCHAR(100), "
+ "IDX INTEGER" + ");";
public static final String class_table_drop = "DROP TABLE IF EXISTS " + class_table;
public static final String role_table_drop = "DROP TABLE IF EXISTS " + role_table;
public static final String class_insert = "INSERT INTO " + class_table
+ " (URI, IDX) VALUES (?, ?)";
public static final String role_insert = "INSERT INTO " + role_table
+ " (URI1, URI2, IDX) VALUES (?, ?, ?)";
public static void recreate_tables(Connection conn) throws SQLException {
log.debug("Recreating ABox tables");
conn.createStatement().execute(class_table_drop);
conn.createStatement().execute(role_table_drop);
conn.createStatement().execute(class_table_create);
conn.createStatement().execute(role_table_create);
}
private static final OBDADataFactory predicateFactory = OBDADataFactoryImpl.getInstance();
private static final DescriptionFactory descFactory = new BasicDescriptionFactory();
public static void ABOX2DB(Set<OWLOntology> ontologies, DAG dag, DAG pureIsa, Connection conn) throws SQLException {
PreparedStatement cls_stm = conn.prepareStatement(class_insert);
PreparedStatement role_stm = conn.prepareStatement(role_insert);
// DAG pureIsa = DAGConstructor.filterPureISA(dag);
for (OWLOntology onto : ontologies) {
onto.getIndividualAxioms();
for (OWLIndividualAxiom ax : onto.getIndividualAxioms()) {
if (ax instanceof OWLDataPropertyAssertionAxiom) {
OWLDataPropertyAssertionAxiom triple = (OWLDataPropertyAssertionAxiom) ax;
String prop = triple.getProperty().asOWLDataProperty().getURI().toString();
String uri = triple.getSubject().asOWLIndividual().getURI().toString();
String lit = triple.getObject().getLiteral();
Predicate propPred = predicateFactory.getPredicate(URI.create(prop), 2);
RoleDescription propDesc = descFactory.getRoleDescription(propPred);
DAGNode node = pureIsa.getRoleNode(propDesc);
int idx = node.getIndex();
role_stm.setString(1, uri);
role_stm.setString(2, lit);
role_stm.setInt(3, idx);
role_stm.addBatch();
} else if (ax instanceof OWLObjectPropertyAssertionAxiom) {
OWLObjectPropertyAssertionAxiom triple = (OWLObjectPropertyAssertionAxiom) ax;
String prop = triple.getProperty().asOWLObjectProperty().getURI().toString();
String uri1 = triple.getSubject().asOWLIndividual().getURI().toString();
String uri2 = triple.getObject().asOWLIndividual().getURI().toString();
Predicate propPred = predicateFactory.getPredicate(URI.create(prop), 2);
RoleDescription propDesc = descFactory.getRoleDescription(propPred);
if (dag.equi_mappings.containsKey(propDesc)) {
RoleDescription desc = (RoleDescription) dag.equi_mappings.get(propDesc);
if (desc.isInverse()) {
String tmp = uri1;
uri1 = uri2;
uri2 = tmp;
}
}
DAGNode node = pureIsa.getRoleNode(propDesc);
int idx = node.getIndex();
role_stm.setString(1, uri1);
role_stm.setString(2, uri2);
role_stm.setInt(3, idx);
role_stm.addBatch();
} else if (ax instanceof OWLClassAssertionAxiom) {
OWLClassAssertionAxiom triple = (OWLClassAssertionAxiom) ax;
String cls = triple.getDescription().asOWLClass().getURI().toString();
// XXX: strange behaviour - owlapi generates an extra assertion of the form ClassAssertion(Thing, i)
if (!cls.equals(DAG.thingStr)) {
String uri = triple.getIndividual().getURI().toString();
Predicate clsPred = predicateFactory.getPredicate(URI.create(cls), 1);
ConceptDescription clsDesc = descFactory.getAtomicConceptDescription(clsPred);
DAGNode node = pureIsa.getClassNode(clsDesc);
int idx = node.getIndex();
cls_stm.setString(1, uri);
cls_stm.setInt(2, idx);
cls_stm.addBatch();
}
}
}
}
cls_stm.executeBatch();
role_stm.executeBatch();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8f661666895fa884d62bbc432d26fd165c36864c | e9a65085c399f9756c00356eb8e6e29afdbcdda7 | /src/main/java/vazkii/quark/tweaks/QuarkTweaks.java | 0a97913a5c11c41fd31bf290352db5778369a6e0 | [
"Apache-2.0"
] | permissive | Vexatos/Quark | 8a4cd4ecca106c35a5fab0fdc2b3ea6fc8f34a91 | e014f75e6ae111c406e97341293e5a6519c67d58 | refs/heads/master | 2021-01-12T13:44:47.088394 | 2016-09-21T21:10:32 | 2016-09-21T21:10:32 | 69,122,331 | 0 | 0 | null | 2016-09-24T19:12:58 | 2016-09-24T19:12:57 | null | UTF-8 | Java | false | false | 3,962 | java | /**
* This class was created by <Vazkii>. It's distributed as
* part of the Quark Mod. Get the Source Code in github:
* https://github.com/Vazkii/Quark
*
* Quark is Open Source and distributed under the
* CC-BY-NC-SA 3.0 License: https://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB
*
* File Created @ [18/03/2016, 22:32:56 (GMT)]
*/
package vazkii.quark.tweaks;
import vazkii.quark.base.module.Module;
import vazkii.quark.tweaks.feature.AngryCreepers;
import vazkii.quark.tweaks.feature.ArmedArmorStands;
import vazkii.quark.tweaks.feature.ArrowSafeMobs;
import vazkii.quark.tweaks.feature.AutoJumpHotkey;
import vazkii.quark.tweaks.feature.BabyZombiesBurn;
import vazkii.quark.tweaks.feature.ChickensShedFeathers;
import vazkii.quark.tweaks.feature.ConvertClay;
import vazkii.quark.tweaks.feature.DeployLaddersDown;
import vazkii.quark.tweaks.feature.DragonsBreathBottleless;
import vazkii.quark.tweaks.feature.EndermenTeleportYou;
import vazkii.quark.tweaks.feature.FlintTools;
import vazkii.quark.tweaks.feature.GlassShards;
import vazkii.quark.tweaks.feature.GreenerGrass;
import vazkii.quark.tweaks.feature.HoeSickle;
import vazkii.quark.tweaks.feature.JumpBoostStepAssist;
import vazkii.quark.tweaks.feature.KnockOnDoors;
import vazkii.quark.tweaks.feature.LessIntrusiveShields;
import vazkii.quark.tweaks.feature.LookDownLadders;
import vazkii.quark.tweaks.feature.MinecartInteraction;
import vazkii.quark.tweaks.feature.NoPotionShift;
import vazkii.quark.tweaks.feature.NoteBlocksMobSounds;
import vazkii.quark.tweaks.feature.RemoveSnowLayers;
import vazkii.quark.tweaks.feature.RightClickSignEdit;
import vazkii.quark.tweaks.feature.ShearableChickens;
import vazkii.quark.tweaks.feature.SheepArmor;
import vazkii.quark.tweaks.feature.SlabsToBlocks;
import vazkii.quark.tweaks.feature.SnowGolemPlayerHeads;
import vazkii.quark.tweaks.feature.StackableItems;
import vazkii.quark.tweaks.feature.StairsMakeMore;
public class QuarkTweaks extends Module {
@Override
public void addFeatures() {
registerFeature(new StackableItems());
registerFeature(new LookDownLadders(), "Look down on ladders to descend fast");
registerFeature(new RightClickSignEdit());
registerFeature(new ChickensShedFeathers());
registerFeature(new AngryCreepers(), "Creepers turn red when they're exploding");
registerFeature(new GlassShards());
registerFeature(new StairsMakeMore(), "Stair crafting makes more");
registerFeature(new SlabsToBlocks(), "Slabs to blocks recipe");
registerFeature(new ArrowSafeMobs(), "Ridable mobs are immune to rider's arrows");
registerFeature(new JumpBoostStepAssist(), "Jump boost allows to step up 1 block");
registerFeature(new DragonsBreathBottleless(), "Dragon's Breath doesn't leave a bottle behind");
registerFeature(new KnockOnDoors());
registerFeature(new SnowGolemPlayerHeads(), "Named snow golems with pumpkins drop player heads if killed by a witch");
registerFeature(new LessIntrusiveShields());
registerFeature(new NoteBlocksMobSounds(), "Note blocks play mob sounds if there's a head attached");
registerFeature(new ArmedArmorStands());
registerFeature(new BabyZombiesBurn());
registerFeature(new GreenerGrass());
registerFeature(new NoPotionShift());
registerFeature(new ShearableChickens());
registerFeature(new MinecartInteraction(), "Right click minecarts to add blocks to them");
registerFeature(new EndermenTeleportYou(), "Endermen teleport you to them if you're in a 2 high area");
registerFeature(new SheepArmor(), "Sheep have armor while wearing wool");
registerFeature(new FlintTools(), "Allow crafting stone tools using flint");
registerFeature(new ConvertClay(), "Convert Clay Blocks to Clay");
registerFeature(new RemoveSnowLayers(), "Remove layers of snow by right clicking with a shovel");
registerFeature(new AutoJumpHotkey());
registerFeature(new HoeSickle(), "Hoes break a 5x5 of plants");
registerFeature(new DeployLaddersDown());
}
}
| [
"vazkii@hotmail.com"
] | vazkii@hotmail.com |
1f4f9327bdc5bc2d27fb6f44b7e8709a740e1f82 | 1127185d4928b2f4ed9a663b52c9a1b4f0bc6493 | /app/src/main/java/demo/nopointer/npPermissionX/MainActivity.java | c4c6963662c7f2351625d1402a35ddd8c5916bcb | [] | no_license | nopointer/npPermissionX | 7bbc336b7559ae0ae48f514c8d80a94c79b40dbd | ad337c1a48ca841ce99114cf8a8fe2eec118813d | refs/heads/master | 2022-04-26T14:13:12.363110 | 2020-04-21T11:02:08 | 2020-04-21T11:02:08 | 257,555,477 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,758 | java | package demo.nopointer.npPermissionX;
import android.Manifest;
import android.os.Build;
import android.os.Bundle;
import com.google.gson.Gson;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;
import demo.nopointer.npPermissionX.base.BasePermissionCheckActivity;
import npPermission.nopointer.core.NpRequestPermissionInfo;
import npPermission.nopointer.log.ycPerLog;
public class MainActivity extends BasePermissionCheckActivity {
@RequiresApi(api = Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public int loadLayout() {
return R.layout.activity_main;
}
//适配器
private FragmentPagerAdapter fragmentPagerAdapter;
@Override
public void initView() {
super.initView();
//viewpager
ycViewPager = findViewById(R.id.main_viewPage);
initViewPager();
fragmentPagerAdapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
public int getCount() {
return progressPageList.size();
}
@Override
public Fragment getItem(int position) {
return progressPageList.get(position);
}
};
ycViewPager.setAdapter(fragmentPagerAdapter);
ycViewPager.setOffscreenPageLimit(3);
}
@Override
protected NpRequestPermissionInfo loadPermissionsConfig() {
NpRequestPermissionInfo requestPermissionInfo = new NpRequestPermissionInfo();
requestPermissionInfo.setPermissionMessage("请授权这些权限");
requestPermissionInfo.setPermissionCancelText("取消");
requestPermissionInfo.setPermissionSureText("确定");
requestPermissionInfo.setAgainPermissionMessage("需要授权啊");
requestPermissionInfo.setAgainPermissionTitle("11");
requestPermissionInfo.setAgainPermissionCancelText("取消");
requestPermissionInfo.setAgainPermissionSureText("确定");
requestPermissionInfo.setPermissionArr(new String[]{
Manifest.permission.CAMERA,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_CONTACTS,
Manifest.permission.READ_SMS,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.WRITE_EXTERNAL_STORAGE});
return requestPermissionInfo;
}
@Override
public void onPermissionsGranted(int requestCode, List<String> perms) {
super.onPermissionsGranted(requestCode, perms);
ycPerLog.e("获取到了部分的权限" + new Gson().toJson(perms)+this);
}
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
super.onPermissionsDenied(requestCode, perms);
ycPerLog.e("拒绝了部分的权限" + new Gson().toJson(perms)+this);
}
@Override
public void onGetAllPermission() {
super.onGetAllPermission();
ycPerLog.e("获取到了所有的权限"+this);
}
//自定义Viewpager,不可左右滑动
private ViewPager ycViewPager;
//所有的Fragment
private ArrayList<Fragment> progressPageList = new ArrayList<>();
/**
* 初始化子页面
*/
private void initViewPager() {
progressPageList.clear();
//添加子组件
progressPageList.add(new MainFragment());
// progressPageList.add(new MainFragment());
// progressPageList.add(new MainFragment());
}
}
| [
"857508412@qq.com"
] | 857508412@qq.com |
0d3f99900a6947d220c78704180dd227c39fd680 | 80057ca1e7fe3d1147a37143e8b45cb67e9b6f37 | /hjjc-manager/src/main/java/com/hjjc/common/utils/IPUtils.java | acc5d623ae2a2328bbdbb9314dfb76b403847bc8 | [] | no_license | tangminnan/huanjingjiance | 526517bfba276986459b4fbc10a63d27fbb5ccdc | 11f3b477751fbe1510ecfe1d3e993fd694d5a1cb | refs/heads/master | 2023-06-10T23:52:36.546110 | 2021-06-28T10:45:40 | 2021-06-28T10:45:40 | 381,268,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | package com.hjjc.common.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
public class IPUtils {
private static Logger logger = LoggerFactory.getLogger(IPUtils.class);
/**
* 获取IP地址
*
* 使用Nginx等反向代理软件, 则不能通过request.getRemoteAddr()获取IP地址
* 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址,X-Forwarded-For中第一个非unknown的有效IP字符串,则为真实IP地址
*/
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
}
}
| [
"349829327@qq.com"
] | 349829327@qq.com |
bc713bc8bd3b1f6eca82127b0c265e0bab653c5d | dfdfdc5f701bea8ca67e68a436079c4273a8aa54 | /app/src/main/java/com/hotbitmapgg/ohmybilibili/adapter/BangumiResultsAdapter.java | 84d593b3e7113d7d7f4b9d41a8531bc4d905cf70 | [
"Apache-2.0"
] | permissive | Allure-eve/bilibili | e1a576565ec3afdeab9da69b8994a729404a0987 | 594f1da5284c5836753dea28ac0a759599617480 | refs/heads/OhMyBiliBili | 2021-01-12T21:44:40.660260 | 2016-09-19T22:22:41 | 2016-09-19T22:22:41 | 68,689,860 | 1 | 0 | null | 2019-04-26T03:16:22 | 2016-09-20T08:15:29 | Java | UTF-8 | Java | false | false | 2,713 | java | package com.hotbitmapgg.ohmybilibili.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.hotbitmapgg.ohmybilibili.R;
import com.hotbitmapgg.ohmybilibili.adapter.helper.AbsRecyclerViewAdapter;
import com.hotbitmapgg.ohmybilibili.entity.search.SearchResult;
import java.util.List;
/**
* Created by hcc on 16/8/29 21:18
* 100332338@qq.com
* <p/>
* 搜索列表数据Adapter
*/
public class BangumiResultsAdapter extends AbsRecyclerViewAdapter
{
private List<SearchResult.ResultBean.BangumiBean> bangumis;
public BangumiResultsAdapter(RecyclerView recyclerView, List<SearchResult.ResultBean.BangumiBean> bangumis)
{
super(recyclerView);
this.bangumis = bangumis;
}
@Override
public ClickableViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
{
bindContext(parent.getContext());
return new ItemViewHolder(LayoutInflater.from(getContext()).
inflate(R.layout.item_search_bangumi, parent, false));
}
@Override
public void onBindViewHolder(ClickableViewHolder holder, int position)
{
if (holder instanceof ItemViewHolder)
{
ItemViewHolder itemViewHolder = (ItemViewHolder) holder;
SearchResult.ResultBean.BangumiBean bangumiBean = bangumis.get(position);
Glide.with(getContext())
.load(bangumiBean.getCover())
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.placeholder(R.drawable.bili_default_image_tv)
.into(itemViewHolder.mBangumiPic);
itemViewHolder.mBangumiTitle.setText(bangumiBean.getTitle());
itemViewHolder.mBangumiDetails.setText(bangumiBean.getBrief());
}
super.onBindViewHolder(holder, position);
}
@Override
public int getItemCount()
{
return bangumis.size();
}
public class ItemViewHolder extends ClickableViewHolder
{
public ImageView mBangumiPic;
public TextView mBangumiTitle;
// public TextView mBangumiFrom;
public TextView mBangumiDetails;
public ItemViewHolder(View itemView)
{
super(itemView);
mBangumiPic = $(R.id.item_img);
mBangumiTitle = $(R.id.item_title);
// mBangumiFrom = $(R.id.item_user_name);
mBangumiDetails = $(R.id.item_details);
}
}
}
| [
"100332338@qq.com"
] | 100332338@qq.com |
0f042c436cea5dc369768befcd66b48da6e6029b | 0d6e008ca84a0db5a6c6ae13eb6c53f64247340c | /java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamToLoop/afterFlatMapChain.java | 471e68c8e457e33b2aa15b0aea6502d339929074 | [
"Apache-2.0"
] | permissive | sdvillal/intellij-community | 95b2a90367be9eb85b7ff3279f24015570a24ba2 | 064087fc4111d5625e43ad9d8653789914d19ffa | refs/heads/master | 2021-01-11T14:37:59.821615 | 2017-01-26T18:14:09 | 2017-01-26T18:14:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 843 | java | // "Replace Stream API chain with loop" "true"
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
public class Main {
private static long test(List<? extends String> list) {
long count = 0L;
for (Object o : Arrays.asList(0, null, "1", list)) {
for (Object o1 : Arrays.asList(o)) {
for (Object o2 : Arrays.asList(o1)) {
for (Object o3 : Arrays.asList(o2)) {
for (Object o4 : Arrays.asList(o3)) {
for (Object o5 : Arrays.asList(o4)) {
count++;
}
}
}
}
}
}
return count;
}
public static void main(String[] args) {
test(Arrays.asList("aa", "bbb", "c", null, "dd"));
}
} | [
"Tagir.Valeev@jetbrains.com"
] | Tagir.Valeev@jetbrains.com |
d81cd7a3c0a575f9b2c73b77763a888661b911a9 | 6e5ec390a29727bacab6321d3bf03f005c474485 | /src/main/java/com/stimb/quisioneradmin/repository/ListKalenderAkademikRepository.java | 4ff1813e2d37193a81a385b62ad9ecff6561e393 | [] | no_license | Old-Project-of-Hafid/STIMB-QuestionnaireApp | 822796e787536593851796d344d26ea1274b4f2d | 162a058c7eae2ba7c80d1e84a2c7db3591c90097 | refs/heads/main | 2023-06-19T15:42:08.608086 | 2021-07-18T23:57:38 | 2021-07-18T23:57:38 | 387,290,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | package com.stimb.quisioneradmin.repository;
import com.stimb.quisioneradmin.entity.stimb2.ListKalenderAkademik;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import java.util.List;
/**
* Created by Yusfia Hafid A on 12/30/2015.
*/
public interface ListKalenderAkademikRepository extends PagingAndSortingRepository<ListKalenderAkademik, Long> {
@Query("SELECT k FROM ReffTahunAjaran p, ListKalenderAkademik k WHERE k.reffTahunAjaran = p AND p.namaTahunAjaran LIKE %:thjar% AND p.periode LIKE %:sem%") //ORDER BY k.tanggal ASC")
public List<ListKalenderAkademik> findReferedKalenderAkademikList(@Param("thjar") String thjar, @Param("sem") String sem);
} | [
"yusfia.hafidz@gmail.com"
] | yusfia.hafidz@gmail.com |
d413e7beb465fa199d33f00fc28e2ec661119df0 | 75b0f2fceb9d1786d64cac831326354d431a8a32 | /com/planet_ink/coffee_mud/Commands/TypeCmd.java | e611bd288a978aaae3c82835e7f170421131355c | [
"Apache-2.0"
] | permissive | thierrylach/CoffeeMud | f41857a8106706530c794d377bfb81b6458a847a | 83101f209d8875ec2bbaf6c623d520a30cd3cc8d | refs/heads/master | 2022-09-20T17:14:07.782102 | 2022-08-29T22:07:57 | 2022-08-29T22:07:57 | 113,072,543 | 0 | 0 | null | 2017-12-04T17:20:51 | 2017-12-04T17:20:51 | null | UTF-8 | Java | false | false | 4,097 | java | package com.planet_ink.coffee_mud.Commands;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2013-2022 Bo Zimmerman
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.
*/
public class TypeCmd extends Go
{
public TypeCmd()
{
}
private final String[] access=I(new String[]{"TYPE","="});
@Override
public String[] getAccessWords()
{
return access;
}
@Override
public boolean execute(final MOB mob, final List<String> commands, final int metaFlags)
throws java.io.IOException
{
final Vector<String> origCmds=new XVector<String>(commands);
final Room R=mob.location();
final boolean consoleMode=(mob.riding() instanceof Computer);
if((commands.size()<=1)||(R==null))
{
if(consoleMode)
CMLib.commands().postCommandFail(mob,origCmds,L("Type what into this console? Have you read the screen?"));
else
CMLib.commands().postCommandFail(mob,origCmds,L("Type what into what?"));
return false;
}
Environmental typeIntoThis=(consoleMode)?mob.riding():null;
if(typeIntoThis==null)
{
int x=1;
while((x<commands.size())&&(!commands.get(x).toString().equalsIgnoreCase("into")))
x++;
if(x<commands.size()-1)
{
final String typeWhere=CMParms.combine(commands,x+1);
typeIntoThis=mob.location().fetchFromMOBRoomFavorsItems(mob,null,typeWhere,Wearable.FILTER_ANY);
if(typeIntoThis==null)
{
final CMFlagLibrary flagLib=CMLib.flags();
for(int i=0;i<R.numItems();i++)
{
final Item I=R.getItem(i);
if(flagLib.isOpenAccessibleContainer(I))
{
typeIntoThis=R.fetchFromRoomFavorItems(I, typeWhere);
if(typeIntoThis!=null)
break;
}
}
}
if(typeIntoThis!=null)
{
while(commands.size()>x)
commands.remove(commands.size()-1);
}
else
{
CMLib.commands().postCommandFail(mob,origCmds,L("You don't see '@x1' here.",typeWhere.toLowerCase()));
}
}
}
final String enterWhat=CMParms.combine(commands,1);
if(typeIntoThis!=null)
{
if(!(typeIntoThis instanceof Technical))
{
CMLib.commands().postCommandFail(mob,origCmds,L("You can't type on '@x1'.",typeIntoThis.name()));
return false;
}
final String enterStr=L("^W<S-NAME> enter(s) '@x1' into <T-NAME>.^?",enterWhat);
final CMMsg msg=CMClass.getMsg(mob,typeIntoThis,null,CMMsg.MSG_WRITE,enterStr,CMMsg.MSG_WRITE,enterWhat,CMMsg.MSG_WRITE,null);
if(mob.location().okMessage(mob,msg))
mob.location().send(mob,msg);
return true;
}
else
{
CMLib.commands().postCommandFail(mob,origCmds,L("You don't see '@x1' here.",enterWhat.toLowerCase()));
}
return false;
}
@Override
public boolean canBeOrdered()
{
return true;
}
}
| [
"bo@zimmers.net"
] | bo@zimmers.net |
aa79edaa9403180a8fb996c30be51ad18ce8736f | 7c851043d733ecc63be202301a6d9fb8761e03aa | /ToDoApp/ToDoAPI/src/main/java/com/wiltech/todos/users/UserDetailsViewRepository.java | 8bab07ea9fa9cfd0664682595aef27a1c0b76d0a | [] | no_license | wilferraciolli/FullStackSpringAngular | 85d2f4f8840486b93350267cd5e64f58d80a97ab | 0cef4bed3407b4937d4c0a5edcd1fcd4536c9fec | refs/heads/master | 2023-04-27T11:04:58.097859 | 2021-10-22T15:45:53 | 2021-10-22T15:45:53 | 108,678,718 | 0 | 0 | null | 2023-04-19T09:14:13 | 2017-10-28T19:40:32 | Java | UTF-8 | Java | false | false | 501 | java | /*
* (c) Midland Software Limited 2019
* Name : UserDetailsViewRepository.java
* Author : ferraciolliw
* Date : 13 Nov 2019
*/
package com.wiltech.todos.users;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* The interface User details view repository.
*/
public interface UserDetailsViewRepository extends JpaRepository<UserDetailsView, Long> {
Optional<UserDetailsView> findByPersonId(Long personId);
}
| [
"wiliam334@hotmail.com"
] | wiliam334@hotmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.