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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7be9c8a150d7c2d6cf611619492f0764a9686f1e | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/kotlin/l/b/a/b/e/c.java | ab1ce9d744c53adba0e09a7dd9917e00f4b97525 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 274 | java | package kotlin.l.b.a.b.e;
import kotlin.l.b.a.b.h.s;
public abstract interface c
extends s
{}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes11.jar
* Qualified Name: kotlin.l.b.a.b.e.c
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
9b4adbb39505cfa3144fc0081576d3a3a11c6fe3 | 76852b1b29410436817bafa34c6dedaedd0786cd | /sources-2020-07-19-tempmail/sources/com/google/android/gms/internal/ads/zzajd.java | 4dc7cb2aa5a352bd916aa78e52e55a40a3892a0d | [] | no_license | zteeed/tempmail-apks | 040e64e07beadd8f5e48cd7bea8b47233e99611c | 19f8da1993c2f783b8847234afb52d94b9d1aa4c | refs/heads/master | 2023-01-09T06:43:40.830942 | 2020-11-04T18:55:05 | 2020-11-04T18:55:05 | 310,075,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | java | package com.google.android.gms.internal.ads;
import com.google.android.gms.ads.instream.InstreamAd;
/* compiled from: com.google.android.gms:play-services-ads-lite@@19.2.0 */
public final class zzajd extends zzaiz {
/* renamed from: b reason: collision with root package name */
private final InstreamAd.InstreamAdLoadCallback f5744b;
public zzajd(InstreamAd.InstreamAdLoadCallback instreamAdLoadCallback) {
this.f5744b = instreamAdLoadCallback;
}
public final void O3(zzaiq zzaiq) {
this.f5744b.onInstreamAdLoaded(new zzajb(zzaiq));
}
public final void S5(int i) {
this.f5744b.onInstreamAdFailedToLoad(i);
}
}
| [
"zteeed@minet.net"
] | zteeed@minet.net |
4c0f80824bdcecb75147dc7b959974b674cb2893 | e682fa3667adce9277ecdedb40d4d01a785b3912 | /internal/fischer/mangf/A169588.java | c3619519f328377f0dc0367ae6094589d5b62208 | [
"Apache-2.0"
] | permissive | gfis/joeis-lite | 859158cb8fc3608febf39ba71ab5e72360b32cb4 | 7185a0b62d54735dc3d43d8fb5be677734f99101 | refs/heads/master | 2023-08-31T00:23:51.216295 | 2023-08-29T21:11:31 | 2023-08-29T21:11:31 | 179,938,034 | 4 | 1 | Apache-2.0 | 2022-06-25T22:47:19 | 2019-04-07T08:35:01 | Roff | UTF-8 | Java | false | false | 457 | java | package irvine.oeis.a169;
// Generated by gen_seq4.pl build/arronk
import irvine.math.z.Z;
import irvine.oeis.a346.A346426;
/**
* A169588 The total number of ways of partitioning the multiset {1,1,1,1,2,3,...,n-3}.
* @author Georg Fischer
*/
public class A169588 extends A346426 {
private int mN = -1;
@Override
public int getOffset() {
return 4;
}
@Override
public Z next() {
++mN;
return super.matrixElement(4, mN);
}
}
| [
"dr.Georg.Fischer@gmail.com"
] | dr.Georg.Fischer@gmail.com |
fd17a55ffead13d2809bc51c6a341ad164704254 | 3de3dae722829727edfdd6cc3b67443a69043475 | /edexOsgi/com.raytheon.uf.edex.plugin.text.dbsrv/src/com/raytheon/uf/edex/plugin/text/dbsrv/impl/VersionsAdapter.java | c7c164afeeb053d6c73ef38c865abead451e7180 | [
"LicenseRef-scancode-public-domain",
"Apache-2.0"
] | permissive | Unidata/awips2 | 9aee5b7ec42c2c0a2fa4d877cb7e0b399db74acb | d76c9f96e6bb06f7239c563203f226e6a6fffeef | refs/heads/unidata_18.2.1 | 2023-08-18T13:00:15.110785 | 2023-08-09T06:06:06 | 2023-08-09T06:06:06 | 19,332,079 | 161 | 75 | NOASSERTION | 2023-09-13T19:06:40 | 2014-05-01T00:59:04 | Java | UTF-8 | Java | false | false | 6,309 | java | /**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.plugin.text.dbsrv.impl;
import com.raytheon.uf.common.dataplugin.text.dbsrv.ICommandExecutor;
import com.raytheon.uf.common.dataplugin.text.dbsrv.TextDBSrvCommandTags;
import com.raytheon.uf.common.dataplugin.text.dbsrv.VersionsTableTags;
import com.raytheon.uf.common.message.Header;
import com.raytheon.uf.common.message.Message;
import com.raytheon.uf.common.message.Property;
import com.raytheon.uf.common.wmo.AFOSProductId;
import com.raytheon.uf.edex.plugin.text.db.TextDB;
/**
* Manipulates version headers on textdbsrv messages
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 8, 2008 1538 jkorman Initial creation
* May 15, 2014 2536 bclement moved from uf.edex.textdbsrv
* Aug 22, 2014 2926 bclement compatibility changes with new textdb service
* Jan 18, 2016 4562 tjensen Moved from edex.plugin.text to
* edex.plugin.text.dbsrv
*
* </pre>
*
* @author jkorman
* @version 1.0
*/
public class VersionsAdapter implements ICommandExecutor {
private TextDB textDB;
/**
*
*/
public VersionsAdapter() {
textDB = new TextDB();
}
/**
*
* @return
*/
public static final String getViewTag() {
return "versions";
}
/**
*
*/
public void dispose() {
}
/**
*
*/
@Override
public Message execute(Message cmdMessage) {
Header sHeader = cmdMessage.getHeader();
// Get the operation code
String op = sHeader.getProperty(VersionsTableTags.OP.name());
TextDBSrvCommandTags opTag = TextDBSrvCommandTags.valueOf(op);
String productId = sHeader.getProperty(VersionsTableTags.PRODID.name());
if (opTag != null && productId != null) {
AFOSProductId prodId = new AFOSProductId(productId);
if (prodId.isFilled()) {
switch (opTag) {
case PUT: {
String versions = sHeader
.getProperty(VersionsTableTags.VERSION.name());
addVersionInfo(sHeader, prodId.getCcc(), prodId.getNnn(),
prodId.getXxx(), versions);
break;
}
case GET: {
getVersionInfo(sHeader, prodId.getCcc(), prodId.getNnn(),
prodId.getXxx());
break;
}
case DELETE: {
deleteVersionInfo(sHeader, prodId.getCcc(),
prodId.getNnn(), prodId.getXxx());
break;
}
default: {
String tagName = (opTag != null) ? opTag.name() : "null";
Property[] props = new Property[] { new Property(
CommandExecutor.STDERR,
"ERROR:Invalid command tag = [" + tagName + "]"), };
sHeader.setProperties(props);
break;
}
}
}
}
cmdMessage.setHeader(sHeader);
return cmdMessage;
}
/**
*
* @param state
* @param xxxId
* @param cccId
* @return
*/
private void addVersionInfo(Header header, String ccc, String nnn,
String xxx, String versions) {
Property newProperty = new Property(CommandExecutor.STDERR,
"NORMAL:Adding productId " + ccc + nnn + xxx + " versions "
+ versions);
Property errProperty = new Property(CommandExecutor.STDERR,
"ERROR:Failure adding to versions table.");
Property[] props = new Property[] { newProperty, };
if (!textDB.addVersions(ccc, nnn, xxx, Integer.parseInt(versions))) {
props = new Property[] { newProperty, errProperty };
}
header.setProperties(props);
}
/**
*
* @param header
* @param ccc
* @param nnn
* @param xxx
*/
private void getVersionInfo(Header header, String ccc, String nnn,
String xxx) {
String PROP_FMT = CommandExecutor.STDOUT;
Property[] props = null;
String vers = textDB.getVersions(ccc, nnn, xxx);
if (vers != null) {
props = new Property[] { new Property(PROP_FMT, vers) };
} else {
props = new Property[] { new Property(CommandExecutor.STDERR,
"ERROR:Failure reading versions table."), };
}
header.setProperties(props);
}
/**
*
* @param state
* @param xxxId
* @param cccId
* @return
*/
private void deleteVersionInfo(Header header, String ccc, String nnn,
String xxx) {
Property newProperty = new Property(CommandExecutor.STDERR,
"NORMAL:Deleting product id " + ccc + nnn + xxx
+ " from versionstable.");
Property errProperty = new Property(CommandExecutor.STDERR,
"ERROR:Failure deleting " + ccc + nnn + xxx
+ " from versionstable.");
Property[] props = new Property[] { newProperty, };
if (!textDB.deleteVersions(ccc, nnn, xxx)) {
props = new Property[] { newProperty, errProperty };
}
header.setProperties(props);
}
}
| [
"mjames@unidata.ucar.edu"
] | mjames@unidata.ucar.edu |
d37adfb923e36bb24f70be78ee39feae9f3f4543 | 80552d844f54667b4d6f00845a667026d656e1ba | /zip/spring-framework-3.2.x/spring-core/src/test/java/org/springframework/core/env/MutablePropertySourcesTests.java | 3f51dcd7112679de4d1b0f87601d670a67113f66 | [
"Apache-2.0"
] | permissive | 13266764646/spring-framewrok3.2.x | e662e4d633adec91fcfca6d66e15a7555044429d | 84c238239ebd8cebdddee540c0fefa8e4755eac8 | refs/heads/master | 2020-05-03T15:38:25.422211 | 2019-08-26T02:44:12 | 2019-08-26T02:44:12 | 178,707,063 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,492 | java | /*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core.env;
import org.junit.Test;
import org.springframework.mock.env.MockPropertySource;
import static java.lang.String.*;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import static org.springframework.core.env.MutablePropertySources.*;
/**
* Unit tests for {@link MutablePropertySources}
*
* @author Chris Beams
*/
public class MutablePropertySourcesTests {
@Test
public void test() {
MutablePropertySources sources = new MutablePropertySources();
sources.addLast(new MockPropertySource("b").withProperty("p1", "bValue"));
sources.addLast(new MockPropertySource("d").withProperty("p1", "dValue"));
sources.addLast(new MockPropertySource("f").withProperty("p1", "fValue"));
assertThat(sources.size(), equalTo(3));
assertThat(sources.contains("a"), is(false));
assertThat(sources.contains("b"), is(true));
assertThat(sources.contains("c"), is(false));
assertThat(sources.contains("d"), is(true));
assertThat(sources.contains("e"), is(false));
assertThat(sources.contains("f"), is(true));
assertThat(sources.contains("g"), is(false));
assertThat(sources.get("b"), not(nullValue()));
assertThat(sources.get("b").getProperty("p1"), equalTo((Object)"bValue"));
assertThat(sources.get("d"), not(nullValue()));
assertThat(sources.get("d").getProperty("p1"), equalTo((Object)"dValue"));
sources.addBefore("b", new MockPropertySource("a"));
sources.addAfter("b", new MockPropertySource("c"));
assertThat(sources.size(), equalTo(5));
assertThat(sources.precedenceOf(PropertySource.named("a")), is(0));
assertThat(sources.precedenceOf(PropertySource.named("b")), is(1));
assertThat(sources.precedenceOf(PropertySource.named("c")), is(2));
assertThat(sources.precedenceOf(PropertySource.named("d")), is(3));
assertThat(sources.precedenceOf(PropertySource.named("f")), is(4));
sources.addBefore("f", new MockPropertySource("e"));
sources.addAfter("f", new MockPropertySource("g"));
assertThat(sources.size(), equalTo(7));
assertThat(sources.precedenceOf(PropertySource.named("a")), is(0));
assertThat(sources.precedenceOf(PropertySource.named("b")), is(1));
assertThat(sources.precedenceOf(PropertySource.named("c")), is(2));
assertThat(sources.precedenceOf(PropertySource.named("d")), is(3));
assertThat(sources.precedenceOf(PropertySource.named("e")), is(4));
assertThat(sources.precedenceOf(PropertySource.named("f")), is(5));
assertThat(sources.precedenceOf(PropertySource.named("g")), is(6));
sources.addLast(new MockPropertySource("a"));
assertThat(sources.size(), equalTo(7));
assertThat(sources.precedenceOf(PropertySource.named("b")), is(0));
assertThat(sources.precedenceOf(PropertySource.named("c")), is(1));
assertThat(sources.precedenceOf(PropertySource.named("d")), is(2));
assertThat(sources.precedenceOf(PropertySource.named("e")), is(3));
assertThat(sources.precedenceOf(PropertySource.named("f")), is(4));
assertThat(sources.precedenceOf(PropertySource.named("g")), is(5));
assertThat(sources.precedenceOf(PropertySource.named("a")), is(6));
sources.addFirst(new MockPropertySource("a"));
assertThat(sources.size(), equalTo(7));
assertThat(sources.precedenceOf(PropertySource.named("a")), is(0));
assertThat(sources.precedenceOf(PropertySource.named("b")), is(1));
assertThat(sources.precedenceOf(PropertySource.named("c")), is(2));
assertThat(sources.precedenceOf(PropertySource.named("d")), is(3));
assertThat(sources.precedenceOf(PropertySource.named("e")), is(4));
assertThat(sources.precedenceOf(PropertySource.named("f")), is(5));
assertThat(sources.precedenceOf(PropertySource.named("g")), is(6));
assertEquals(sources.remove("a"), PropertySource.named("a"));
assertThat(sources.size(), equalTo(6));
assertThat(sources.contains("a"), is(false));
assertEquals(sources.remove("a"), null);
assertThat(sources.size(), equalTo(6));
String bogusPS = "bogus";
try {
sources.addAfter(bogusPS, new MockPropertySource("h"));
fail("expected non-existent PropertySource exception");
} catch (IllegalArgumentException ex) {
assertThat(ex.getMessage(),
equalTo(format(NON_EXISTENT_PROPERTY_SOURCE_MESSAGE, bogusPS)));
}
sources.addFirst(new MockPropertySource("a"));
assertThat(sources.size(), equalTo(7));
assertThat(sources.precedenceOf(PropertySource.named("a")), is(0));
assertThat(sources.precedenceOf(PropertySource.named("b")), is(1));
assertThat(sources.precedenceOf(PropertySource.named("c")), is(2));
sources.replace("a", new MockPropertySource("a-replaced"));
assertThat(sources.size(), equalTo(7));
assertThat(sources.precedenceOf(PropertySource.named("a-replaced")), is(0));
assertThat(sources.precedenceOf(PropertySource.named("b")), is(1));
assertThat(sources.precedenceOf(PropertySource.named("c")), is(2));
sources.replace("a-replaced", new MockPropertySource("a"));
try {
sources.replace(bogusPS, new MockPropertySource("bogus-replaced"));
fail("expected non-existent PropertySource exception");
} catch (IllegalArgumentException ex) {
assertThat(ex.getMessage(),
equalTo(format(NON_EXISTENT_PROPERTY_SOURCE_MESSAGE, bogusPS)));
}
try {
sources.addBefore("b", new MockPropertySource("b"));
fail("expected exception");
} catch (IllegalArgumentException ex) {
assertThat(ex.getMessage(),
equalTo(format(ILLEGAL_RELATIVE_ADDITION_MESSAGE, "b")));
}
try {
sources.addAfter("b", new MockPropertySource("b"));
fail("expected exception");
} catch (IllegalArgumentException ex) {
assertThat(ex.getMessage(),
equalTo(format(ILLEGAL_RELATIVE_ADDITION_MESSAGE, "b")));
}
}
@Test
public void getNonExistentPropertySourceReturnsNull() {
MutablePropertySources sources = new MutablePropertySources();
assertThat(sources.get("bogus"), nullValue());
}
}
| [
"972181522@qq.com"
] | 972181522@qq.com |
84bf487e58322b61e68c0517cfa160fd622e38f5 | a0127e392c8fef7392188215aab7e4e31741c634 | /dev/gwtc/api/src/main/java/xapi/dev/gwtc/api/IsAppSpace.java | f17842e37c2e0bc2169d2180634386db6377ac49 | [
"BSD-3-Clause"
] | permissive | WeTheInternet/xapi | 1f0918023bc0b44b9ddac4af92f68cac162470bf | 04416d1527f82b5975f9d48bf57f7e407aa480e3 | refs/heads/master | 2023-08-13T23:00:04.939034 | 2022-11-26T09:12:09 | 2022-11-26T09:12:09 | 9,408,774 | 24 | 8 | NOASSERTION | 2022-07-07T21:43:55 | 2013-04-13T04:42:51 | Java | UTF-8 | Java | false | false | 260 | java | package xapi.dev.gwtc.api;
import java.io.File;
/**
* Created by James X. Nelson (james @wetheinter.net) on 9/20/17.
*/
public interface IsAppSpace {
File getSpeedTracerLogFile();
File getUnitCacheDir();
File getCompileDir(int compileId);
}
| [
"James@WeTheInter.net"
] | James@WeTheInter.net |
ab61f3e133e4162d8780616a6ad98e4712f7afb8 | 0b97409901c47b520b33558ae2d3a3f16479c142 | /dbe-VersaoAntiga/11-WS-Restful/src/br/com/fiap/dao/impl/GenericDAOImpl.java | 30ae9f769dcdcc449641ebc039849f5b6c229808 | [] | no_license | paulosthiven25/DBE-DigitalBusinessEnablement- | e57b75a06015fef0a64ba3b90439389c162127d2 | 67d0787d085053b22612f05bce607920feaad0f6 | refs/heads/master | 2022-12-01T04:23:45.858460 | 2019-10-01T15:04:41 | 2019-10-01T15:04:41 | 183,063,887 | 0 | 0 | null | 2022-11-24T08:16:34 | 2019-04-23T17:27:31 | Java | UTF-8 | Java | false | false | 1,335 | java | package br.com.fiap.dao.impl;
import java.lang.reflect.ParameterizedType;
import java.util.List;
import javax.persistence.EntityManager;
import br.com.fiap.dao.GenericDAO;
import br.com.fiap.exception.CodigoInexistenteException;
import br.com.fiap.exception.CommitException;
public class GenericDAOImpl<T,K> implements GenericDAO<T, K>{
private EntityManager em;
private Class<T> clazz;
@SuppressWarnings("all")
public GenericDAOImpl(EntityManager em) {
this.em = em;
clazz = (Class<T>) ((ParameterizedType) getClass()
.getGenericSuperclass()).getActualTypeArguments()[0];
}
public void cadastrar(T tabela) {
em.persist(tabela);
}
public void remover(K codigo) throws CodigoInexistenteException {
T tabela = buscar(codigo);
if (tabela == null) {
throw new CodigoInexistenteException();
}
em.remove(tabela);
}
public void atualizar(T tabela) {
em.merge(tabela);
}
public T buscar(K codigo) {
return em.find(clazz, codigo);
}
public void commit() throws CommitException {
try {
em.getTransaction().begin();
em.getTransaction().commit();
}catch(Exception e) {
e.printStackTrace();
em.getTransaction().rollback();
throw new CommitException();
}
}
@Override
public List<T> listar(){
return em.createQuery("from "+clazz.getName(),clazz).getResultList();
}
} | [
"logonrmlocal@fiap.com.br"
] | logonrmlocal@fiap.com.br |
0f4b7a3285b8a0657e93280438964a24eba9e6e1 | d8f6d06a331e4f571ad905e07f68f0a72247b318 | /ta_ice/lib/toplink-src/oracle/toplink/tools/sessionconfiguration/model/transport/naming/RMIRegistryNamingServiceConfig.java | 4af513aad8704e575c26221b56c3ffab18a8681d | [] | no_license | reggiej/TA_ICE_Dlittle | daabc425c3bba71226ac57a7287fc29954546a73 | 6b3dad230772480c1c07dbd5f953b17261f89a4a | refs/heads/master | 2016-09-06T04:25:06.713090 | 2014-05-19T17:26:18 | 2014-05-19T17:26:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 425 | java | // Copyright (c) 1998, 2006, Oracle. All rights reserved.
package oracle.toplink.tools.sessionconfiguration.model.transport.naming;
/**
* INTERNAL:
*/
public class RMIRegistryNamingServiceConfig {
private String m_url;
public RMIRegistryNamingServiceConfig() {
}
public void setURL(String url) {
m_url = url;
}
public String getURL() {
return m_url;
}
} | [
"reggie.jackson@acnc-md.com"
] | reggie.jackson@acnc-md.com |
fef6e427f0aa698448fd1c5070228210e39691c1 | 09a631fbd3d75e9b578fee760f30165590fff0a7 | /app/src/main/java/com/randomappsinc/simpleflashcards/theme/ThemedTextView.java | fed35b654b8cc054625ad0a6e4a8df19822ae15e | [
"Apache-2.0"
] | permissive | laithhas/Simple-Flashcards | f7532d806fc2be6e591549499845836c024f970e | bdbec74e6047e8ad5fab16d9a85081e8dc4d8711 | refs/heads/master | 2022-02-17T20:07:16.470019 | 2019-08-27T05:19:22 | 2019-08-27T05:19:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,089 | java | package com.randomappsinc.simpleflashcards.theme;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.StringRes;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.content.ContextCompat;
import com.randomappsinc.simpleflashcards.R;
public class ThemedTextView extends AppCompatTextView implements ThemeManager.Listener {
private ThemeManager themeManager;
private int normalModeColor;
private int normalModeHintColor;
private int darkModeColor;
private int darkModeHintColor;
public ThemedTextView(Context context, AttributeSet attrs) {
super(context, attrs);
themeManager = ThemeManager.get();
normalModeColor = ContextCompat.getColor(context, R.color.dark_gray);
normalModeHintColor = ContextCompat.getColor(context, R.color.gray);
darkModeColor = ContextCompat.getColor(context, R.color.white);
darkModeHintColor = ContextCompat.getColor(context, R.color.half_white);
setProperTextColor();
}
public void setProperTextColor() {
setTextColor(themeManager.getDarkModeEnabled(getContext()) ? darkModeColor : normalModeColor);
}
// Call this method if you're using the TextView to show regular-style text and want to ensure proper colors
public void setTextNormally(String text) {
setText(text);
setProperTextColor();
}
// Call this method if you're using the TextView to show hint-style text
public void setTextAsHint(@StringRes int resId) {
setText(resId);
setTextColor(themeManager.getDarkModeEnabled(getContext()) ? darkModeHintColor : normalModeHintColor);
}
@Override
public void onThemeChanged(boolean darkModeEnabled) {
setProperTextColor();
}
@Override
public void onAttachedToWindow() {
themeManager.registerListener(this);
super.onAttachedToWindow();
}
@Override
public void onDetachedFromWindow() {
themeManager.unregisterListener(this);
super.onDetachedFromWindow();
}
}
| [
"chessnone@yahoo.com"
] | chessnone@yahoo.com |
704a8d79334d2aeab3b4a2c2156c28fa74a5e786 | 799cd2676d8d712b71d4890dfdeee341cc3a752f | /src/main/java/com/zhang/thread/chapter2/t5/MyThread2.java | 1889b106ea59a7698c32c3270d2823d3c91f6b4d | [] | no_license | zhang1990zxc/multi-thread | 7337e6252a8a5c8d1502e5028311ce31a70e2ddd | e603a26adc41d8d6f7ec8e3a950769b84e73b17e | refs/heads/master | 2021-11-11T06:18:12.439586 | 2021-11-05T12:31:41 | 2021-11-05T12:31:41 | 252,998,407 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | package com.zhang.thread.chapter2.t5;
/**
* @ClassName MyThread1
* @Description 整条街最靓的仔,写点注释吧
* @Author 天涯
* @Date 2020/8/16 15:02
* @Version 1.0
**/
public class MyThread2 extends Thread {
private Task task;
public MyThread2(Task task) {
super();
this.task = task;
}
@Override
public void run() {
super.run();
CommonUtils.beginTime2 = System.currentTimeMillis();
task.doLongTimeTask();
CommonUtils.endTime2 = System.currentTimeMillis();
}
}
| [
"1018736264@qq.com"
] | 1018736264@qq.com |
16346a0537a3a9882e997cc14f6a1df5b2d0bf45 | 4d7b1b6c5ce9517a11ac957f34bbc88d0df3ae1c | /java-server/common-board/src/main/java/net/chrisrichardson/eventstore/examples/kanban/common/board/model/BoardQueryResponse.java | ebf4b95d1de29ae82983a161469c9161edb51e0e | [
"Apache-2.0"
] | permissive | narayanansubramanian/es-kanban-board | 2fb3b11e8fe16daf6654e2585cfaaf7854308c2e | 9720b4a8f60a3117fa75fbcac14c65bb691d892b | refs/heads/master | 2021-01-12T05:49:38.491972 | 2017-03-13T06:40:29 | 2017-03-13T06:40:29 | 77,210,021 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package net.chrisrichardson.eventstore.examples.kanban.common.board.model;
public class BoardQueryResponse {
private Board data;
public BoardQueryResponse() {}
public BoardQueryResponse(Board data) {
this.data = data;
}
public Board getData() {
return data;
}
public void setData(Board data) {
this.data = data;
}
}
| [
"chris@chrisrichardson.net"
] | chris@chrisrichardson.net |
b0f67ed92937b915bf909e0fae5f81ae2109123d | 2175d6a417843e151d54cda309bff47be0b97da3 | /src/main/java/demos/antiSQLInjection/org/boris/expr/function/excel/LENGTH.java | b4f66e7b3c3c007ab525cf8c47aea2c3ff43c912 | [] | no_license | sqlparser/gsp_demo_java | 6cf93fdf567f40ca1da86e4d9da8d19d25452e55 | 6e377789c0b36f47013449a65ea293c9495b7dcc | refs/heads/master | 2023-08-18T02:02:34.857633 | 2023-06-08T02:32:26 | 2023-06-08T02:32:26 | 206,196,892 | 108 | 55 | null | 2023-04-14T18:30:08 | 2019-09-04T00:37:05 | Java | UTF-8 | Java | false | false | 830 | java | package org.boris.expr.function.excel;
import org.boris.expr.Expr;
import org.boris.expr.ExprArray;
import org.boris.expr.ExprDouble;
import org.boris.expr.ExprError;
import org.boris.expr.ExprException;
import org.boris.expr.ExprString;
import org.boris.expr.IEvaluationContext;
import org.boris.expr.function.AbstractFunction;
public class LENGTH extends AbstractFunction
{
public Expr evaluate(IEvaluationContext context, Expr[] args)
throws ExprException {
assertArgCount(args, 1);
Expr a = evalArg(context, args[0]);
if (a instanceof ExprArray)
return ExprError.VALUE;
String str = null;
if (a instanceof ExprString)
str = ((ExprString) a).str;
else
str = a.toString();
return new ExprDouble(str.length());
}
}
| [
"shawn@example.com"
] | shawn@example.com |
45c20fd3bad0421b9b82d2125b23bc26bebaff8e | 9623f83defac3911b4780bc408634c078da73387 | /powercraft_15/src/minecraft/cpw/mods/fml/client/GuiDupesFound.java | ef8cedeb293959f82c52505160413c59d9f9a7fb | [] | no_license | BlearStudio/powercraft-legacy | 42b839393223494748e8b5d05acdaf59f18bd6c6 | 014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8 | refs/heads/master | 2021-01-21T21:18:55.774908 | 2015-04-06T20:45:25 | 2015-04-06T20:45:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,145 | java | /*
* Forge Mod Loader
* Copyright (c) 2012-2013 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Contributors:
* cpw - implementation
*/
package cpw.mods.fml.client;
import java.io.File;
import java.util.Map.Entry;
import net.minecraft.client.gui.GuiErrorScreen;
import cpw.mods.fml.common.DuplicateModsFoundException;
import cpw.mods.fml.common.MissingModsException;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.versioning.ArtifactVersion;
public class GuiDupesFound extends GuiErrorScreen
{
private DuplicateModsFoundException dupes;
public GuiDupesFound(DuplicateModsFoundException dupes)
{
this.dupes = dupes;
}
@Override
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
super.initGui();
}
@Override
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int par1, int par2, float par3)
{
this.drawDefaultBackground();
int offset = Math.max(85 - dupes.dupes.size() * 10, 10);
this.drawCenteredString(this.fontRenderer, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF);
offset+=10;
this.drawCenteredString(this.fontRenderer, "You have mod sources that are duplicate within your system", this.width / 2, offset, 0xFFFFFF);
offset+=10;
this.drawCenteredString(this.fontRenderer, "Mod Id : File name", this.width / 2, offset, 0xFFFFFF);
offset+=5;
for (Entry<ModContainer, File> mc : dupes.dupes.entries())
{
offset+=10;
this.drawCenteredString(this.fontRenderer, String.format("%s : %s", mc.getKey().getModId(), mc.getValue().getName()), this.width / 2, offset, 0xEEEEEE);
}
}
}
| [
"nils.h.emmerich@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c"
] | nils.h.emmerich@gmail.com@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c |
2b328f6f6d70fdae1fbec0c7511d19d135869fb4 | 1e2aa28f071eec13971f052cdfcf94baa04220dc | /src/main/java/com/thoughtworks/ketsu/domain/user/UserRepository.java | a0d280adf4ad3fe2abc813f7bf2215768f4c9b37 | [] | no_license | HFCherish/order7 | 3fcc57efd665e98578b4eb01a6a34e3ad68277ab | fbb5c4fb8fb835d54a8fdfad5cb905145cf3a365 | refs/heads/master | 2021-01-19T03:41:17.343130 | 2016-07-22T11:17:36 | 2016-07-22T11:17:36 | 64,724,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package com.thoughtworks.ketsu.domain.user;
import java.util.Map;
import java.util.Optional;
public interface UserRepository {
User save(Map info);
Optional<User> findById(long id);
}
| [
"hf_cherish@163.com"
] | hf_cherish@163.com |
6c1a7967a1acb4e3326b0663bd514e1993adae23 | 5835451d6f51080156e427bd2f6c580b347ddc82 | /Cucumber_EcommerceProject/src/main/java/Test_steps/Login.java | 3175e01933c928cb9c6bce7ac414b40e4cd45fa0 | [] | no_license | gkarthi2802/Ecommerce_cucumber | 821f0e05ec9f191a89f749d12648a2e4b1cb9c6b | aa086568185c0f948259dbca7c06cc3cf273f729 | refs/heads/master | 2021-07-22T19:52:16.063861 | 2019-11-19T16:25:03 | 2019-11-19T16:25:03 | 222,736,733 | 0 | 0 | null | 2020-10-13T17:34:54 | 2019-11-19T16:10:08 | Java | UTF-8 | Java | false | false | 1,465 | java | package Test_steps;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
public class Login {
public WebDriver driver;
//@Given("^user opens the browser and enter the url http://automationpractice.com/index.php$")
public void open_browser_enter_url() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Karthik\\Desktop\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver();
driver.get("http://automationpractice.com/index.php");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(5000, TimeUnit.MILLISECONDS);
}
//@When(" ^user clicks on signin button$")
public void user_clicks_sign_in_button() {
driver.findElement(By.partialLinkText("Sign in")).click();
}
//When("^ user enters username and password$")
public void fill_username_paassword() {
driver.findElement(By.id("email")).sendKeys("gkarthi28@gmail.com");
driver.findElement(By.id("passwd")).sendKeys("XXXXXXXXX");
}
//@When("^ click on sign in button$")
public void click_sign_in() {
driver.findElement(By.id("SubmitLogin")).click();
}
//@When("^Then it should navigate to the page with title Myaccount-mystore$")
public void assert_loginpage() {
String title = driver.getTitle();
Assert.assertEquals("My account - My Store", title);
}
}
| [
"="
] | = |
c055b0a5a00fc04f2076db619bde98b2368bc63d | 7d01ce48a914eed4b46f3bac1b6a23a90d8a5621 | /src/main/java/com/nam/express/dao/CourierTaskDao.java | 4062e8b77119b0af0411f7d1035eb91f5b7d7e75 | [] | no_license | YershovAleksandr/Express | a2087b36d6adde983f1ac718b676ba2d8664c516 | f46b7002f4f5d92d3445b047e18f679337054635 | refs/heads/master | 2020-04-22T01:01:07.533914 | 2019-02-11T20:10:02 | 2019-02-11T20:10:02 | 170,000,403 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,622 | java | package com.nam.express.dao;
import com.nam.express.dao.mapper.CourierTaskMapper;
import com.nam.express.model.CourierTask;
import com.nam.express.util.JDBCSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CourierTaskDao {
private static Logger log = LoggerFactory.getLogger(CourierTaskDao.class);
private JdbcTemplate jdbcTemplate = new JdbcTemplate(JDBCSource.getDataSource());
public List<CourierTask> getAll(){
log.info("Get All Courier Tasks");
return jdbcTemplate.query("SELECT * FROM courierdb", new CourierTaskMapper());
}
public CourierTask get(int id){
log.info("Get Courier Task id = " + id);
return jdbcTemplate.queryForObject("SELECT * FROM courierdb WHERE courierdb_id = ?", new Object[]{id}, new CourierTaskMapper());
}
public void create(CourierTask courierTask){
log.info("Create Courier Task");
SimpleJdbcInsert insert = new SimpleJdbcInsert(JDBCSource.getDataSource()).withTableName("courierdb");
Map<String, Object> param = new HashMap<>();
param.put("courierdb_orderid", courierTask.getOrderId());
param.put("courierdb_description", courierTask.getDescription());
insert.execute(param);
}
public void deleteByOrderId(int id){
log.info("Delete Courier Task");
jdbcTemplate.update("DELETE FROM courierdb WHERE courierdb_orderid = ?", id);
}
} | [
"namstudionsk@gmail.com"
] | namstudionsk@gmail.com |
8aaceaf7369299894e4e8ab507f930b8e0791a8d | 5a0bfac7ad00c079fe8e0bdf1482f4271c46eeab | /app/src/main/wechat6.5.3/android/support/v4/app/k.java | 6923e4b3bf1799040ea5062fd551ce0f3ece5d30 | [] | no_license | newtonker/wechat6.5.3 | 8af53a870a752bb9e3c92ec92a63c1252cb81c10 | 637a69732afa3a936afc9f4679994b79a9222680 | refs/heads/master | 2020-04-16T03:32:32.230996 | 2017-06-15T09:54:10 | 2017-06-15T09:54:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 917 | java | package android.support.v4.app;
import android.os.Bundle;
import android.support.v4.app.Fragment.SavedState;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.List;
public abstract class k {
public abstract Fragment E(int i);
public abstract void F(int i);
public abstract Fragment a(Bundle bundle, String str);
public abstract void a(Bundle bundle, String str, Fragment fragment);
public abstract n aW();
public abstract List<Fragment> aX();
public abstract void dump(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr);
public abstract SavedState e(Fragment fragment);
public abstract boolean executePendingTransactions();
public abstract boolean isDestroyed();
public abstract Fragment k(String str);
public abstract void popBackStack();
public abstract boolean popBackStackImmediate();
}
| [
"zhangxhbeta@gmail.com"
] | zhangxhbeta@gmail.com |
db6a25d73ddb460845e069010eae2d4f9cf87c2b | 4dc1b766005c902c5e353f695bebe352edc63a62 | /molgenis-core-db/src/main/java/org/molgenis/db/generators/DerbyCreateSubclassPerTableGen.java | 08674600639ea179f5b565b5a45e59b139ebdcff | [] | no_license | mswertz/molgenis-maven-experimental | 89e4e9b11a8b4b64dc7a186aacc69e796a011b65 | 577702028c2f93e81351d54624ee07be79359b77 | refs/heads/master | 2020-06-02T12:35:26.359066 | 2013-01-02T10:34:44 | 2013-01-02T10:34:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,905 | java | package org.molgenis.db.generators;
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.util.Map;
import org.apache.log4j.Logger;
import org.molgenis.MolgenisGenerator;
import org.molgenis.MolgenisModel;
import org.molgenis.MolgenisOptions;
import org.molgenis.model.EntityModel;
import freemarker.template.Template;
public class DerbyCreateSubclassPerTableGen extends MolgenisGenerator
{
public static final transient Logger logger = Logger.getLogger(DerbyCreateSubclassPerTableGen.class);
@Override
public void generate(MolgenisModel model, MolgenisOptions options) throws Exception
{
// create an hsqldb connection
Class.forName(options.db_driver);
Connection conn = DriverManager.getConnection(options.db_uri + ";create=true");
Statement stmt = null;
// create generator
Template template = this.createTemplate(this.getClass().getSimpleName() + ".hsql.ftl");
Map<String, Object> templateArgs = createTemplateArguments(options);
for (EntityModel entity : model.getEntities())
{
// create arguments
templateArgs.put("entity", entity);
templateArgs.put("model", model);
// generate
ByteArrayOutputStream out = new ByteArrayOutputStream();
template.process(templateArgs, new OutputStreamWriter(out, Charset.forName("UTF-8")));
// send to database
stmt = conn.createStatement();
stmt.executeUpdate(out.toString("UTF-8"));
// send to log
logger.debug("created hsql table: " + out.toString());
}
// shutdown
DriverManager.getConnection("jdbc:derby:;shutdown=true");
stmt.close();
conn.close();
}
@Override
public String getDescription()
{
return "Generate a hsql database using connection settings";
}
}
| [
"m.a.swertz@rug.nl"
] | m.a.swertz@rug.nl |
a4394fe60ca2cd009d2f9c303bdaea8157f45ef0 | 9d640c8350122bc367bb67355f27ad1ddf731cf6 | /demo/src/main/java/com/elk/demo/elasticSearch/dao/search/PrefixDao.java | 670f631570bb0e90c625fe4f9dee60c521abfe4c | [] | no_license | fuLinHu/designModel | 8cbd2260cdf62ecf9c2bf438ec01ddc70b9b7242 | 9358fd157a6373038a924a8501916cbf380dc986 | refs/heads/master | 2022-09-27T13:30:16.689895 | 2021-11-19T06:48:25 | 2021-11-19T06:48:25 | 165,197,804 | 0 | 0 | null | 2022-09-01T23:45:10 | 2019-01-11T07:18:51 | HTML | UTF-8 | Java | false | false | 270 | java | package com.elk.demo.elasticSearch.dao.search;
import org.springframework.stereotype.Repository;
/**
* @className
* @Description TODO
* @Author 付林虎
* @Date 2021/1/28 15:17
* @Version V1.0
*/
@Repository
public class PrefixDao extends ElasticSearchDao {
}
| [
"1205668006@qq.com"
] | 1205668006@qq.com |
ccf295f9b3236207637b40cb31726c7fb0b6eb08 | 08809023d59d6263d4341a8d1b73038a931661bb | /src/main/java/com/csx/codec/marshalling/SubReqServer.java | 89b931000b119067c17c57d20e33863d99f984c7 | [] | no_license | chensongxian/netty | b1e31cc4a28578f14a530c0193b0bdc9a197eab7 | 16117cc99092685e331fc741671c93f3e91e3d54 | refs/heads/master | 2021-05-11T23:36:16.687223 | 2018-01-22T15:25:07 | 2018-01-22T15:25:07 | 117,515,099 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,589 | java | package com.csx.codec.marshalling;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.marshalling.MarshallingDecoder;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
/**
* Created with IntelliJ IDEA.
*
* @Description: TODO
* @Author: csx
* @Date: 2018-01-21
*/
public class SubReqServer {
public void bind(int port) throws Exception {
// 配置服务端的NIO线程组
EventLoopGroup bossGroup = new NioEventLoopGroup();
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.option(ChannelOption.SO_BACKLOG, 100)
.handler(new LoggingHandler(LogLevel.INFO))
.childHandler(new ChannelInitializer<SocketChannel>() {
@Override
public void initChannel(SocketChannel ch) {
ch.pipeline().addLast(
MarshallingCodeCFactory
.buildMarshallingDecoder());
ch.pipeline().addLast(
MarshallingCodeCFactory
.buildMarshallingEncoder());
ch.pipeline().addLast(new SubReqServerHandler());
}
});
// 绑定端口,同步等待成功
ChannelFuture f = b.bind(port).sync();
// 等待服务端监听端口关闭
f.channel().closeFuture().sync();
} finally {
// 优雅退出,释放线程池资源
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}
}
public static void main(String[] args) throws Exception {
int port = 8080;
if (args != null && args.length > 0) {
try {
port = Integer.valueOf(args[0]);
} catch (NumberFormatException e) {
// 采用默认值
}
}
new SubReqServer().bind(port);
}
}
| [
"1164077611@qq.com"
] | 1164077611@qq.com |
3063ff799fbb5e14361d56b232cbc43b8876a52e | 8f04a7386d1bb60e8e8de5883c383910e5b46742 | /Server/api/src/net/ME1312/SubData/Server/Library/Exception/EncryptionException.java | 9f8fd881ce1ace3b07a69b24519f3a85b931fe35 | [
"Apache-2.0"
] | permissive | ME1312/SubData-2 | 007606616fa024e575b679b1961315bcda30e905 | 18de49856e8b90dac81ee0698ea792c26894643b | refs/heads/master | 2023-03-09T03:51:52.163618 | 2023-02-22T22:46:59 | 2023-02-22T22:46:59 | 177,348,665 | 3 | 2 | Apache-2.0 | 2021-10-01T18:15:19 | 2019-03-23T22:59:16 | Java | UTF-8 | Java | false | false | 428 | java | package net.ME1312.SubData.Server.Library.Exception;
import java.io.IOException;
/**
* Encryption Exception
*/
public class EncryptionException extends IOException {
public EncryptionException() {}
public EncryptionException(String s) {
super(s);
}
public EncryptionException(Throwable e, String s) {
super(s, e);
}
public EncryptionException(Throwable e) {
super(e);
}
}
| [
"admin@me1312.net"
] | admin@me1312.net |
1be59adafa336421fce5bc424d62fa0df7f4cfe2 | 7d0e096aa6ccb65cfc185ec35d344689b7bc07e4 | /springboot-banner/src/main/java/com/secbro2/banner/SpringbootBannerApplication.java | e70bd4c1a1e45837e164d1900d4c3e7effdcfc75 | [] | no_license | secbr/springboot-all | 89bad6bcd350da2bdcfd36b6e2332a074e417244 | 8f7413e591e2a5f12074a67eeba6ef6674bbf513 | refs/heads/master | 2022-08-24T09:40:35.197236 | 2022-08-02T02:21:30 | 2022-08-02T02:21:30 | 178,757,985 | 28 | 22 | null | 2022-07-31T11:01:25 | 2019-04-01T00:31:28 | Java | UTF-8 | Java | false | false | 692 | java | package com.secbro2.banner;
import org.springframework.boot.Banner;
import org.springframework.boot.ImageBanner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.io.ClassPathResource;
/**
* banner学习
*
* @author zzs
*/
@SpringBootApplication
public class SpringbootBannerApplication {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(SpringbootBannerApplication.class);
// Banner banner = new ImageBanner(new ClassPathResource("banner1.png"));
// app.setBanner(banner);
// app.setBannerMode(Banner.Mode.OFF);
app.run(args);
}
}
| [
"xinyoulingxi2008@126.com"
] | xinyoulingxi2008@126.com |
d1f41c517ac476018a40986c2db6ef99e9fe11f6 | bceba483c2d1831f0262931b7fc72d5c75954e18 | /src/qubed/corelogicextensions/BUYDOWNOCCURRENCESEXTENSION.java | bc660e7e72f50bbfc52812cc8c0f88ad83f5742d | [] | no_license | Nigel-Qubed/credit-services | 6e2acfdb936ab831a986fabeb6cefa74f03c672c | 21402c6d4328c93387fd8baf0efd8972442d2174 | refs/heads/master | 2022-12-01T02:36:57.495363 | 2020-08-10T17:26:07 | 2020-08-10T17:26:07 | 285,552,565 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,490 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2020.08.05 at 04:53:09 AM CAT
//
package qubed.corelogicextensions;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for BUYDOWN_OCCURRENCES_EXTENSION complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="BUYDOWN_OCCURRENCES_EXTENSION">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="MISMO" type="{http://www.mismo.org/residential/2009/schemas}MISMO_BASE" minOccurs="0"/>
* <element name="OTHER" type="{http://www.mismo.org/residential/2009/schemas}OTHER_BASE" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BUYDOWN_OCCURRENCES_EXTENSION", propOrder = {
"mismo",
"other"
})
public class BUYDOWNOCCURRENCESEXTENSION {
@XmlElement(name = "MISMO")
protected MISMOBASE mismo;
@XmlElement(name = "OTHER")
protected OTHERBASE other;
/**
* Gets the value of the mismo property.
*
* @return
* possible object is
* {@link MISMOBASE }
*
*/
public MISMOBASE getMISMO() {
return mismo;
}
/**
* Sets the value of the mismo property.
*
* @param value
* allowed object is
* {@link MISMOBASE }
*
*/
public void setMISMO(MISMOBASE value) {
this.mismo = value;
}
/**
* Gets the value of the other property.
*
* @return
* possible object is
* {@link OTHERBASE }
*
*/
public OTHERBASE getOTHER() {
return other;
}
/**
* Sets the value of the other property.
*
* @param value
* allowed object is
* {@link OTHERBASE }
*
*/
public void setOTHER(OTHERBASE value) {
this.other = value;
}
}
| [
"vectorcrael@yahoo.com"
] | vectorcrael@yahoo.com |
4fca1aed07bdc3356abf7e1886d343758d8ea060 | 8907c30c4c9ebfc369e2c420a0e05c490738d765 | /protocoder/protocoder_apprunner/src/main/java/org/protocoderrunner/apprunner/api/dashboard/PDashboardButton.java | 7246c65bbecb87044aa792f626d9945e5f680751 | [
"MIT"
] | permissive | olea/protocoder | 6caba8f713c3afb1442bccc5ea175ee8306f045d | ab62827be8f087aba7030a36f481547172aec17f | refs/heads/master | 2020-05-29T12:23:24.028669 | 2014-10-03T07:52:59 | 2014-10-03T07:52:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,524 | java | /*
* Protocoder
* A prototyping platform for Android devices
*
* Victor Diaz Barrales victormdb@gmail.com
*
* Copyright (C) 2014 Victor Diaz
* Copyright (C) 2013 Motorola Mobility LLC
*
* 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 org.protocoderrunner.apprunner.api.dashboard;
import java.net.UnknownHostException;
import org.json.JSONException;
import org.json.JSONObject;
import org.protocoderrunner.apidoc.annotation.APIMethod;
import org.protocoderrunner.apprunner.PInterface;
import org.protocoderrunner.apprunner.ProtocoderScript;
import org.protocoderrunner.network.CustomWebsocketServer;
import org.protocoderrunner.network.CustomWebsocketServer.WebSocketListener;
import org.protocoderrunner.utils.StrUtils;
import android.app.Activity;
public class PDashboardButton extends PInterface {
private static final String TAG = "PDashboardButton";
String id;
String name;
public PDashboardButton(Activity a) {
super(a);
}
// --------- JDashboard add ---------//
public interface jDashboardAddCB {
void event();
}
public void add(String name, int x, int y, int w, int h, final jDashboardAddCB callbackfn) throws JSONException,
UnknownHostException {
this.id = StrUtils.generateRandomString();
this.name = name;
JSONObject values = new JSONObject()
.put("id", id)
.put("name", name)
.put("type", "button")
.put("x", x)
.put("y", y)
.put("w", w)
.put("h", h);
JSONObject msg = new JSONObject()
.put("type", "widget")
.put("action", "add")
.put("values", values);
CustomWebsocketServer.getInstance(a.get()).send(msg);
CustomWebsocketServer.getInstance(a.get()).addListener(id, new WebSocketListener() {
@Override
public void onUpdated(JSONObject jsonObject) {
mHandler.post(new Runnable() {
@Override
public void run() {
callbackfn.event();
}
});
}
});
}
public void update(boolean pressed) throws JSONException, UnknownHostException {
JSONObject values = new JSONObject()
.put("name", name)
.put("type", "button")
.put("val", pressed);
JSONObject msg = new JSONObject()
.put("type", "widget")
.put("action", "update")
.put("values", values);
CustomWebsocketServer.getInstance(a.get()).send(msg);
}
}
| [
"victormdb@gmail.com"
] | victormdb@gmail.com |
ce0168b5ecd74bd2e4031ed14276bcf27c140759 | ddd38972d2e73c464ee77024f6ba4d6e11aac97b | /platform/arcus-alexa/src/main/java/com/iris/alexa/message/v2/error/ValueOutOfRangeError.java | 828c2ca9acf1ebb09fa7943ee92d4d7fe24b9409 | [
"Apache-2.0"
] | permissive | arcus-smart-home/arcusplatform | bc5a3bde6dc4268b9aaf9082c75482e6599dfb16 | a2293efa1cd8e884e6bedbe9c51bf29832ba8652 | refs/heads/master | 2022-04-27T02:58:20.720270 | 2021-09-05T01:36:12 | 2021-09-05T01:36:12 | 168,190,985 | 104 | 50 | Apache-2.0 | 2022-03-10T01:33:34 | 2019-01-29T16:49:10 | Java | UTF-8 | Java | false | false | 1,478 | java | /*
* Copyright 2019 Arcus Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.iris.alexa.message.v2.error;
public class ValueOutOfRangeError implements ErrorPayload {
private double minimumValue;
private double maximumValue;
public ValueOutOfRangeError() {
}
public ValueOutOfRangeError(double minimumValue, double maximumValue) {
this.minimumValue = minimumValue;
this.maximumValue = maximumValue;
}
public double getMinimumValue() {
return minimumValue;
}
public void setMinimumValue(double minimumValue) {
this.minimumValue = minimumValue;
}
public double getMaximumValue() {
return maximumValue;
}
public void setMaximumValue(double maximumValue) {
this.maximumValue = maximumValue;
}
@Override
public String toString() {
return "ValueOutOfRangeError [minimumValue=" + minimumValue
+ ", maximumValue=" + maximumValue + ']';
}
}
| [
"b@yoyo.com"
] | b@yoyo.com |
56cf1d571207c36b0e7cb0a299672cb09be180a1 | a7497fae8dd751b07abe1c61dbb09d52f47f3d76 | /org.isistan.flabot.engine/src/org/isistan/flabot/engine/executionstate/impl/StateDeterminationStrategyRegistryImpl.java | 80566fed8a771532615b3ca9861f015010632d74 | [] | no_license | niconistal/FLABot | 639388ec36e514cb6f8c63caa01530bff2e1fcbd | a118b9fd20c3ee44b6d2b456b3f7b362ce92327a | refs/heads/master | 2021-03-12T19:52:59.571266 | 2013-01-29T01:46:46 | 2013-01-29T01:46:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,398 | java | /**
* <copyright>
* </copyright>
*
* $Id: StateDeterminationStrategyRegistryImpl.java,v 1.2 2006/02/03 21:03:07 dacostae Exp $
*/
package org.isistan.flabot.engine.executionstate.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EcoreEMap;
import org.eclipse.emf.ecore.util.InternalEList;
import org.isistan.flabot.engine.executionstate.ExecutionstatePackage;
import org.isistan.flabot.engine.executionstate.StateDeterminationStrategyRegistry;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>State Determination Strategy Registry</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.isistan.flabot.engine.executionstate.impl.StateDeterminationStrategyRegistryImpl#getRegistry <em>Registry</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StateDeterminationStrategyRegistryImpl extends EObjectImpl implements StateDeterminationStrategyRegistry {
/**
* The cached value of the '{@link #getRegistry() <em>Registry</em>}' map.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRegistry()
* @generated
* @ordered
*/
protected EMap registry = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StateDeterminationStrategyRegistryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExecutionstatePackage.eINSTANCE.getStateDeterminationStrategyRegistry();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EMap getRegistry() {
if (registry == null) {
registry = new EcoreEMap(ExecutionstatePackage.eINSTANCE.getResponsibilityToStateDeterminationStrategyMapEntry(), ResponsibilityToStateDeterminationStrategyMapEntryImpl.class, this, ExecutionstatePackage.STATE_DETERMINATION_STRATEGY_REGISTRY__REGISTRY);
}
return registry;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
if (featureID >= 0) {
switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
case ExecutionstatePackage.STATE_DETERMINATION_STRATEGY_REGISTRY__REGISTRY:
return ((InternalEList)getRegistry()).basicRemove(otherEnd, msgs);
default:
return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
}
}
return eBasicSetContainer(null, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(EStructuralFeature eFeature, boolean resolve) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case ExecutionstatePackage.STATE_DETERMINATION_STRATEGY_REGISTRY__REGISTRY:
return getRegistry();
}
return eDynamicGet(eFeature, resolve);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(EStructuralFeature eFeature, Object newValue) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case ExecutionstatePackage.STATE_DETERMINATION_STRATEGY_REGISTRY__REGISTRY:
getRegistry().clear();
getRegistry().addAll((Collection)newValue);
return;
}
eDynamicSet(eFeature, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(EStructuralFeature eFeature) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case ExecutionstatePackage.STATE_DETERMINATION_STRATEGY_REGISTRY__REGISTRY:
getRegistry().clear();
return;
}
eDynamicUnset(eFeature);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(EStructuralFeature eFeature) {
switch (eDerivedStructuralFeatureID(eFeature)) {
case ExecutionstatePackage.STATE_DETERMINATION_STRATEGY_REGISTRY__REGISTRY:
return registry != null && !registry.isEmpty();
}
return eDynamicIsSet(eFeature);
}
} //StateDeterminationStrategyRegistryImpl
| [
"nistal.nicolas@gmail.com"
] | nistal.nicolas@gmail.com |
8f994ee08560fc835798efd4ab342b9017438904 | 67ae86ea97dc4e9e50b330520428919467a5372e | /src/main/java/com/cbs/edu/examples/patterns/adapter/MyInputStream.java | 4db1103c70ff667aa54a019e98e1962c0e78cb87 | [] | no_license | Dergachov/JavaStudyPro | a17f5a308a815a0f3e54279717dddf83dda8ff06 | 38c1a289c1be07440ad68e3dadebb2c60f0e174c | refs/heads/master | 2020-06-28T19:42:41.314831 | 2017-09-16T13:39:39 | 2017-09-16T13:39:39 | 74,471,695 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 145 | java | package com.cbs.edu.examples.patterns.adapter;
public abstract class MyInputStream {
abstract int read();
abstract int available();
}
| [
"deyneko55@gmail.com"
] | deyneko55@gmail.com |
35973d574e31489aa5ebecac0b5e091840bcdcd9 | f58896f88d2d6c35a673c364458aa4909868a5b3 | /security/RSA/backend-java/src/main/java/com/example/backendjava/BackendJavaApplication.java | 2c23d8e8e652da684be9722edb74cb979681a8aa | [] | permissive | ZQH123196/basic | 6b332db5615056a0dd6b9fdbc27e776cce4cca67 | 32748827321c93eba6cb3c9c9b660037e3392402 | refs/heads/master | 2023-07-10T22:25:18.857952 | 2023-06-25T23:17:35 | 2023-06-25T23:17:35 | 224,331,045 | 0 | 0 | MIT | 2021-04-22T19:21:33 | 2019-11-27T02:54:07 | Dart | UTF-8 | Java | false | false | 326 | java | package com.example.backendjava;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class BackendJavaApplication {
public static void main(String[] args) {
SpringApplication.run(BackendJavaApplication.class, args);
}
}
| [
"zqh123196@gmail.com"
] | zqh123196@gmail.com |
2725ccb013526ae49d9f20f6f2b9c1e2fb3c7d05 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_8e6f84aee7d8f7ae4be4fa5c6029b9dff1fe3130/ZLSwingApplicationWindow/4_8e6f84aee7d8f7ae4be4fa5c6029b9dff1fe3130_ZLSwingApplicationWindow_s.java | 041d8368e1fa078be39c6bb9917d0a1bf39e469e | [] | 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 | 5,264 | java | package org.zlibrary.ui.swing.application;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.WindowEvent;
import java.util.HashMap;
import java.util.Map;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JToolBar;
import javax.swing.WindowConstants;
import org.zlibrary.core.application.ZLApplication;
import org.zlibrary.core.application.ZLApplicationWindow;
import org.zlibrary.core.application.menu.Menu;
import org.zlibrary.core.application.toolbar.ButtonItem;
import org.zlibrary.core.application.toolbar.Item;
import org.zlibrary.options.ZLIntegerRangeOption;
import org.zlibrary.options.ZLOption;
import org.zlibrary.ui.swing.library.ZLSwingLibrary;
import org.zlibrary.ui.swing.view.ZLSwingViewWidget;
public class ZLSwingApplicationWindow extends ZLApplicationWindow {
private JFrame myFrame;
private JToolBar myToolbar;
private Map<Item, Action> myItemActionMap = new HashMap<Item, Action>();
final private ZLIntegerRangeOption myXOption =
new ZLIntegerRangeOption(ZLOption.LOOK_AND_FEEL_CATEGORY, "Options", "XPosition", 0, 2000, 10);
final private ZLIntegerRangeOption myYOption =
new ZLIntegerRangeOption(ZLOption.LOOK_AND_FEEL_CATEGORY, "Options", "YPosition", 0, 2000, 10);
final private ZLIntegerRangeOption myWidthOption =
new ZLIntegerRangeOption(ZLOption.LOOK_AND_FEEL_CATEGORY, "Options", "Width", 10, 2000, 800);
final private ZLIntegerRangeOption myHeightOption =
new ZLIntegerRangeOption(ZLOption.LOOK_AND_FEEL_CATEGORY, "Options", "Height", 10, 2000, 600);
private class ZLFrame extends JFrame {
ZLFrame() {
setSize((int)myWidthOption.getValue(), (int)myHeightOption.getValue());
setLocation((int)myXOption.getValue(), (int)myYOption.getValue());
addComponentListener(new ComponentAdapter() {
public void componentResized(ComponentEvent event) {
Dimension size = getSize();
myWidthOption.setValue(size.width);
myHeightOption.setValue(size.height);
}
public void componentMoved(ComponentEvent event) {
Point point = getLocation();
myXOption.setValue(point.x);
myYOption.setValue(point.y);
}
});
}
protected void processWindowEvent(WindowEvent event) {
if (event.getID() == WindowEvent.WINDOW_CLOSING) {
ZLSwingLibrary.shutdown();
}
super.processWindowEvent(event);
}
}
public ZLSwingApplicationWindow(ZLApplication application) {
super(application);
myFrame = new ZLFrame();
myFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
myToolbar = new JToolBar();
myToolbar.setFloatable(false);
myFrame.getRootPane().setLayout(new BorderLayout());
myFrame.getRootPane().add(myToolbar, BorderLayout.NORTH);
}
public void run() {
myToolbar.setVisible(true);
myFrame.setVisible(true);
}
public void init() {
super.init();
}
public void initMenu() {
for (Menu.Item item : application().getMenubar().items()) {
switch (item.getType()) {
case ITEM:
//System.out.println(((Menubar.PlainItem)item).name());
break;
case SUBMENU:
break;
case SEPARATOR:
break;
}
}
}
public void setCaption(String caption) {
myFrame.setTitle(caption);
}
protected ZLSwingViewWidget createViewWidget() {
ZLSwingViewWidget viewWidget = new ZLSwingViewWidget(ZLSwingViewWidget.Angle.DEGREES0);
myFrame.getRootPane().add(viewWidget.getPanel(), BorderLayout.CENTER);
return viewWidget;
}
public void addToolbarItem(Item item) {
if (item.getType() == Item.Type.BUTTON) {
ButtonItem buttonItem = (ButtonItem)item;
String iconFileName = "icons/toolbar/" + buttonItem.getIconName() + ".png";
java.net.URL iconURL = getClass().getClassLoader().getResource(iconFileName);
ImageIcon icon = (iconURL != null) ? new ImageIcon(iconURL) : new ImageIcon(iconFileName);
Action action = new MyButtonAction(buttonItem);
action.putValue(Action.SMALL_ICON, icon);
myToolbar.add(action);
myItemActionMap.put(item, action);
} else {
myToolbar.addSeparator();
}
}
private class MyButtonAction extends AbstractAction {
private ButtonItem item;
MyButtonAction(ButtonItem item) {
this.item = item;
}
public void actionPerformed(ActionEvent event) {
onButtonPress(item);
}
}
public void setToolbarItemState(Item item, boolean visible, boolean enabled) {
AbstractAction action = (AbstractAction)myItemActionMap.get(item);
action.setEnabled(enabled);
//setVisible()???
// TODO: implement
}
public void setToggleButtonState(ButtonItem item) {
// TODO: implement
}
public void setFullscreen(boolean fullscreen) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
this.myFrame.setSize(screenSize);
}
public boolean isFullscreen() {
return (myFrame.getSize() == Toolkit.getDefaultToolkit().getScreenSize());
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
17ab7d913452d54688206bec8d1a020169ae87d4 | 63b904315830636060a8254ae2ad1919c6bd9979 | /platform-framework-3.0.1-osm/src/main/java/cn/com/qytx/platform/org/domain/base/BaseCompanyInfo.java | 74dae5a20ae04ac7f5ee79d3e6e22b2b569854c3 | [] | no_license | anxingg/online-safe-monitor | a7f07edf64c11963afd3a376a6ce77e8cfdcf1d5 | ab340521bc1a18d82657572eed740ba0356d02d9 | refs/heads/master | 2021-01-21T10:55:07.980749 | 2017-04-16T12:59:40 | 2017-04-16T12:59:40 | 83,502,219 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,071 | java | package cn.com.qytx.platform.org.domain.base;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import cn.com.qytx.platform.base.domain.CompanyId;
/**
* 功能:基本单位信息表
* 版本: 1.0
* 开发人员:贾永强
* 创建日期: 下午2:17:26
* 修改日期:下午2:17:26
* 修改列表:
*/
@MappedSuperclass
public class BaseCompanyInfo implements Serializable {
@CompanyId
@Id
@Column(name = "company_id")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer companyId;
//单位名称
@Column(name="company_name",length=150)
private String companyName;
//单位编码
@Column(name="company_code",length=50)
private String companyCode;
//联系电话
@Column(name="Tel",length=50)
private String tel ;
//地址
@Column(name="Address",length=150)
private String address;
//邮箱
@Column(name="Email",length=50)
private String email;
//说明
@Column(name="Introduction",length=200)
private String introduction;
//log地址
@Column(name="log_Url",length=100)
private String logUrl;
//单位简称
@Column(name="short_name",length=50)
private String shortName;
//联系人
@Column(name="link_man",length=150)
private String linkMan;
@Column(name="philosophy")
private String philosophy;
@Column(name="company_state")
private Integer companyState;
@Column(name="expiration_time")
private Date expirationTime;
@Column(name="insert_time")
private Timestamp insertTime;
@Transient
private String extension;
public String getPhilosophy() {
return philosophy;
}
public void setPhilosophy(String philosophy) {
this.philosophy = philosophy;
}
public String getExtension() {
return extension;
}
public void setExtension(String extension) {
this.extension = extension;
}
public String getLogUrl() {
return logUrl;
}
public void setLogUrl(String logUrl) {
this.logUrl = logUrl;
}
public String getShortName() {
return shortName;
}
public void setShortName(String shortName) {
this.shortName = shortName;
}
public String getLinkMan() {
return linkMan;
}
public void setLinkMan(String linkMan) {
this.linkMan = linkMan;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public String getCompanyName() {
return this.companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getCompanyCode() {
return this.companyCode;
}
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
public Integer getCompanyState() {
return companyState;
}
public void setCompanyState(Integer companyState) {
this.companyState = companyState;
}
public Date getExpirationTime() {
return expirationTime;
}
public void setExpirationTime(Date expirationTime) {
this.expirationTime = expirationTime;
}
public Timestamp getInsertTime() {
return insertTime;
}
public void setInsertTime(Timestamp insertTime) {
this.insertTime = insertTime;
}
} | [
"13683717560@139.com"
] | 13683717560@139.com |
2bddec574f11450a9f66156aa9a1b53c0f670db9 | 74ae24d049cfcab4f477dde92367094890aec688 | /components/phase_management/src/java/tests/com/topcoder/management/phase/accuracytests/MockPhaseHandler.java | cb1def256c1d5d389c35738885e08345e9361a78 | [] | no_license | appirio-tech/direct-app | 8fa562f769db792eb244948f0d375604ac853ef1 | 002aa5e67064a85ed9752d651d86403b1268cf38 | refs/heads/dev | 2023-08-09T20:01:29.514463 | 2022-12-21T01:19:53 | 2022-12-21T01:19:53 | 23,885,120 | 21 | 78 | null | 2022-12-21T01:41:11 | 2014-09-10T17:49:11 | Java | UTF-8 | Java | false | false | 1,555 | java | /*
* Copyright (C) 2006 TopCoder Inc., All Rights Reserved.
*
*/
package com.topcoder.management.phase.accuracytests;
import com.topcoder.management.phase.PhaseHandler;
import com.topcoder.project.phases.Phase;
/**
* <p>
* A mock implementation of PhaseHandler used only for test purpose.
* </p>
* @author Thinfox
* @version 1.0
*/
public class MockPhaseHandler implements PhaseHandler {
/**
* Represents whether operations can be performed for all phases.
*/
private final boolean canPerform;
/**
* Creates a mock instance with the given canPerform flag.
* @param canPerform whether operations can be performed for all phases.
*/
public MockPhaseHandler(boolean canPerform) {
this.canPerform = canPerform;
}
/**
* The handler will provide the decision of whether the start, end or cancel operations can be performed for the
* input phase.
* @param phase phase to test
* @return false always.
*/
public boolean canPerform(Phase phase) {
return this.canPerform;
}
/**
* Extra logic to be used when the phase is starting, ending or canceling. This will be called by the PhaseManager
* implementation at phase change time to perform additional tasks that are due when the input phase has changed
* (moved to the next phase) Do nothing here.
* @param phase phase to apply an operation to
* @param operator operator applying
*/
public void perform(Phase phase, String operator) {
// do nothing.
}
} | [
"hohosky@gmail.com"
] | hohosky@gmail.com |
22620f237c30bfa6915ca4ea4ce116664791d94c | e934ea451331e47c3b22374a1dcb14b7f06468e2 | /server/src/main/java/sf/net/experimaestro/utils/HeapElement.java | c9c45b3a65fb27241e498c7205b80fb1be303d6b | [] | no_license | nicolasdespres/experimaestro | 7ba71b174d598547a9b2e4fdfdf4af8c2b829cd2 | fa0407dac58c5181de7550d23ad5dbdf9d2e7721 | refs/heads/master | 2021-01-17T22:16:13.937657 | 2015-11-25T14:14:41 | 2015-11-25T14:14:41 | 32,166,147 | 0 | 0 | null | 2015-03-13T16:11:39 | 2015-03-13T16:11:39 | null | UTF-8 | Java | false | false | 930 | java | /*
* This file is part of experimaestro.
* Copyright (c) 2012 B. Piwowarski <benjamin@bpiwowar.net>
*
* experimaestro 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.
*
* experimaestro 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 experimaestro. If not, see <http://www.gnu.org/licenses/>.
*/
package sf.net.experimaestro.utils;
/**
* @author bpiwowar
* @date 22/03/2007
*/
public interface HeapElement<E> {
int getIndex();
void setIndex(int index);
} | [
"benjamin@bpiwowar.net"
] | benjamin@bpiwowar.net |
74fc7a8e607fe89c0187c429a51530c2eb73f351 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/33/33_d475daafa3908df8c2adfb535893e9733bae977f/FacebookPersonLoader/33_d475daafa3908df8c2adfb535893e9733bae977f_FacebookPersonLoader_t.java | cf94dd650799810124a251a7fdb5f1f1236c464e | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,641 | java | package com.sk.impl2;
import static com.sk.impl2.FacebookApiLoader.SITE_KEY;
import java.net.MalformedURLException;
import java.net.URL;
import com.google.gson.JsonObject;
import com.sk.parse.IndividualExtractor;
import com.sk.parse.Parsers;
import com.sk.util.DocNavigator;
import com.sk.util.FieldBuilder;
import com.sk.util.PersonalData;
import com.sk.web.IOUtil;
import com.sk.web.Request;
public class FacebookPersonLoader extends IndividualExtractor {
private static final String BASE_URL = "https://graph.facebook.com/%s";
private final Request request;
private JsonObject json;
FacebookPersonLoader(String id) throws MalformedURLException {
String url = String.format(BASE_URL, IOUtil.urlEncode(id));
request = new Request(url, "GET");
request.addHeader("access_token", ApiUtility.getAccessToken(SITE_KEY).getKey());
}
@Override
protected Request getRequest() {
return request;
}
@Override
protected void parse(URL source, String data) {
json = Parsers.parseJSON(data).getAsJsonObject();
}
@Override
protected PersonalData getResult() {
init();
FieldBuilder builder = new FieldBuilder();
PersonalData ret = new PersonalData(SITE_KEY);
for (DocNavigator navigator : navigators) {
navigator.navigate(json, builder);
}
builder.joinNames();
builder.addTo(ret);
return ret;
}
private static final DocNavigator[] navigators = { new DocNavigator("firstName", "first_name"),
new DocNavigator("lastName", "last_name"), new DocNavigator("gender", "gender"),
new DocNavigator("email", "email"), new DocNavigator("id", "id") };
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
18efb8b39eddeacaca25712fd972fcf214b2a420 | 613b90f015f0437fb856a1795c07ac7fc1f5a231 | /spring-in-action/spring-in-actuator/spring-http2-waiter-service/src/main/java/org/fufeng/project/waiter/repository/CoffeeRepository.java | 6c997bedc62035668f0276dddab76c427500cd43 | [] | no_license | LCY2013/spring-in-thinking | f1984e83fd9f082f1ae3b91ef48d6a8204b65843 | b4614a94c56b6784a4a7aca755375d5191a884ad | refs/heads/master | 2023-06-23T04:20:58.539974 | 2023-06-11T02:23:01 | 2023-06-11T02:23:01 | 244,082,628 | 1 | 0 | null | 2022-12-14T20:43:37 | 2020-03-01T03:52:33 | Java | UTF-8 | Java | false | false | 350 | java | package org.fufeng.project.waiter.repository;
import org.fufeng.project.waiter.model.Coffee;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface CoffeeRepository extends JpaRepository<Coffee, Long> {
List<Coffee> findByNameInOrderById(List<String> list);
Coffee findByName(String name);
}
| [
"15281205719@163.com"
] | 15281205719@163.com |
94274ce7a16c36b8192a48371dc722576d81d043 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-14227-3-19-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/com/xpn/xwiki/plugin/activitystream/internal/RecordableEventMigrator_ESTest.java | 2421b86943f500b96702f8715a682486dd8c06ca | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 597 | java | /*
* This file was automatically generated by EvoSuite
* Tue Jan 21 19:23:40 UTC 2020
*/
package com.xpn.xwiki.plugin.activitystream.internal;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class RecordableEventMigrator_ESTest extends RecordableEventMigrator_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
5c61e8d3ee0602fdc7d942c1395b21b46a48b921 | efe2b43b729586f238b79956c9d21e12ed58cb65 | /speechifytek/src/main/java/com/ubtechinc/alpha/speech/ifytek/IfytekConstants.java | fba507910cfff7e7c8b221b05b89acfe955bb55b | [] | no_license | junnikokuki/RobotApplication | a0fe1523ea57eff5d9ce98f7c0acc5dca8366ab6 | 8ee5d2229dbbd9632e30fd71ef8afb2b6ac1874a | refs/heads/master | 2021-06-22T01:05:24.771868 | 2017-08-15T16:28:13 | 2017-08-15T16:28:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,578 | java | package com.ubtechinc.alpha.speech.ifytek;
import android.os.Environment;
import com.iflytek.cloud.SpeechConstant;
/**
* @desc : 科大讯飞配置
* @author: Logic
* @email : logic.peng@ubtech.com
* @time : 2017/7/30
* @modifier:
* @modify_time:
*/
public class IfytekConstants {
//TTS
public static final String VOICENAME_NANA = "nannan";
public static final String VOICENAME_XIAOYAN = "xiaoyan";
public static final String VOICENAME_XIAOFENG = "xiaofeng";
public static final String VOICENAME_CATHERINE = "catherine";
public static final String VOICENAME_JOHN = "john";
public static final String VOICENAME_YBXF1 = "ybxf1";
public final static String DEFAULT_TTS_SPEED = "64";
public final static String DEFAULT_TTS_PITCH = "50";
public final static String DEFAULT_TTS_VOLUME = "80";
public final static String DEFAULT_TTS_LANGUAGE = "zh_cn";
public static final String KEY_GRAMMAR_ABNF_ID = "grammar_abnf_id";
public static final String GRAMMAR_TYPE_ABNF = "abnf";
public static final String GRAMMAR_TYPE_BNF = "bnf";
public static final String mGrammarEngineType = SpeechConstant.TYPE_LOCAL;//语音识别本地还是云识别标志位
public static final int ASR_INIT_PARAM = 1;
public static final String GRAMMAR_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/msc/test5mic";// 本地语法构建路径
public final static int WAKEUP_MAX_VALUE = 60; // 唤醒门限最大值
public final static int WAKEUP_MIN_VALUE = -20; // 唤醒门限最小值
}
| [
"adward.wei@ubtrobot.com"
] | adward.wei@ubtrobot.com |
8fb04d2cd20b7312bfa31f3bfae73754e6a15a49 | 4365604e3579b526d473c250853548aed38ecb2a | /modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/v202011/CreativeWrapperServiceInterfacegetCreativeWrappersByStatement.java | 6b4665f210ea6d5efb484481c698fbaae1f44437 | [
"Apache-2.0"
] | permissive | lmaeda/googleads-java-lib | 6e73572b94b6dcc46926f72dd4e1a33a895dae61 | cc5b2fc8ef76082b72f021c11ff9b7e4d9326aca | refs/heads/master | 2023-08-12T19:03:46.808180 | 2021-09-28T16:48:04 | 2021-09-28T16:48:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,476 | java | // Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.admanager.jaxws.v202011;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* Gets a {@link CreativeWrapperPage} of {@link CreativeWrapper}
* objects that satisfy the given {@link Statement#query}. The following
* fields are supported for filtering:
*
* <table>
* <tr>
* <th scope="col">PQL Property</th> <th scope="col">Object Property</th>
* </tr>
* <tr>
* <td>{@code id}</td>
* <td>{@link CreativeWrapper#id}</td>
* </tr>
* <tr>
* <td>{@code labelId}</td>
* <td>{@link CreativeWrapper#labelId}</td>
* </tr>
* <tr>
* <td>{@code status}</td>
* <td>{@link CreativeWrapper#status}</td>
* </tr>
* <tr>
* <td>{@code ordering}</td>
* <td>{@link CreativeWrapper#ordering}</td>
* </tr>
* </table>
*
* @param filterStatement a Publisher Query Language statement used to filter
* a set of creative wrappers.
* @return the creative wrappers that match the given filter
*
*
* <p>Java class for getCreativeWrappersByStatement element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="getCreativeWrappersByStatement">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="filterStatement" type="{https://www.google.com/apis/ads/publisher/v202011}Statement" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"filterStatement"
})
@XmlRootElement(name = "getCreativeWrappersByStatement")
public class CreativeWrapperServiceInterfacegetCreativeWrappersByStatement {
protected Statement filterStatement;
/**
* Gets the value of the filterStatement property.
*
* @return
* possible object is
* {@link Statement }
*
*/
public Statement getFilterStatement() {
return filterStatement;
}
/**
* Sets the value of the filterStatement property.
*
* @param value
* allowed object is
* {@link Statement }
*
*/
public void setFilterStatement(Statement value) {
this.filterStatement = value;
}
}
| [
"christopherseeley@users.noreply.github.com"
] | christopherseeley@users.noreply.github.com |
759954b002b90a96f4861f71ec57eac9ead3e554 | 1b73e8efd1ec9fbdd2c32162eaf0f8ce30666d08 | /Mosima/Projet_Calibration_M2/src/apache/commons/math3/linear/FieldMatrixPreservingVisitor.java | 8df4510a11033a958a2d3340d99645d637bb5269 | [] | no_license | dtbinh/M2_Androide | 060db9575aa10b8ab0a9707db3e34cc64f5d0e03 | a828b7ff477470c8e00c012dd36d61df2ef7d910 | refs/heads/master | 2020-06-16T05:02:29.653270 | 2016-11-29T11:54:24 | 2016-11-29T11:54:24 | 75,243,702 | 1 | 0 | null | 2016-12-01T01:38:37 | 2016-12-01T01:38:36 | null | UTF-8 | Java | false | false | 2,162 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package apache.commons.math3.linear;
import apache.commons.math3.FieldElement;
/**
* Interface defining a visitor for matrix entries.
*
* @param <T> the type of the field elements
* @version $Id: FieldMatrixPreservingVisitor.java 1416643 2012-12-03 19:37:14Z tn $
* @since 2.0
*/
public interface FieldMatrixPreservingVisitor<T extends FieldElement<?>> {
/**
* Start visiting a matrix.
* <p>This method is called once before any entry of the matrix is visited.</p>
* @param rows number of rows of the matrix
* @param columns number of columns of the matrix
* @param startRow Initial row index
* @param endRow Final row index (inclusive)
* @param startColumn Initial column index
* @param endColumn Final column index (inclusive)
*/
void start(int rows, int columns,
int startRow, int endRow, int startColumn, int endColumn);
/**
* Visit one matrix entry.
* @param row row index of the entry
* @param column column index of the entry
* @param value current value of the entry
*/
void visit(int row, int column, T value);
/**
* End visiting a matrix.
* <p>This method is called once after all entries of the matrix have been visited.</p>
* @return the value that the <code>walkInXxxOrder</code> must return
*/
T end();
}
| [
"keithdae@gmail.com"
] | keithdae@gmail.com |
341f430dbdd79a77fea2f1de7e0f2382b19d209c | d372f8ac87ee96440d0537d2c82a751e350d404f | /org/omg/DynamicAny/DynValueHelper.java | 4882bcc6b67c2076564a56ec39f3ed92360c81f0 | [] | no_license | xiangyuqi22/java_src | 837ea6f6afc93d87dd287cd6898131cee5cce6ea | 9e2e24f9a3afc5f91a25a5c95e1fd181907bcdb7 | refs/heads/master | 2020-05-30T03:09:29.001557 | 2019-05-31T03:09:32 | 2019-05-31T03:09:32 | 189,510,418 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,452 | java | package org.omg.DynamicAny;
/**
* org/omg/DynamicAny/DynValueHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from d:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u77/6540/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl
* Sunday, March 20, 2016 10:02:51 PM PDT
*/
/**
* DynValue objects support the manipulation of IDL non-boxed value types.
* The DynValue interface can represent both null and non-null value types.
* For a DynValue representing a non-null value type, the DynValue's components comprise
* the public and private members of the value type, including those inherited from concrete base value types,
* in the order of definition. A DynValue representing a null value type has no components
* and a current position of -1.
* <P>Warning: Indiscriminantly changing the contents of private value type members can cause the value type
* implementation to break by violating internal constraints. Access to private members is provided to support
* such activities as ORB bridging and debugging and should not be used to arbitrarily violate
* the encapsulation of the value type.
*/
abstract public class DynValueHelper
{
private static String _id = "IDL:omg.org/DynamicAny/DynValue:1.0";
public static void insert (org.omg.CORBA.Any a, org.omg.DynamicAny.DynValue that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static org.omg.DynamicAny.DynValue extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynValueHelper.id (), "DynValue");
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static org.omg.DynamicAny.DynValue read (org.omg.CORBA.portable.InputStream istream)
{
throw new org.omg.CORBA.MARSHAL ();
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.DynamicAny.DynValue value)
{
throw new org.omg.CORBA.MARSHAL ();
}
public static org.omg.DynamicAny.DynValue narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof org.omg.DynamicAny.DynValue)
return (org.omg.DynamicAny.DynValue)obj;
else if (!obj._is_a (id ()))
throw new org.omg.CORBA.BAD_PARAM ();
else
{
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
org.omg.DynamicAny._DynValueStub stub = new org.omg.DynamicAny._DynValueStub ();
stub._set_delegate(delegate);
return stub;
}
}
public static org.omg.DynamicAny.DynValue unchecked_narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof org.omg.DynamicAny.DynValue)
return (org.omg.DynamicAny.DynValue)obj;
else
{
org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
org.omg.DynamicAny._DynValueStub stub = new org.omg.DynamicAny._DynValueStub ();
stub._set_delegate(delegate);
return stub;
}
}
}
| [
"xnaxt@qq.com"
] | xnaxt@qq.com |
a0229196876f0130457d19cc4b29becfa68a1021 | 7e1511cdceeec0c0aad2b9b916431fc39bc71d9b | /flakiness-predicter/input_data/original_tests/square-okhttp/flakyMethods/com.squareup.okhttp.internal.http.URLConnectionTest-contentDisagreesWithChunkedHeader.java | 4b8bd52d81f17c70d55c5cc0075702d62369cf6b | [
"BSD-3-Clause"
] | permissive | Taher-Ghaleb/FlakeFlagger | 6fd7c95d2710632fd093346ce787fd70923a1435 | 45f3d4bc5b790a80daeb4d28ec84f5e46433e060 | refs/heads/main | 2023-07-14T16:57:24.507743 | 2021-08-26T14:50:16 | 2021-08-26T14:50:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 576 | java | @Test public void contentDisagreesWithChunkedHeader() throws IOException {
MockResponse mockResponse=new MockResponse();
mockResponse.setChunkedBody("abc",3);
ByteArrayOutputStream bytesOut=new ByteArrayOutputStream();
bytesOut.write(mockResponse.getBody());
bytesOut.write("\r\nYOU SHOULD NOT SEE THIS".getBytes("UTF-8"));
mockResponse.setBody(bytesOut.toByteArray());
mockResponse.clearHeaders();
mockResponse.addHeader("Transfer-encoding: chunked");
server.enqueue(mockResponse);
server.play();
assertContent("abc",client.open(server.getUrl("/")));
}
| [
"aalsha2@masonlive.gmu.edu"
] | aalsha2@masonlive.gmu.edu |
6248173d4cd23a298aff34574e36010ae3a8cbb3 | 0bffcdd8c5f803627956bd7cec7b28d1cea00dc3 | /src/main/java/android/support/annotation/ColorInt.java | a9b106d01f3c7b03430fa4d8d280b29817aff970 | [] | no_license | sinzua/baseApk | eb5d8c28cdb385ec49413217151ebba7c2fbb723 | 9011fb631ed84b1747561244cc08fff38205e97c | refs/heads/master | 2021-01-21T17:39:20.367401 | 2017-05-21T18:06:26 | 2017-05-21T18:06:26 | 91,977,496 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package android.support.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.FIELD})
public @interface ColorInt {
}
| [
"sinzua@gmail.com"
] | sinzua@gmail.com |
af0e8c67c5941ae4d5fd663f2863bab7bdbd650e | 29acc5b6a535dfbff7c625f5513871ba55554dd2 | /aws-java-sdk-marketplacecommerceanalytics/src/main/java/com/amazonaws/services/marketplacecommerceanalytics/model/transform/GenerateDataSetResultJsonUnmarshaller.java | 584b9780eb6734e8ed3749abb09688d42734fff5 | [
"JSON",
"Apache-2.0"
] | permissive | joecastro/aws-sdk-java | b2d25f6a503110d156853836b49390d2889c4177 | fdbff1d42a73081035fa7b0f172b9b5c30edf41f | refs/heads/master | 2021-01-21T16:52:46.982971 | 2016-01-11T22:55:28 | 2016-01-11T22:55:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,939 | java | /*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.marketplacecommerceanalytics.model.transform;
import java.util.Map;
import java.util.Map.Entry;
import com.amazonaws.services.marketplacecommerceanalytics.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* GenerateDataSetResult JSON Unmarshaller
*/
public class GenerateDataSetResultJsonUnmarshaller implements
Unmarshaller<GenerateDataSetResult, JsonUnmarshallerContext> {
public GenerateDataSetResult unmarshall(JsonUnmarshallerContext context)
throws Exception {
GenerateDataSetResult generateDataSetResult = new GenerateDataSetResult();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL)
return null;
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("dataSetRequestId", targetDepth)) {
context.nextToken();
generateDataSetResult
.setDataSetRequestId(StringJsonUnmarshaller
.getInstance().unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null
|| context.getLastParsedParentElement().equals(
currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return generateDataSetResult;
}
private static GenerateDataSetResultJsonUnmarshaller instance;
public static GenerateDataSetResultJsonUnmarshaller getInstance() {
if (instance == null)
instance = new GenerateDataSetResultJsonUnmarshaller();
return instance;
}
}
| [
"aws@amazon.com"
] | aws@amazon.com |
ee385386eefcc884d7f94930f28761f9ae3c9f12 | c15b74e50f249df767047dcb2564faf6b8166c51 | /src/main/java/com/xwy/four/chapter2/io/netty/chat/server/WebSocketServer.java | 08cd2b14bebdd97c5be66fe493d6b6c0aaff8283 | [] | no_license | never123450/thread | 09c469e97ea1e81d1fdec96bd0784808982540ca | d5727a1643de3a10130166b3b396bac0d294ca63 | refs/heads/master | 2022-07-22T20:06:05.124971 | 2022-07-21T02:33:41 | 2022-07-21T02:33:41 | 204,009,094 | 0 | 0 | null | 2022-07-11T21:09:34 | 2019-08-23T13:57:56 | Java | UTF-8 | Java | false | false | 3,290 | java | /*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.xwy.four.chapter2.io.netty.chat.server;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.util.SelfSignedCertificate;
/**
* A HTTP server which serves Web Socket requests at:
*
* http://localhost:8080/websocket
*
* Open your browser at <a href="http://localhost:8080/">http://localhost:8080/</a>, then the demo page will be loaded
* and a Web Socket connection will be made automatically.
*
* This server illustrates support for the different web socket specification versions and will work with:
*
* <ul>
* <li>Safari 5+ (draft-ietf-hybi-thewebsocketprotocol-00)
* <li>Chrome 6-13 (draft-ietf-hybi-thewebsocketprotocol-00)
* <li>Chrome 14+ (draft-ietf-hybi-thewebsocketprotocol-10)
* <li>Chrome 16+ (RFC 6455 aka draft-ietf-hybi-thewebsocketprotocol-17)
* <li>Firefox 7+ (draft-ietf-hybi-thewebsocketprotocol-10)
* <li>Firefox 11+ (RFC 6455 aka draft-ietf-hybi-thewebsocketprotocol-17)
* </ul>
*/
public final class WebSocketServer {
static final boolean SSL = System.getProperty("ssl") != null;
static final int PORT = Integer.parseInt(System.getProperty("port", SSL? "8443" : "8080"));
public static void main(String[] args) throws Exception {
// Configure SSL.
final SslContext sslCtx;
if (SSL) {
SelfSignedCertificate ssc = new SelfSignedCertificate();
sslCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey()).build();
} else {
sslCtx = null;
}
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.handler(new LoggingHandler(LogLevel.INFO))
.childHandler(new WebSocketServerInitializer(sslCtx));
Channel ch = b.bind(PORT).sync().channel();
System.out.println("Open your web browser and navigate to " +
(SSL? "https" : "http") + "://127.0.0.1:" + PORT + '/');
ch.closeFuture().sync();
} finally {
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}
}
}
| [
"845619585@qq.com"
] | 845619585@qq.com |
b4a5084605a32ff87d9285921013b8b3810123cb | 9faec3651af5a8a8b6621b45a726d8a4af750b50 | /saml/client-adapter/wildfly/wildfly9-subsystem/src/main/java/org/keycloak/subsystem/adapter/saml/extension/KeycloakDependencyProcessorWildFly.java | 163bc055ca4b44483c5ca58629ff7f3a87f70314 | [
"Apache-2.0"
] | permissive | rishiHPE/keycloak | db589dd4fd993073fc0da78684e73f9e6fe8b4de | c6b34f32a1baf9890340fdf4dc75b7517a468a33 | refs/heads/master | 2020-12-28T08:31:25.618739 | 2015-09-30T15:16:44 | 2015-09-30T15:16:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,038 | java | /*
* Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. 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 org.keycloak.subsystem.adapter.saml.extension;
import org.jboss.as.server.deployment.module.ModuleDependency;
import org.jboss.as.server.deployment.module.ModuleSpecification;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoader;
/**
* Add platform-specific modules for WildFly.
*
* @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc.
*/
public class KeycloakDependencyProcessorWildFly extends KeycloakDependencyProcessor {
private static final ModuleIdentifier KEYCLOAK_WILDFLY_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-wildfly-saml-adapter");
private static final ModuleIdentifier KEYCLOAK_UNDERTOW_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-undertow-saml-adapter");
@Override
protected void addPlatformSpecificModules(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) {
// ModuleDependency(ModuleLoader moduleLoader, ModuleIdentifier identifier, boolean optional, boolean export, boolean importServices, boolean userSpecified)
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_WILDFLY_ADAPTER, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_UNDERTOW_ADAPTER, false, false, false, false));
}
}
| [
"bburke@redhat.com"
] | bburke@redhat.com |
dfbdb7b81e1104ad0796c1859fa24702d1a100b0 | b801d688e01ca0ea993c1a84e1bc164967258aff | /javase-sample/grpc-sample/src/main/java/com/github/jitwxs/sample/grpc/pcbook/Rating.java | 7be34871647ce07f39f4acf6a38e5bc495e7e697 | [
"Apache-2.0"
] | permissive | jitwxs/blog-sample | 1a1e4152b48939baa5b09a2704dd089dfbe520ed | 5123346e01a1ec94cc56b5afbd45732487d7ecb8 | refs/heads/master | 2022-02-24T06:04:26.341746 | 2022-02-16T14:11:26 | 2022-02-16T14:11:26 | 131,931,262 | 339 | 243 | Apache-2.0 | 2021-09-20T15:25:44 | 2018-05-03T02:32:58 | Java | UTF-8 | Java | false | false | 458 | java | package com.github.jitwxs.sample.grpc.pcbook;
public class Rating {
private int count;
private double sum;
public Rating(int count, double sum) {
this.count = count;
this.sum = sum;
}
public int getCount() {
return count;
}
public double getSum() {
return sum;
}
public static Rating add(Rating r1, Rating r2) {
return new Rating(r1.count + r2.count, r1.sum + r2.sum);
}
}
| [
"jitwxs@foxmail.com"
] | jitwxs@foxmail.com |
d62fe7fff262159021efdcf2865ebe24370acd53 | 5eb61dc67145c1b1d5a908b803520ba9da83f82d | /Day43_hibernate/test/com/lanou3g/bean/manytomany/UserTest.java | f28e98df504baebccd9bc384381ad63c9dcf0dee | [] | no_license | OnTheRightWay/workspace | 27549e5344a8d56575a5b5798bdabf9fe661872d | f6767929db06f66defdee50dcf87fb7441207e87 | refs/heads/master | 2021-09-09T15:06:33.482564 | 2018-03-17T06:07:57 | 2018-03-17T06:07:57 | 113,117,366 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 797 | java | package com.lanou3g.bean.manytomany;
import com.lanou3g.util.HibernateUtil;
import org.junit.Test;
public class UserTest {
@Test
public void save(){
HibernateUtil.handle(session -> {
User user = new User();
user.setUname("张三");
Role role = new Role();
role.setRname("管理员");
role.getUsers().add(user);
user.getRoles().add(role);
session.save(role);
return null;
});
}
@Test
public void get(){
HibernateUtil.handle(session -> {
User user = session.get(User.class, "402894ea610d818601610d8188a50001");
System.out.println(user.getRoles());
System.out.println(user);
return user;
});
}
} | [
"34029301+OnTheRightWay@users.noreply.github.com"
] | 34029301+OnTheRightWay@users.noreply.github.com |
daf2b98a6edd518169bd09b34f6eff8cf3e3f2d9 | ee461488c62d86f729eda976b421ac75a964114c | /trunk/ProxyWebApp/src/net/sourceforge/htmlunit/proxy/webapp/server/AddLogServlet.java | f0efd802e97a10ac4bf1644867f8da8e35361f83 | [
"Apache-2.0"
] | permissive | svn2github/htmlunit | 2c56f7abbd412e6d9e0efd0934fcd1277090af74 | 6fc1a7d70c08fb50fef1800673671fd9cada4899 | refs/heads/master | 2023-09-03T10:35:41.987099 | 2015-07-26T13:12:45 | 2015-07-26T13:12:45 | 37,107,064 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,743 | java | /*
* Copyright (c) 2010 HtmlUnit team.
*
* 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 net.sourceforge.htmlunit.proxy.webapp.server;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sourceforge.htmlunit.proxy.webapp.shared.LogEntry;
/**
* Servlet to add a log entry.
*
* @author Ahmed Ashour
* @version $Revision$
*/
public class AddLogServlet extends HttpServlet {
private static final long serialVersionUID = -704495463938248705L;
/**
* {@inheritDoc}
*/
@Override
protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {
final Reader reader = req.getReader();
final StringBuilder sb = new StringBuilder();
int ch;
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
reader.close();
LogServiceImpl.addLog(new LogEntry(sb.toString()));
resp.setStatus(HttpServletResponse.SC_OK);
final Writer writer = resp.getWriter();
writer.write("Ok!");
writer.close();
}
}
| [
"asashour@5f5364db-9458-4db8-a492-e30667be6df6"
] | asashour@5f5364db-9458-4db8-a492-e30667be6df6 |
6ad84fa70f4b406d399d5aee08340d0e9bfa5959 | f72971fbab14458776400d240216442d8a46cbe1 | /modules/common/src/main/java/wsimport/lib/amadeus/pnr/read/AirOrginDestType.java | 3b47596ad23dc7b7635dc39081528b56655aaeb6 | [] | no_license | hamzzy/Amadeus-Sabre-Java-Multi-GDS-SDK | cea5ee9f3be520bfbf509d5207adcc7c0f4ec4b8 | a21e706c17b85d99e1ef573f66c88efa9e2918fe | refs/heads/master | 2022-11-05T16:49:24.067050 | 2020-06-28T03:59:13 | 2020-06-28T03:59:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java |
package wsimport.lib.amadeus.pnr.read;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for AirOrginDestType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="AirOrginDestType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="First"/>
* <enumeration value="Intermediate"/>
* <enumeration value="Last"/>
* <enumeration value="Only"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "AirOrginDestType")
@XmlEnum
public enum AirOrginDestType {
@XmlEnumValue("First")
FIRST("First"),
@XmlEnumValue("Intermediate")
INTERMEDIATE("Intermediate"),
@XmlEnumValue("Last")
LAST("Last"),
@XmlEnumValue("Only")
ONLY("Only");
private final String value;
AirOrginDestType(String v) {
value = v;
}
public String value() {
return value;
}
public static AirOrginDestType fromValue(String v) {
for (AirOrginDestType c: AirOrginDestType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"info@brakket.tech"
] | info@brakket.tech |
ba1a76f5cf2bbd347fc2f3842cc4d4438110e31d | 0ff12c4d3965c34db8c92ceebd8b6313c12b7561 | /pulsarang/pulsarang-mom-server/src/main/java/com/pulsarang/mom/store/proc/ConsumerResponseCode.java | 110e5fa794c41ad06738a18fd5776a593809b7ae | [] | no_license | Uncontainer/proto | aba023cf12e8245abe5a72e2a5fd95aaa4b1d25a | a136bd7e4a11782927bc55d9d9cb1e35abe25013 | refs/heads/master | 2021-01-19T19:14:16.693873 | 2015-04-21T01:52:44 | 2015-04-21T01:52:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 844 | java | package com.pulsarang.mom.store.proc;
public enum ConsumerResponseCode {
SUCCESS(200), // 성공적으로 처리.
ACCEPTED(202), // 처리에는 실패하였으나 재처리는 수행하지 않음.
BAD_REQUEST(400), // Event에 필수 정보가 포함되어 있지 않음.
FORBIDDEN(403), // ACL에 없는 Dispatcher로부터 Event가 수신되었을 경우.
NOT_ACCEPTABLE(406), // 선처리 되어야 하는 event를 수신하지 못하였을 경우.
CONFLICT(409), // 이미 처리된 Event.
INTERNAL_SERVER_ERROR(500), // 원인을 알지 못하는 Event 처리 실패.
SERVICE_UNAVAILABLE(503), // 연동 시스템 오류 등으로 인해 event를 처리하지 못하였을 경우. Retry-After 옵션으로 재시도 여부를 알려줄 수 있다.
;
final int code;
ConsumerResponseCode(int code) {
this.code = code;
}
}
| [
"veiner.202@daumkakao.com"
] | veiner.202@daumkakao.com |
00364bab1de9455a35fb59cdece2019915102b71 | 868bf400c0143e6a13c9dc2804726449816e4b68 | /LintCode-master/Java/157. Read N Characters Given Read4.java | ddf5ab0d6309848c384b21d5a29691010dd7d119 | [] | no_license | EngrDevDom/Java-Codes | 7d39efd8fc7f5d9589c34f98adaa71fc923308b9 | ab6934cbe5a3e0330b64cca53738180675a1f74a | refs/heads/master | 2022-12-02T08:14:58.380076 | 2020-08-11T16:02:18 | 2020-08-11T16:02:18 | 286,783,520 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,862 | java | E
tags: String, Enumeration
Read4 题目. 理解题目: 是有个input object buff, 会被populated with data.
#### String in char[] format
- 理解题目: 其实就是track `可以read多少bytes by read4() response`
- 另外一个有用的function `System.arraycopy(src, srcIndex, dest, destIndex, length)`
- Edge Case:
- When there is not enough space to the result buffer, `i + 3 > n`, then only copy what we can: `Math.min(n - i, count)`
- `count < 4` meaning there is not enough content to read, break
```
/*
Given a file and assume that you can only read the file using a given method read4, implement a method to read n characters.
Method read4:
The API read4 reads 4 consecutive characters from the file, then writes those characters into the buffer array buf.
The return value is the number of actual characters read.
Note that read4() has its own file pointer, much like FILE *fp in C.
Definition of read4:
Parameter: char[] buf
Returns: int
Note: buf[] is destination not source, the results from read4 will be copied to buf[]
Below is a high level example of how read4 works:
File file("abcdefghijk"); // File is "abcdefghijk", initially file pointer (fp) points to 'a'
char[] buf = new char[4]; // Create buffer with enough space to store characters
read4(buf); // read4 returns 4. Now buf = "abcd", fp points to 'e'
read4(buf); // read4 returns 4. Now buf = "efgh", fp points to 'i'
read4(buf); // read4 returns 3. Now buf = "ijk", fp points to end of file
Method read:
By using the read4 method, implement the method read that reads n characters from the file and store it in the buffer array buf. Consider that you cannot manipulate the file directly.
The return value is the number of actual characters read.
Definition of read:
Parameters: char[] buf, int n
Returns: int
Note: buf[] is destination not source, you will need to write the results to buf[]
Example 1:
Input: file = "abc", n = 4
Output: 3
Explanation: After calling your read method, buf should contain "abc". We read a total of 3 characters from the file, so return 3. Note that "abc" is the file's content, not buf. buf is the destination buffer that you will have to write the results to.
Example 2:
Input: file = "abcde", n = 5
Output: 5
Explanation: After calling your read method, buf should contain "abcde". We read a total of 5 characters from the file, so return 5.
Example 3:
Input: file = "abcdABCD1234", n = 12
Output: 12
Explanation: After calling your read method, buf should contain "abcdABCD1234". We read a total of 12 characters from the file, so return 12.
Example 4:
Input: file = "leetcode", n = 5
Output: 5
Explanation: After calling your read method, buf should contain "leetc". We read a total of 5 characters from the file, so return 5.
Note:
Consider that you cannot manipulate the file directly, the file is only accesible for read4 but not for read.
The read function will only be called once for each test case.
You may assume the destination buffer array, buf, is guaranteed to have enough space for storing n characters.
*/
/*
- use temp to store all items read, and System.copy into buf.
- track overall progress: i
- if read4 returns < 4, mark end and return.
*/
public class Solution extends Reader4 {
/**
* @param buf Destination buffer
* @param n Maximum number of characters to read
* @return The number of characters read
*/
public int read(char[] buf, int n) {
if (buf == null || n <= 0) return 0;
int i = 0;
while (i < n) {
char[] temp = new char[4];
int count = read4(temp);
int range = i + 3 < n ? count : Math.min(n - i, count);
System.arraycopy(temp, 0, buf, i, range);
i += range;
if (count < 4) break;
}
return i;
}
}
``` | [
"60880034+EngrDevDom@users.noreply.github.com"
] | 60880034+EngrDevDom@users.noreply.github.com |
039203bdc2e6baeff57f7388cca66ba148130ca5 | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/java-design-patterns/learning/7433/RemoteServiceInterface.java | 4ac78c1c8c665795e216e4b3deea0080db0819eb | [] | 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 | 1,377 | java | /**
* The MIT License
* Copyright (c) 2014-2016 Ilkka Seppälä
*
* 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 com.iluwatar.ambassador;
/**
* Interface shared by ({@link RemoteService}) and ({@link ServiceAmbassador}).
*/
interface RemoteServiceInterface {
int FAILURE = -1;
long doRemoteFunction(int value) throws Exception;
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
5e9de921dba2d3d1a6215c49e64cbbee908935fc | 9cde1bef40a72eaa90ad84fc5146ab49fac9e063 | /fess-db-mysql/src/main/java/org/codelibs/fess/db/exbhv/FavoriteLogBhv.java | 13714610c318b60af8b522a52c31d40ec64df9f8 | [] | no_license | SocialSkyInc/fess-db | 307aa23c812eb5f6cd0c85c1e9a90117f2a72932 | 4e3e3e4dd6f7818edd2e02fc43bb97d91e3dac5a | refs/heads/master | 2021-05-11T03:00:23.043498 | 2015-03-29T11:22:29 | 2015-03-29T11:22:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package org.codelibs.fess.db.exbhv;
import org.codelibs.fess.db.bsbhv.BsFavoriteLogBhv;
/**
* The behavior of FAVORITE_LOG.
* <p>
* You can implement your original methods here.
* This class remains when re-generating.
* </p>
* @author DBFlute(AutoGenerator)
*/
public class FavoriteLogBhv extends BsFavoriteLogBhv {
}
| [
"shinsuke@yahoo.co.jp"
] | shinsuke@yahoo.co.jp |
dc1ab381804cb976b4cac27fe1cb58663b9c2e7e | 3d1b6e2dbcfaae60acbb275e708acc0ed024287f | /src/main/java/nirmalya/aatithya/restmodule/inventory/controller/RestStoreMasterController.java | 47b2707352efe6a26ebadfdd79ea4104210520cf | [] | no_license | dhamotharang/restmodule | 8fe4716c3b6bf32325be703604fbf62fe57cf3f4 | df2c2c58d45849e67088eff688a8ad14bd018da5 | refs/heads/master | 2023-02-11T14:33:59.958335 | 2021-01-06T14:50:32 | 2021-01-06T14:50:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,908 | java | package nirmalya.aatithya.restmodule.inventory.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import nirmalya.aatithya.restmodule.common.utils.DataTableRequest;
import nirmalya.aatithya.restmodule.common.utils.DropDownModel;
import nirmalya.aatithya.restmodule.common.utils.JsonResponse;
import nirmalya.aatithya.restmodule.inventory.dao.RestStoreMasterDao;
import nirmalya.aatithya.restmodule.inventory.model.RestStoreMasterModel;
/**
* @author NirmalyaLabs
*
*/
@RestController
@RequestMapping(value = "inventory")
public class RestStoreMasterController {
@Autowired
RestStoreMasterDao storeDao;
Logger logger = LoggerFactory.getLogger(RestStoreMasterController.class);
/*
*
* PostMapping for add get country name
*
*
*/
@RequestMapping(value = "get-country-name", method = { RequestMethod.GET })
public List<DropDownModel> getCountryNameList() {
logger.info("Method : getCountryNameList starts");
logger.info("Method : getCountryNameList ends");
return storeDao.getCountryNameList();
}
/*
*
* Get mapping for get State name
*
*/
@RequestMapping(value = "get-state-name", method = { RequestMethod.GET })
public ResponseEntity<JsonResponse<List<DropDownModel>>> getStoreStateName(@RequestParam String id) {
logger.info("Method : getStoreStateName starts");
logger.info("Method : getStoreStateName ends");
return storeDao.getStoreStateName(id);
}
/*
*
* Get mapping for get District name
*
*/
@RequestMapping(value = "get-district-name", method = { RequestMethod.GET })
public ResponseEntity<JsonResponse<List<DropDownModel>>> getStoreDistrictName(@RequestParam String id) {
logger.info("Method : getStoreDistrictName starts");
logger.info("Method : getStoreDistrictName ends");
return storeDao.getStoreDistrictName(id);
}
/*
* Post Mapping to Add new Store
*
*/
@RequestMapping(value = "/restAddNewStore", method = { RequestMethod.POST })
public ResponseEntity<JsonResponse<Object>> restAddNewStore(@RequestBody RestStoreMasterModel storeMaster) {
logger.info("Method : restAddNewStore starts");
logger.info("Method : restAddNewStore endss");
return storeDao.restAddNewStore(storeMaster);
}
/*
* returns all Store Details
*
*/
@RequestMapping(value = "/getAllStoreDetails", method = { RequestMethod.POST })
public ResponseEntity<JsonResponse<List<RestStoreMasterModel>>> viewStoreMasterDetails(
@RequestBody DataTableRequest request) {
logger.info("Method : viewStoreMasterDetails starts");
logger.info("Method : viewStoreMasterDetails endss");
return storeDao.viewStoreMasterDetails(request);
}
/*
* returns particular store Details in model
*
*/
@RequestMapping(value = "/viewStoreDetailsModal", method = { RequestMethod.GET })
public ResponseEntity<JsonResponse<RestStoreMasterModel>> viewStoreDetailsModal(@RequestParam("id") String id) {
logger.info("Method : viewStoreDetailsModal starts");
logger.info("Method : viewStoreDetailsModal ends");
return storeDao.viewStoreDetailsModal(id);
}
/*
* delete particular store Details
*
*/
@RequestMapping(value = "/deleteStoreDetails", method = { RequestMethod.GET })
public ResponseEntity<JsonResponse<Object>> deleteStoreDetails(@RequestParam String id) {
logger.info("Method : deleteStoreDetails starts");
logger.info("Method : deleteStoreDetails end");
return storeDao.deleteStoreDetails(id);
}
/*
*
* Get mapping for get State Name for edit
*
*
*/
@RequestMapping(value = "get-state-name-editList", method = { RequestMethod.GET })
public List<DropDownModel> getStateNameEditList(@RequestParam String id) {
logger.info("Method : getStateNameEditList starts");
logger.info("Method : getStateNameEditList endss");
return storeDao.getStateNameEditList(id);
}
/*
*
* Get mapping for get District Name for edit
*
*
*/
@RequestMapping(value = "rest-get-distName-editList", method = { RequestMethod.GET })
public List<DropDownModel> getDistNameEditList(@RequestParam String id) {
logger.info("Method : getDistNameEditList starts");
logger.info("Method : getDistNameEditList endss");
return storeDao.getDistNameEditList(id);
}
/*
* returns particular Store for edit
*
*/
@RequestMapping(value = "/editStoreDetails", method = { RequestMethod.GET })
public ResponseEntity<JsonResponse<RestStoreMasterModel>> editStoreDetails(@RequestParam("id") String id) {
logger.info("Method : editStoreDetails starts");
logger.info("Method : editStoreDetails ends");
return storeDao.editStoreDetails(id);
}
/*
*
* PostMapping for add get store name search param
*
*
*/
@RequestMapping(value = "get-store-name", method = { RequestMethod.GET })
public List<DropDownModel> getStoreList() {
logger.info("Method : getStoreList starts");
logger.info("Method : getStoreList ends");
return storeDao.getStoreList();
}
/*
*
* PostMapping for add get state name search param
*
*
*/
@RequestMapping(value = "get-state-search-param", method = { RequestMethod.GET })
public List<DropDownModel> getStateListSearchParam() {
logger.info("Method : getStateListSearchParam starts");
logger.info("Method : getStateListSearchParam ends");
return storeDao.getStateListSearchParam();
}
}
| [
"Nirmalya Labs@DESKTOP-4AJAMHM"
] | Nirmalya Labs@DESKTOP-4AJAMHM |
0340cc1c1c007bcb3279325245e85f22889c46cd | 9c07402f7c91c1d8182e8faa8bd4e3798059330e | /Sprint2ws4/ovs/src/main/java/com/cg/ovs/web/AdminController.java | 8cc942732293686312554c3629c598252ef839bb | [] | no_license | Sriya156/Capg29dec | 823dcc592bc81e2ef32f8ef86fc6018168ed739e | 9587db2c4a0b7a0529238b0a72d6709c84408d68 | refs/heads/master | 2023-03-08T16:26:17.212161 | 2021-02-22T10:59:25 | 2021-02-22T10:59:25 | 326,886,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,264 | java | package com.cg.ovs.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cg.ovs.domain.UserDetail;
import com.cg.ovs.service.UserAdminService;
@RestController
@RequestMapping("ovs/api/Admin")
public class AdminController {
@Autowired
UserAdminService userAdminService;
@GetMapping("/findAll")
public ResponseEntity<?> viewAllUsers() {
Iterable<UserDetail> userDetails =userAdminService.viewAll();
return new ResponseEntity<Iterable>(userDetails,HttpStatus.OK);
}
@GetMapping("/findByRole/{role}")
public ResponseEntity<?> viewAllByRole(@PathVariable int role)
{
if(role==1 || role==2)
{
Iterable<UserDetail> userDetails =userAdminService.viewByRole(role);
System.out.println(userDetails);
return new ResponseEntity<Iterable>(userDetails,HttpStatus.OK);
}
else
{
return new ResponseEntity<String>("Enter role either 1(Admin) or 2(Customer)",HttpStatus.OK);
}
}
} | [
"you@example.com"
] | you@example.com |
2d9d003afc785e092466d96e27fd0c4bf29d7dc4 | 9ad6ab6ccd37fb74e76d72e1d331c2a29802d42a | /src/main/java/net/doubledoordev/d3commands/commands/CommandHighlight.java | 7677bae1cba7018fe8a196bc8a45e4b2b3959b29 | [
"BSD-2-Clause"
] | permissive | DoubleDoorDevelopment/D3Commands | ac2d0e4dd749532bf1eb0e0d721769378bc0c366 | e79d0b8bc2e41bb8148cb731ef7513d4dd9ec44e | refs/heads/master | 2021-01-21T04:54:38.447839 | 2017-08-01T22:08:06 | 2017-08-01T22:08:06 | 22,894,652 | 3 | 4 | null | 2015-07-19T03:27:51 | 2014-08-12T22:30:16 | Java | UTF-8 | Java | false | false | 4,935 | java | /*
* Copyright (c) 2014-2016, Dries007 & DoubleDoorDevelopment
* 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.
*
* 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.
*/
package net.doubledoordev.d3commands.commands;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.network.play.server.SPacketEntityMetadata;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.common.util.FakePlayer;
import javax.annotation.Nullable;
import java.util.List;
public class CommandHighlight extends CommandBase
{
@Override
public String getCommandName()
{
return "highlight";
}
@Override
public String getCommandUsage(ICommandSender icommandsender)
{
return "/highlight [target] [true|false]";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if (args.length == 0)
{
getCommandSenderAsPlayer(sender).setGlowing(getCommandSenderAsPlayer(sender).isGlowing());
sender.addChatMessage(new TextComponentTranslation("d3.cmd.highlight.success", sender.getDisplayName()));
return;
}
if (args.length == 1)
{
try
{
getCommandSenderAsPlayer(sender).setGlowing(parseBoolean(args[0]));
sender.addChatMessage(new TextComponentTranslation("d3.cmd.highlight.success", sender.getDisplayName()));
}
catch (CommandException ignored)
{
for (Entity e : getEntityList(server, sender, args[0]))
{
e.setGlowing(!e.isGlowing());
}
}
return;
}
boolean b = parseBoolean(args[1]);
for (Entity e : getEntityList(server, sender, args[0]))
{
e.setGlowing(b);
}
// target.setGlowing(!target.isGlowing());
//
// DataParameter<Byte> FLAGS = new DataParameter<>(0, DataSerializers.BYTE);
// EntityDataManager dm = target.getDataManager();
// EntityDataManager fake = new EntityDataManager(target);
// fake.register(FLAGS, (byte) (dm.get(FLAGS) & (1 << 6)));
//
// EntityPlayerMP senderMP = getCommandSenderAsPlayer(sender);
//
// SPacketEntityMetadata p = new SPacketEntityMetadata(target.getEntityId(), dm, false);
// senderMP.connection.sendPacket(p);
//
// sender.addChatMessage(new TextComponentTranslation("d3.cmd.highlight.success", target.getDisplayName()));
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public boolean isUsernameIndex(final String[] args, final int userIndex)
{
return userIndex == 0;
}
@Override
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos)
{
if (args.length == 1) return getListOfStringsMatchingLastWord(args, server.getAllUsernames());
if (args.length == 2) return getListOfStringsMatchingLastWord(args, "true", "false");
return super.getTabCompletionOptions(server, sender, args, pos);
}
}
| [
"admin@dries007.net"
] | admin@dries007.net |
3d2141df72f8f6fa3b10fc58003f70f3bc22a656 | 7a3219622ae15913b41af65c326f715fcc661e79 | /똑소리(똑똑하게 소비하는 우리)/app/src/main/java/com/example/sws/gongmoex1/GoodStore/GoodPriceListItem.java | 63785f4b7003dca454f7a49fd1c48f8a1145562e | [
"MIT"
] | permissive | MobileSeoul/2017seoul-65 | 3843d0e1f7e1a26994f9616f0ee23cfbbecf8c5e | e78b38aeced747810d927ccc971b444026cf7f98 | refs/heads/master | 2021-05-05T01:56:15.712241 | 2018-02-01T01:07:22 | 2018-02-01T01:07:22 | 119,763,887 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,157 | java | package com.example.sws.gongmoex1.GoodStore;
/**
* Created by sws on 2017-08-24.
*/
public class GoodPriceListItem {
//착한가게 카드뷰를 위한 모든 정보들을 선언
private String name, image, info, address, pride, way, phone, information;
private int rank;
void setName(String name){
this.name = name;
}
void setImage(String image){
this.image = image;
}
void setAddress(String address) {this.address = address;}
void setRank(int rank){this.rank = rank;}
void setInfo(String info){this.info = info;}
void setPride(String pride){this.pride = pride;}
void setWay(String way){this.way = way;}
void setPhone(String phone){this.phone = phone;}
void setInformation(String information){this.information = information;}
String getName(){return name;}
String getImage(){return image;}
String getAddress(){return address;}
String getInfo(){return info;}
int getRank(){return rank;}
String getPride(){return pride;}
String getWay(){return way;}
String getPhone(){return phone;}
String getInformation(){return information;}
}
| [
"karelin208@naver.com"
] | karelin208@naver.com |
8aa2f9b129dd4a077a6ce6fdc29c3b4e6ece4815 | 3eca6278418d9eef7f5f850b23714a8356ef525f | /tumi/TesoreriaEJB/ejbModule/pe/com/tumi/tesoreria/ingreso/domain/IngresoDetalleInterfaz.java | 41315d067d4b6a88355fccaa7931e621ab5c1f93 | [] | no_license | cdelosrios88/tumiws-bizarq | 2728235b3f3239f12f14b586bb6349e2f9b8cf4f | 7b32fa5765a4384b8d219c5f95327b2e14dd07ac | refs/heads/master | 2021-01-23T22:53:21.052873 | 2014-07-05T05:19:58 | 2014-07-05T05:19:58 | 32,641,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,542 | java | package pe.com.tumi.tesoreria.ingreso.domain;
import java.math.BigDecimal;
import pe.com.tumi.contabilidad.cierre.domain.LibroDiario;
import pe.com.tumi.empresa.domain.Subsucursal;
import pe.com.tumi.empresa.domain.Sucursal;
import pe.com.tumi.framework.negocio.domain.TumiDomain;
import pe.com.tumi.persona.core.domain.Persona;
public class IngresoDetalleInterfaz extends TumiDomain{
private Integer intDocumentoGeneral;
private String strNroDocumento;
private Persona persona;
private Sucursal sucursal;
private Subsucursal subsucursal;
private String strDescripcion;
private BigDecimal bdSubtotal;
private BigDecimal bdMonto;
private Integer intOrden;
private LibroDiario libroDiario;
//Agregado 09.12.2013 JCHAVEZ
private String strDescSucursal;
public Integer getIntDocumentoGeneral() {
return intDocumentoGeneral;
}
public void setIntDocumentoGeneral(Integer intDocumentoGeneral) {
this.intDocumentoGeneral = intDocumentoGeneral;
}
public Persona getPersona() {
return persona;
}
public void setPersona(Persona persona) {
this.persona = persona;
}
public Sucursal getSucursal() {
return sucursal;
}
public void setSucursal(Sucursal sucursal) {
this.sucursal = sucursal;
}
public String getStrDescripcion() {
return strDescripcion;
}
public void setStrDescripcion(String strDescripcion) {
this.strDescripcion = strDescripcion;
}
public BigDecimal getBdSubtotal() {
return bdSubtotal;
}
public void setBdSubtotal(BigDecimal bdSubtotal) {
this.bdSubtotal = bdSubtotal;
}
public Integer getIntOrden() {
return intOrden;
}
public void setIntOrden(Integer intOrden) {
this.intOrden = intOrden;
}
public Subsucursal getSubsucursal() {
return subsucursal;
}
public void setSubsucursal(Subsucursal subsucursal) {
this.subsucursal = subsucursal;
}
public BigDecimal getBdMonto() {
return bdMonto;
}
public void setBdMonto(BigDecimal bdMonto) {
this.bdMonto = bdMonto;
}
public String getStrNroDocumento() {
return strNroDocumento;
}
public void setStrNroDocumento(String strNroDocumento) {
this.strNroDocumento = strNroDocumento;
}
public LibroDiario getLibroDiario() {
return libroDiario;
}
public void setLibroDiario(LibroDiario libroDiario) {
this.libroDiario = libroDiario;
}
public String getStrDescSucursal() {
return strDescSucursal;
}
public void setStrDescSucursal(String strDescSucursal) {
this.strDescSucursal = strDescSucursal;
}
} | [
"cdelosrios@bizarq.com@b3a863b4-f5f8-5366-a268-df30542ed8c1"
] | cdelosrios@bizarq.com@b3a863b4-f5f8-5366-a268-df30542ed8c1 |
28a24b65a37638dcb4fc2a34afd24325e4e8527b | 4b7b00c518a52ed242f59baf9b8091ee47e0c383 | /guiCtrl/src/main/java/com/huari/ui/FourModeView.java | 45c86856130c5074c7bb04bf9ef6337682d8e089 | [] | no_license | xiaotao1234/task628 | f84f5b02836327c1e6410254049573cbfeb28ec7 | 17235dc559eaedf56cdd4321b7b4b62de59b904d | refs/heads/master | 2022-11-13T23:05:01.615459 | 2020-06-28T11:27:12 | 2020-06-28T11:27:12 | 275,572,689 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,889 | java | package com.huari.ui;
import java.util.ArrayList;
import java.util.Map;
import com.huari.diskactivity.R;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
public class FourModeView extends LinearLayout {
View bottomView, headView;
com.huari.ui.SingDrawWave singdrawwave;
Handler handler;
MyListViewAdapter cusadapter;
LinearLayout withlistview;
ListView mylistview;
TextView shixiangdu;// 触摸时,显示触摸点的角度
TextView tabletitlesecond, tabletitlethird, headshowtjmode, headshowmax;
String tjmode;// 统计模式
boolean zhengbeiboolean;
boolean graphshowboolean;
public FourModeView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
ini();
}
public FourModeView(Context context, AttributeSet attrs) {
super(context, attrs);
ini();
}
public FourModeView(Context context) {
super(context);
ini();
}
public void clear() {
DataSave.clear();
headshowmax.setText("");
singdrawwave.postInvalidate();
cusadapter.notifyDataSetChanged();
}
public void setTableTitleSecond(String s) {
tabletitlesecond.setText(s);
}
public void setTableTitleThird(String s) {
tabletitlethird.setText(s);
}
public void tongjimodeswitch(String tjmodename) {
tjmode = tjmodename;
if (tjmode.equals("fudu")) {
headshowtjmode.setText("按最大幅度统计");
tabletitlesecond.setText("幅度(dBuV)");
} else if (tjmode.equals("gailv")) {
headshowtjmode.setText("按最大概率统计");
tabletitlesecond.setText("概率(%)");
} else if (tjmode.equals("zhiliang")) {
headshowtjmode.setText("按最高质量统计");
tabletitlesecond.setText("质量(%)");
}
if (graphshowboolean) {
singdrawwave.setThreeMode(tjmodename);
cusadapter.notifyDataSetChanged();
} else {
cusadapter.notifyDataSetChanged();
singdrawwave.setThreeMode(tjmodename);
}
}
public void setGraphModeShow(boolean graphmode) {
graphshowboolean = graphmode;
singdrawwave.postInvalidate();
cusadapter.notifyDataSetChanged();
if (graphshowboolean) {
singdrawwave.setVisibility(View.VISIBLE);
withlistview.setVisibility(View.INVISIBLE);
} else {
singdrawwave.setVisibility(View.INVISIBLE);
withlistview.setVisibility(View.VISIBLE);
}
}
public void setNorthBoolean(boolean northboolean) {
zhengbeiboolean = northboolean;
singdrawwave.setNorthBoolean(northboolean);
cusadapter.notifyDataSetChanged();
if (northboolean) {
tabletitlethird.setText("正北示向度");
} else {
tabletitlethird.setText("相对示向度");
}
}
private void ini() {
zhengbeiboolean = true;
tjmode = "fudu";
graphshowboolean = true;
setOrientation(VERTICAL);
headView = LayoutInflater.from(getContext()).inflate(
R.layout.headlinearlayout, null);
bottomView = LayoutInflater.from(getContext()).inflate(
R.layout.framelayout, null);// 是一个FrameLayout
mylistview = bottomView.findViewById(R.id.listview);
withlistview = bottomView.findViewById(R.id.listlinear);// 切换
tabletitlesecond = withlistview.findViewById(R.id.innertv2);
tabletitlethird = withlistview.findViewById(R.id.innertv3);
headshowtjmode = headView.findViewById(R.id.tongjimodename);
headshowmax = headView.findViewById(R.id.tv1);
shixiangdu = headView.findViewById(R.id.tv2);
singdrawwave = bottomView.findViewById(R.id.mynewview);// 切换
singdrawwave.setTextView(shixiangdu);
singdrawwave.setThreeMode(tjmode);
singdrawwave.setNorthBoolean(zhengbeiboolean);
if (tjmode.equals("fudu")) {
tabletitlesecond.setText("幅度(dBuV)");
headshowtjmode.setText("按最大幅度统计");
} else if (tjmode.equals("zhiliang")) {
tabletitlesecond.setText("质量(%)");
headshowtjmode.setText("按最高质量统计");
} else if (tjmode.equals("gailv")) {
tabletitlesecond.setText("概率(%)");
headshowtjmode.setText("按最大概率统计");
}
if (zhengbeiboolean) {
tabletitlethird.setText("正北示向度");
} else {
tabletitlethird.setText("相对示向度");
}
if (graphshowboolean) {
singdrawwave.setVisibility(View.VISIBLE);
withlistview.setVisibility(View.INVISIBLE);
} else {
singdrawwave.setVisibility(View.INVISIBLE);
withlistview.setVisibility(View.VISIBLE);
}
cusadapter = new MyListViewAdapter();
mylistview.setAdapter(cusadapter);
addView(headView);
addView(bottomView);
handler = new Handler() {
public void handleMessage(android.os.Message msg) {
if (msg.what == 0x16) {
try {
if (graphshowboolean) {
singdrawwave.postInvalidate();
} else {
cusadapter.notifyDataSetChanged();
}
;
if (tjmode.equals("fudu")) {
headshowmax
.setText("最优值( 正北"
+ DataSave.MaxPlidegree
+ "° / "
+ "相对"
+ DataSave.datamap
.get(DataSave.MaxPlidegree).reldegree
+ "° )");
}
else if (tjmode.equals("zhiliang")) {
headshowmax
.setText("最优值( 正北"
+ DataSave.MaxQuadegree
+ "° / "
+ "相对"
+ DataSave.datamap
.get(DataSave.MaxQuadegree).reldegree
+ "° )");
} else if (tjmode.equals("gailv")) {
headshowmax
.setText("最优值( 正北"
+ DataSave.MaxProdegree
+ "° / "
+ "相对"
+ DataSave.datamap
.get(DataSave.MaxProdegree).reldegree
+ "° )");
}
} catch (Exception e) {
}
}
};
};
}
public void refresh() {
Message msg = new Message();
msg.what = 0x16;
handler.sendMessage(msg);
}
class MyListViewAdapter extends BaseAdapter {
@Override
public int getCount() {
return DataSave.datamap.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View line = LayoutInflater.from(getContext()).inflate(
R.layout.table, null);
TextView tvs1 = line.findViewById(R.id.t1);// 用来显示序号
TextView tvs2 = line.findViewById(R.id.t2);
TextView tvs3 = line.findViewById(R.id.t3);
tvs1.setText(position + 1 + "");
if (tjmode.equals("fudu")) {
ArrayList<Map.Entry<Float, MyData>> list = DataSave
.sortByPli(DataSave.datamap);
tvs2.setText(list.get(position)
.getValue().maxplitude + "");
if (zhengbeiboolean) {
tvs3.setText(list.get(position)
.getKey() + "°");
} else {
tvs3.setText(list.get(position)
.getValue().reldegree + "°");
}
} else if (tjmode.equals("zhiliang")) {
ArrayList<Map.Entry<Float, MyData>> list = DataSave
.sortByQua(DataSave.datamap);
tvs2.setText(list.get(position)
.getValue().maxquality + "");
if (zhengbeiboolean) {
tvs3.setText(list.get(position)
.getKey() + "°");
} else {
tvs3.setText(list.get(position)
.getValue().reldegree + "°");
}
} else if (tjmode.equals("gailv")) {
ArrayList<Map.Entry<Float, MyData>> list = DataSave
.sortByPro(DataSave.datamap);
float g = Math.round(list
.get(position).getValue().count
/ (float) (DataSave.sum) * 100);
tvs2.setText(g + "");
if (zhengbeiboolean) {
tvs3.setText(list.get(position)
.getKey() + "°");
} else {
tvs3.setText(list.get(position)
.getValue().reldegree + "°");
}
}
return line;
}
}
}
| [
"1432049416@qq.com"
] | 1432049416@qq.com |
2104d3e702f9df6add4a556986da95abbb5da676 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/apache/hadoop/hbase/TestLocalHBaseCluster.java | 142775adba7e610ad898f73240fb473d977f707a | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 3,937 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hbase;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.master.HMaster;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.testclassification.MiscTests;
import org.apache.zookeeper.KeeperException;
import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@Category({ MiscTests.class, MediumTests.class })
public class TestLocalHBaseCluster {
@ClassRule
public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestLocalHBaseCluster.class);
private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
/**
* Check that we can start a local HBase cluster specifying a custom master
* and regionserver class and then cast back to those classes; also that
* the cluster will launch and terminate cleanly. See HBASE-6011. Uses the
* HBaseTestingUtility facilities for creating a LocalHBaseCluster with
* custom master and regionserver classes.
*/
@Test
public void testLocalHBaseCluster() throws Exception {
// Set Master class and RegionServer class, and use default values for other options.
StartMiniClusterOption option = StartMiniClusterOption.builder().masterClass(TestLocalHBaseCluster.MyHMaster.class).rsClass(TestLocalHBaseCluster.MyHRegionServer.class).build();
TestLocalHBaseCluster.TEST_UTIL.startMiniCluster(option);
// Can we cast back to our master class?
try {
int val = ((TestLocalHBaseCluster.MyHMaster) (TestLocalHBaseCluster.TEST_UTIL.getHBaseCluster().getMaster(0))).echo(42);
Assert.assertEquals(42, val);
} catch (ClassCastException e) {
Assert.fail("Could not cast master to our class");
}
// Can we cast back to our regionserver class?
try {
int val = ((TestLocalHBaseCluster.MyHRegionServer) (TestLocalHBaseCluster.TEST_UTIL.getHBaseCluster().getRegionServer(0))).echo(42);
Assert.assertEquals(42, val);
} catch (ClassCastException e) {
Assert.fail("Could not cast regionserver to our class");
}
TestLocalHBaseCluster.TEST_UTIL.shutdownMiniCluster();
}
/**
* A private master class similar to that used by HMasterCommandLine when
* running in local mode.
*/
public static class MyHMaster extends HMaster {
public MyHMaster(Configuration conf) throws IOException, InterruptedException, KeeperException {
super(conf);
}
public int echo(int val) {
return val;
}
}
/**
* A private regionserver class with a dummy method for testing casts
*/
public static class MyHRegionServer extends MiniHBaseCluster.MiniHBaseClusterRegionServer {
public MyHRegionServer(Configuration conf) throws IOException, InterruptedException {
super(conf);
}
public int echo(int val) {
return val;
}
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
3c8574caac83f9437f4d1828ca7f8ed17a410cb7 | 98ba1f06a3f1931c08577390c1e8aa3f91043e5b | /tcb/bces/bus/compilation/DispatcherException.java | 40c7f2b4a5cbef233a62119ed33eab5a69b20372 | [
"MIT"
] | permissive | TheCyberBrick/BCES | 545686d5b5ed28b7c2aed567d01f222df03c170c | e987c3bc813d1b5efbff6116e4bf599a18fa1b47 | refs/heads/master | 2021-01-19T01:49:32.008483 | 2019-09-15T10:47:24 | 2019-09-15T10:47:24 | 31,559,272 | 18 | 2 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package tcb.bces.bus.compilation;
/**
* This exception is thrown if something with the dispatcher goes wrong.
*
* @author TCB
*
*/
public class DispatcherException extends RuntimeException {
private static final long serialVersionUID = 4532942017698486145L;
public DispatcherException(String msg) {
super(msg);
}
public DispatcherException(String msg, Exception cause) {
super(msg, cause);
}
}
| [
"samuelboerlin@bluewin.ch"
] | samuelboerlin@bluewin.ch |
4b9640e455effb744e8b72fc9c269737f7596fc0 | 470ea24db48cd0311835f51d23522549f7bd040d | /product/server/src/main/java/com/lchy/product/utils/JsonUtil.java | 83f95daaa8d388d0e5a1e482be416b308222de04 | [] | no_license | noseparte/microservice | d2bd51c6028183b439b7370e4ccfba33dbf06bed | 278ab51d4592cf5cd20bc7305681178f6312ca6d | refs/heads/master | 2021-03-25T10:59:30.416495 | 2020-03-16T04:38:18 | 2020-03-16T04:38:18 | 247,611,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 547 | java | package com.lchy.product.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* Created by 廖师兄
* 2018-02-21 10:40
*/
public class JsonUtil {
private static ObjectMapper objectMapper = new ObjectMapper();
/**
* 转换为json字符串
* @param object
* @return
*/
public static String toJson(Object object) {
try {
return objectMapper.writeValueAsString(object);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return null;
}
}
| [
"noseparte@aliyun.com"
] | noseparte@aliyun.com |
9614c84d6376c69f07eb2e340958ab83b62a0565 | a801e029fb7c1de4f766b309cfb0f7dba4164d99 | /src/test/java/com/ft/config/WebConfigurerTest.java | 834170bf728956d01f5fdd7824187c6780900aa4 | [] | no_license | dinhtrung/smpp-client-conn | 73044d12e4b8aed267826640cd9729e93250074f | 09a8b5c5716b074cd2d177ee1e163a4294b99a7c | refs/heads/master | 2020-05-07T10:04:47.189725 | 2019-04-09T16:06:07 | 2019-04-09T16:06:07 | 180,404,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,523 | java | package com.ft.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import io.undertow.Undertow;
import io.undertow.Undertow.Builder;
import io.undertow.UndertowOptions;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.env.MockEnvironment;
import org.springframework.mock.web.MockServletContext;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.xnio.OptionMap;
import javax.servlet.*;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Unit tests for the WebConfigurer class.
*
* @see WebConfigurer
*/
public class WebConfigurerTest {
private WebConfigurer webConfigurer;
private MockServletContext servletContext;
private MockEnvironment env;
private JHipsterProperties props;
@Before
public void setup() {
servletContext = spy(new MockServletContext());
doReturn(mock(FilterRegistration.Dynamic.class))
.when(servletContext).addFilter(anyString(), any(Filter.class));
doReturn(mock(ServletRegistration.Dynamic.class))
.when(servletContext).addServlet(anyString(), any(Servlet.class));
env = new MockEnvironment();
props = new JHipsterProperties();
webConfigurer = new WebConfigurer(env, props);
}
@Test
public void testStartUpProdServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
webConfigurer.onStartup(servletContext);
}
@Test
public void testStartUpDevServletContext() throws ServletException {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
webConfigurer.onStartup(servletContext);
}
@Test
public void testCustomizeServletContainer() {
env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
assertThat(container.getMimeMappings().get("abs")).isEqualTo("audio/x-mpeg");
assertThat(container.getMimeMappings().get("html")).isEqualTo("text/html;charset=utf-8");
assertThat(container.getMimeMappings().get("json")).isEqualTo("text/html;charset=utf-8");
Builder builder = Undertow.builder();
container.getBuilderCustomizers().forEach(c -> c.customize(builder));
OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions");
assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isNull();
}
@Test
public void testUndertowHttp2Enabled() {
props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0);
UndertowServletWebServerFactory container = new UndertowServletWebServerFactory();
webConfigurer.customize(container);
Builder builder = Undertow.builder();
container.getBuilderCustomizers().forEach(c -> c.customize(builder));
OptionMap.Builder serverOptions = (OptionMap.Builder) ReflectionTestUtils.getField(builder, "serverOptions");
assertThat(serverOptions.getMap().get(UndertowOptions.ENABLE_HTTP2)).isTrue();
}
@Test
public void testCorsFilterOnApiPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
options("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com")
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"))
.andExpect(header().string(HttpHeaders.VARY, "Origin"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true"))
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800"));
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com"));
}
@Test
public void testCorsFilterOnOtherPath() throws Exception {
props.getCors().setAllowedOrigins(Collections.singletonList("*"));
props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE"));
props.getCors().setAllowedHeaders(Collections.singletonList("*"));
props.getCors().setMaxAge(1800L);
props.getCors().setAllowCredentials(true);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/test/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated() throws Exception {
props.getCors().setAllowedOrigins(null);
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
@Test
public void testCorsFilterDeactivated2() throws Exception {
props.getCors().setAllowedOrigins(new ArrayList<>());
MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController())
.addFilters(webConfigurer.corsFilter())
.build();
mockMvc.perform(
get("/api/test-cors")
.header(HttpHeaders.ORIGIN, "other.domain.com"))
.andExpect(status().isOk())
.andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN));
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
fc3690e52c32d961572d6f9d3bc7d3b0d93ea91e | 05112aafa34ab67ba22f8c0b51a53a2a8a7c17c7 | /lib/src/main/java/com/sematec/java/lib/TestConstructorClass.java | 35f84e84cae3babc488ab35f08476ff1017db2a4 | [] | no_license | SirLordPouya/SematecJavaMehr98 | 34f9839a294f5bb1b76ecaab2bb25b37bdcba164 | 213107b82f644e6e126f398d441b449fee3ea374 | refs/heads/master | 2020-08-28T01:47:20.512923 | 2019-10-25T14:30:38 | 2019-10-25T14:30:38 | 217,552,083 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 677 | java | package com.sematec.java.lib;
public class TestConstructorClass {
int teacherId;
String name = "";
public TestConstructorClass(int id) {
teacherId = id;
}
public TestConstructorClass(int id, String teacherName) {
teacherId = id;
name = teacherName;
}
public void nothing() {
}
public String teacherTypeAndName() {
switch (teacherId) {
case 0:
return "RASMI " + name;
case 1:
return "KHOSUSI " + name;
case 2:
return "SAATI " + name;
default:
return "UNKNOWN TEACHER ";
}
}
}
| [
"pouyaheydary@gmail.com"
] | pouyaheydary@gmail.com |
2884ca4abed01bcf6aab6a905f99f29fac8a5d4e | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.socialplatform-base/sources/X/AnonymousClass0ly.java | 4484256250da0350095dc201ecbaced6e3dc64f9 | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 323 | java | package X;
/* renamed from: X.0ly reason: invalid class name */
public class AnonymousClass0ly extends ThreadLocal<C03290lz> {
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // java.lang.ThreadLocal
public final C03290lz initialValue() {
return new C03290lz();
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
415dd7cde8620891d9430d60e5924eb4cf0b65c9 | 64c80fcda57d935fc038245f3873dddc2811e1e0 | /src/main/java/spring/Main.java | 1e975c059b021919d1c13874ffd1183edd3c7d45 | [] | no_license | Jeka1978/db-demo | 0eb996e4ca2a0b2217b8d1e72f500992e8399a57 | 9c7fc72a6f3a196d3b9856c9389e6bca75dc5c7e | refs/heads/master | 2020-12-05T14:57:44.385719 | 2016-08-30T13:38:11 | 2016-08-30T13:38:11 | 66,273,465 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 759 | java | package spring;
import factory.IRobot;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.stereotype.Service;
import spring.quoters.Person;
import spring.quoters.Quoter;
import spring.quoters.StupidService;
import spring.quoters.TalkingRobot;
import java.nio.file.FileSystem;
import java.util.Arrays;
/**
* Created by Evegeny on 26/08/2016.
*/
public class Main {
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("spring");
context.close();
}
}
| [
"papakita2009"
] | papakita2009 |
7cd6d104450ab87e4a3bb74d8cdbc43d1d148cf3 | 3cf1c14c40fa94db9b0a0d5554d6a6e4aa5fe872 | /src/main/java/com/lambda/web/music/Movie.java | 1177a40a6d78f593c772fa32978ac375d7f68daf | [] | no_license | kangyerim/spring40.vue.mybatis.lambda | 6c894a88be89dd41aec662145ddca6dfa102c399 | efe79901a4214bed60dde657b860641f294bb27a | refs/heads/master | 2022-10-08T17:15:15.569284 | 2020-06-02T06:08:50 | 2020-06-02T06:08:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 622 | java | package com.lambda.web.music;
import lombok.*;
import org.springframework.stereotype.Component;
import javax.persistence.*;
@Entity
@Getter
@Setter
@ToString
@NoArgsConstructor
public class Movie {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long movieSeq;
@Column(length = 4)
private String rank;
@Column(length = 100)
private String title;
@Column(length = 10)
private String rankDate;
@Builder
public Movie(String rank, String title, String rankDate) {
this.rank = rank;
this.title = title;
this.rankDate = rankDate;
}
}
| [
"pakjkwan@gmail.com"
] | pakjkwan@gmail.com |
c0e59a0c802027b3e6d996457049dd2b2c228adc | 00b88fa2accabc1c430570c0c994a54375314d89 | /hsweb-authorization/hsweb-authorization-api/src/main/java/org/hswebframework/web/authorization/define/AuthorizeDefinitionCustomizer.java | b0fe8d320955f071e697beb946c1e7263f31e139 | [
"Apache-2.0"
] | permissive | hs-web/hsweb-framework | 07101fbacb592977e6039cbb1c94558b5718fdd6 | e577bc368a91a862927682bf90bda8d17456fccc | refs/heads/master | 2023-08-14T17:43:37.042689 | 2023-08-14T09:22:09 | 2023-08-14T09:22:09 | 49,850,704 | 9,107 | 3,543 | Apache-2.0 | 2023-09-14T08:43:27 | 2016-01-18T03:51:39 | Java | UTF-8 | Java | false | false | 160 | java | package org.hswebframework.web.authorization.define;
public interface AuthorizeDefinitionCustomizer {
void custom(AuthorizeDefinitionContext context);
}
| [
"zh.sqy@qq.com"
] | zh.sqy@qq.com |
68f38fcc4d9478b6507388b964213770141858fb | 78eec81183292baca06303fabf9c9ff857879da8 | /src/com/bit2015/mysite/action/guestbook/DeleteAction.java | 1cf69268cc81d7a449d934c8c3f83d31e22f4dd3 | [] | no_license | NaJungMin/mysite | 63472448bf078a5e92eac6b1d99a52f26203606b | f711eb10d1df2ed45b59396a3ea243dc835b55dd | refs/heads/master | 2020-04-05T22:55:28.041492 | 2015-08-19T06:41:33 | 2015-08-19T06:41:33 | 41,017,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 905 | java | package com.bit2015.mysite.action.guestbook;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.bit2015.mysite.dao.GuestBookDao;
import com.bit2015.web.action.Action;
import com.bit2015.web.util.WebUtil;
public class DeleteAction extends Action {
@Override
public void execute(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try{
String sno = request.getParameter("no");
String password = request.getParameter("password");
GuestBookDao dao = GuestBookDao.getInstance();
dao.delete(sno,password);
WebUtil.redirect(request, response, "guestbook");
}catch(SQLException ex){
System.out.println("db error :"+ex);
}
}
}
| [
"bit@bit-PC"
] | bit@bit-PC |
f61d5e73533c4707aca6e4ebe473b95420e49801 | 39390e1c0bf53d7f2e44b5242f1fb2b47300aaf7 | /trunk/EZMIS/jteap-jhtj/com/jteap/jhtj/bbsj/model/BbSjTs.java | 012d2f0f49645db1e6fa3b4629762c17a9777b90 | [] | no_license | BGCX067/ezmis-svn-to-git | 3e061173c86055de6a1c0204271b3d3276cea7cf | 24b15ab52a8d750a0ce782a6b64226583c859e03 | refs/heads/master | 2021-01-11T11:08:51.702990 | 2015-12-28T14:08:08 | 2015-12-28T14:08:08 | 48,874,376 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,829 | java | package com.jteap.jhtj.bbsj.model;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
@Entity
@Table(name="tj_bbsjts")
public class BbSjTs {
@Id
@GeneratedValue(generator="system-uuid")
@GenericGenerator(name="system-uuid",strategy="uuid")
@Column(name="id")
@Type(type="string")
private String id;
@Column(name="bbindexid")
private String bbindexid;
//可编辑域json字符串[{fd:'',cp:'',tp:''},{fd:'',cp:'',tp:''}]
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name="EDITABLE_LIST", columnDefinition="CLOB", nullable=true)
private String editableInputs;
/**
* cp:caption 标题
* fd:field name字段名称
* ce: cell 单元格 49,6
* tp: type 数据类型 普通字符串01、日期域02、签名日期域03、意见签名域04、不用验证签名域05、需要验证签名域06、数字07、计算域08
* cf : calculate formula 计算公式
* mt : must 是否必填项目 必填01 选填02
* fm: fomat 格式化 适用于数字类型和日期类型,也可是${fdname}222${dt}类似字符串
* st: save type 保存方式 追加01 覆盖02
* ip: is allow input 是否允许键盘输入 允许01 不允许02
* ev: enumValue 枚举值 是,否
* vl: 验证规则 x>10 & x<100等
* dv: default value 默认值 直接填写/通配符配置
* ${personLoginName} 当前登录名称 可使用工号
${sysdt(yyyy-MM-dd hh:mm:ss)} 当前时间
${sNo(####)} 流水号
${UUID32} 32位UUID
*
* <root tn=''>
* <di cp='' fd='' ce='' tp=''fm='' st='' ev='' vl='' dv=''/>
* <di cp='' fd='' ce='' tp=''fm='' st='' ev='' vl='' dv=''/>
* <di cp='' fd='' ce='' tp=''fm='' st='' ev='' vl='' dv=''/>
* </root>
*
*/
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name="EXCEL_DI_XML", columnDefinition="CLOB", nullable=true)
private String excelDataItemXml; //excel数据项xml
public String getExcelDataItemXml() {
return excelDataItemXml;
}
public void setExcelDataItemXml(String excelDataItemXml) {
this.excelDataItemXml = excelDataItemXml;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getEditableInputs() {
return editableInputs;
}
public void setEditableInputs(String editableInputs) {
this.editableInputs = editableInputs;
}
public String getBbindexid() {
return bbindexid;
}
public void setBbindexid(String bbindexid) {
this.bbindexid = bbindexid;
}
}
| [
"you@example.com"
] | you@example.com |
097d6ce7a974403f4f0015a0617c39603a79a61e | b3ec91bb314550d31061036f946a81af04a09405 | /BiglyBT/src/coreFlavor/java/com/biglybt/android/core/az/DNSProvider.java | 6bf9e4fdb7517edd5d8d375778b8b207cef40c1f | [] | no_license | chenyongtaogd/BiglyBT-Android | b956e1f54b8cc3b83ea162fce393e537b074d0b1 | f686442be2320cd1cd9e60441e5a0b969248b531 | refs/heads/master | 2022-04-25T21:52:21.958884 | 2020-05-05T07:22:47 | 2020-05-05T07:22:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,000 | java | /*
* Copyright (c) Azureus Software, Inc, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package com.biglybt.android.core.az;
import java.net.*;
import java.util.*;
import org.xbill.DNS.*;
import com.biglybt.core.util.AENetworkClassifier;
import com.biglybt.core.util.DNSUtils;
import com.biglybt.core.util.DNSUtils.DNSUtilsIntf;
import com.biglybt.core.util.Debug;
import com.biglybt.util.Thunk;
/**
* DNS calls using xbill
* <p/>
* Note: This is formatted similar to DNSUtilsImpl.java in core, for easy
* diff comparison.<br/>
* See https://github.com/BiglySoftware/BiglyBT/blob/master/core/src/com/biglybt/core/util/dns/DNSUtilsImpl.java
*/
public class DNSProvider
implements DNSUtilsIntf
{
private final static int[] REC_ALL = new int[]{ Type.A, Type.AAAA, Type.CNAME };
private final static int[] REC_V4 = new int[]{ Type.A, Type.CNAME };
private final static int[] REC_V6 = new int[]{ Type.AAAA, Type.CNAME };
private final Map<String, Cache> cache_map = new HashMap<>(8);
@Override
public DNSUtils.DNSDirContext
getInitialDirContext()
throws Exception
{
return (new Context(null));
}
@Override
public DNSUtils.DNSDirContext
getDirContextForServer(
String dns_server_ip )
throws Exception
{
return (new Context(dns_server_ip));
}
@Override
public Inet6Address
getIPV6ByName(
String host )
throws UnknownHostException
{
List<Inet6Address> all = getAllIPV6ByName( host );
return( all.get(0));
}
@Override
public Inet4Address
getIPV4ByName(
String host )
throws UnknownHostException
{
List<Inet4Address> all = getAllIPV4ByName( host );
return( all.get(0));
}
public List<Inet6Address>
getAllIPV6ByName(
String host )
throws UnknownHostException
{
try{
List<InetAddress> result = getAllByName( getInitialDirContext(), host, REC_V6 );
if ( result.size() > 0 ){
return((List<Inet6Address>)(Object)result );
}
}catch( Throwable e ){
}
throw( new UnknownHostException( host ));
}
public List<Inet4Address>
getAllIPV4ByName(
String host )
throws UnknownHostException
{
try{
List<InetAddress> result = getAllByName( getInitialDirContext(), host, REC_V4 );
if ( result.size() > 0 ){
return((List<Inet4Address>)(Object)result );
}
}catch( Throwable e ){
}
throw( new UnknownHostException( host ));
}
@Override
public List<InetAddress>
getAllByName(
String host )
throws UnknownHostException
{
try{
return( getAllByName( getInitialDirContext(), host ));
} catch (UnknownHostException e) {
throw (e);
} catch (Throwable e) {
throw (new UnknownHostException(
host + ": " + Debug.getNestedExceptionMessage(e)));
}
}
@Override
public List<InetAddress>
getAllByName(
DNSUtils.DNSDirContext context,
String host )
throws UnknownHostException
{
List<InetAddress> result = getAllByName( context, host, REC_ALL );
if ( result.size() > 0 ){
return( result );
}
throw( new UnknownHostException( host ));
}
private List<InetAddress>
getAllByName(
DNSUtils.DNSDirContext context,
String host,
int[] attributes )
throws UnknownHostException
{
if ( AENetworkClassifier.categoriseAddress( host ) != AENetworkClassifier.AT_PUBLIC ){
throw( new UnknownHostException( host ));
}
List<InetAddress> result = new ArrayList<>();
getAllByNameSupport(context, host, attributes, 1, result);
return( result );
}
private void
getAllByNameSupport(
DNSUtils.DNSDirContext context,
String host,
int[] attributes,
int depth,
List<InetAddress> result )
throws UnknownHostException
{
if ( depth > 16 ){
return;
}
try{
String server = ((Context) context).getServer();
for (int attribute : attributes) {
Lookup lookup = new Lookup(host, attribute);
lookup.setResolver(new SimpleResolver(server));
setCache(server, lookup);
lookup.run();
Record[] a_results = lookup.getAnswers();
if (a_results == null) {
continue;
}
for (Record r : a_results) {
if (r instanceof CNAMERecord) {
String value = ((CNAMERecord) r).getTarget().toString();
getAllByNameSupport(context, value, attributes, depth+1, result);
} else if (r instanceof ARecord) {
result.add(((ARecord) r).getAddress());
} else if (r instanceof AAAARecord) {
result.add(((AAAARecord) r).getAddress());
}
}
}
}catch( Throwable e ){
throw (new UnknownHostException(
host + ": " + Debug.getNestedExceptionMessage(e)));
}
}
@Override
public List<String>
getTXTRecords(
String query )
{
List<String> result = new ArrayList<>();
try{
Lookup l = new Lookup(query, Type.TXT);
setCache(null, l);
l.run();
Record[] records = l.getAnswers();
if (records != null) {
for (Record r : records) {
TXTRecord txt = (TXTRecord) r;
result.addAll((List<String>) txt.getStrings());
}
}
}catch( Throwable e ){
}
return( result );
}
@Override
public String
getTXTRecord(
String query )
throws UnknownHostException
{
try{
Lookup l = new Lookup(query, Type.TXT);
setCache(null, l);
l.run();
Record[] records = l.getAnswers();
if (records != null) {
for (Record r : records) {
TXTRecord txt = (TXTRecord) r;
List<String> strs = (List<String>) txt.getStrings();
if (strs.size() > 0) {
return (strs.get(0));
}
}
}
throw( new UnknownHostException( "DNS query returned no results" ));
}catch( Throwable e ){
throw( new UnknownHostException(
query + ": " + Debug.getNestedExceptionMessage(e)));
}
}
private void setCache(String server, Lookup lookup) {
if (server != null) {
Cache cache;
synchronized (cache_map) {
cache = cache_map.get(server);
if (cache == null) {
cache = new Cache();
cache_map.put(server, cache);
}
}
lookup.setCache(cache);
}
}
@Thunk
class Context
implements DNSUtils.DNSDirContext
{
private final String server;
@Thunk
Context(String _server) {
server = _server;
}
@Thunk
String getServer() {
return (server);
}
@Override
public String getString() {
return (server == null ? "<default>" : server); //NON-NLS
}
}
}
| [
"725353+TuxPaper@users.noreply.github.com"
] | 725353+TuxPaper@users.noreply.github.com |
4edc3424f2aebaae8c6d8bbe31192260099f441e | fed41971c78ff70c701d754cfd023e3ea671ee85 | /gd-customer-service/src/main/java/com/gudeng/commerce/gd/customer/service/impl/AppactivitystatServiceImpl.java | 62d9e3a5d3072862f7a372103c5bbcfd12a8368d | [] | no_license | f3226912/gd | 204647c822196b52513e5f0f8e475b9d47198d2a | 882332a9da91892a38e38443541d93ddd91c7fec | refs/heads/master | 2021-01-19T06:47:44.052835 | 2017-04-07T03:42:12 | 2017-04-07T03:42:12 | 87,498,686 | 0 | 6 | null | null | null | null | UTF-8 | Java | false | false | 2,439 | java | package com.gudeng.commerce.gd.customer.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.gudeng.commerce.gd.customer.dao.BaseDao;
import com.gudeng.commerce.gd.customer.dto.AppactivitystatDTO;
import com.gudeng.commerce.gd.customer.entity.AppactivitystatEntity;
import com.gudeng.commerce.gd.customer.service.AppactivitystatService;
/**
* 谷登科技代码生成器出品,模板不代表正确,请酌情修改
*
* @author lidong
*
*/
public class AppactivitystatServiceImpl implements AppactivitystatService {
@Autowired
private BaseDao<?> baseDao;
@Override
public AppactivitystatDTO getById(String id) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", id);
return baseDao.queryForObject("AppactivitystatEntity.getById", map, AppactivitystatDTO.class);
}
@Override
public List<AppactivitystatDTO> getList(Map<String, Object> map) throws Exception {
return baseDao.queryForList("AppactivitystatEntity.getList", map, AppactivitystatDTO.class);
}
@Override
public int deleteById(String id) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", id);
return baseDao.execute("AppactivitystatEntity.deleteById", map);
}
@Override
public int deleteBatch(List<String> list) throws Exception {
int len = list.size();
Map<String, Object>[] batchValues = new HashMap[len];
for (int i = 0; i < len; i++) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", StringUtils.trim(list.get(i)));
batchValues[i] = map;
}
return baseDao.batchUpdate("AppactivitystatEntity.deleteById", batchValues).length;
}
@Override
public int update(AppactivitystatDTO t) throws Exception {
return baseDao.execute("AppactivitystatEntity.update", t);
}
@Override
public int getTotal(Map<String, Object> map) throws Exception {
return baseDao.queryForObject("AppactivitystatEntity.getTotal", map, Integer.class);
}
@Override
public Long insert(AppactivitystatEntity entity) throws Exception {
return baseDao.persist(entity, Long.class);
}
@Override
public List<AppactivitystatDTO> getListPage(Map<String, Object> map) throws Exception {
return baseDao.queryForList("AppactivitystatEntity.getListPage", map, AppactivitystatDTO.class);
}
} | [
"253332973@qq.com"
] | 253332973@qq.com |
31eccc0a855c4aecf0765c299646da4a2e912b7d | 012e9bd5bfbc5ceca4e36af55a7ddf4fce98b403 | /code/app/src/main/java/com/yzb/card/king/bean/ticket/SortType.java | 2710f021b0d1f35df74c11e2be97b9bbfca8af31 | [] | no_license | litliang/ms | a7152567c2f0e4d663efdda39503642edd33b4b6 | d7483bc76d43e060906c47acc1bc2c3179838249 | refs/heads/master | 2021-09-01T23:51:50.934321 | 2017-12-29T07:30:49 | 2017-12-29T07:30:49 | 115,697,248 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | package com.yzb.card.king.bean.ticket;
/**
* 描述:
* 作者:殷曙光
* 日期:2016/10/11 11:12
*/
public class SortType implements IFilterPopItem
{
private String code;
private String name;
private int sortIndex = 0;
public SortType()
{
}
public SortType(String code, String name)
{
this.code = code;
this.name = name;
}
public SortType(String code, String name,int sortIndex)
{
this.code = code;
this.name = name;
this.sortIndex = sortIndex;
}
public int getSortIndex()
{
return sortIndex;
}
public void setSortIndex(int sortIndex)
{
this.sortIndex = sortIndex;
}
public String getCode()
{
return code;
}
public void setCode(String code)
{
this.code = code;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
// @Override
// public String getItemName()
// {
// return name;
// }
}
| [
"864631546@qq.com"
] | 864631546@qq.com |
6428d754d5e291993478230a28512b55a2940972 | c395e83cb3f17ec9d61dccae2b5480cfb213a1fb | /springboot3-demo/mybatis-demo/src/main/java/com/example/dao/UserSqlProvider.java | 7ce5c9b88302c8deee12c8d1f390a47a0ec00d71 | [
"MIT"
] | permissive | hanqunfeng/springbootchapter | ea62c04f1364c3d48d4ba5245bb0dca4e2aa7d7f | 3d81dbc0644c923b2b808112e58045690408a78b | refs/heads/master | 2023-08-31T01:19:48.933309 | 2023-08-29T10:11:28 | 2023-08-29T10:11:28 | 246,488,567 | 9 | 10 | MIT | 2023-06-26T03:37:34 | 2020-03-11T06:04:37 | Java | UTF-8 | Java | false | false | 1,768 | java | package com.example.dao;
import com.example.model.User;
import org.apache.ibatis.jdbc.SQL;
public class UserSqlProvider {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
*/
public String insertSelective(User record) {
SQL sql = new SQL();
sql.INSERT_INTO("user");
if (record.getId() != null) {
sql.VALUES("id", "#{id,jdbcType=BIGINT}");
}
if (record.getName() != null) {
sql.VALUES("name", "#{name,jdbcType=VARCHAR}");
}
if (record.getAge() != null) {
sql.VALUES("age", "#{age,jdbcType=INTEGER}");
}
if (record.getEmail() != null) {
sql.VALUES("email", "#{email,jdbcType=VARCHAR}");
}
if (record.getDel() != null) {
sql.VALUES("del", "#{del,jdbcType=VARCHAR}");
}
return sql.toString();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
*/
public String updateByPrimaryKeySelective(User record) {
SQL sql = new SQL();
sql.UPDATE("user");
if (record.getName() != null) {
sql.SET("name = #{name,jdbcType=VARCHAR}");
}
if (record.getAge() != null) {
sql.SET("age = #{age,jdbcType=INTEGER}");
}
if (record.getEmail() != null) {
sql.SET("email = #{email,jdbcType=VARCHAR}");
}
if (record.getDel() != null) {
sql.SET("del = #{del,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
}
| [
"hanqf2008@163.com"
] | hanqf2008@163.com |
b3980a4e6b5ee3367329a2b9d48ae09eb7aecd88 | 9d04ff8392d5060a057c3c07acee48bf9140a1fb | /hapi-fhir-base/src/main/java/ca/uhn/fhir/model/view/ViewGenerator.java | 94251143d37b0850a43f9b9f4d38fb3d912fcb7c | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | pogo61/hapi-fhir | 3fab60dead0ca3ad0a0453d645639a6c80a18b99 | 46602c777ffccc94b81497928c7bd750a55b0bb4 | refs/heads/master | 2021-01-15T08:35:56.257518 | 2015-06-17T20:28:15 | 2015-06-17T20:28:15 | 37,580,597 | 0 | 0 | null | 2015-06-17T07:50:28 | 2015-06-17T07:50:28 | null | UTF-8 | Java | false | false | 4,065 | java | package ca.uhn.fhir.model.view;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2015 University Health Network
* %%
* 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.
* #L%
*/
import java.util.List;
import org.hl7.fhir.instance.model.api.IBase;
import ca.uhn.fhir.context.BaseRuntimeChildDefinition;
import ca.uhn.fhir.context.BaseRuntimeElementCompositeDefinition;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.RuntimeChildDeclaredExtensionDefinition;
import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.ExtensionDt;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
public class ViewGenerator {
private FhirContext myCtx;
public ViewGenerator(FhirContext theFhirContext) {
myCtx=theFhirContext;
}
public <T extends IResource> T newView(IResource theResource, Class<T> theTargetType) {
Class<? extends IResource> sourceType = theResource.getClass();
RuntimeResourceDefinition sourceDef = myCtx.getResourceDefinition(theResource);
RuntimeResourceDefinition targetDef = myCtx.getResourceDefinition(theTargetType);
if (sourceType.equals(theTargetType)) {
@SuppressWarnings("unchecked")
T resource = (T) theResource;
return resource;
}
T retVal;
try {
retVal = theTargetType.newInstance();
} catch (InstantiationException e) {
throw new ConfigurationException("Failed to instantiate " + theTargetType, e);
} catch (IllegalAccessException e) {
throw new ConfigurationException("Failed to instantiate " + theTargetType, e);
}
copyChildren(sourceDef, (BaseElement) theResource, targetDef, (BaseElement) retVal);
return retVal;
}
private void copyChildren(BaseRuntimeElementCompositeDefinition<?> theSourceDef, BaseElement theSource, BaseRuntimeElementCompositeDefinition<?> theTargetDef, BaseElement theTarget) {
if (!theSource.isEmpty()) {
List<BaseRuntimeChildDefinition> targetChildren = theTargetDef.getChildren();
for (BaseRuntimeChildDefinition nextChild : targetChildren) {
String elementName = nextChild.getElementName();
if (nextChild.getValidChildNames().size() > 1) {
elementName = nextChild.getValidChildNames().iterator().next();
}
BaseRuntimeChildDefinition sourceChildEquivalent = theSourceDef.getChildByNameOrThrowDataFormatException(elementName);
if (sourceChildEquivalent == null) {
continue;
}
List<? extends IBase> sourceValues = sourceChildEquivalent.getAccessor().getValues(theSource);
for (IBase nextElement : sourceValues) {
nextChild.getMutator().addValue(theTarget, nextElement);
}
}
List<RuntimeChildDeclaredExtensionDefinition> targetExts = theTargetDef.getExtensions();
for (RuntimeChildDeclaredExtensionDefinition nextExt : targetExts) {
String url = nextExt.getExtensionUrl();
RuntimeChildDeclaredExtensionDefinition sourceDeclaredExt = theSourceDef.getDeclaredExtension(url);
if (sourceDeclaredExt == null) {
for (ExtensionDt next : theSource.getAllUndeclaredExtensions()) {
if (next.getUrlAsString().equals(url)) {
nextExt.getMutator().addValue(theTarget, next.getValue());
}
}
} else {
List<? extends IBase> values = sourceDeclaredExt.getAccessor().getValues(theSource);
for (IBase nextElement : values) {
nextExt.getMutator().addValue(theTarget, nextElement);
}
}
}
}
}
}
| [
"jamesagnew@gmail.com"
] | jamesagnew@gmail.com |
75b5337a85ebe1b889d27de3a57be0dd7f4a64d9 | 1af49694004c6fbc31deada5618dae37255ce978 | /chrome/browser/download/internal/android/java/src/org/chromium/chrome/browser/download/home/DownloadManagerCoordinatorImpl.java | dfd55e26fd708df40b638459ac4c1d342027c724 | [
"BSD-3-Clause"
] | permissive | sadrulhc/chromium | 59682b173a00269ed036eee5ebfa317ba3a770cc | a4b950c23db47a0fdd63549cccf9ac8acd8e2c41 | refs/heads/master | 2023-02-02T07:59:20.295144 | 2020-12-01T21:32:32 | 2020-12-01T21:32:32 | 317,678,056 | 3 | 0 | BSD-3-Clause | 2020-12-01T21:56:26 | 2020-12-01T21:56:25 | null | UTF-8 | Java | false | false | 8,036 | java | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.download.home;
import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.Callback;
import org.chromium.base.DiscardableReferencePool;
import org.chromium.base.ObserverList;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.base.supplier.ObservableSupplier;
import org.chromium.base.task.PostTask;
import org.chromium.chrome.browser.download.home.filter.Filters;
import org.chromium.chrome.browser.download.home.filter.Filters.FilterType;
import org.chromium.chrome.browser.download.home.list.DateOrderedListCoordinator;
import org.chromium.chrome.browser.download.home.list.DateOrderedListCoordinator.DateOrderedListObserver;
import org.chromium.chrome.browser.download.home.list.ListItem;
import org.chromium.chrome.browser.download.home.snackbars.DeleteUndoCoordinator;
import org.chromium.chrome.browser.download.home.toolbar.ToolbarCoordinator;
import org.chromium.chrome.browser.download.internal.R;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate;
import org.chromium.components.feature_engagement.Tracker;
import org.chromium.components.offline_items_collection.OfflineContentProvider;
import org.chromium.components.prefs.PrefService;
import org.chromium.content_public.browser.UiThreadTaskTraits;
import org.chromium.ui.modaldialog.ModalDialogManager;
import java.io.Closeable;
/**
* The top level coordinator for the download home UI. This is currently an in progress class and
* is not fully fleshed out yet.
*/
class DownloadManagerCoordinatorImpl
implements DownloadManagerCoordinator, ToolbarCoordinator.ToolbarActionDelegate {
private final ObserverList<Observer> mObservers = new ObserverList<>();
private final DateOrderedListCoordinator mListCoordinator;
private final DeleteUndoCoordinator mDeleteCoordinator;
private final ToolbarCoordinator mToolbarCoordinator;
private final SelectionDelegate<ListItem> mSelectionDelegate;
private final Activity mActivity;
private final Callback<Context> mSettingsLauncher;
private ViewGroup mMainView;
private boolean mMuteFilterChanges;
/** Builds a {@link DownloadManagerCoordinatorImpl} instance. */
public DownloadManagerCoordinatorImpl(Activity activity, DownloadManagerUiConfig config,
ObservableSupplier<Boolean> isPrefetchEnabledSupplier,
Callback<Context> settingsLauncher, SnackbarManager snackbarManager,
ModalDialogManager modalDialogManager, PrefService prefService, Tracker tracker,
FaviconProvider faviconProvider, OfflineContentProvider provider,
LegacyDownloadProvider legacyProvider,
DiscardableReferencePool discardableReferencePool) {
mActivity = activity;
mSettingsLauncher = settingsLauncher;
mDeleteCoordinator = new DeleteUndoCoordinator(snackbarManager);
mSelectionDelegate = new SelectionDelegate<ListItem>();
mListCoordinator = new DateOrderedListCoordinator(mActivity, config,
isPrefetchEnabledSupplier, provider, legacyProvider,
mDeleteCoordinator::showSnackbar, mSelectionDelegate, this::notifyFilterChanged,
createDateOrderedListObserver(), modalDialogManager, prefService, faviconProvider,
discardableReferencePool);
mToolbarCoordinator = new ToolbarCoordinator(mActivity, this, mListCoordinator,
mSelectionDelegate, config.isSeparateActivity, tracker);
initializeView();
if (config.startWithPrefetchedContent) {
updateForUrl(Filters.toUrl(Filters.FilterType.PREFETCHED));
}
RecordUserAction.record("Android.DownloadManager.Open");
}
/**
* Creates the top level layout for download home including the toolbar.
* TODO(crbug.com/880468) : Investigate if it is better to do in XML.
*/
private void initializeView() {
mMainView = new FrameLayout(mActivity);
mMainView.setBackgroundColor(
ApiCompatibilityUtils.getColor(mActivity.getResources(), R.color.default_bg_color));
FrameLayout.LayoutParams listParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
listParams.setMargins(0,
mActivity.getResources().getDimensionPixelOffset(
R.dimen.selectable_list_toolbar_height),
0, 0);
mMainView.addView(mListCoordinator.getView(), listParams);
FrameLayout.LayoutParams toolbarParams = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT);
toolbarParams.gravity = Gravity.TOP;
mMainView.addView(mToolbarCoordinator.getView(), toolbarParams);
}
private DateOrderedListObserver createDateOrderedListObserver() {
return new DateOrderedListObserver() {
@Override
public void onListScroll(boolean canScrollUp) {
if (mToolbarCoordinator == null) return;
mToolbarCoordinator.setShowToolbarShadow(canScrollUp);
}
@Override
public void onEmptyStateChanged(boolean isEmpty) {
if (mToolbarCoordinator == null) return;
mToolbarCoordinator.setSearchEnabled(!isEmpty);
}
};
}
// DownloadManagerCoordinator implementation.
@Override
public void destroy() {
mDeleteCoordinator.destroy();
mListCoordinator.destroy();
mToolbarCoordinator.destroy();
}
@Override
public View getView() {
return mMainView;
}
@Override
public boolean onBackPressed() {
if (mListCoordinator.handleBackPressed()) return true;
if (mToolbarCoordinator.handleBackPressed()) return true;
return false;
}
@Override
public void updateForUrl(String url) {
try (FilterChangeBlock block = new FilterChangeBlock()) {
mListCoordinator.setSelectedFilter(Filters.fromUrl(url));
}
}
@Override
public void addObserver(Observer observer) {
mObservers.addObserver(observer);
PostTask.postTask(UiThreadTaskTraits.DEFAULT,
() -> observer.onUrlChanged(Filters.toUrl(mListCoordinator.getSelectedFilter())));
}
@Override
public void removeObserver(Observer observer) {
mObservers.removeObserver(observer);
}
// ToolbarActionDelegate implementation.
@Override
public void close() {
mActivity.finish();
}
@Override
public void openSettings() {
RecordUserAction.record("Android.DownloadManager.Settings");
mSettingsLauncher.onResult(mActivity);
}
private void notifyFilterChanged(@FilterType int filter) {
mSelectionDelegate.clearSelection();
if (mMuteFilterChanges) return;
String url = Filters.toUrl(filter);
for (Observer observer : mObservers) observer.onUrlChanged(url);
}
/**
* Helper class to mute state changes when processing a state change request from an external
* source.
*/
private class FilterChangeBlock implements Closeable {
private final boolean mOriginalMuteFilterChanges;
public FilterChangeBlock() {
mOriginalMuteFilterChanges = mMuteFilterChanges;
mMuteFilterChanges = true;
}
@Override
public void close() {
mMuteFilterChanges = mOriginalMuteFilterChanges;
}
}
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
27facf2be09e68842f616f433be1aa2c1247c300 | eb436284ad4e2a8836642e48fb1a7827cf0af43b | /src/com/ukettle/widget/kettle/service/KettleLogsService.java | b58de61e121645ee550020aa6e41381e45ba1631 | [] | no_license | superjili/Kettle | 9cf175770a8f460126ed2de432e0aebcd98569da | f07d6129264001306afd77c9c31f5565ef60ce61 | refs/heads/master | 2021-01-13T04:34:33.867672 | 2015-11-27T05:11:36 | 2015-11-27T05:11:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 162 | java | package com.ukettle.widget.kettle.service;
import com.ukettle.basics.base.service.BaseService;
public interface KettleLogsService<T> extends BaseService<T> {
} | [
"839536@qq.com"
] | 839536@qq.com |
11e327d86734f36f5be35efcd6ffa25004afc7eb | 528fd272a727f0c1517b5cad58d6a95a099400e5 | /extensions/servlet/src/main/java/com/stormpath/shiro/servlet/config/IniPropertiesSource.java | 0d8c9b2e86504cf90f9699746c6533c114400f2a | [
"Apache-2.0"
] | permissive | stormpath/stormpath-shiro | 15ffd1867c63c0e21348354246e25e24ab190915 | 7a3c4fd3bd0ed9bb4546932495c79e6ad6fa1a92 | refs/heads/master | 2023-08-10T14:57:41.803295 | 2017-03-06T15:03:49 | 2017-03-06T15:03:49 | 4,142,377 | 29 | 41 | null | 2016-10-17T18:04:26 | 2012-04-25T23:34:10 | Java | UTF-8 | Java | false | false | 2,170 | java | /*
* Copyright 2012 Stormpath, 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.stormpath.shiro.servlet.config;
import com.stormpath.sdk.impl.config.PropertiesSource;
import org.apache.shiro.config.Ini;
import org.apache.shiro.util.CollectionUtils;
import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;
/**
* A {@link PropertiesSource} that returns all <code>stormpath.*</code> attributes contained withing the
* <code>[stormpath]</code> section of an {@link Ini} object (typically a shiro.ini file).
*
* @since 0.7.0
*/
public class IniPropertiesSource implements PropertiesSource {
final private Ini ini;
final private static String STORMPATH_CONFIG_SECTION_NAME = "stormpath";
public IniPropertiesSource(Ini ini) {
this.ini = ini;
}
@Override
public Map<String, String> getProperties() {
if (CollectionUtils.isEmpty(ini)) {
return Collections.emptyMap();
}
// find the 'stormpath' config section, otherwise return an empty map
Ini.Section section = ini.getSection(STORMPATH_CONFIG_SECTION_NAME);
if (CollectionUtils.isEmpty(section)) {
section = ini.getSection(Ini.DEFAULT_SECTION_NAME);
}
if (CollectionUtils.isEmpty(section)) {
return Collections.emptyMap();
}
// we now have a Ini section with some content
TreeMap<String, String> allProperties = new TreeMap<String, String>(section);
String keyPrefix = "stormpath.";
return Collections.unmodifiableMap(allProperties.subMap(keyPrefix, keyPrefix + Character.MAX_VALUE));
}
}
| [
"bdemers@apache.org"
] | bdemers@apache.org |
239cef15e2315e383ca958796a11f2a867d86c5c | 9c197c38980d6e1848c22d00fb163f7c6bda7cba | /src/main/java/com/richard/money/api/config/property/MoneyApiProperty.java | d0e6c94a597a2324504a16bed21cc952590b33ab | [] | no_license | Ricardolv/money-api | 70ed269e9a3a37bc851d775d27ed5aca9fb5adeb | 36deae9ea0be0ac747680149d386e7f55d8875a8 | refs/heads/master | 2021-01-01T16:11:55.487448 | 2018-02-02T02:45:46 | 2018-02-02T02:45:46 | 97,785,633 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 565 | java | package com.richard.money.api.config.property;
import lombok.Data;
import lombok.Getter;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties("money-api")
public class MoneyApiProperty {
@Getter
private final Security security = new Security();
@Getter
private final Environment environment = new Environment();
@Data
public static class Environment {
private String allowedOrigin;
}
@Data
public static class Security {
private boolean enableHttps;
}
}
| [
"richardluizv@gmail.com"
] | richardluizv@gmail.com |
3f54427be2e97bb2a69d7f7b571e04b3739649e1 | dbc4afbba669cd6f1bed2713905dffd8f8960d91 | /base/src/main/java/cai/test/com/base/http/app/RequestInterceptListener.java | 7d8f36926183e35562f7e15508d662b53e97cee7 | [] | no_license | 17771436337/BaseLibarray | c125b452a670064d2686edf288bbc20d9462f71d | c823106e1a83c5ef05a90ea3c11a717a437311f1 | refs/heads/master | 2021-09-01T18:45:11.848709 | 2017-12-28T08:34:11 | 2017-12-28T08:34:11 | 110,525,367 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 424 | java | package cai.test.com.base.http.app;
import cai.test.com.base.http.request.UriRequest;
/**
* Created by wyouflf on 15/11/10.
* 拦截请求响应(在后台线程工作).
* <p>
* 用法: 请求的callback参数同时实现RequestInterceptListener
*/
public interface RequestInterceptListener {
void beforeRequest(UriRequest request) throws Throwable;
void afterRequest(UriRequest request) throws Throwable;
} | [
"1020233514@qq.com"
] | 1020233514@qq.com |
4903b8737cf96520e69ef694174fc683b1575c8c | 4134a10ba266afbb26c63185cfe739ccafac9419 | /apple-id-zookeeper/src/test/java/test/benchmark/BenchmarkZookeeper.java | 04f2354af55111bfa9388fbfc9275bcbd4e8375c | [] | no_license | xushaomin/apple-id | 73b2f988e34ff71ba2f1fca67eeb9c28c9ce7e44 | e8cc76a898fed9a08887303e516546dc940141c4 | refs/heads/master | 2022-11-22T09:39:29.547351 | 2021-01-13T07:17:28 | 2021-01-13T07:17:28 | 54,872,332 | 4 | 10 | null | 2022-11-16T02:44:56 | 2016-03-28T06:44:43 | Java | UTF-8 | Java | false | false | 1,540 | java | package test.benchmark;
import com.appleframework.id.ZookeeperIdGenerator;
import test.utils.StringUtils;
public class BenchmarkZookeeper extends BaseBenchmarkSerialId {
public static void main(String[] args) {
int numRuns, numThreads, numNamespaces;
try {
numRuns = Integer.parseInt(System.getProperty("numRuns"));
} catch (Exception e) {
numRuns = 32000;
}
try {
numThreads = Integer.parseInt(System.getProperty("numThreads"));
} catch (Exception e) {
numThreads = 4;
}
try {
numNamespaces = Integer.parseInt(System.getProperty("numNamespaces"));
} catch (Exception e) {
numNamespaces = 4;
}
String zkConnString = System.getProperty("zkConnStr");
if (StringUtils.isBlank(zkConnString)) {
zkConnString = "localhost:2181/id-server";
}
System.out.println("Num runs: " + numRuns + " / Num threads: " + numThreads
+ " / Num namespaces: " + numNamespaces);
System.out.println("ZK: " + zkConnString);
ZookeeperIdGenerator.invalidate();
final ZookeeperIdGenerator idGenerator = ZookeeperIdGenerator.getInstance(zkConnString);
initValues(idGenerator, numNamespaces);
for (int i = 0; i < 10; i++) {
runTest(idGenerator, numRuns, numThreads, numNamespaces, "Zookeeper");
}
printValues(idGenerator, numNamespaces);
idGenerator.destroy();
}
}
| [
"xushaomin@foxmail.com"
] | xushaomin@foxmail.com |
666b2a4632f8229a626198daa726b01cdc5bbd27 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Jetty/Jetty1505.java | 2143abc0e8a1b17560fc05383b14f952b354b7be | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | @Test
public void testIPHost() throws Exception
{
ByteBuffer buffer = BufferUtil.toBuffer(
"GET / HTTP/1.1\r\n"
+ "Host: 192.168.0.1\r\n"
+ "Connection: close\r\n"
+ "\r\n");
HttpParser.RequestHandler handler = new Handler();
HttpParser parser = new HttpParser(handler);
parser.parseNext(buffer);
Assert.assertEquals("192.168.0.1", _host);
Assert.assertEquals(0, _port);
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
0d8b8cd74243049092f6541d3c10ad6075ac4e47 | 05e5bee54209901d233f4bfa425eb6702970d6ab | /net/minecraft/server/v1_7_R4/CommandAchievement.java | 79b50e92429f1daa9b47e273bcb88382a38c0fc9 | [] | no_license | TheShermanTanker/PaperSpigot-1.7.10 | 23f51ff301e7eb05ef6a3d6999dd2c62175c270f | ea9d33bcd075e00db27b7f26450f9dc8e6d18262 | refs/heads/master | 2022-12-24T10:32:09.048106 | 2020-09-25T15:43:22 | 2020-09-25T15:43:22 | 298,614,646 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,376 | java | /* */ package net.minecraft.server.v1_7_R4;
/* */
/* */ import java.util.ArrayList;
/* */ import java.util.List;
/* */ import net.minecraft.util.com.google.common.collect.Lists;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class CommandAchievement
/* */ extends CommandAbstract
/* */ {
/* */ public String getCommand() {
/* 17 */ return "achievement";
/* */ }
/* */
/* */
/* */ public int a() {
/* 22 */ return 2;
/* */ }
/* */
/* */
/* */ public String c(ICommandListener paramICommandListener) {
/* 27 */ return "commands.achievement.usage";
/* */ }
/* */
/* */
/* */ public void execute(ICommandListener paramICommandListener, String[] paramArrayOfString) {
/* 32 */ if (paramArrayOfString.length >= 2) {
/* 33 */ EntityPlayer entityPlayer; Statistic statistic = StatisticList.getStatistic(paramArrayOfString[1]);
/* */
/* */
/* 36 */ if (statistic == null && !paramArrayOfString[1].equals("*")) {
/* 37 */ throw new CommandException("commands.achievement.unknownAchievement", new Object[] { paramArrayOfString[1] });
/* */ }
/* */
/* 40 */ if (paramArrayOfString.length >= 3) {
/* 41 */ entityPlayer = d(paramICommandListener, paramArrayOfString[2]);
/* */ } else {
/* 43 */ entityPlayer = b(paramICommandListener);
/* */ }
/* */
/* 46 */ if (paramArrayOfString[0].equalsIgnoreCase("give")) {
/* 47 */ if (statistic == null) {
/* 48 */ for (Achievement achievement : AchievementList.e) {
/* 49 */ entityPlayer.a(achievement);
/* */ }
/* */
/* 52 */ a(paramICommandListener, this, "commands.achievement.give.success.all", new Object[] { entityPlayer.getName() });
/* */ } else {
/* 54 */ if (statistic instanceof Achievement) {
/* 55 */ Achievement achievement = (Achievement)statistic;
/* 56 */ ArrayList<Achievement> arrayList = Lists.newArrayList();
/* */
/* 58 */ while (achievement.c != null && !entityPlayer.getStatisticManager().hasAchievement(achievement.c)) {
/* 59 */ arrayList.add(achievement.c);
/* 60 */ achievement = achievement.c;
/* */ }
/* */
/* 63 */ for (Achievement achievement1 : Lists.reverse(arrayList)) {
/* 64 */ entityPlayer.a(achievement1);
/* */ }
/* */ }
/* */
/* 68 */ entityPlayer.a(statistic);
/* */
/* 70 */ a(paramICommandListener, this, "commands.achievement.give.success.one", new Object[] { entityPlayer.getName(), statistic.j() });
/* */ }
/* */
/* */ return;
/* */ }
/* */ }
/* */
/* 77 */ throw new ExceptionUsage("commands.achievement.usage", new Object[0]);
/* */ }
/* */
/* */
/* */ public List tabComplete(ICommandListener paramICommandListener, String[] paramArrayOfString) {
/* 82 */ if (paramArrayOfString.length == 1) {
/* 83 */ return a(paramArrayOfString, new String[] { "give" });
/* */ }
/* */
/* 86 */ if (paramArrayOfString.length == 2) {
/* 87 */ ArrayList<String> arrayList = Lists.newArrayList();
/* */
/* 89 */ for (Statistic statistic : StatisticList.stats) {
/* 90 */ arrayList.add(statistic.name);
/* */ }
/* */
/* 93 */ return a(paramArrayOfString, arrayList);
/* */ }
/* */
/* 96 */ if (paramArrayOfString.length == 3) {
/* 97 */ return a(paramArrayOfString, MinecraftServer.getServer().getPlayers());
/* */ }
/* */
/* 100 */ return null;
/* */ }
/* */
/* */
/* */ public boolean isListStart(String[] paramArrayOfString, int paramInt) {
/* 105 */ return (paramInt == 2);
/* */ }
/* */ }
/* Location: D:\Paper-1.7.10\PaperSpigot-1.7.10-R0.1-SNAPSHOT-latest.jar!\net\minecraft\server\v1_7_R4\CommandAchievement.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 1.1.3
*/ | [
"tanksherman27@gmail.com"
] | tanksherman27@gmail.com |
c201e2e42c7b98bf2ce723725b8ca4ce0c5f074b | e89dc01c95b8b45404f971517c2789fd21657749 | /src/main/java/com/alipay/api/response/KoubeiContentContentinfoModifyResponse.java | 75df420d91573add22082adff7a924955ba0673f | [
"Apache-2.0"
] | permissive | guoweiecust/alipay-sdk-java-all | 3370466eec70c5422c8916c62a99b1e8f37a3f46 | bb2b0dc8208a7a0ab8521a52f8a5e1fcef61aeb9 | refs/heads/master | 2023-05-05T07:06:47.823723 | 2021-05-25T15:26:21 | 2021-05-25T15:26:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 826 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: koubei.content.contentinfo.modify response.
*
* @author auto create
* @since 1.0, 2019-03-15 10:30:13
*/
public class KoubeiContentContentinfoModifyResponse extends AlipayResponse {
private static final long serialVersionUID = 6883772297532594142L;
/**
* 内容id
*/
@ApiField("data")
private String data;
/**
* 全链路Id
*/
@ApiField("trace_id")
private String traceId;
public void setData(String data) {
this.data = data;
}
public String getData( ) {
return this.data;
}
public void setTraceId(String traceId) {
this.traceId = traceId;
}
public String getTraceId( ) {
return this.traceId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
37a2b2816beac922d0b00c07af3156889e436eaa | aed22399d76349d666c2b2afb374bfb49663061d | /discover-zookeeper/src/main/java/org/springframework/cloud/zookeeper/discovery/ZookeeperDiscoveryClientConfiguration.java | a561cba7bcac9088022cf97806292ff8f471168b | [] | no_license | yinkaihuang/discover-client | 37212c825fc95754134593757b249a6949cbb7d7 | 0295e60e84cfb7cdb00d892630953cb0c68ba77e | refs/heads/master | 2020-07-08T03:11:10.278949 | 2019-09-21T04:16:03 | 2019-09-21T04:16:03 | 203,548,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,295 | java | /*
* Copyright 2013-2015 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.cloud.zookeeper.discovery;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* {@link org.springframework.cloud.client.discovery.DiscoveryClient} configuration
* for Zookeeper.
*
* @author Spencer Gibb
* @since 1.0.0
*/
@Configuration
@ConditionalOnProperty(value = "spring.cloud.zookeeper.discovery.enabled", matchIfMissing = true)
public class ZookeeperDiscoveryClientConfiguration {
class Marker {}
@Bean
public Marker zookeeperDiscoveryClientMarker() {
return new Marker();
}
}
| [
"yin.chong@intellif.com"
] | yin.chong@intellif.com |
166d0698e34c19551a501604bf45f3b1bc08ca2d | d320db6e9e0fcd023ad702136242c2a542ec2018 | /swak-core/src/main/java/com/swak/utils/Images.java | b26676a8221dd4b12f0f7d00082c4fb73b16c8b1 | [
"Apache-2.0"
] | permissive | youbooks/swak | f7e249932c7dc3d3154ed40313c392645c2ee64d | d8d6ca32d80783667d9c27e0d2d56c9fd05ea918 | refs/heads/master | 2023-02-13T03:10:14.061240 | 2021-01-11T03:51:58 | 2021-01-11T03:51:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,728 | java | package com.swak.utils;
import java.awt.Graphics;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.HeadlessException;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.swing.ImageIcon;
/**
* 加载图片: 加载jpg 图片时,图片变红问题
*
* @author lifeng
* @date 2021年1月6日 上午10:47:13
*/
public class Images {
/**
* 加载图片
*
* @param file
* @return
*/
public static BufferedImage load(File file) {
Image image = Toolkit.getDefaultToolkit().getImage(file.getPath());
if (image instanceof BufferedImage) {
return (BufferedImage) image;
}
// This code ensures that all the pixels in the image are loaded
image = new ImageIcon(image).getImage();
BufferedImage bimage = null;
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
try {
int transparency = Transparency.OPAQUE;
GraphicsDevice gs = ge.getDefaultScreenDevice();
GraphicsConfiguration gc = gs.getDefaultConfiguration();
bimage = gc.createCompatibleImage(image.getWidth(null), image.getHeight(null), transparency);
} catch (HeadlessException e) {
// The system does not have a screen
}
if (bimage == null) {
// Create a buffered image using the default color model
int type = BufferedImage.TYPE_INT_RGB;
bimage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
}
// Copy image to buffered image
Graphics g = bimage.createGraphics();
// Paint the image onto the buffered image
g.drawImage(image, 0, 0, null);
g.dispose();
return bimage;
}
} | [
"618lf@163.com"
] | 618lf@163.com |
a2720445a02f1de26a25466f3b6252e1547aaa44 | dcf8f26d0b7d3f3c249e0296069148d3adac0acf | /src/main/java/Sud_Game/services/CommandParser.java | eaa3b43bbc39c7fd5c469701a24d1fe8f6c4d8b3 | [] | no_license | Jacci19/Various-projects | 466b0fcd44f6b51e00369248cd1657c07c8302ee | fb930cf3ec899a8f77c840c4eb3814f32a541ff2 | refs/heads/master | 2020-03-29T06:03:22.440862 | 2019-02-15T12:17:24 | 2019-02-15T12:17:50 | 149,606,856 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,478 | java | package Sud_Game.services;
import Sud_Game.AgilityFightStrategy;
import Sud_Game.FightStrategy;
import Sud_Game.FightThread;
import Sud_Game.domain.Direction;
import Sud_Game.domain.NPC;
import Sud_Game.domain.Player;
public class CommandParser {
public void actOnCommand(String playerCommand, Player player) {
playerCommand = playerCommand.toLowerCase();
String[] splitted = playerCommand.split(" ");
Command command = null;
switch (splitted[0]) {
case "n":
case "north":
command = new MoveCommand(Direction.N, player);
break;
case "s":
case "south":
command = new MoveCommand(Direction.S, player);
break;
case "e":
case "east":
command = new MoveCommand(Direction.E, player);
break;
case "w":
case "west":
command = new MoveCommand(Direction.W, player);
break;
case "kill":
command = new KillCommand(splitted[1], player);
break;
case "look":
command = new LookCommand(player);
break;
default:
System.out.println("Unknown command.");
break;
}
if(command!=null) {
System.out.println(command.execute());
}
}
}
| [
"jacek205@wp.pl"
] | jacek205@wp.pl |
b10a4996f64d09df4dbefcb6d78b3d0352cf0ee3 | 7e845b6940f896fb81b8f5a7ef525ba5a27073a8 | /shijingsh-ai-model/src/main/java/com/shijingsh/ai/model/neuralnetwork/learn/RmsPropLearner.java | 059e206ea244bbbf3d5653a2ec7e112c6b3bb6e1 | [
"Apache-2.0"
] | permissive | shijingsh/shijingsh-ai | 9ae48ac27677999406868139b8daf93df89bbc18 | b4c0be173bc4f2e29e6ef19e861bba9460596cbc | refs/heads/master | 2022-10-07T05:03:54.637990 | 2020-05-08T06:47:42 | 2020-05-08T06:47:42 | 244,068,779 | 1 | 1 | null | 2022-10-05T04:04:45 | 2020-03-01T01:38:32 | Java | UTF-8 | Java | false | false | 5,067 | java | package com.shijingsh.ai.model.neuralnetwork.learn;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import com.shijingsh.ai.math.structure.MathCalculator;
import com.shijingsh.ai.math.structure.matrix.DenseMatrix;
import com.shijingsh.ai.math.structure.matrix.MathMatrix;
import com.shijingsh.ai.model.neuralnetwork.schedule.ConstantSchedule;
import com.shijingsh.ai.model.neuralnetwork.schedule.Schedule;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.math3.util.FastMath;
import com.shijingsh.ai.math.structure.MathCalculator;
import com.shijingsh.ai.math.structure.matrix.DenseMatrix;
import com.shijingsh.ai.math.structure.matrix.MathMatrix;
import com.shijingsh.ai.model.neuralnetwork.schedule.ConstantSchedule;
import com.shijingsh.ai.model.neuralnetwork.schedule.Schedule;
import com.shijingsh.ai.modem.ModemCycle;
import com.shijingsh.ai.modem.ModemDefinition;
/**
* RMS Prop学习器
*
* <pre>
* 参考Deeplearning4j团队
*
* http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
* </pre>
*
* @author Birdy
*
*/
@ModemDefinition(value = { "rmsDecay", "epsilon", "learnSchedule" })
public class RmsPropLearner implements Learner, ModemCycle {
public static final float DEFAULT_RMSPROP_LEARN_RATE = 1E-1F;
public static final float DEFAULT_RMSPROP_EPSILON = 1E-8F;
public static final float DEFAULT_RMSPROP_RMSDECAY = 0.95F;
private float rmsDecay;
private float epsilon;
private Schedule learnSchedule;
private Map<String, DenseMatrix> lastGradients;
public RmsPropLearner() {
this(DEFAULT_RMSPROP_RMSDECAY, DEFAULT_RMSPROP_EPSILON, new ConstantSchedule(DEFAULT_RMSPROP_LEARN_RATE));
}
public RmsPropLearner(float rmsDecay, float epsilon, Schedule learnSchedule) {
this.rmsDecay = rmsDecay;
this.epsilon = epsilon;
this.learnSchedule = learnSchedule;
this.lastGradients = new HashMap<>();
}
@Override
public void doCache(Map<String, MathMatrix> gradients) {
lastGradients.clear();
for (Entry<String, MathMatrix> term : gradients.entrySet()) {
MathMatrix gradient = term.getValue();
DenseMatrix lastGradient = DenseMatrix.valueOf(gradient.getRowSize(), gradient.getColumnSize());
lastGradient.setValues(epsilon);
lastGradients.put(term.getKey(), lastGradient);
}
}
@Override
public void learn(Map<String, MathMatrix> gradients, int iteration, int epoch) {
if (lastGradients.isEmpty()) {
throw new IllegalStateException("Updater has not been initialized with view state");
}
for (Entry<String, MathMatrix> term : gradients.entrySet()) {
MathMatrix gradient = term.getValue();
DenseMatrix lastGradient = lastGradients.get(term.getKey());
double learnRatio = learnSchedule.valueAt(iteration, epoch);
lastGradient.iterateElement(MathCalculator.PARALLEL, (scalar) -> {
int row = scalar.getRow();
int column = scalar.getColumn();
float value = scalar.getValue();
float delta = gradient.getValue(row, column);
value = value * rmsDecay + delta * delta * (1F - rmsDecay);
scalar.setValue(value);
});
// lr * gradient / (sqrt(cache) + 1e-8)
gradient.iterateElement(MathCalculator.PARALLEL, (scalar) -> {
int row = scalar.getRow();
int column = scalar.getColumn();
float value = scalar.getValue();
value = (float) (value * (learnRatio / (FastMath.sqrt(lastGradient.getValue(row, column)) + epsilon)));
scalar.setValue(value);
});
}
}
@Override
public void beforeSave() {
}
@Override
public void afterLoad() {
lastGradients = new HashMap<>();
}
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object == null) {
return false;
}
if (getClass() != object.getClass()) {
return false;
} else {
RmsPropLearner that = (RmsPropLearner) object;
EqualsBuilder equal = new EqualsBuilder();
equal.append(this.rmsDecay, that.rmsDecay);
equal.append(this.epsilon, that.epsilon);
equal.append(this.learnSchedule, that.learnSchedule);
return equal.isEquals();
}
}
@Override
public int hashCode() {
HashCodeBuilder hash = new HashCodeBuilder();
hash.append(rmsDecay);
hash.append(epsilon);
hash.append(learnSchedule);
return hash.toHashCode();
}
@Override
public String toString() {
return "RmsPropLearner(rmsDecay=" + rmsDecay + ", epsilon=" + epsilon + ", learnSchedule=" + learnSchedule + ")";
}
}
| [
"liukefu2050@sina.com"
] | liukefu2050@sina.com |
59c9fbb793873e0b27cfaaaa475ad188e03bb868 | 5edfe5bb8cde144a020dd7436f1bed6cef5e2aa8 | /src/com/java/campus/Solution12.java | 0972d1d119c7af0816e8c3e4bcf8172ed4f0bc89 | [] | no_license | yw3388/Data_Structure | abb479c97905565bf15c5e6bb538332b014361e0 | a6e43cde760b08baf0815217a04244df2a1abaf4 | refs/heads/master | 2022-02-12T20:13:23.918302 | 2019-08-15T07:36:12 | 2019-08-15T07:36:12 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,975 | java | package com.java.campus;
import java.util.LinkedHashMap;
import java.util.Scanner;
/**
* av394281中,充满威严的蕾米莉亚大小姐因为触犯某条禁忌,被隙间妖怪八云紫(紫m……èi)按住头在键盘上滚动。
同样在弹幕里乱刷梗被紫姐姐做成罪袋的你被指派找到大小姐脸滚键盘打出的一行字中的第 `k` 个仅出现一次的字。
(为简化问题,大小姐没有滚出 ascii 字符集以外的字)
输出描述:
输出的每一行对应输入的每一行的答案,如果无解,输出字符串`Myon~`
(请不要输出多余的空行)
为了方便评测,如果答案存在且为c,请输出[c]
示例1
输入
2 misakamikotodaisuki
3 !bakabaka~ bakabaka~ 1~2~9!
3 3.1415926535897932384626433832795028841971693993751o582097494459211451488946419191919l91919hmmhmmahhhhhhhhhh
7 www.bilibili.com/av170001
1 111
输出
[d]
[9]
[l]
[7]
Myon~
* @author WangShuaiJie
*
*/
public class Solution12 {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
while(sc.hasNext()){
String str=sc.nextLine();
System.out.println(getAppearOnce(n,str));
}
}
private static String getAppearOnce(int n, String str){
if(str.length()==0 || str==null || n>=str.length()) return "Myon~";
LinkedHashMap<Character, Integer> map=new LinkedHashMap<Character, Integer>();
for(char c:str.toCharArray()){
if(map.containsKey(c)){
map.put(c,map.get(c)+1);
}else{
map.put(c,1);
}
}
int count=0;
for(Character c:map.keySet()){
if(map.get(c)==1){
count=count+1;
if(count==n){
return c.toString();
}
}
}
return "Myon~";
}
}
| [
"2283613941@qq.com"
] | 2283613941@qq.com |
083fe57478d59a89dbe3ebc9f6b05ec4afc4857d | 76fb910a2d7d8d5f43366a43d4fb6b5427d18325 | /d2k4_source/dtcheng/ncsa/d2k/modules/projects/dtcheng/GeneralExample.java | 20f279567626499a0fc2174b7ecbd044299f1abc | [] | no_license | EISALab/IMOGAgroundwater | 2bf8342a89753c0fefa95a45809cdc376b307f4a | 6bf1bd74e7fbc59082fec127b4b6b1537076c180 | refs/heads/master | 2016-09-06T04:49:14.305434 | 2013-06-12T16:22:52 | 2013-06-12T16:22:52 | 10,646,593 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,764 | java | package ncsa.d2k.modules.projects.dtcheng;
import ncsa.d2k.modules.core.datatype.table.*;
import java.util.*;
public class GeneralExample implements java.io.Serializable
{
int numInputs;
int numOutputs;
String [] inputNames;
String [] outputNames;
public int getInputType(int i)
{
System.out.println("Must overide this!!!");
return ColumnTypes.DOUBLE;
}
public int getOutputType(int i)
{
System.out.println("Must overide this!!!");
return ColumnTypes.DOUBLE;
}
public double getInputDouble(int i)
{
System.out.println("Must overide this!!!");
return 0.0;
}
public double getOutputDouble(int i)
{
System.out.println("Must overide this!!!");
return 0.0;
}
public void setInputDouble(int i, double value)
{
System.out.println("Must overide this!!!");
}
public void setOutputDouble(int i, double value)
{
System.out.println("Must overide this!!!");
}
public String getInputString(int i)
{
return Double.toString(this.getInputDouble(i));
}
public String getOutputString(int i)
{
return Double.toString(this.getOutputDouble(i));
}
public int getInputInt(int i)
{
return (int) this.getInputDouble(i);
}
public int getOutputInt(int i)
{
return (int) this.getOutputDouble(i);
}
public float getInputFloat(int i)
{
return (float) this.getInputDouble(i);
}
public float getOutputFloat(int i)
{
return (float) this.getOutputDouble(i);
}
public short getInputShort(int i)
{
return (short) this.getInputDouble(i);
}
public short getOutputShort(int i)
{
return (short) this.getOutputDouble(i);
}
public long getInputLong(int i)
{
return (long) this.getInputDouble(i);
}
public long getOutputLong(int i)
{
return (long) this.getOutputDouble(i);
}
public byte getInputByte(int i)
{
return (byte) this.getInputDouble(i);
}
public byte getOutputByte(int i)
{
return (byte) this.getOutputDouble(i);
}
public Object getInputObject(int i)
{
return (Object) new Double(this.getInputDouble(i));
}
public Object getOutputObject(int i)
{
return (Object) new Double(this.getOutputDouble(i));
}
public char getInputChar(int i)
{
return (char) this.getInputDouble(i);
}
public char getOutputChar(int i)
{
return (char) this.getOutputDouble(i);
}
public byte[] getInputBytes(int i)
{
byte [] bytes = new byte[1];
bytes[0] = (byte) this.getInputDouble(i);
return bytes;
}
public byte[] getOutputBytes(int i)
{
byte [] bytes = new byte[1];
bytes[0] = (byte) this.getOutputDouble(i);
return bytes;
}
public char[] getInputChars(int i)
{
char [] chars = new char[1];
chars[0] = (char) this.getInputDouble(i);
return chars;
}
public char[] getOutputChars(int i)
{
char [] chars = new char[1];
chars[0] = (char) this.getOutputDouble(i);
return chars;
}
public boolean getInputBoolean(int i)
{
if (this.getInputDouble(i) < 0.5)
return false;
else
return true;
}
public boolean getOutputBoolean(int i)
{
if (this.getOutputDouble(i) < 0.5)
return false;
else
return true;
}
public boolean isInputNominal(int i)
{
return false;
}
public boolean isOutputNominal(int i)
{
return false;
}
public boolean isInputScalar(int i)
{
return true;
}
public boolean isOutputScalar(int i)
{
return true;
}
public int getNumInputs()
{
return numInputs;
}
/*
public int getNumOutputs()
{
return numOutputs;
}
*/
public void setNumInputs(int i)
{
numInputs = i;
}
public void setNumOutputs(int i)
{
numOutputs = i;
}
public String getInputName(int i)
{
return inputNames[i];
}
public String getOutputName(int i)
{
return outputNames[i];
}
public void setInputNames(String [] names)
{
this.inputNames = names;
}
public void setOutputNames(String [] names)
{
this.outputNames = names;
}
public Example physicalCopy()
{
System.out.println("must overide method");
return null;
}
public GeneralExample()
{
}
public Example shallowCopy()
{
GeneralExample copy = new GeneralExample();
copy.numInputs = this.numInputs;
copy.numOutputs = this.numOutputs;
copy.inputNames = this.inputNames;
copy.outputNames = this.outputNames;
return (Example) copy;
}
public Example deepCopy()
{
GeneralExample copy = new GeneralExample();
copy.numInputs = this.numInputs;
copy.numOutputs = this.numOutputs;
copy.inputNames = this.inputNames;
copy.outputNames = this.outputNames;
return (Example) copy;
}
public GeneralExample(Example [] examples)
{
this.numInputs = ((ExampleTable)(examples[0].getTable())).getNumInputFeatures();
this.numOutputs = ((ExampleTable)(examples[0].getTable())).getNumOutputFeatures();
}
public void setInput(int i, double value)
{
this.setInputDouble(i, value);
}
public void setOutput(int i, double value)
{
this.setOutputDouble(i, value);
}
public void deleteInputs(boolean [] deleteFeatures)
{
System.out.println("!!! deleteInputs not defined");
}
/**
* Get an Object from the table.
* @param row the row of the table
* @param column the column of the table
* @return the Object at (row, column)
*/
public Object getObject(int row, int column)
{
return null;
}
}
| [
"krishjadhwani@gmail.com"
] | krishjadhwani@gmail.com |
af1ed2d5727f5dfeb529772ffb50a3fd31adb3fe | 97fd02f71b45aa235f917e79dd68b61c62b56c1c | /src/main/java/com/tencentcloudapi/iotcloud/v20210408/models/DescribeProductTaskResponse.java | afb5153f75d047d37e3cbba51dbcacfb9b538211 | [
"Apache-2.0"
] | permissive | TencentCloud/tencentcloud-sdk-java | 7df922f7c5826732e35edeab3320035e0cdfba05 | 09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec | refs/heads/master | 2023-09-04T10:51:57.854153 | 2023-09-01T03:21:09 | 2023-09-01T03:21:09 | 129,837,505 | 537 | 317 | Apache-2.0 | 2023-09-13T02:42:03 | 2018-04-17T02:58:16 | Java | UTF-8 | Java | false | false | 3,168 | 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.iotcloud.v20210408.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class DescribeProductTaskResponse extends AbstractModel{
/**
* 产品任务详细信息
*/
@SerializedName("TaskInfo")
@Expose
private ProductTaskInfo TaskInfo;
/**
* 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
@SerializedName("RequestId")
@Expose
private String RequestId;
/**
* Get 产品任务详细信息
* @return TaskInfo 产品任务详细信息
*/
public ProductTaskInfo getTaskInfo() {
return this.TaskInfo;
}
/**
* Set 产品任务详细信息
* @param TaskInfo 产品任务详细信息
*/
public void setTaskInfo(ProductTaskInfo TaskInfo) {
this.TaskInfo = TaskInfo;
}
/**
* Get 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @return RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public String getRequestId() {
return this.RequestId;
}
/**
* Set 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @param RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public void setRequestId(String RequestId) {
this.RequestId = RequestId;
}
public DescribeProductTaskResponse() {
}
/**
* NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
* and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
*/
public DescribeProductTaskResponse(DescribeProductTaskResponse source) {
if (source.TaskInfo != null) {
this.TaskInfo = new ProductTaskInfo(source.TaskInfo);
}
if (source.RequestId != null) {
this.RequestId = new String(source.RequestId);
}
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamObj(map, prefix + "TaskInfo.", this.TaskInfo);
this.setParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
| [
"tencentcloudapi@tencent.com"
] | tencentcloudapi@tencent.com |
c90fdc64a2f5f999aeb882eede3466cab94b327f | 4abd603f82fdfa5f5503c212605f35979b77c406 | /html/Programs/hw0/b7cb076c22e3683e5d342c62281ccc4e/Bingo.java | a6e8cfcc5d7c2330107d2757b5a864252fb37bd0 | [] | no_license | dn070017/1042-PDSA | b23070f51946c8ac708d3ab9f447ab8185bd2a34 | 5e7d7b1b2c9d751a93de9725316aa3b8f59652e6 | refs/heads/master | 2020-03-20T12:13:43.229042 | 2018-06-15T01:00:48 | 2018-06-15T01:00:48 | 137,424,305 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,349 | java | import java.io.BufferedReader;
import java.io.FileReader;
public class Bingo {
public static void main(String[] args) throws Exception { // exception for BufferedReader
// TODO Auto-generated method stub
String[] numberData; // register for number data
String[] bingoString; // bingo input string
String[][] bingoMapString; // bingo map string
int numOfString; // for bingo input string size
int sizeOfMatrix; // for bingo map string size
BingoMap bingoMap;
BufferedReader br = new BufferedReader(new FileReader(args[0])); // get the filename from args
numberData = br.readLine().split("","");
numOfString = Integer.valueOf(numberData[0]);
sizeOfMatrix = Integer.valueOf(numberData[1]);
bingoString = new String[numOfString];
bingoString = br.readLine().split("","");
/*for(int i = 0; i < numOfString; i++){
System.out.print(bingoString[i] + "" "");
}*/
bingoMapString = new String[sizeOfMatrix][sizeOfMatrix];
// TODO BingoMapString input format check
for(int i = 0; i < sizeOfMatrix; i++){
bingoMapString[i] = br.readLine().split("","");
/*for(int j = 0; j < sizeOfMatrix; j++){
System.out.print(bingoMapString[i][j] + "" "");
}
System.out.println();*/
}
bingoMap = new BingoMap(bingoMapString, sizeOfMatrix);
bingoMap.inputString(bingoString, numOfString);
System.out.println(bingoMap.result());
}
}
class BingoMap{
String[][] mapString;
String[] inputString;
int numOfString;
int sizeOfMap;
public BingoMap(String[][] mapString, int sizeOfMap){
this.mapString = mapString;
this.sizeOfMap = sizeOfMap;
}
void inputString(String[] inputString, int numOfString){
this.inputString = inputString;
this.numOfString = numOfString;
}
int result(){
// TODO algorithm for output right answer
return this.bingoAlg(digitallize());
}
boolean[][] digitallize (){
boolean[][] booleanMap = new boolean[sizeOfMap][sizeOfMap];
for(int i=0; i < sizeOfMap; i++){
for(int j=0; j < sizeOfMap; j++){
for(int k=0; k< numOfString; k++){
if(booleanMap[i][j] == false)
booleanMap[i][j] = mapString[i][j].equals(inputString[k]);
}
}
}
/*for(int i = 0; i<sizeOfMap; i++){
for(int j = 0; j<sizeOfMap; j++)
System.out.print(booleanMap[i][j]);
System.out.println();
}*/
return booleanMap;
}
int bingoAlg(boolean[][] booleanMap){
int result = 0;
boolean[][] resultMapFlag = new boolean[3][]; // flags for all map
resultMapFlag[0] = new boolean[sizeOfMap]; // flags for column
resultMapFlag[1] = new boolean[sizeOfMap]; // flags for row
resultMapFlag[2] = new boolean[2]; // flags for diagonal
for(int i=0; i<sizeOfMap; i++){
for(int j=0; j<sizeOfMap; j++){
if(booleanMap[i][j] == false){
resultMapFlag[0][i] = true;
resultMapFlag[1][j] = true;
if(i == j){
resultMapFlag[2][0] = true;
}
else if(i == sizeOfMap - j + 1){
resultMapFlag[2][1] = true;
System.out.println(""x:"" + i + ""; y:"" + j);
}
}
}
}
for(boolean[] resultMapFlagRow: resultMapFlag){
for(boolean resultFlag: resultMapFlagRow){
if(resultFlag == false){
result++;
}
}
}
return result;
}
}
| [
"dn070017@gmail.com"
] | dn070017@gmail.com |
8d83641612dd990146da4dc09ab148984e92f6d6 | b2b92ec7a86789afb0e54612687404cf30496119 | /src/main/java/name/martingeisse/blockworld/client/util/resource/Font.java | a6e2813a5eeace4f89c5dad02e258f4723636723 | [] | no_license | MartinGeisse/blockworld | 81bc9df0c55b45bf8f8b2e3e8152fc3d0ba17194 | 94db33657319068327354d0fca5620add354c94a | refs/heads/master | 2021-01-10T16:16:14.660901 | 2016-04-04T18:36:15 | 2016-04-04T18:36:15 | 54,893,998 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,279 | java | /**
* Copyright (c) 2010 Martin Geisse
*
* This file is distributed under the terms of the MIT license.
*/
package name.martingeisse.blockworld.client.util.resource;
import static org.lwjgl.opengl.GL11.GL_UNPACK_ROW_LENGTH;
import static org.lwjgl.opengl.GL11.GL_UNPACK_SKIP_PIXELS;
import static org.lwjgl.opengl.GL11.GL_UNPACK_SKIP_ROWS;
import static org.lwjgl.opengl.GL11.GL_UNSIGNED_BYTE;
import static org.lwjgl.opengl.GL11.glBitmap;
import static org.lwjgl.opengl.GL11.glDrawPixels;
import static org.lwjgl.opengl.GL11.glPixelStorei;
import static org.lwjgl.opengl.GL11.glPixelZoom;
import java.nio.ByteBuffer;
import org.lwjgl.opengl.GL11;
/**
* An OpenGL-capabable font, using a "character atlas" image.
* The character's image coordinates are resolved as follows:
*
* - first, the character is mapped to an integer index. This allows to
* handle sparse Unicode fonts, non-Unicode fonts using different
* codepages, and so on.
*
* - the integer index is used to determine the boundary coordinates
*
* - The character is automatically y-flipped to handle OpenGL's reversed
* coordinate system compared to image files.
*
* Drawing characters with this font uses OpenGL's current raster position
* and assumes that this position has been set before. This allows using the
* font both for the HUD (using glWindowPos) or "floating" text
* in the 3d world (using glRasterPos).
*/
public abstract class Font {
/**
* Aligns the top boundary of the text with the current raster position.
*/
public static final int ALIGN_TOP = 0;
/**
* Aligns the left boundary of the text with the current raster position.
*/
public static final int ALIGN_LEFT = 0;
/**
* Aligns the horizontal or vertical center of the text with the current raster position.
*/
public static final int ALIGN_CENTER = 1;
/**
* Aligns the bottom boundary of the text with the current raster position.
*/
public static final int ALIGN_BOTTOM = 2;
/**
* Aligns the right boundary of the text with the current raster position.
*/
public static final int ALIGN_RIGHT = 2;
/**
* Draws text using this font.
*
* @param s the string of text to draw
* @param zoom the zoom factor
* @param horizontalAlignment how to align the text horizontally
* @param verticalAlignment how to align the text vertically
*/
public void drawText(final String s, final float zoom, final int horizontalAlignment, final int verticalAlignment) {
// determine width and height of the string
int stringWidth = getStringWidth(s), height = getCharacterHeight();
// move the current raster position according to the alignment
{
int dx, dy;
if (horizontalAlignment == ALIGN_CENTER) {
dx = -stringWidth / 2;
} else if (horizontalAlignment == ALIGN_RIGHT) {
dx = -stringWidth;
} else {
dx = 0;
}
if (verticalAlignment == ALIGN_CENTER) {
dy = height / 2;
} else if (verticalAlignment == ALIGN_BOTTOM) {
dy = height;
} else {
dy = 0;
}
glBitmap(0, 0, 0, 0, dx * zoom, dy * zoom, null);
}
// draw the characters
ByteBuffer image = getImage();
glPixelStorei(GL_UNPACK_ROW_LENGTH, getImageWidth());
for (int i=0; i<s.length(); i++) {
int characterIndex = getCharacterIndex(s.charAt(i));
if (characterIndex >= 0) {
int characterWidth = getCharacterWidth(characterIndex);
glPixelStorei(GL_UNPACK_SKIP_ROWS, getCharacterTopBoundary(characterIndex));
glPixelStorei(GL_UNPACK_SKIP_PIXELS, getCharacterLeftBoundary(characterIndex));
glPixelZoom(zoom, -zoom);
glDrawPixels(characterWidth, height, GL11.GL_ALPHA, GL_UNSIGNED_BYTE, image);
glBitmap(0, 0, 0, 0, characterWidth * zoom, 0, null);
}
}
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
}
/**
* Returns the font atlas image.
* @return the image
*/
protected abstract ByteBuffer getImage();
/**
* Returns the width of the font atlas image
* @return the image width
*/
protected abstract int getImageWidth();
/**
* Determines the character index for the specified character.
* May return -1 to indicate a character that is not supported by this font.
*
* @param c the character
* @return the index of the character in this font or -1
*/
protected abstract int getCharacterIndex(char c);
/**
* Returns the left boundary of the specified character.
* @param characterIndex the character index
* @return the left boundary
*/
protected abstract int getCharacterLeftBoundary(int characterIndex);
/**
* Returns the top boundary of the specified character.
* @param characterIndex the character index
* @return the top boundary
*/
protected abstract int getCharacterTopBoundary(int characterIndex);
/**
* Returns the width of the specified character.
* @param characterIndex the character index
* @return the width
*/
public abstract int getCharacterWidth(int characterIndex);
/**
* Returns the width of the specified string.
* @param s the string
* @return the width
*/
public abstract int getStringWidth(String s);
/**
* Returns the height of all characters.
* @return the height
*/
public abstract int getCharacterHeight();
}
| [
"martingeisse@googlemail.com"
] | martingeisse@googlemail.com |
7897cee01eb3dd3f2d36f9b2aef8ca2b52b7bf0a | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/androidannotations--androidannotations/cd8004ed8ebb3be9f83a16764f9bc08e06f8dd6a/after/ItemClickProcessor.java | 13d022c748d078c529497f99508ab5640f37da1f | [] | 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 | 3,260 | java | /*
* Copyright 2010-2011 Pierre-Yves Ricau (py.ricau at gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.googlecode.androidannotations.processing;
import java.lang.annotation.Annotation;
import java.util.List;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.VariableElement;
import com.googlecode.androidannotations.annotations.Id;
import com.googlecode.androidannotations.annotations.ItemClick;
import com.googlecode.androidannotations.generation.ItemClickInstruction;
import com.googlecode.androidannotations.model.Instruction;
import com.googlecode.androidannotations.model.MetaActivity;
import com.googlecode.androidannotations.model.MetaModel;
import com.googlecode.androidannotations.rclass.IRClass;
import com.googlecode.androidannotations.rclass.IRInnerClass;
import com.googlecode.androidannotations.rclass.RClass.Res;
/**
* @author Benjamin Fellous
* @author Pierre-Yves Ricau
*/
public class ItemClickProcessor implements ElementProcessor {
private final IRClass rClass;
public ItemClickProcessor(IRClass rClass) {
this.rClass = rClass;
}
@Override
public Class<? extends Annotation> getTarget() {
return ItemClick.class;
}
@Override
public void process(Element element, MetaModel metaModel) {
String methodName = element.getSimpleName().toString();
ItemClick annotation = element.getAnnotation(ItemClick.class);
int idValue = annotation.value();
IRInnerClass rInnerClass = rClass.get(Res.ID);
String itemClickQualifiedId;
if (idValue == Id.DEFAULT_VALUE) {
String fieldName = element.getSimpleName().toString();
int lastIndex = fieldName.lastIndexOf("ItemClicked");
if (lastIndex != -1) {
fieldName = fieldName.substring(0, lastIndex);
}
itemClickQualifiedId = rInnerClass.getIdQualifiedName(fieldName);
} else {
itemClickQualifiedId = rInnerClass.getIdQualifiedName(idValue);
}
Element enclosingElement = element.getEnclosingElement();
MetaActivity metaActivity = metaModel.getMetaActivities().get(enclosingElement);
List<Instruction> onCreateInstructions = metaActivity.getOnCreateInstructions();
ExecutableElement executableElement = (ExecutableElement) element;
List<? extends VariableElement> parameters = executableElement.getParameters();
Instruction instruction;
if (parameters.size() == 1) {
VariableElement parameter = parameters.get(0);
String parameterQualifiedName = parameter.asType().toString();
instruction = new ItemClickInstruction(methodName, itemClickQualifiedId, parameterQualifiedName);
} else {
instruction = new ItemClickInstruction(methodName, itemClickQualifiedId);
}
onCreateInstructions.add(instruction);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
4226f772a0921b1bf81b96f8577eaf546c8d3c5b | e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f | /TwistedTrek/import1/studio/ignitionigloogames/twistedtrek/import1/generic/UniqueID5.java | 657e5c693e6cd275cb17062f93e4d5dcff2bb5e3 | [
"Unlicense"
] | permissive | retropipes/older-java-games | 777574e222f30a1dffe7936ed08c8bfeb23a21ba | 786b0c165d800c49ab9977a34ec17286797c4589 | refs/heads/master | 2023-04-12T14:28:25.525259 | 2021-05-15T13:03:54 | 2021-05-15T13:03:54 | 235,693,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 156 | java | /* Import1: A Maze-Solving Game */
package studio.ignitionigloogames.twistedtrek.import1.generic;
public interface UniqueID5 {
int getIdentifier5();
}
| [
"eric.ahnell@puttysoftware.com"
] | eric.ahnell@puttysoftware.com |
503a04c135c57e3cf9f9decbdc26b917e89bf164 | 5148293c98b0a27aa223ea157441ac7fa9b5e7a3 | /Method_Scraping/xml_scraping/NicadOutputFile_t1_beam_2nd/Nicad_t1_beam_2nd1919.java | 8180252c8863faf40594f3e6b1cff659571f7724 | [] | no_license | ryosuke-ku/TestCodeSeacherPlus | cfd03a2858b67a05ecf17194213b7c02c5f2caff | d002a52251f5461598c7af73925b85a05cea85c6 | refs/heads/master | 2020-05-24T01:25:27.000821 | 2019-08-17T06:23:42 | 2019-08-17T06:23:42 | 187,005,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | // clone pairs:8986:80%
// 12243:beam/runners/samza/src/main/java/org/apache/beam/runners/samza/runtime/KeyedTimerData.java
public class Nicad_t1_beam_2nd1919
{
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final KeyedTimerData<?> that = (KeyedTimerData<?>) o;
return Arrays.equals(keyBytes, that.keyBytes) && timerData.equals(that.timerData);
}
} | [
"naist1020@gmail.com"
] | naist1020@gmail.com |
50c7b714749c570cd7859157ea2bcb02e92cf43e | 8212d4f7e302cbd8735cb49759117cd2e8267684 | /whois-update/src/main/java/net/ripe/db/whois/update/handler/validator/inetnum/ReferenceCheck.java | 079cc124192087343ab6b58413b7f4298f6a1c4e | [
"BSD-3-Clause"
] | permissive | zigri2612/whois | e05a087c1a20ff03176cab3634d2cca79e0fca4b | 11f4f3505c04c9a32997794905d679e22fa0d60b | refs/heads/master | 2021-01-23T23:56:05.558802 | 2015-12-21T04:05:56 | 2015-12-21T04:05:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,490 | java | package net.ripe.db.whois.update.handler.validator.inetnum;
import com.google.common.collect.Lists;
import net.ripe.db.whois.common.dao.RpslObjectDao;
import net.ripe.db.whois.common.dao.RpslObjectInfo;
import net.ripe.db.whois.common.dao.RpslObjectUpdateDao;
import net.ripe.db.whois.common.domain.CIString;
import net.ripe.db.whois.common.domain.attrs.InetStatus;
import net.ripe.db.whois.common.domain.attrs.OrgType;
import net.ripe.db.whois.common.rpsl.AttributeType;
import net.ripe.db.whois.common.rpsl.ObjectType;
import net.ripe.db.whois.common.rpsl.RpslAttribute;
import net.ripe.db.whois.common.rpsl.RpslObject;
import net.ripe.db.whois.update.domain.Action;
import net.ripe.db.whois.update.domain.PreparedUpdate;
import net.ripe.db.whois.update.domain.UpdateContext;
import net.ripe.db.whois.update.domain.UpdateMessages;
import net.ripe.db.whois.update.handler.validator.BusinessRuleValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import static net.ripe.db.whois.update.handler.validator.inetnum.InetStatusHelper.getStatus;
@Component
public class ReferenceCheck implements BusinessRuleValidator {
private final RpslObjectUpdateDao rpslObjectUpdateDao;
private final RpslObjectDao rpslObjectDao;
@Autowired
public ReferenceCheck(final RpslObjectUpdateDao rpslObjectUpdateDao, final RpslObjectDao rpslObjectDao) {
this.rpslObjectUpdateDao = rpslObjectUpdateDao;
this.rpslObjectDao = rpslObjectDao;
}
@Override
public List<Action> getActions() {
return Lists.newArrayList(Action.CREATE, Action.MODIFY);
}
@Override
public List<ObjectType> getTypes() {
return Lists.newArrayList(ObjectType.INETNUM, ObjectType.INET6NUM);
}
@Override
public void validate(final PreparedUpdate update, final UpdateContext updateContext) {
if (update.isOverride()) {
return;
}
final InetStatus inetStatus = getStatus(update);
final List<RpslAttribute> updatedOrgAttributes = update.getUpdatedObject().findAttributes(AttributeType.ORG);
if (inetStatus.needsOrgReference() && updatedOrgAttributes.isEmpty()) {
updateContext.addMessage(update, UpdateMessages.orgAttributeMissing());
return;
}
if (updatedOrgAttributes.isEmpty()) {
return;
}
final RpslAttribute org = updatedOrgAttributes.get(0);
final RpslObject referencedOrganisation = findOrgReference(org);
if (referencedOrganisation == null) {
updateContext.addMessage(update, UpdateMessages.referenceNotFound(org.getCleanValue()));
return;
}
final CIString cleanOrgTypeValue = referencedOrganisation.findAttribute(AttributeType.ORG_TYPE).getCleanValue();
final OrgType orgType = OrgType.getFor(cleanOrgTypeValue);
if (orgType == null || !inetStatus.isValidOrgType(orgType)) {
updateContext.addMessage(update, UpdateMessages.wrongOrgType(inetStatus.getAllowedOrgTypes()));
}
}
private RpslObject findOrgReference(final RpslAttribute org) {
final RpslObjectInfo referencedOrganisationInfo = rpslObjectUpdateDao.getAttributeReference(org.getType(), org.getCleanValue());
return (referencedOrganisationInfo == null ? null : rpslObjectDao.getByKey(ObjectType.ORGANISATION, referencedOrganisationInfo.getKey()));
}
}
| [
"agoston@ripe.net"
] | agoston@ripe.net |
493815e6b33a2bd63185f6aeddaadce60bf3dd3c | 71dd5a62896d88ef3d1a8b383d6964408d7d239f | /springstudy/workspace/E18_Autowired/src/main/java/com/koreait/spring/Computer.java | 6e4121ef39aa4d494faa302fee82318743f702c7 | [] | no_license | hwangseokjin94/java_web_0224 | 42df3f57b3b50598e2ca8b12d27e20a284670ca7 | 6c9ab05ac743763db8264c42c814b79cada95458 | refs/heads/master | 2022-11-13T08:23:36.271978 | 2020-07-02T08:26:19 | 2020-07-02T08:26:19 | 250,546,467 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 471 | java | package com.koreait.spring;
import org.springframework.beans.factory.annotation.Autowired;
public class Computer {
@Autowired //speaker타입의bean을 찾아서 자동으로 주입해준다.
private Speaker speaker;
public void playGame() {
System.out.println("게임을한다.");
}
public void devApp() {
System.out.println("개발을한다.");
}
public void volumeUp() {
speaker.volumeUp();
}
public void volumeDown() {
speaker.volumeDown();
}
}
| [
"vpdnsldk@gmail.com"
] | vpdnsldk@gmail.com |
d9ea16cbf6ba0abc4d0441389c3b01c38b25b806 | c4cbdbe03557bab8070947e3ac09e62922b26e90 | /security-tools/src/test/java/com/eshare/security/utils/KeyConvertUtilTest.java | f24c477eff2c40c11b643ac6c7d8deb93e4c6413 | [] | no_license | EvanLeung08/eshare-develop-tools | e6cf2302278425de0d064eb2bccbb1ae654ac9ac | 9038434efe5cab4ef2bf746c842daddecc068e3c | refs/heads/master | 2021-12-26T05:28:03.486080 | 2021-12-18T15:41:25 | 2021-12-18T15:41:25 | 204,256,308 | 0 | 0 | null | 2021-12-18T15:41:25 | 2019-08-25T06:39:11 | Java | UTF-8 | Java | false | false | 2,800 | java | package com.eshare.security.utils;
import com.eshare.security.common.AbstractTest;
import io.jsonwebtoken.lang.Assert;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyPair;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Security;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.security.interfaces.RSAKey;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPrivateKey;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.bouncycastle.openpgp.PGPUtil;
import org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator;
import org.junit.Test;
/**
* Created by liangyh on 2019/8/25. Email:10856214@163.com
*/
public class KeyConvertUtilTest extends AbstractTest {
@Test
public void testConvertPGPPublicKey2PublicKey() throws IOException, PGPException {
PGPPublicKey pgpPublicKey = PGPKeyUtil.readPublicKey(findFile(PUBLIC_KEY_FILE));
PublicKey publicKey = KeyConvertUtil.convertPGPPublicKey2PublicKey(pgpPublicKey);
//Check if the public key is an instance of RSAKey
Assert.isInstanceOf(RSAKey.class, publicKey);
}
@Test
public void tsetConvertPGPPrivateKey2PrivateKey()
throws IOException, PGPException, NoSuchProviderException {
PGPSecretKey pgpSecretKey = PGPKeyUtil.readSecretKey(findFile(PRIVATE_KEY_FILE));
//Prepare key ring collection
PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection(
PGPUtil.getDecoderStream(findFile(PRIVATE_KEY_FILE)), new JcaKeyFingerprintCalculator());
final PGPPrivateKey pgpPrivateKey = PGPKeyUtil
.findSecretKey(pgpSec, pgpSecretKey.getKeyID(), PASSWORD.toCharArray());
PrivateKey privateKey = KeyConvertUtil.convertPGPPrivateKey2PrivateKey(pgpPrivateKey);
//Check if the private key is an instance of RSAKey
Assert.isInstanceOf(RSAKey.class, privateKey);
}
@Test
public void testGetKeypair()
throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException, UnrecoverableKeyException {
KeyStore instance = KeyStore.getInstance(KeyStore.getDefaultType());
instance.load(findFile(KEYSTORE_FILE), PASSWORD.toCharArray());
KeyPair keyPair = KeyConvertUtil.getKeyPair(instance, KEY_ALIAS, PASSWORD);
//Check if the private key is an instance of Key
Assert.isInstanceOf(RSAKey.class, keyPair.getPrivate());
}
} | [
"10856214@163.com"
] | 10856214@163.com |
851a08eeee159b037f8e1ad47c18796a37da38df | a62d1806650f87186f8a6e6cfa6b30256a51acd1 | /src/HuffmanTree/test.java | e4c556089731d7eee40b3222facf3063137ccc92 | [] | no_license | XiaYiTiao/Vcode | 94958fd142c347cdff1eb9d9031c8c892737e408 | 3f22db0fc422092c605c980f8fed03fd316a4074 | refs/heads/master | 2020-05-14T12:34:46.825996 | 2019-04-09T16:03:10 | 2019-04-09T16:03:10 | 181,796,217 | 1 | 0 | null | 2019-04-17T01:43:30 | 2019-04-17T01:43:30 | null | UTF-8 | Java | false | false | 621 | java | package HuffmanTree;
import java.util.ArrayList;
import java.util.List;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
HuffmanTree tree = new HuffmanTree();
List<HuffmanTree.Node> list = new ArrayList<HuffmanTree.Node>();
list.add(tree.new Node("A", 40));
list.add(tree.new Node("B", 7));
list.add(tree.new Node("C", 10));
list.add(tree.new Node("D", 30));
list.add(tree.new Node("E", 12));
list.add(tree.new Node("F", 2));
HuffmanTree.Node root = tree.createTree(list);
tree.showall(root);
}
}
| [
"victorzsnail@qq.com"
] | victorzsnail@qq.com |
32ea1b89066ae2bb6d0734925c3433753477442d | f8e846599d14085a214967dfd3b700f6ead01613 | /app/src/main/java/com/ubn/ummelquwain/ui/screens/landing/favorite/FavFragment.java | 6453d1f2f7959d7af3bfc9bb428004fd6425a630 | [] | no_license | MohamedAliArafa/UmmElQuwain | 1332288e6e54e16855c29594c82f573449dcf70d | 51efbb0a06eb7567da11a9797d4c227daa866e27 | refs/heads/master | 2021-01-22T12:25:51.881673 | 2017-11-29T14:00:33 | 2017-11-29T14:00:33 | 102,348,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,984 | java | package com.ubn.ummelquwain.ui.screens.landing.favorite;
import android.arch.lifecycle.LifecycleRegistry;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import com.ubn.ummelquwain.R;
import com.ubn.ummelquwain.adapter.FavStationAdapter;
import com.ubn.ummelquwain.adapter.SponsorAdapter;
import com.ubn.ummelquwain.models.response.Sponsors.SponsorResultModel;
import com.ubn.ummelquwain.models.response.Station.StationResultModel;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.realm.RealmResults;
public class FavFragment extends Fragment implements FavContract.ModelView{
@BindView(R.id.progressBar)
ProgressBar mProgressBar;
@BindView(R.id.recycler_spenser)
RecyclerView mSpenserRecycler;
@BindView(R.id.recycler_stations)
RecyclerView mStationRecycler;
private SponsorAdapter mSponsorAdapter;
private FavStationAdapter mStationAdapter;
LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
FavPresenter mPresenter;
public FavFragment() {
// Required empty public constructor
}
public static FavFragment newInstance() {
return new FavFragment();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPresenter = new FavPresenter(getContext(), this, getParentFragment().getFragmentManager(), getLifecycle());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_fav, container, false);
ButterKnife.bind(this, view);
mStationRecycler.setLayoutManager(new LinearLayoutManager(getContext()));
mStationAdapter = new FavStationAdapter(getContext(), null, mPresenter);
mStationRecycler.setAdapter(mStationAdapter);
mSpenserRecycler.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
mSponsorAdapter = new SponsorAdapter(getContext(), null, R.layout.list_item_sponser);
mSpenserRecycler.setAdapter(mSponsorAdapter);
return view;
}
@Override
public void updateSponsorUI(List<SponsorResultModel> models) {
mSponsorAdapter.updateData(models);
}
@Override
public void updateFavUI(RealmResults<StationResultModel> models) {
mStationAdapter.updateData(models);
}
@Override
public void showProgress() {
mProgressBar.setVisibility(View.VISIBLE);
}
@Override
public void hideProgress() {
mProgressBar.setVisibility(View.GONE);
}
}
| [
"ghostarafa@gmail.com"
] | ghostarafa@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.