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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f39f56b0b1fbe39e82e16085af460bb35043f91c | d93bdd9bfadc714d3c73cfaad0e4d48d33b27e8f | /ricardod.camargol/src/algoritmos/Operaciones.java | 2ce25ab2da389c2fe3557e6e3c12b1fefcd72a80 | [] | no_license | ricardocamargo18/Pruebagithub | be3db1464b759aed2a714021896489a7345cecd1 | e60b9db2400d242660c92491700498f9f62bef4e | refs/heads/master | 2020-03-28T06:07:37.531390 | 2018-09-16T23:52:19 | 2018-09-16T23:52:19 | 147,814,947 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package algoritmos;
public class Operaciones {
public static double coeficiente(double i, double j) {
double facN,facR,resta,facresta,resultado;
facN=factorial(i);
facR=factorial(j);
resta=i-j;
facresta=factorial(resta);
resultado=(facN)/(facR*(facresta));
return (resultado);
}
public static double factorial(double x) {
double factor=1;
while (x!=0)
{
factor*=x;
x--;
}
return factor;
}
}
| [
"rcamargol@unbosque.edu.co"
] | rcamargol@unbosque.edu.co |
b0ea506530cd86e4a69bb003e01f7aecf473284f | 901aec9c9408a737cf382d6c3549e44eb3d0f167 | /framework-base-common/framework-core-single-table-orm/src/main/java/org/framework/core/single/table/orm/core/ORM.java | 73921ec8cfe1fb458b1d4b5b2cb10ce759260533 | [] | no_license | zhangjunfang/architecture | a32f1d3e5dfd528517ed8dc4fd2e6b32a0a12e2d | 709cbc68a8381d93e7af779470025a1d8a27de4e | refs/heads/master | 2016-09-15T08:41:37.899666 | 2016-03-05T11:23:52 | 2016-03-05T11:23:52 | 33,911,525 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,236 | java | /**
* Copyright (c) 2011-2015, @author ocean(zhangjufang0505@163.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.framework.core.single.table.orm.core;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Types;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.rowset.CachedRowSet;
import org.framework.core.single.table.orm.util.DuplexMap;
import org.framework.core.single.table.orm.util.Ref;
/**
* Object relationship mapping.
* @author ocean(zhangjufang0505@163.com)
*
*/
public class ORM {
public static <T> T toBean(Class<T> beanClass,Map<String, Object> map) {
T t = null;
try {
t = beanClass.newInstance();
for(Map.Entry<String, Object> e2:map.entrySet())
if(e2.getValue()!=null)
Ref.setFieldVal(t, e2.getKey(), e2.getValue());
} catch (InstantiationException e1) {
e1.printStackTrace();
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
return t;
}
public static <T> List<T> toBeans(Class<T> beanClass,List<Map<String, Object>> maps) {
List<T> list = new ArrayList<T>();
for(Map<String, Object> map:maps)
list.add(toBean(beanClass, map));
return list.isEmpty()?null:list;
}
public static <T> T toBean(Class<T> beanClass,Map<String, Object> map,DuplexMap<String, String> columnFiledDuplexMap) {
T t = null;
try {
t = beanClass.newInstance();
for(Map.Entry<String, Object> e:map.entrySet())
if(e.getValue()!=null)
Ref.setFieldVal(t, columnFiledDuplexMap.getByK(e.getKey()), e.getValue());
} catch (InstantiationException e1) {
e1.printStackTrace();
} catch (IllegalAccessException e1) {
e1.printStackTrace();
}
return t;
}
public static <T> List<T> toBeans(Class<T> beanClass,List<Map<String, Object>> maps,DuplexMap<String, String> columnFiledDuplexMap) {
List<T> list = new ArrayList<T>();
for(Map<String, Object> map:maps)
list.add(toBean(beanClass, map,columnFiledDuplexMap));
return list.isEmpty()?null:list;
}
public static <T> List<T> toBeans(Class<T> beanClass,CachedRowSet crs,DuplexMap<String, String> columnFiledDuplexMap) {
return toBeans(beanClass, toMaps(crs), columnFiledDuplexMap);
}
public static Map<String, Object> toMap(Object bean) {
if(bean==null)
return null;
Map<String, Object> map = new HashMap<String, Object>();
List<Field> fields = Ref.getBeanFields(bean.getClass());
if(fields!=null){
try {
for(Field field:fields){
if(!Modifier.isStatic(field.getModifiers())){
field.setAccessible(true);
map.put(field.getName(), field.get(bean));
}
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
return map;
}
public static Map<String, Object> toMap(Object bean,DuplexMap<String, String> filedColumnDuplexMap) {
if(bean==null)
return null;
Map<String, Object> map = new HashMap<String, Object>();
List<Field> fields = Ref.getBeanFields(bean.getClass());
if(fields!=null){
try {
for(Field field:fields){
if(!Modifier.isStatic(field.getModifiers())){
field.setAccessible(true);
map.put(filedColumnDuplexMap.getByK(field.getName()), field.get(bean));
}
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
return map;
}
public static List<Map<String, Object>> toMaps(CachedRowSet crs) {
List<Map<String, Object>> maps = new ArrayList<Map<String, Object>>();
try {
ResultSetMetaData rsmd = crs.getMetaData();
int columnCount = rsmd.getColumnCount();
String[] labelNames = new String[columnCount];
int[] types = new int[columnCount];
for (int i=0; i<columnCount; i++) {
labelNames[i] = rsmd.getColumnLabel(i+1);
types[i] = rsmd.getColumnType(i+1);
}
while(crs.next()){
Map<String, Object> map = new HashMap<String, Object>();
Object value = null;
for(int i=0;i<columnCount;i++){
if (types[i] < Types.BLOB)
value = crs.getObject(i+1);
else if (types[i] == Types.CLOB)
value = handleClob(crs.getClob(i+1));
else if (types[i] == Types.NCLOB)
value = handleClob(crs.getNClob(i+1));
else if (types[i] == Types.BLOB)
value = handleBlob(crs.getBlob(i+1));
else
value = crs.getObject(i+1);
map.put(labelNames[i], value);
}
maps.add(map);
}
crs.close();
crs = null;
} catch (SQLException e) {
e.printStackTrace();
}
return maps;
}
public static byte[] handleBlob(Blob blob) {
byte[] data = null;
InputStream is = null;
try {
is = blob.getBinaryStream();
data = new byte[(int)blob.length()];
is.read(data);
is.close();
return data;
} catch (IOException e1) {
e1.printStackTrace();
} catch (SQLException e2) {
e2.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return data;
}
public static String handleClob(Clob clob) {
String data = null;
Reader reader = null;
try {
reader = clob.getCharacterStream();
char[] buffer = new char[(int)clob.length()];
reader.read(buffer);
data = new String(buffer);
} catch (IOException e1) {
e1.printStackTrace();
} catch (SQLException e2) {
e2.printStackTrace();
} finally {
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return data;
}
}
| [
"zhangjunfang0505@163.com"
] | zhangjunfang0505@163.com |
2fc2c69a06829a3482100d421dbfbeab30c9eb16 | 8ceecf7c29e21dcf107166cfc77d14816437d65a | /brave/src/main/java/brave/propagation/TraceIdContext.java | 1029314dad3697d63b789c6fe25c039f903a8642 | [
"Apache-2.0"
] | permissive | slaveuser/brave20180725 | bd0c2994fefc5429ea843761015abfe0f6d23321 | cf6cba4de81f59fe35b6f45d981938ace7f77545 | refs/heads/master | 2020-05-16T11:41:45.065243 | 2019-04-23T13:45:29 | 2019-04-23T13:45:29 | 183,024,383 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,858 | java | package brave.propagation;
import brave.internal.Nullable;
import java.util.logging.Level;
import java.util.logging.Logger;
import static brave.internal.HexCodec.lenientLowerHexToUnsignedLong;
import static brave.internal.HexCodec.writeHexLong;
/**
* Contains inbound trace ID and sampling flags, used when users control the root trace ID, but not
* the span ID (ex Amazon X-Ray or other correlation).
*/
//@Immutable
public final class TraceIdContext extends SamplingFlags {
static final Logger LOG = Logger.getLogger(TraceIdContext.class.getName());
public static Builder newBuilder() {
return new Builder();
}
/** When non-zero, the trace containing this span uses 128-bit trace identifiers. */
public long traceIdHigh() {
return traceIdHigh;
}
/** Unique 8-byte identifier for a trace, set on all spans within it. */
public long traceId() {
return traceId;
}
public Builder toBuilder() {
return new Builder(this);
}
/** Returns {@code $traceId} */
@Override
public String toString() {
boolean traceHi = traceIdHigh != 0;
char[] result = new char[traceHi ? 32 : 16];
int pos = 0;
if (traceHi) {
writeHexLong(result, pos, traceIdHigh);
pos += 16;
}
writeHexLong(result, pos, traceId);
return new String(result);
}
public static final class Builder extends InternalBuilder {
Builder(TraceIdContext context) { // no external implementations
traceIdHigh = context.traceIdHigh;
traceId = context.traceId;
flags = context.flags;
}
/** @see TraceIdContext#traceIdHigh() */
public Builder traceIdHigh(long traceIdHigh) {
this.traceIdHigh = traceIdHigh;
return this;
}
/** @see TraceIdContext#traceId() */
public Builder traceId(long traceId) {
this.traceId = traceId;
return this;
}
/** @see TraceIdContext#sampled() */
@Override public Builder sampled(boolean sampled) {
super.sampled(sampled);
return this;
}
/** @see TraceIdContext#sampled() */
@Override public Builder sampled(@Nullable Boolean sampled) {
super.sampled(sampled);
return this;
}
/** @see TraceIdContext#debug() */
@Override public Builder debug(boolean debug) {
super.debug(debug);
return this;
}
public final TraceIdContext build() {
if (traceId == 0L) throw new IllegalStateException("Missing: traceId");
return new TraceIdContext(this);
}
@Override Logger logger() {
return LOG;
}
Builder() { // no external implementations
}
}
final long traceIdHigh, traceId;
TraceIdContext(Builder builder) { // no external implementations
super(builder.flags);
traceIdHigh = builder.traceIdHigh;
traceId = builder.traceId;
}
/** Only includes mandatory fields {@link #traceIdHigh()} and {@link #traceId()} */
@Override public boolean equals(Object o) {
if (o == this) return true;
if (!(o instanceof TraceIdContext)) return false;
TraceIdContext that = (TraceIdContext) o;
return (traceIdHigh == that.traceIdHigh) && (traceId == that.traceId);
}
/** Only includes mandatory fields {@link #traceIdHigh()} and {@link #traceId()} */
@Override public int hashCode() {
int h = 1;
h *= 1000003;
h ^= (int) ((traceIdHigh >>> 32) ^ traceIdHigh);
h *= 1000003;
h ^= (int) ((traceId >>> 32) ^ traceId);
return h;
}
static abstract class InternalBuilder {
abstract Logger logger();
long traceIdHigh, traceId;
int flags = 0; // bit field for sampled and debug
/**
* Returns true when {@link TraceContext#traceId()} and potentially also {@link TraceContext#traceIdHigh()}
* were parsed from the input. This assumes the input is valid, an up to 32 character lower-hex
* string.
*
* <p>Returns boolean, not this, for conditional, exception free parsing:
*
* <p>Example use:
* <pre>{@code
* // Attempt to parse the trace ID or break out if unsuccessful for any reason
* String traceIdString = getter.get(carrier, key);
* if (!builder.parseTraceId(traceIdString, propagation.traceIdKey)) {
* return TraceContextOrSamplingFlags.EMPTY;
* }
* }</pre>
*
* @param traceIdString the 1-32 character lowerhex string
* @param key the name of the propagation field representing the trace ID; only using in logging
* @return false if the input is null or malformed
*/
// temporarily package protected until we figure out if this is reusable enough to expose
final boolean parseTraceId(String traceIdString, Object key) {
if (isNull(key, traceIdString)) return false;
int length = traceIdString.length();
if (invalidIdLength(key, length, 32)) return false;
// left-most characters, if any, are the high bits
int traceIdIndex = Math.max(0, length - 16);
if (traceIdIndex > 0) {
traceIdHigh = lenientLowerHexToUnsignedLong(traceIdString, 0, traceIdIndex);
if (traceIdHigh == 0) {
maybeLogNotLowerHex(key, traceIdString);
return false;
}
}
// right-most up to 16 characters are the low bits
traceId = lenientLowerHexToUnsignedLong(traceIdString, traceIdIndex, length);
if (traceId == 0) {
maybeLogNotLowerHex(key, traceIdString);
return false;
}
return true;
}
boolean invalidIdLength(Object key, int length, int max) {
if (length > 1 && length <= max) return false;
Logger log = logger();
if (log.isLoggable(Level.FINE)) {
log.fine(key + " should be a 1 to " + max + " character lower-hex string with no prefix");
}
return true;
}
boolean isNull(Object key, String maybeNull) {
if (maybeNull != null) return false;
Logger log = logger();
if (log.isLoggable(Level.FINE)) log.fine(key + " was null");
return true;
}
void maybeLogNotLowerHex(Object key, String notLowerHex) {
Logger log = logger();
if (log.isLoggable(Level.FINE)) {
log.fine(key + ": " + notLowerHex + " is not a lower-hex string");
}
}
InternalBuilder sampled(boolean sampled) {
flags |= FLAG_SAMPLED_SET;
if (sampled) {
flags |= FLAG_SAMPLED;
} else {
flags &= ~FLAG_SAMPLED;
}
return this;
}
InternalBuilder sampled(@Nullable Boolean sampled) {
if (sampled != null) return sampled((boolean) sampled);
flags &= ~FLAG_SAMPLED_SET;
return this;
}
/** Ensures sampled is set when debug is */
InternalBuilder debug(boolean debug) {
if (debug) {
flags |= FLAG_DEBUG;
flags |= FLAG_SAMPLED_SET;
flags |= FLAG_SAMPLED;
} else {
flags &= ~FLAG_DEBUG;
}
return this;
}
}
}
| [
"gmcpo@LAPTOP-2AD376QK"
] | gmcpo@LAPTOP-2AD376QK |
dda306fe4a01caa3cb38862f0ac9bea73271b473 | b6eb0ecadbb70ed005d687268a0d40e89d4df73e | /feilong-net/feilong-net-http/src/test/java/com/feilong/net/http/PutTest.java | 5c62d672a43bf7ecc03d4566036b296d2882972a | [
"Apache-2.0"
] | permissive | ifeilong/feilong | b175d02849585c7b12ed0e9864f307ed1a26e89f | a0d4efeabc29503b97caf0c300afe956a5caeb9f | refs/heads/master | 2023-08-18T13:08:46.724616 | 2023-08-14T04:30:34 | 2023-08-14T04:30:34 | 252,767,655 | 97 | 28 | Apache-2.0 | 2023-04-17T17:47:44 | 2020-04-03T15:14:35 | Java | UTF-8 | Java | false | false | 1,142 | java | /*
* Copyright (C) 2008 feilong
*
* 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.feilong.net.http;
import org.junit.Test;
import com.feilong.net.http.HttpClientUtil;
public class PutTest{
@Test(expected = NullPointerException.class)
public void testPutNull(){
HttpClientUtil.put((String) null);
}
@Test(expected = IllegalArgumentException.class)
public void testPutEmpty(){
HttpClientUtil.put("");
}
@Test(expected = IllegalArgumentException.class)
public void testPutBlank(){
HttpClientUtil.put(" ");
}
}
| [
"venusdrogon@163.com"
] | venusdrogon@163.com |
bdd31034ed9f8ce201d5ec291bd463cc8c3721b7 | 9d05e874cc5dce229d4818df4a01c3de6ef5dd6b | /src/test/java/Amol/AppTest.java | 4eb797e00b165430a56a8ae0c45caf1097429b0d | [] | no_license | sanketmistri/CucumberPOM | d5249bb77f67b9336bc396d649b715571855363b | 0f016f92e3da6df0d4d9556454c9da30f52975e9 | refs/heads/master | 2021-05-18T10:07:38.753351 | 2020-03-30T04:50:33 | 2020-03-30T04:50:33 | 251,204,473 | 0 | 0 | null | 2020-10-13T20:45:26 | 2020-03-30T04:50:54 | Java | UTF-8 | Java | false | false | 276 | java | package Amol;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
| [
"amolujagare@gmail.com"
] | amolujagare@gmail.com |
590cc16a3d3a08031183d5d6173e2654217aaa11 | 8218a67b4657738b73f585cbc453e6c91d89d13f | /src/main/java/com/zt/service/ImportorderStep.java | 58ec2aa787ad4f41d173a52f3fd3614b4deec33d | [] | no_license | myege/wms | 8ac1335eb3283fe8022db5c2e95cb025e12ca3ba | e272b4b95c524d168b6f0cf40a5d38dd64237a3f | refs/heads/master | 2023-08-18T20:04:28.562030 | 2021-09-18T09:22:06 | 2021-09-18T09:22:06 | 407,808,250 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 288 | java | package com.zt.service;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
@WebService
@BindingType("http://www.w3.org/2003/05/soap/bindings/HTTP/")
public interface ImportorderStep {
@WebMethod
String importorderStep(String paramString);
}
| [
"myoperatwmsoms@outlook.com"
] | myoperatwmsoms@outlook.com |
13da3a430ba7ae3222e73d05db5473284c17eaf9 | 29cbccef9d3884d5f81580fd6af07ade36b7a176 | /examples/src/java/org/apache/hivemind/examples/ExampleUtils.java | 983924272f49c5e2414b06b21d165bcb5008dcb3 | [
"Apache-2.0"
] | permissive | rsassi/hivemind1 | 848ee0d913f668c69de3bba00060908ddc9305a2 | 5802c535431431a7a576a86e1983c7b523e03491 | refs/heads/branch-1-0 | 2023-06-23T19:49:12.272173 | 2021-07-25T03:46:28 | 2021-07-25T03:46:28 | 389,250,137 | 0 | 0 | null | 2021-07-25T03:46:29 | 2021-07-25T03:20:30 | Java | UTF-8 | Java | false | false | 2,114 | java | // Copyright 2004 The Apache Software Foundation
//
// 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.apache.hivemind.examples;
import java.util.Locale;
import org.apache.hivemind.ClassResolver;
import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.DefaultClassResolver;
import org.apache.hivemind.impl.RegistryBuilder;
import org.apache.hivemind.util.FileResource;
/**
* Utilities needed by the examples.
*
* @author Howard Lewis Ship
*/
public class ExampleUtils
{
/**
* Builds a Registry for a file stored in the src/descriptor/META-INF directory.
*
* @param fileName -- the name of the module descriptor file.
*/
public static Registry buildRegistry(String fileName)
{
// The examples package is structured oddly (so that it doesn't interfere with
// the main HiveMind framework tests), so we have to go through some gyrations
// here that aren't necessary in an ordinary HiveMind application.
String projectRoot = System.getProperty("PROJECT_ROOT", ".");
String path = projectRoot + "/examples/src/descriptor/META-INF/" + fileName;
RegistryBuilder builder = new RegistryBuilder();
ClassResolver resolver = new DefaultClassResolver();
// Process standard files, on the classpath.
builder.processModules(resolver);
// Process the examples.xml file, which (given its non-standard name)
// is not visible.
builder.processModule(resolver, new FileResource(path));
return builder.constructRegistry(Locale.getDefault());
}
}
| [
"ahuegen@localhost"
] | ahuegen@localhost |
7828905959cb9f6d2912febed475a2e34d1738d1 | e0d2d798ee990357e9d24dbeb29653d2853cfe29 | /subprojects/model-core/src/main/java/org/gradle/api/model/ObjectFactory.java | 6f098d77fe9dbd350a57f1463f3cf73c307f2af5 | [
"MIT",
"LGPL-2.1-only",
"Apache-2.0",
"CPL-1.0"
] | permissive | balazsbanyai/gradle | a2c899f4f59e87cb1c40a3a23b0e005a6dd409fe | f22eea2bd288f2cefc043df1fb3ff48eb8abc779 | refs/heads/master | 2021-06-07T09:37:03.999756 | 2017-06-13T10:20:43 | 2017-07-06T16:34:39 | 96,475,247 | 0 | 0 | Apache-2.0 | 2018-11-29T13:54:07 | 2017-07-06T21:57:42 | Java | UTF-8 | Java | false | false | 1,988 | java | /*
* Copyright 2017 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.gradle.api.model;
import org.gradle.api.Incubating;
import org.gradle.api.Named;
/**
* A factory for creating various kinds of model objects.
* <p>
* An instance of the factory can be injected into a task or plugin by annotating a public constructor or method with {@code javax.inject.Inject}. It is also available via {@link org.gradle.api.Project#getObjects()}.
*
* @since 4.0
*/
@Incubating
public interface ObjectFactory {
/**
* Creates a simple immutable {@link Named} object of the given type and name.
*
* <p>The given type can be an interface that extends {@link Named} or an abstract class that 'implements' {@link Named}. An abstract class, if provided:</p>
* <ul>
* <li>Must provide a zero-args constructor that is not private.</li>
* <li>Must not define or inherit any instance fields.</li>
* <li>Should not provide an implementation for {@link Named#getName()} and should define this method as abstract. Any implementation will be overridden.</li>
* <li>Must not define or inherit any other abstract methods.</li>
* </ul>
*
* <p>An interface, if provided, must not define or inherit any other methods.</p>
*
* <p>Objects created using this method are not decorated or extensible.</p>
*/
<T extends Named> T named(Class<T> type, String name);
}
| [
"adam@gradle.com"
] | adam@gradle.com |
97a22a27ea155d44d36b3a146d9d59df5c76b077 | ae96f87cb7e483acdff3f05b3e22eb83df0f6e9b | /spring-cloud-starter-stream-source-sftp/src/main/java/org/springframework/cloud/stream/app/sftp/source/metadata/SftpSourceRedisIdempotentReceiverConfiguration.java | 01b19f906e0797942fead0354e47c5084de4b0c5 | [
"Apache-2.0"
] | permissive | sobychacko/sftp | ea271b6ad96abdf0e9239dddec99669ab5f7ec77 | 4b97c0404aa59353bb71321299b7767c51267cf4 | refs/heads/master | 2021-01-19T19:56:50.418161 | 2018-05-22T15:02:20 | 2018-05-22T15:02:27 | 72,126,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,305 | java | /*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.stream.app.sftp.source.metadata;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.integration.channel.NullChannel;
import org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor;
import org.springframework.integration.handler.advice.IdempotentReceiverInterceptor;
import org.springframework.integration.metadata.ConcurrentMetadataStore;
import org.springframework.integration.redis.metadata.RedisMetadataStore;
import org.springframework.integration.selector.MetadataStoreSelector;
/**
* @author Chris Schaefer
*/
@EnableConfigurationProperties({ SftpSourceRedisIdempotentReceiverProperties.class, RedisProperties.class })
public class SftpSourceRedisIdempotentReceiverConfiguration {
protected static final String REMOTE_DIRECTORY_MESSAGE_HEADER = "file_remoteDirectory";
@Autowired
private BeanFactory beanFactory;
@Bean
@ConditionalOnMissingBean
public ConcurrentMetadataStore metadataStore(RedisConnectionFactory redisConnectionFactory,
SftpSourceRedisIdempotentReceiverProperties sftpSourceRedisIdempotentReceiverProperties) {
return new RedisMetadataStore(redisConnectionFactory, sftpSourceRedisIdempotentReceiverProperties.getKeyName());
}
@Bean
@ConditionalOnMissingBean
public IdempotentReceiverInterceptor idempotentReceiverInterceptor(ConcurrentMetadataStore metadataStore) {
String expressionStatement = new StringBuilder()
.append("headers['")
.append(REMOTE_DIRECTORY_MESSAGE_HEADER)
.append("'].concat(payload)")
.toString();
Expression expression = new SpelExpressionParser().parseExpression(expressionStatement);
ExpressionEvaluatingMessageProcessor<String> idempotentKeyStrategy =
new ExpressionEvaluatingMessageProcessor<>(expression);
idempotentKeyStrategy.setBeanFactory(this.beanFactory);
IdempotentReceiverInterceptor idempotentReceiverInterceptor =
new IdempotentReceiverInterceptor(new MetadataStoreSelector(idempotentKeyStrategy, metadataStore));
idempotentReceiverInterceptor.setDiscardChannel(new NullChannel());
return idempotentReceiverInterceptor;
}
}
| [
"abilan@pivotal.io"
] | abilan@pivotal.io |
8a61ebe85d12e92ab04816b05d8480284929e8e8 | b411493854996347634cdac5e9005ec90e03d763 | /tests/io.sarl.lang.ui.tests/src/io/sarl/lang/ui/tests/quickfix/ProtectKeywordQuickfixTest.java | e332cec5886271401e1378203b4246fe5383b45a | [
"Apache-2.0"
] | permissive | gb96/sarl | 4c64b1ed306a655407d3c90565c409211045db25 | a24d15e360d0e735ae1378275656ce320506adfc | refs/heads/master | 2021-05-05T19:34:34.003924 | 2018-01-16T16:18:23 | 2018-01-16T16:18:23 | 117,787,214 | 0 | 0 | null | 2018-01-17T05:11:30 | 2018-01-17T05:11:30 | null | UTF-8 | Java | false | false | 1,200 | java | /*
* Copyright (C) 2014-2017 the original authors 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 io.sarl.lang.ui.tests.quickfix;
import org.junit.Test;
import io.sarl.lang.parser.SyntaxIssueCodes;
@SuppressWarnings("all")
public class ProtectKeywordQuickfixTest extends AbstractSARLQuickfixTest {
@Test
public void fix() {
assertQuickFixWithErrors(
SyntaxIssueCodes.USED_RESERVED_KEYWORD,
//
// Code to fix:
//
"package io.sarl.lang.tests.behavior.mypackage",
//
// Label and description:
//
"Change to '^behavior'",
//
// Expected fixed code:
//
"package io.sarl.lang.tests.^behavior.mypackage");
}
}
| [
"galland@arakhne.org"
] | galland@arakhne.org |
84a1ca7ae5e33fa285f30792ceeb9ff6510a2576 | 2a040f5cb47915a58ff47e3a95fbb8e53ce09b5a | /app/src/main/java/com/swipelistview/SwipeListViewListener.java | 40224b1995d43534ec949100c6628c931d2d9e20 | [] | no_license | githubwithme/farm | 7ad23f520f289de716c76baa93e9b6f8427da5ce | 34827ce4eb2db66c5057c384cc79344d91c85710 | refs/heads/master | 2020-12-12T13:56:05.409508 | 2016-02-26T08:03:37 | 2016-02-26T08:03:37 | 48,423,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,389 | java | package com.swipelistview;
/**
* Created by ${hmj} on 2016/1/20.
*/
public interface SwipeListViewListener
{
/**
* Called when open animation finishes
*
* @param position list item
* @param toRight Open to right
*/
void onOpened(int position, boolean toRight);
/**
* Called when close animation finishes
*
* @param position list item
* @param fromRight Close from right
*/
void onClosed(int position, boolean fromRight);
/**
* Called when the list changed
*/
void onListChanged();
/**
* Called when user is moving an item
*
* @param position list item
* @param x Current position X
*/
void onMove(int position, float x);
/**
* Start open item
*
* @param position list item
* @param action current action
* @param right to right
*/
void onStartOpen(int position, int action, boolean right);
/**
* Start close item
*
* @param position list item
* @param right
*/
void onStartClose(int position, boolean right);
/**
* Called when user clicks on the front view
*
* @param position list item
*/
void onClickFrontView(int position);
/**
* Called when user clicks on the back view
*
* @param position list item
*/
void onClickBackView(int position);
/**
* Called when user dismisses items
*
* @param reverseSortedPositions Items dismissed
*/
void onDismiss(int[] reverseSortedPositions);
/**
* Used when user want to change swipe list mode on some rows. Return SWIPE_MODE_DEFAULT
* if you don't want to change swipe list mode
*
* @param position position that you want to change
* @return type
*/
int onChangeSwipeMode(int position);
/**
* Called when user choice item
*
* @param position position that choice
* @param selected if item is selected or not
*/
void onChoiceChanged(int position, boolean selected);
/**
* User start choice items
*/
void onChoiceStarted();
/**
* User end choice items
*/
void onChoiceEnded();
/**
* User is in first item of list
*/
void onFirstListItem();
/**
* User is in last item of list
*/
void onLastListItem();
}
| [
"1655815015@qq.com"
] | 1655815015@qq.com |
8df5eaa11a45cb7557fe2617ce25c2cd00ed4ab6 | 0ed0793dfbe80580b733925d1197726052dad16b | /src/com/sun/org/apache/bcel/internal/generic/FCMPG.java | 855e0f26c45dd80c6554279e2201b312ac5e09e0 | [] | no_license | td1617/jdk1.8-source-analysis | 73b653f014f90eee1a6c6f8dd9b132b2333666f9 | e260d95608527ca360892bdd21c9b75ea072fbaa | refs/heads/master | 2023-03-12T03:22:09.529624 | 2021-02-25T01:00:11 | 2021-02-25T01:01:44 | 341,839,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,878 | java | /*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.sun.org.apache.bcel.internal.generic;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache BCEL" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache BCEL", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR
* ITS 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
/**
* FCMPG - Compare floats: value1 > value2
* <PRE>Stack: ..., value1, value2 -> ..., result</PRE>
*
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
*/
public class FCMPG extends Instruction
implements TypedInstruction, StackProducer, StackConsumer {
public FCMPG() {
super(com.sun.org.apache.bcel.internal.Constants.FCMPG, (short) 1);
}
/**
* @return Type.FLOAT
*/
public Type getType(ConstantPoolGen cp) {
return Type.FLOAT;
}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
public void accept(Visitor v) {
v.visitTypedInstruction(this);
v.visitStackProducer(this);
v.visitStackConsumer(this);
v.visitFCMPG(this);
}
}
| [
"2714956759@qq.com"
] | 2714956759@qq.com |
065507daa908ea6a26e1878fbe0ac0fb5447a4e5 | 0ad51dde288a43c8c2216de5aedcd228e93590ac | /src/com/vmware/converter/VspanSameSessionPortConflict.java | 161041231ac3d93731e64b4d03edcefa3c669a73 | [] | no_license | YujiEda/converter-sdk-java | 61c37b2642f3a9305f2d3d5851c788b1f3c2a65f | bcd6e09d019d38b168a9daa1471c8e966222753d | refs/heads/master | 2020-04-03T09:33:38.339152 | 2019-02-11T15:19:04 | 2019-02-11T15:19:04 | 155,151,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,367 | java | /**
* VspanSameSessionPortConflict.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package com.vmware.converter;
public class VspanSameSessionPortConflict extends com.vmware.converter.DvsFault implements java.io.Serializable {
private java.lang.String vspanSessionKey;
private java.lang.String portKey;
public VspanSameSessionPortConflict() {
}
public VspanSameSessionPortConflict(
com.vmware.converter.LocalizedMethodFault faultCause,
com.vmware.converter.LocalizableMessage[] faultMessage,
java.lang.String vspanSessionKey,
java.lang.String portKey) {
super(
faultCause,
faultMessage);
this.vspanSessionKey = vspanSessionKey;
this.portKey = portKey;
}
/**
* Gets the vspanSessionKey value for this VspanSameSessionPortConflict.
*
* @return vspanSessionKey
*/
public java.lang.String getVspanSessionKey() {
return vspanSessionKey;
}
/**
* Sets the vspanSessionKey value for this VspanSameSessionPortConflict.
*
* @param vspanSessionKey
*/
public void setVspanSessionKey(java.lang.String vspanSessionKey) {
this.vspanSessionKey = vspanSessionKey;
}
/**
* Gets the portKey value for this VspanSameSessionPortConflict.
*
* @return portKey
*/
public java.lang.String getPortKey() {
return portKey;
}
/**
* Sets the portKey value for this VspanSameSessionPortConflict.
*
* @param portKey
*/
public void setPortKey(java.lang.String portKey) {
this.portKey = portKey;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof VspanSameSessionPortConflict)) return false;
VspanSameSessionPortConflict other = (VspanSameSessionPortConflict) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.vspanSessionKey==null && other.getVspanSessionKey()==null) ||
(this.vspanSessionKey!=null &&
this.vspanSessionKey.equals(other.getVspanSessionKey()))) &&
((this.portKey==null && other.getPortKey()==null) ||
(this.portKey!=null &&
this.portKey.equals(other.getPortKey())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getVspanSessionKey() != null) {
_hashCode += getVspanSessionKey().hashCode();
}
if (getPortKey() != null) {
_hashCode += getPortKey().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(VspanSameSessionPortConflict.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("urn:vim25", "VspanSameSessionPortConflict"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("vspanSessionKey");
elemField.setXmlName(new javax.xml.namespace.QName("urn:vim25", "vspanSessionKey"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("portKey");
elemField.setXmlName(new javax.xml.namespace.QName("urn:vim25", "portKey"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"yuji_eda@dwango.co.jp"
] | yuji_eda@dwango.co.jp |
2548d2fd900785e4a221a0ae22ee3526b153c742 | 95e944448000c08dd3d6915abb468767c9f29d3c | /sources/com/bytedance/frameworks/baselib/network/http/impl/C10168g.java | 0f6f8ba343d772c6b38341845bb9c5fbff714b51 | [] | no_license | xrealm/tiktok-src | 261b1faaf7b39d64bb7cb4106dc1a35963bd6868 | 90f305b5f981d39cfb313d75ab231326c9fca597 | refs/heads/master | 2022-11-12T06:43:07.401661 | 2020-07-04T20:21:12 | 2020-07-04T20:21:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | package com.bytedance.frameworks.baselib.network.http.impl;
import com.p280ss.android.ugc.aweme.lancet.network.C32283c;
import java.net.URI;
import java.util.Map;
/* renamed from: com.bytedance.frameworks.baselib.network.http.impl.g */
final class C10168g {
/* renamed from: a */
static void m30206a(C10166f fVar, URI uri, C10163e eVar) {
C32283c.m104806a(fVar.f27693a);
fVar.mo24848b(uri, eVar);
}
/* renamed from: a */
static void m30207a(C10166f fVar, Map map, boolean z) {
fVar.mo24846a(map, z);
C32283c.m104806a(fVar.f27693a);
}
}
| [
"65450641+Xyzdesk@users.noreply.github.com"
] | 65450641+Xyzdesk@users.noreply.github.com |
4e5db90e8118b37f2ac8a2a71d0c670be285e71b | 9166017b52b7f35191fc83b3cfcccac7ee4c3e85 | /xkVideoRecord/src/main/java/com/yunbao/phonelive/video/shortvideo/editor/bgm/TCMusicChooseLayout.java | 5d71d153c6a1e751475ca5ed643429505b7b11d1 | [] | no_license | 1352101891/APICLoud-master | 76d121603a268e16e691cef19a671cb862a907ca | f804423d778f0e60f33eb40986bfdae856df0d17 | refs/heads/master | 2022-01-15T10:57:56.118220 | 2019-05-31T15:29:40 | 2019-05-31T15:29:40 | 148,508,513 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,190 | java | package com.yunbao.phonelive.video.shortvideo.editor.bgm;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;
import com.yunbao.phonelive.R;
import java.util.ArrayList;
import java.util.List;
/**
* Created by hanszhli on 2017/6/15.
*/
public class TCMusicChooseLayout extends RelativeLayout {
private RecyclerView mRecyclerView;
private RelativeLayout mRlEmpty, mRlLoading, mRlRoot;
private TCMusicAdapter mMusicListAdapter;
private List<TCBGMInfo> mMusicList;
public TCMusicChooseLayout(Context context) {
super(context);
init();
}
public TCMusicChooseLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public TCMusicChooseLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
View view = View.inflate(getContext(), R.layout.layout_chose_music, this);
mRlRoot = (RelativeLayout) view.findViewById(R.id.chose_rl_root);
mRlEmpty = (RelativeLayout) view.findViewById(R.id.chose_rl_empty);
mRecyclerView = (RecyclerView) view.findViewById(R.id.chose_rv_music);
mRlLoading = (RelativeLayout) view.findViewById(R.id.chose_rl_loading_music);
initMusicList();
}
private void initMusicList() {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
mMusicList = new ArrayList<>();
mMusicListAdapter = new TCMusicAdapter(mMusicList);
mRecyclerView.setAdapter(mMusicListAdapter);
mRlLoading.setVisibility(View.VISIBLE);
//延迟500ms在进行歌曲加载, 避免与外部线程竞争
this.postDelayed(new Runnable() {
@Override
public void run() {
loadMusicAndSetAdapter();
}
}, 500);
}
private void loadMusicAndSetAdapter() {
new Thread(new Runnable() {
@Override
public void run() {
mMusicList.clear();
mMusicList.addAll(TCMusicManager.getInstance(getContext()).getAllMusic());
//切换到主线程
post(new Runnable() {
@Override
public void run() {
mRlLoading.setVisibility(View.GONE);
if (mMusicList != null && mMusicList.size() > 0) {
mMusicListAdapter.notifyDataSetChanged();
mRecyclerView.setAdapter(mMusicListAdapter);
} else {
mRlEmpty.setVisibility(View.VISIBLE);
}
}
});
}
}).start();
}
public void setOnItemClickListener(TCMusicAdapter.OnItemClickListener listener) {
mMusicListAdapter.setOnItemClickListener(listener);
}
public List<TCBGMInfo> getMusicList() {
return mMusicList;
}
}
| [
"1352101891@qq.com"
] | 1352101891@qq.com |
916673dd0e81cfcab12d3e0e0e3c05ebe70150fb | 4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849 | /aliyun-java-sdk-emas-dmp/src/main/java/com/aliyuncs/emas_dmp/transform/v20210402/ListTargetAudienceResponseUnmarshaller.java | 61a51d569996584004133d568eb46e26ed42584d | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-java-sdk | a263fa08e261f12d45586d1b3ad8a6609bba0e91 | e19239808ad2298d32dda77db29a6d809e4f7add | refs/heads/master | 2023-09-03T12:28:09.765286 | 2023-09-01T09:03:00 | 2023-09-01T09:03:00 | 39,555,898 | 1,542 | 1,317 | NOASSERTION | 2023-09-14T07:27:05 | 2015-07-23T08:41:13 | Java | UTF-8 | Java | false | false | 4,178 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.emas_dmp.transform.v20210402;
import java.util.ArrayList;
import java.util.List;
import com.aliyuncs.emas_dmp.model.v20210402.ListTargetAudienceResponse;
import com.aliyuncs.emas_dmp.model.v20210402.ListTargetAudienceResponse.Data;
import com.aliyuncs.emas_dmp.model.v20210402.ListTargetAudienceResponse.Data.Crowds;
import com.aliyuncs.transform.UnmarshallerContext;
public class ListTargetAudienceResponseUnmarshaller {
public static ListTargetAudienceResponse unmarshall(ListTargetAudienceResponse listTargetAudienceResponse, UnmarshallerContext _ctx) {
listTargetAudienceResponse.setRequestId(_ctx.stringValue("ListTargetAudienceResponse.RequestId"));
Data data = new Data();
data.setPageNum(_ctx.integerValue("ListTargetAudienceResponse.Data.PageNum"));
data.setPageSize(_ctx.integerValue("ListTargetAudienceResponse.Data.PageSize"));
data.setTotalPages(_ctx.integerValue("ListTargetAudienceResponse.Data.TotalPages"));
data.setTotalElements(_ctx.integerValue("ListTargetAudienceResponse.Data.TotalElements"));
List<Crowds> taList = new ArrayList<Crowds>();
for (int i = 0; i < _ctx.lengthValue("ListTargetAudienceResponse.Data.TaList.Length"); i++) {
Crowds crowds = new Crowds();
crowds.setTaId(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].TaId"));
crowds.setName(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].Name"));
crowds.setCreatedTime(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].CreatedTime"));
crowds.setTotalNumber(_ctx.longValue("ListTargetAudienceResponse.Data.TaList["+ i +"].TotalNumber"));
crowds.setSource(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].Source"));
crowds.setTaBaseType(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].TaBaseType"));
crowds.setTaType(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].TaType"));
crowds.setTenantId(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].TenantId"));
crowds.setTenantName(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].TenantName"));
crowds.setAccountId(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].AccountId"));
crowds.setAccountName(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].AccountName"));
crowds.setStatus(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].Status"));
crowds.setUploadFileNum(_ctx.integerValue("ListTargetAudienceResponse.Data.TaList["+ i +"].UploadFileNum"));
crowds.setPushStatus(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].PushStatus"));
crowds.setPushTime(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].PushTime"));
crowds.setErrorMessage(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].ErrorMessage"));
crowds.setCreateCondition(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].CreateCondition"));
crowds.setBusinessScenario(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].BusinessScenario"));
List<String> pushedBand = new ArrayList<String>();
for (int j = 0; j < _ctx.lengthValue("ListTargetAudienceResponse.Data.TaList["+ i +"].PushedBand.Length"); j++) {
pushedBand.add(_ctx.stringValue("ListTargetAudienceResponse.Data.TaList["+ i +"].PushedBand["+ j +"]"));
}
crowds.setPushedBand(pushedBand);
taList.add(crowds);
}
data.setTaList(taList);
listTargetAudienceResponse.setData(data);
return listTargetAudienceResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
9cd03d68b7d5b051c67d4a2840795ee2e6432e0b | 117f1fce7baf23e2a7eee10c337d856a07d4a055 | /VirtuePk 803/src/org/virtue/Launcher.java | f27209210e23eb9bd70fddf45875e03b37ad4dbd | [] | no_license | TagsRocks/VirtuePk | 618cece186d0239769b4bba36f7d2a2664ad5230 | 61760bdaa4d7c91ad603bb43bff05e7a77c037e2 | refs/heads/master | 2020-06-20T09:33:05.634074 | 2014-06-30T02:51:01 | 2014-06-30T02:51:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,014 | java | package org.virtue;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.virtue.cache.Cache;
import org.virtue.cache.ChecksumTable;
import org.virtue.cache.Container;
import org.virtue.cache.def.CacheIndex;
import org.virtue.cache.def.ItemDefinitionLoader;
import org.virtue.cache.def.NPCDefinitionLoader;
import org.virtue.cache.def.ObjectDefinitionLoader;
import org.virtue.cache.tools.CacheLoader;
import org.virtue.game.GameEngine;
import org.virtue.game.core.threads.MainThreadFactory;
import org.virtue.game.logic.Lobby;
import org.virtue.game.logic.node.object.RS3Object;
import org.virtue.game.logic.social.clans.ClanSettingsAPI;
import org.virtue.game.logic.social.clans.internal.ClanSettingsManager;
import org.virtue.network.RS2Network;
import org.virtue.network.io.IOHub;
import org.virtue.network.loginserver.DataServer;
import org.virtue.utility.ConsoleLogger;
import org.virtue.utility.Huffman;
import org.virtue.utility.TimeUtil;
/**
* @author Taylor Moon
* @since Jan 22, 2014
*/
public class Launcher {
/**
* Represents the secure random.
*/
private static final Random RANDOM = new SecureRandom();
/**
* Represents the main executor that executes the game engine.
*/
private static final ExecutorService ENGINE_LOADER = Executors.newCachedThreadPool(new MainThreadFactory());
/**
* Represents the network foundation of the server.
*/
private static final RS2Network NETWORK = new RS2Network();
/**
* Represents the game engine.
*/
private static final GameEngine ENGINE = new GameEngine();
/**
* Represents the game {@link Cache}.
*/
private static Cache CACHE;
/**
* Represents the {@link Huffman} encryption library
*/
private static Huffman HUFFMAN;
/**
* Represents the clan management system
*/
private static ClanSettingsManager CLANS;
/**
* Represents the main method.
* @param args The arguments casted on runtime.
*/
public static void main(String[] args) {
try {
System.setOut(new ConsoleLogger(System.out));
System.setErr(new ConsoleLogger(System.err));
long currentTime = TimeUtil.currentTimeMillis();
System.out.println("Welcome to " + Constants.NAME + ".");
loadEngine();
loadCache();
if (Constants.LOGIN_SERVER) {
DataServer.load();
}
Lobby.load();
IOHub.load();
NETWORK.load();
CLANS = new ClanSettingsManager();
System.out.println("VirtuePK took " + (TimeUtil.currentTimeMillis() - currentTime) + " milli seconds to launch.");
} catch (Exception e) {
ENGINE.handleException(e);
}
}
/**
* Loads the Virtue game engine.
*/
private static void loadEngine() {
ENGINE_LOADER.execute(ENGINE);
ENGINE.getTickManager().register(ENGINE.getLogicProcessor());
}
/**
* Loads the Xerxes cache.
* @throws Exception If an exception occurs.
*/
private static void loadCache() throws Exception {
System.out.println("Loading cache.");
/*File cacheFile = new File(System.getProperty("user.home") + "/Desktop/cache/");
if (!new File(cacheFile, "main_file_cache.dat2").exists()) {
cacheFile = new File("data/cache/");
}*/
CACHE = CacheLoader.getCache();//new Cache(FileStore.open(cacheFile));
Container container = new Container(Container.COMPRESSION_NONE, CACHE.createChecksumTable().encode(true, ChecksumTable.ON_DEMAND_MODULUS, ChecksumTable.ON_DEMAND_EXPONENT));
CACHE.setChecksumtable(container.encode());
ItemDefinitionLoader.load(CACHE);//Loads the item definitions
NPCDefinitionLoader.load(CACHE);//Loads the NPC definitions
ObjectDefinitionLoader.load(CACHE);//Loads the object definitions
RS3Object.initTransforms();//Initialises the object transforms
//Initialies the huffman codec
ByteBuffer huffmanData = Launcher.getCache().read(CacheIndex.HUFFMAN_ENCODING, CACHE.getFileId(CacheIndex.HUFFMAN_ENCODING, "huffman")).getData();
byte[] data = new byte[huffmanData.remaining()];
huffmanData.get(data);
HUFFMAN = new Huffman(data);
}
/**
* @return the engine
*/
public static GameEngine getEngine() {
return ENGINE;
}
/**
* @return the network
*/
public static RS2Network getNetwork() {
return NETWORK;
}
/**
* @return the random
*/
public static Random getRandom() {
return RANDOM;
}
/**
* @return the cACHE
*/
public static Cache getCache() {
return CACHE;
}
/**
* @return The huffman encoding library
*/
public static Huffman getHuffman () {
return HUFFMAN;
}
/**
* @return The clan management system
*/
public static ClanSettingsAPI getClanManager () {
return CLANS;
}
public static int getDay () {
return (int) Math.abs((System.currentTimeMillis() - Constants.RUNE_DAY_0) / Constants.MS_PER_DAY);
}
}
| [
"sundays211@gmail.com"
] | sundays211@gmail.com |
72fa15566d83cd531c0a4941141514afffd272be | 68997877e267f71388a878d37e3380e161f2f1bb | /app/src/main/java/com/sy/bottle/servlet/Bottle_Set_Servlet.java | 17d00b968d431cf611520c127300a6f4ad098835 | [] | no_license | jiangadmin/Bottle | 1af8555efb6d54a314c500ec8e83fe795c20f796 | 582c7ab0eb216400980cd4aae830a3db131b66f6 | refs/heads/master | 2020-03-20T00:53:31.757289 | 2018-07-25T01:22:42 | 2018-07-25T01:22:42 | 137,059,653 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,349 | java | package com.sy.bottle.servlet;
import android.app.Dialog;
import android.os.AsyncTask;
import android.text.TextUtils;
import com.google.gson.Gson;
import com.sy.bottle.dialog.Loading;
import com.sy.bottle.dialog.ReLogin_Dialog;
import com.sy.bottle.entity.Base_Entity;
import com.sy.bottle.entity.Const;
import com.sy.bottle.entity.Save_Key;
import com.sy.bottle.utils.HttpUtil;
import com.sy.bottle.utils.LogUtil;
import com.sy.bottle.utils.SaveUtils;
import com.sy.bottle.view.TabToast;
import java.util.HashMap;
import java.util.Map;
/**
* @author: jiangyao
* @date: 2018/6/7
* @Email: www.fangmu@qq.com
* @Phone: 186 6120 1018
* TODO: 扔瓶子
*/
public class Bottle_Set_Servlet extends AsyncTask<String, Integer, Base_Entity> {
private static final String TAG = "Bottle_Set_Servlet";
Dialog dialog;
public Bottle_Set_Servlet(Dialog dialog) {
this.dialog = dialog;
}
@Override
protected Base_Entity doInBackground(String... strings) {
Map map = new HashMap();
map.put("type", strings[0]);
map.put("content", strings[1]);
String res = HttpUtil.request(HttpUtil.POST, Const.API + "bottles/" + SaveUtils.getString(Save_Key.UID), map);
LogUtil.e(TAG, res);
Base_Entity entity;
if (TextUtils.isEmpty(res)) {
entity = new Base_Entity();
entity.setStatus(-1);
entity.setMessage("连接服务器失败");
} else {
try {
entity = new Gson().fromJson(res, Base_Entity.class);
} catch (Exception e) {
entity = new Base_Entity();
entity.setStatus(-2);
entity.setMessage("数据解析失败");
}
}
return entity;
}
@Override
protected void onPostExecute(Base_Entity entity) {
super.onPostExecute(entity);
Loading.dismiss();
switch (entity.getStatus()) {
case 200:
TabToast.makeText("您的瓶子已漂向远方");
dialog.dismiss();
break;
case 401:
new ReLogin_Dialog();
break;
default:
TabToast.makeText(entity.getMessage());
LogUtil.e(TAG, entity.getMessage());
break;
}
}
}
| [
"www.fangmu@qq.com"
] | www.fangmu@qq.com |
373d46fe31ffc11281cd1fe6996fe85326d0f102 | cade452d239f949868cb3a88413abd46ecb8f0b6 | /spring_security_core/src/main/java/com/temp/springcloud/monitor/rest/RedisController.java | ea8ddf98f1669967c63841c8b32d6a8b9a029ae5 | [] | no_license | liwen666/springcloud_new | fb9b06efeb91a9d0fb1da8bb6c5e2abd6e4ac656 | 8b55a705afc6c2b36c586a29faba83f0ecc5bc84 | refs/heads/master | 2023-02-15T05:11:13.585071 | 2023-01-31T04:15:52 | 2023-01-31T04:15:52 | 176,225,728 | 0 | 1 | null | 2022-12-14T20:39:19 | 2019-03-18T07:19:09 | HTML | UTF-8 | Java | false | false | 2,297 | java | package com.temp.springcloud.monitor.rest;
import com.temp.springcloud.common.aop.log.Log;
import com.temp.springcloud.monitor.domin.vo.RedisVo;
import com.temp.springcloud.monitor.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* @author jie
* @date 2018-12-10
*/
@RestController
@RequestMapping("api")
public class RedisController {
@Autowired
private RedisService redisService;
@Log(description = "查询Redis缓存")
@GetMapping(value = "/redis")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_SELECT')")
public ResponseEntity getRedis(String key, Pageable pageable){
return new ResponseEntity(redisService.findByKey(key,pageable), HttpStatus.OK);
}
@Log(description = "新增Redis缓存")
@PostMapping(value = "/redis")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_CREATE')")
public ResponseEntity create(@Validated @RequestBody RedisVo resources){
redisService.save(resources);
return new ResponseEntity(HttpStatus.CREATED);
}
@Log(description = "修改Redis缓存")
@PutMapping(value = "/redis")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_EDIT')")
public ResponseEntity update(@Validated @RequestBody RedisVo resources){
redisService.save(resources);
return new ResponseEntity(HttpStatus.NO_CONTENT);
}
@Log(description = "删除Redis缓存")
@DeleteMapping(value = "/redis/{key}")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
public ResponseEntity delete(@PathVariable String key){
redisService.delete(key);
return new ResponseEntity(HttpStatus.OK);
}
@Log(description = "清空Redis缓存")
@DeleteMapping(value = "/redis/all")
@PreAuthorize("hasAnyRole('ADMIN','REDIS_ALL','REDIS_DELETE')")
public ResponseEntity deleteAll(){
redisService.flushdb();
return new ResponseEntity(HttpStatus.OK);
}
}
| [
"1316138287@qq.com"
] | 1316138287@qq.com |
dff7ec2779a30a8dfe3d0a5cd840b7ce72b2438e | 5a8e39e2a6b1f57cda89b5f70ff537c14b50cc97 | /查询用户名下的矿机信息并显示效率(需求3)/spring boot双库完整版/demo/src/main/java/com/example/demo/domain/Accounts.java | 9966077a79d4b47843578a82bcd34f68c3de9f05 | [] | no_license | 1123762330/git_test | fa074c23ec018200c35d17873a6155bd35227573 | fcce977d428f1f63bfe8c9f4f53edc56ce357965 | refs/heads/master | 2022-12-21T12:17:43.046134 | 2019-07-01T01:32:53 | 2019-07-01T01:32:53 | 161,956,672 | 0 | 1 | null | 2022-12-16T00:01:44 | 2018-12-16T01:03:24 | Java | UTF-8 | Java | false | false | 4,570 | java | package com.example.demo.domain;
public class Accounts {
private int id;
private byte is_admin;
private byte is_anonymous;
private byte no_fees;
private String username;
private String pass;
private String email;
private String timezone;
private String notify_email;
private String loggedIp;
private byte is_locked;
private int failed_logins;
private int failed_pins;
private int signup_timestamp;
private int last_login;
private String pin;
private String api_key;
private String token;
private float donate_percent;
public Accounts() {
}
public Accounts(int id, byte is_admin, byte is_anonymous, byte no_fees, String username, String pass, String email, String timezone, String notify_email, String loggedIp, byte is_locked, int failed_logins, int failed_pins, int signup_timestamp, int last_login, String pin, String api_key, String token, float donate_percent) {
this.id = id;
this.is_admin = is_admin;
this.is_anonymous = is_anonymous;
this.no_fees = no_fees;
this.username = username;
this.pass = pass;
this.email = email;
this.timezone = timezone;
this.notify_email = notify_email;
this.loggedIp = loggedIp;
this.is_locked = is_locked;
this.failed_logins = failed_logins;
this.failed_pins = failed_pins;
this.signup_timestamp = signup_timestamp;
this.last_login = last_login;
this.pin = pin;
this.api_key = api_key;
this.token = token;
this.donate_percent = donate_percent;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public byte getIs_admin() {
return is_admin;
}
public void setIs_admin(byte is_admin) {
this.is_admin = is_admin;
}
public byte getIs_anonymous() {
return is_anonymous;
}
public void setIs_anonymous(byte is_anonymous) {
this.is_anonymous = is_anonymous;
}
public byte getNo_fees() {
return no_fees;
}
public void setNo_fees(byte no_fees) {
this.no_fees = no_fees;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPass() {
return pass;
}
public void setPass(String pass) {
this.pass = pass;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTimezone() {
return timezone;
}
public void setTimezone(String timezone) {
this.timezone = timezone;
}
public String getNotify_email() {
return notify_email;
}
public void setNotify_email(String notify_email) {
this.notify_email = notify_email;
}
public String getLoggedIp() {
return loggedIp;
}
public void setLoggedIp(String loggedIp) {
this.loggedIp = loggedIp;
}
public byte getIs_locked() {
return is_locked;
}
public void setIs_locked(byte is_locked) {
this.is_locked = is_locked;
}
public int getFailed_logins() {
return failed_logins;
}
public void setFailed_logins(int failed_logins) {
this.failed_logins = failed_logins;
}
public int getFailed_pins() {
return failed_pins;
}
public void setFailed_pins(int failed_pins) {
this.failed_pins = failed_pins;
}
public int getSignup_timestamp() {
return signup_timestamp;
}
public void setSignup_timestamp(int signup_timestamp) {
this.signup_timestamp = signup_timestamp;
}
public int getLast_login() {
return last_login;
}
public void setLast_login(int last_login) {
this.last_login = last_login;
}
public String getPin() {
return pin;
}
public void setPin(String pin) {
this.pin = pin;
}
public String getApi_key() {
return api_key;
}
public void setApi_key(String api_key) {
this.api_key = api_key;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public float getDonate_percent() {
return donate_percent;
}
public void setDonate_percent(float donate_percent) {
this.donate_percent = donate_percent;
}
}
| [
"1123762330@qq.com"
] | 1123762330@qq.com |
6e5988da9bef79605288809edfccdba3b9eb96e7 | 4120e073a4b0b2c79870e3ab87b294f98f47d0be | /reports/src/main/java/com/rideaustin/service/model/CumulativeRidesReportEntry.java | cce1dea448a0928ec32c7668ca5c90a923a8999a | [
"MIT"
] | permissive | jyt109/server | 8933281097303d14b5a329f0c679edea4fcd174b | 24354717624c25b5d4faf0b7ea540e2742e8039f | refs/heads/master | 2022-03-20T10:36:44.973843 | 2019-10-03T11:43:07 | 2019-10-03T11:43:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 661 | java | package com.rideaustin.service.model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@ApiModel
public class CumulativeRidesReportEntry {
@ApiModelProperty(required = true)
private Page<DriverRidesReportEntry> driversRidesReport = new PageImpl<>(Collections.emptyList());
@ApiModelProperty(required = true)
private List<RideReportEntry> ridesReport = new ArrayList<>();
}
| [
"mikhail.chugunov@crossover.com"
] | mikhail.chugunov@crossover.com |
5ae4c70c82c4ec15644827fff1a1aa279f4cc3cc | 0bcbe8e4085ed841312ecaf0cea1b74e854a1f4a | /Normal/collections/src/map/TestHashMap2.java | 667ad068249ce1a935f80e4b5792755eed688bee | [] | no_license | yashg0028/ppp | 9015dc3cbdd51f6d13a5b6226de23bccca61f085 | c3c64ca5dff2326bf4aa74febd698732d2b1d05d | refs/heads/master | 2022-09-07T01:57:27.575469 | 2020-03-01T07:44:47 | 2020-03-01T07:44:47 | 240,719,745 | 1 | 0 | null | 2022-09-01T23:20:18 | 2020-02-15T13:45:03 | Java | UTF-8 | Java | false | false | 1,345 | java | package map;
import java.util.*;
public class TestHashMap2 {
public static void main(String args[]) {
/* This is how to declare HashMap */
HashMap<Integer, String> hmap = new HashMap<Integer, String>();
/*Adding elements to HashMap*/
hmap.put(12, "Chaitanya");
hmap.put(2, "Rahul");
hmap.put(7, "Singh");
hmap.put(49, "Ajeet");
hmap.put(3, "Anuj");
System.out.println(hmap);
///************** /* Display content using Iterator*/
Set s = hmap.entrySet();
Iterator iterator = s.iterator();
while(iterator.hasNext())
{
Map.Entry m = (Map.Entry)iterator.next();
System.out.println("key is: "+ m.getKey() + " & Value is: " +m.getValue());
}
/* Get values based on key*/
System.out.println("Value at index 2 is: "+ hmap.get(2));
/* Remove values based on key*/
hmap.remove(3);
System.out.println("Map key and values after removal:");
//**********************
Set s2 = hmap.entrySet();
Iterator iterator2 = s2.iterator();
while(iterator2.hasNext()) {
Map.Entry m2 = (Map.Entry)iterator2.next();
System.out.println("Key is: "+m2.getKey() + " & Value is: "+m2.getValue());
}
}
}
| [
"you@example.com"
] | you@example.com |
97d52c8f749f771729cb7d3e9ec2bee2587d7a8d | b436de102b6cbccdb2eb28b35efadc977960343a | /im-server/src/main/java/com/lcw/im/ImApplication.java | 15962a3d291efb28484ced94151837ee0c57933e | [] | no_license | lcw2004/vue-im | abeb92f7dfc3e6db2c83adc93a78929468a86575 | 7e44789c5f3e17209f9c1d9edfbbd159bd828836 | refs/heads/master | 2020-05-23T11:20:32.837983 | 2019-05-15T02:13:06 | 2019-05-15T02:13:06 | 186,734,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,003 | java | package com.lcw.im;
import com.lcw.base.persistence.BaseRepositoryImpl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableAsync(proxyTargetClass = true)
@EnableCaching(proxyTargetClass = true)
@EnableTransactionManagement
@EnableJpaRepositories(basePackages = "com.lcw", repositoryBaseClass = BaseRepositoryImpl.class)
@EntityScan("com.lcw")
@ComponentScan("com.lcw")
@SpringBootApplication
public class ImApplication {
public static void main(String[] args) {
SpringApplication.run(ImApplication.class, args);
}
}
| [
"lcw2004@163.com"
] | lcw2004@163.com |
8a9a3f3d88c47b4ff2b10e0618464795f0c3f393 | c954c3c6f4e66be31b01f4d4008329f64efa59eb | /src/gov/nasa/worldwindx/examples/ShapeClipping.java | 55255fe23e3e960e213ceb163ed4efd2cc4410cb | [] | no_license | yafengstark/worldwindBook | 3daa454fae4623266fff8e76a47b675cd9f83e56 | 3a658c5691d6195739c12cddba56dfc0caeff7a4 | refs/heads/master | 2020-05-24T10:02:54.701946 | 2019-06-19T13:58:07 | 2019-06-19T13:58:07 | 187,220,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,495 | java | /*
* Copyright (C) 2014 United States Government as represented by the Administrator of the
* National Aeronautics and Space Administration.
* All Rights Reserved.
*/
package gov.nasa.worldwindx.examples;
import gov.nasa.worldwind.WorldWind;
import gov.nasa.worldwind.avlist.AVKey;
import gov.nasa.worldwind.event.*;
import gov.nasa.worldwind.formats.shapefile.ShapefileLayerFactory;
import gov.nasa.worldwind.geom.LatLon;
import gov.nasa.worldwind.layers.RenderableLayer;
import gov.nasa.worldwind.pick.PickedObject;
import gov.nasa.worldwind.render.*;
import gov.nasa.worldwind.util.*;
import gov.nasa.worldwind.util.combine.Combinable;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* Shows how to use the {@link gov.nasa.worldwind.util.combine.Combinable} interface and the {@link
* gov.nasa.worldwind.util.combine.ShapeCombiner} class to compute the intersection of a WorldWind surface shapes with
* Earth's land and water.
* <p/>
* This example provides an editable surface circle indicating a region to clip against either land or water. The land
* and water are represented by an ESRI shapefile containing polygons of Earth's continents, including major islands.
* Clipping against land is accomplished by computing the intersection of the surface circle and the shapefile polygons.
* Clipping against water is accomplished by subtracting the shapefile polygons from the surface circle. The user
* specifies the location of the surface circle, whether to clip against land or water, and the desired resolution of
* the resultant shape, in kilometers.
*
* 根据矢量和图形切割,求补
*
* @author dcollins
* @version $Id: ShapeClipping.java 2411 2014-10-30 21:27:00Z dcollins $
*/
public class ShapeClipping extends ApplicationTemplate
{
public static class AppFrame extends ApplicationTemplate.AppFrame implements SelectListener
{
protected ShapeEditor editor;
protected ShapeAttributes lastAttrs;
protected ShapeClippingPanel clippingPanel;
public AppFrame()
{
this.clippingPanel = new ShapeClippingPanel(this.getWwd());
this.getControlPanel().add(this.clippingPanel, BorderLayout.SOUTH);
this.createLandShape();
this.createClipShape();
}
protected void createLandShape()
{
ShapefileLayerFactory factory = (ShapefileLayerFactory) WorldWind.createConfigurationComponent(
AVKey.SHAPEFILE_LAYER_FACTORY);
factory.createFromShapefileSource("testData/shapefiles/ne_10m_land.shp",
new ShapefileLayerFactory.CompletionCallback()
{
@Override
public void completion(final Object result)
{
if (!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
completion(result);
}
});
return;
}
RenderableLayer layer = (RenderableLayer) result;
Renderable renderable = layer.getRenderables().iterator().next();
clippingPanel.setLandShape((Combinable) renderable);
}
@Override
public void exception(Exception e)
{
Logging.logger().log(java.util.logging.Level.SEVERE, e.getMessage(), e);
}
});
}
protected void createClipShape()
{
ShapeAttributes attrs = new BasicShapeAttributes();
attrs.setInteriorOpacity(0.3);
attrs.setOutlineMaterial(new Material(Color.RED));
attrs.setOutlineWidth(2);
ShapeAttributes highlightAttrs = new BasicShapeAttributes(attrs);
highlightAttrs.setInteriorOpacity(0.6);
highlightAttrs.setOutlineMaterial(new Material(WWUtil.makeColorBrighter(Color.RED)));
highlightAttrs.setOutlineWidth(4);
SurfaceCircle circle = new SurfaceCircle(attrs, LatLon.fromDegrees(42.5, -116), 1e6);
circle.setHighlightAttributes(highlightAttrs);
this.clippingPanel.setClipShape(circle);
RenderableLayer shapeLayer = new RenderableLayer();
shapeLayer.setName("Clipping Shape");
shapeLayer.addRenderable(circle);
this.getWwd().getModel().getLayers().add(shapeLayer);
this.getWwd().addSelectListener(this);
}
@Override
public void selected(SelectEvent event)
{
// This select method identifies the shape to edit.
PickedObject topObject = event.getTopPickedObject();
if (event.getEventAction().equals(SelectEvent.LEFT_CLICK))
{
if (topObject != null && topObject.getObject() instanceof Renderable)
{
if (this.editor == null)
{
// Enable editing of the selected shape.
this.editor = new ShapeEditor(getWwd(), (Renderable) topObject.getObject());
this.editor.setArmed(true);
this.keepShapeHighlighted(true);
event.consume();
}
else if (this.editor.getShape() != event.getTopObject())
{
// Switch editor to a different shape.
this.keepShapeHighlighted(false);
this.editor.setArmed(false);
this.editor = new ShapeEditor(getWwd(), (Renderable) topObject.getObject());
this.editor.setArmed(true);
this.keepShapeHighlighted(true);
event.consume();
}
else if ((event.getMouseEvent().getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) == 0
&& (event.getMouseEvent().getModifiersEx() & MouseEvent.ALT_DOWN_MASK) == 0)
{
// Disable editing of the current shape. Shift and Alt are used by the editor, so ignore
// events with those buttons down.
this.editor.setArmed(false);
this.keepShapeHighlighted(false);
this.editor = null;
event.consume();
}
}
}
}
protected void keepShapeHighlighted(boolean tf)
{
if (tf)
{
this.lastAttrs = ((Attributable) this.editor.getShape()).getAttributes();
((Attributable) this.editor.getShape()).setAttributes(
((Attributable) this.editor.getShape()).getHighlightAttributes());
}
else
{
((Attributable) this.editor.getShape()).setAttributes(this.lastAttrs);
}
}
}
public static void main(String[] args)
{
start("WorldWind Shape Clipping", AppFrame.class);
}
}
| [
"fengfeng043@gmail.com"
] | fengfeng043@gmail.com |
f5f3b027bc8cd1fa04efef3aac1ffdf665888f22 | c050b2a8b1f5d72506d3e10c021ae4b97b87515b | /src/main/java/com/electro/mediator/TimeUUIDGeneratorMediator.java | c1e6f31faf06f9af3e63dd5aa35f4c029d7117a5 | [
"Apache-2.0"
] | permissive | vanjikumaran/TimeUUIDGeneratorMediator | bb1a9eef344b579d3d4030abf2f9ff1358db98c6 | b18ee8e521a403fed59283c037867209b29762ad | refs/heads/master | 2020-03-19T07:32:42.883591 | 2018-06-05T17:25:56 | 2018-06-05T17:25:56 | 136,122,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | package com.electro.mediator;
import com.fasterxml.uuid.Generators;
import org.apache.synapse.MessageContext;
import org.apache.synapse.mediators.AbstractMediator;
public class TimeUUIDGeneratorMediator extends AbstractMediator {
public static final String CURRENT_TIME_UUID = "uri.var.uuid";
public boolean mediate(MessageContext messageContext) {
messageContext.setProperty(CURRENT_TIME_UUID, Generators.timeBasedGenerator().generate().toString());
return true;
}
} | [
"vanjikumaran@gmail.com"
] | vanjikumaran@gmail.com |
96a9347c94078ccf5b71d872b1772df9df00d966 | 2f5e9584534da2c73bc0fe948870085230d3128f | /dtm-jdbc-driver/src/main/java/io/arenadata/dtm/jdbc/core/Field.java | 6deede705f53969c4a85a7f410f790776525e4e4 | [
"Apache-2.0"
] | permissive | AlexRogalskiy/prostore | b3b8a7765c1f607c630cf955a66dab1e3c16ca3a | 5a101cd70e9246941a5cb905601e6577e2589818 | refs/heads/master | 2023-08-29T07:57:45.041365 | 2021-11-11T10:25:21 | 2021-11-11T10:25:21 | 428,456,972 | 0 | 0 | NOASSERTION | 2021-11-15T23:48:32 | 2021-11-15T23:48:22 | null | UTF-8 | Java | false | false | 2,430 | java | /*
* Copyright © 2021 ProStore
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.arenadata.dtm.jdbc.core;
import io.arenadata.dtm.common.model.ddl.ColumnType;
/**
* Field information in ResultSet
*/
public class Field {
/**
* Column name
*/
private String columnLabel;
/**
* Column size
*/
private Integer size;
/**
* Column sql type id
*/
private int sqlType;
/**
* Column dtm type
*/
private ColumnType dtmType;
/**
* Field metadata
*/
private FieldMetadata metadata;
public Field(String columnLabel, ColumnType dtmType) {
this.columnLabel = columnLabel;
this.dtmType = dtmType;
}
public Field(String columnLabel, ColumnType dtmType, FieldMetadata metadata) {
this.columnLabel = columnLabel;
this.dtmType = dtmType;
this.metadata = metadata;
}
public Field(String columnLabel, Integer size, ColumnType dtmType, FieldMetadata metadata) {
this.columnLabel = columnLabel;
this.size = size;
this.dtmType = dtmType;
this.metadata = metadata;
}
public String getColumnLabel() {
return columnLabel;
}
public void setColumnLabel(String columnLabel) {
this.columnLabel = columnLabel;
}
public int getSqlType() {
return sqlType;
}
public void setSqlType(int sqlType) {
this.sqlType = sqlType;
}
public FieldMetadata getMetadata() {
return metadata;
}
public void setMetadata(FieldMetadata metadata) {
this.metadata = metadata;
}
public ColumnType getDtmType() {
return dtmType;
}
public void setDtmType(ColumnType dtmType) {
this.dtmType = dtmType;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
}
| [
"lin@arenadata.io"
] | lin@arenadata.io |
1075d72217d37fd2d8c9d518ef944d7d6a053dce | 821ed0666d39420d2da9362d090d67915d469cc5 | /utils/jdvue/src/main/java/org/onlab/jdvue/DependencyViewer.java | 2f2796f55dd9bad27e4458f6b6e2c75aaf0fc2d9 | [
"Apache-2.0"
] | permissive | LenkayHuang/Onos-PNC-for-PCEP | 03b67dcdd280565169f2543029279750da0c6540 | bd7d201aba89a713f5ba6ffb473aacff85e4d38c | refs/heads/master | 2021-01-01T05:19:31.547809 | 2016-04-12T07:25:13 | 2016-04-12T07:25:13 | 56,041,394 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,702 | java | /*
* Copyright 2015 Open Networking Laboratory
*
* 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.onlab.jdvue;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Set;
/**
* Generator of a self-contained HTML file which serves as a GUI for
* visualizing Java package dependencies carried in the supplied catalog.
*
* The HTML file is an adaptation of D3.js Hierarchical Edge Bundling as
* shown at http://bl.ocks.org/mbostock/7607999.
*
* @author Thomas Vachuska
*/
public class DependencyViewer {
private static final String JPD_EXT = ".db";
private static final String HTML_EXT = ".html";
private static final String INDEX = "index.html";
private static final String D3JS = "d3.v3.min.js";
private static final String TITLE_PLACEHOLDER = "TITLE_PLACEHOLDER";
private static final String D3JS_PLACEHOLDER = "D3JS_PLACEHOLDER";
private static final String DATA_PLACEHOLDER = "DATA_PLACEHOLDER";
private final Catalog catalog;
/**
* Creates a Java package dependency viewer.
*
* @param catalog dependency catalog
*/
public DependencyViewer(Catalog catalog) {
this.catalog = catalog;
}
/**
* Main program entry point.
*
* @param args command line arguments
*/
public static void main(String[] args) {
Catalog cat = new Catalog();
DependencyViewer viewer = new DependencyViewer(cat);
try {
String path = args[0];
cat.load(path + JPD_EXT);
cat.analyze();
System.err.println(cat);
viewer.dumpLongestCycle(cat);
viewer.writeHTMLFile(path);
} catch (IOException e) {
System.err.println("Unable to process catalog: " + e.getMessage());
}
}
/**
* Prints out the longest cycle; just for kicks.
* @param cat catalog
*/
private void dumpLongestCycle(Catalog cat) {
DependencyCycle longest = null;
for (DependencyCycle cycle : cat.getCycles()) {
if (longest == null || longest.getCycleSegments().size() < cycle.getCycleSegments().size()) {
longest = cycle;
}
}
if (longest != null) {
for (Dependency dependency : longest.getCycleSegments()) {
System.out.println(dependency);
}
}
}
/**
* Writes the HTML catalog file for the given viewer.
*
* @param path base file path
* @throws IOException if issues encountered writing the HTML file
*/
public void writeHTMLFile(String path) throws IOException {
String index = slurp(getClass().getResourceAsStream(INDEX));
String d3js = slurp(getClass().getResourceAsStream(D3JS));
FileWriter fw = new FileWriter(path + HTML_EXT);
ObjectWriter writer = new ObjectMapper().writer(); // .writerWithDefaultPrettyPrinter();
fw.write(index.replace(TITLE_PLACEHOLDER, path)
.replace(D3JS_PLACEHOLDER, d3js)
.replace(DATA_PLACEHOLDER, writer.writeValueAsString(toJson())));
fw.close();
}
/**
* Slurps the specified input stream into a string.
*
* @param stream input stream to be read
* @return string containing the contents of the input stream
* @throws IOException if issues encountered reading from the stream
*/
static String slurp(InputStream stream) throws IOException {
StringBuilder sb = new StringBuilder();
BufferedReader br = new BufferedReader(new InputStreamReader(stream));
String line;
while ((line = br.readLine()) != null) {
sb.append(line).append(System.lineSeparator());
}
br.close();
return sb.toString();
}
// Produces a JSON structure designed to drive the hierarchical visual
// representation of Java package dependencies and any dependency cycles
private JsonNode toJson() {
ObjectMapper mapper = new ObjectMapper();
ObjectNode root = mapper.createObjectNode();
root.put("packages", jsonPackages(mapper));
root.put("cycleSegments", jsonCycleSegments(mapper, catalog.getCycleSegments()));
root.put("summary", jsonSummary(mapper));
return root;
}
// Produces a JSON summary of dependencies
private JsonNode jsonSummary(ObjectMapper mapper) {
ObjectNode summary = mapper.createObjectNode();
summary.put("packages", catalog.getPackages().size());
summary.put("sources", catalog.getSources().size());
summary.put("cycles", catalog.getCycles().size());
summary.put("cycleSegments", catalog.getCycleSegments().size());
return summary;
}
// Produces a JSON structure with package dependency data
private JsonNode jsonPackages(ObjectMapper mapper) {
ArrayNode packages = mapper.createArrayNode();
for (JavaPackage javaPackage : catalog.getPackages()) {
packages.add(json(mapper, javaPackage));
}
return packages;
}
// Produces a JSON structure with all cyclic segments
private JsonNode jsonCycleSegments(ObjectMapper mapper,
Set<Dependency> segments) {
ObjectNode cyclicSegments = mapper.createObjectNode();
for (Dependency dependency : segments) {
String s = dependency.getSource().name();
String t = dependency.getTarget().name();
cyclicSegments.put(t + "-" + s,
mapper.createObjectNode().put("s", s).put("t", t));
}
return cyclicSegments;
}
// Produces a JSON object structure describing the specified Java package.
private JsonNode json(ObjectMapper mapper, JavaPackage javaPackage) {
ObjectNode node = mapper.createObjectNode();
ArrayNode imports = mapper.createArrayNode();
for (JavaPackage dependency : javaPackage.getDependencies()) {
imports.add(dependency.name());
}
Set<DependencyCycle> packageCycles = catalog.getPackageCycles(javaPackage);
Set<Dependency> packageCycleSegments = catalog.getPackageCycleSegments(javaPackage);
node.put("name", javaPackage.name());
node.put("size", javaPackage.getSources().size());
node.put("imports", imports);
node.put("cycleSegments", jsonCycleSegments(mapper, packageCycleSegments));
node.put("cycleCount", packageCycles.size());
node.put("cycleSegmentCount", packageCycleSegments.size());
return node;
}
}
| [
"826080529@qq.com"
] | 826080529@qq.com |
69061413753b27b7136a25c52a63e442fe35d76b | 03482d89174b363d8b7ca03d7eaf05c12a012a77 | /cws_model_to_java_skel/test/uo/ri/domain/IntervencionTest.java | 0220e4514a12137784141a10d499d44b3dfaad05 | [] | no_license | cafeteru/RI | 15c2145cc19dae890484b181ca3be4efd25ec969 | dd2f3e32eec71178e95bbb0287e6850604b92652 | refs/heads/master | 2022-01-09T02:43:24.159852 | 2018-10-17T22:45:24 | 2018-10-17T22:45:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,437 | java | package uo.ri.domain;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import uo.ri.model.Association;
import uo.ri.model.Averia;
import uo.ri.model.Cliente;
import uo.ri.model.Intervencion;
import uo.ri.model.Mecanico;
import uo.ri.model.Repuesto;
import uo.ri.model.Sustitucion;
import uo.ri.model.TipoVehiculo;
import uo.ri.model.Vehiculo;
public class IntervencionTest {
private Mecanico mecanico;
private Averia averia;
private Intervencion intervencion;
private Repuesto repuesto;
private Sustitucion sustitucion;
private Vehiculo vehiculo;
private TipoVehiculo tipoVehiculo;
private Cliente cliente;
@Before
public void setUp() {
cliente = new Cliente("dni-cliente", "nombre", "apellidos");
vehiculo = new Vehiculo("1234 GJI", "ibiza", "seat");
Association.Poseer.link(cliente, vehiculo);
tipoVehiculo = new TipoVehiculo("coche", 50.0);
Association.Clasificar.link(tipoVehiculo, vehiculo);
averia = new Averia(vehiculo, "falla la junta la trocla");
mecanico = new Mecanico("dni-mecanico", "nombre", "apellidos");
intervencion = new Intervencion(mecanico, averia);
intervencion.setMinutos(60);
repuesto = new Repuesto("R1001", "junta la trocla", 100.0);
sustitucion = new Sustitucion(repuesto, intervencion);
sustitucion.setCantidad(2);
}
@Test
public void testImporteIntervencion() {
assertTrue(intervencion.getImporte() == 250.0);
}
}
| [
"ivangonzalezmahagamage@gmail.com"
] | ivangonzalezmahagamage@gmail.com |
86a263317a438ae987266f0b047c7684eeca8e3a | b5c485493f675bcc19dcadfecf9e775b7bb700ed | /jee-utility-server-representation/src/test/java/org/cyk/utility/server/business/api/ParentTypeBusiness.java | dba15371024bf83f1525914b870a83f18f74231c | [] | no_license | devlopper/org.cyk.utility | 148a1aafccfc4af23a941585cae61229630b96ec | 14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775 | refs/heads/master | 2023-03-05T23:45:40.165701 | 2021-04-03T16:34:06 | 2021-04-03T16:34:06 | 16,252,993 | 1 | 0 | null | 2022-10-12T20:09:48 | 2014-01-26T12:52:24 | Java | UTF-8 | Java | false | false | 249 | java | package org.cyk.utility.server.business.api;
import org.cyk.utility.server.business.BusinessEntity;
import org.cyk.utility.server.persistence.entities.ParentType;
public interface ParentTypeBusiness extends BusinessEntity<ParentType> {
}
| [
"kycdev@gmail.com"
] | kycdev@gmail.com |
da2bd210ac747a45339390167a1759502aefe16b | 8534ea766585cfbd6986fd845e59a68877ecb15b | /com/github/amlcurran/showcaseview/p042a/C0639a.java | 9aa42d775569e8bf9a0469f29d5fe7c398a5228c | [] | no_license | Shanzid01/NanoTouch | d7af94f2de686f76c2934b9777a92b9949b48e10 | 6d51a44ff8f719f36b880dd8d1112b31ba75bfb4 | refs/heads/master | 2020-04-26T17:39:53.196133 | 2019-03-04T10:23:51 | 2019-03-04T10:23:51 | 173,720,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 214 | java | package com.github.amlcurran.showcaseview.p042a;
import android.graphics.Point;
/* compiled from: Target */
public interface C0639a {
public static final C0639a f1622a = new C0640b();
Point mo1090a();
}
| [
"shanzid.shaiham@gmail.com"
] | shanzid.shaiham@gmail.com |
77a3b9adc9efdb462acffe7b9964c3a1f42199dc | 10247fe892de553dca222298ff691f8b8657aa88 | /dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/html/angular/AngularHtmlUnitResolverTest.java | b1165274c23ad24bbdf423abd1c88cb87f7a017b | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JTIRAT/bleeding_edge | 064067ce7cddd50acdccbc28ea32b7732346c715 | feb0fb0dadc0a145124b9bcc13fd5c145b4013f3 | refs/heads/master | 2020-12-14T07:22:27.293888 | 2014-01-04T04:05:11 | 2014-01-04T04:05:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,162 | java | /*
* Copyright (c) 2013, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
*
* 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.dart.engine.internal.html.angular;
import com.google.dart.engine.ast.Expression;
import com.google.dart.engine.ast.SimpleIdentifier;
import com.google.dart.engine.error.StaticWarningCode;
import com.google.dart.engine.html.ast.HtmlUnitUtils;
public class AngularHtmlUnitResolverTest extends AngularTest {
public void test_moduleAsLocalVariable() throws Exception {
mainSource = contextHelper.addSource("/main.dart", createSource("",//
"import 'angular.dart';",
"",
"@NgController(",
" selector: '[my-controller]',",
" publishAs: 'ctrl')",
"class MyController {",
" String field;",
"}",
"",
"class MyModule extends Module {",
" MyModule() {",
" type(MyController);",
" }",
"}",
"",
"main() {",
" var module = new Module()",
" ..type(MyController);",
" ngBootstrap(module: module);",
"}"));
resolveIndex(//
"<html ng-app>",
" <body>",
" <div my-controller>",
" {{ctrl.field}}",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertNoErrors();
verify(indexSource);
assertResolvedIdentifier("ctrl", "MyController");
}
public void test_NgDirective_usedOnControllerClass() throws Exception {
mainSource = contextHelper.addSource("/main.dart", createSource("",//
"import 'angular.dart';",
"",
"@NgDirective(",
" selector: '[my-controller]',",
" publishAs: 'ctrl')",
"class MyController {",
" String field;",
"}",
"",
"class MyModule extends Module {",
" MyModule() {",
" type(MyController);",
" }",
"}",
"",
"main() {",
" ngBootstrap(module: new MyModule());",
"}"));
resolveIndex(//
"<html ng-app>",
" <body>",
" <div my-controller>",
" {{ctrl.field}}",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertNoErrors();
verify(indexSource);
assertResolvedIdentifier("ctrl", "MyController");
}
public void test_ngRepeat_resolvedExpressions() throws Exception {
addMyController();
resolveIndex(//
"<html ng-app>",
" <body>",
" <div my-marker>",
" <li ng-repeat='name in ctrl.names'>",
" {{name}}",
" </li>",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertNoErrors();
verify(indexSource);
assertResolvedIdentifier("name in", "String");
assertResolvedIdentifier("ctrl.", "MyController");
assertResolvedIdentifier("names'", "List<String>");
assertResolvedIdentifier("name}}", "String");
}
public void test_notResolved_no_ngBootstrap_invocation() throws Exception {
contextHelper.addSource("/main.dart", "// just empty script");
resolveIndex(//
"<html ng-app>",
" <body>",
" <div my-marker>",
" {{ctrl.field}}",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertNoErrors();
// Angular is not initialized, so "ctrl" is not parsed
Expression expression = HtmlUnitUtils.getExpression(indexUnit, findOffset("ctrl"));
assertNull(expression);
}
public void test_notResolved_noDartScript() throws Exception {
resolveIndex(//
"<html ng-app>",
" <body>",
" <div my-marker>",
" {{ctrl.field}}",
" </div>",
" </body>",
"</html>");
assertNoErrors();
// Angular is not initialized, so "ctrl" is not parsed
Expression expression = HtmlUnitUtils.getExpression(indexUnit, findOffset("ctrl"));
assertNull(expression);
}
public void test_notResolved_notAngular() throws Exception {
resolveIndex(//
"<html no-ng-app>",
" <body>",
" <div my-marker>",
" {{ctrl.field}}",
" </div>",
" </body>",
"</html>");
assertNoErrors();
// Angular is not initialized, so "ctrl" is not parsed
Expression expression = HtmlUnitUtils.getExpression(indexUnit, findOffset("ctrl"));
assertNull(expression);
}
public void test_notResolved_wrongControllerMarker() throws Exception {
addMyController();
resolveIndex(//
"<html ng-app>",
" <body>",
" <div not-my-marker>",
" {{ctrl.field}}",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertErrors(indexSource, StaticWarningCode.UNDEFINED_IDENTIFIER);
// "ctrl" is not resolved
SimpleIdentifier identifier = findIdentifier("ctrl");
assertNull(identifier.getBestElement());
}
public void test_resolveExpression_inAttribute() throws Exception {
addMyController();
resolveIndex(//
"<html ng-app>",
" <body>",
" <div my-marker>",
" <button title='{{ctrl.field}}'></button>",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertNoErrors();
verify(indexSource);
assertResolvedIdentifier("ctrl", "MyController");
}
public void test_resolveExpression_inTag() throws Exception {
addMyController();
resolveIndex(//
"<html ng-app>",
" <body>",
" <div my-marker>",
" {{ctrl.field}}",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertNoErrors();
verify(indexSource);
assertResolvedIdentifier("ctrl", "MyController");
}
public void test_resolveExpression_ngApp_onBody() throws Exception {
addMyController();
resolveIndex(//
"<html>",
" <body ng-app>",
" <div my-marker>",
" {{ctrl.field}}",
" </div>",
" <script type='application/dart' src='main.dart'></script>",
" </body>",
"</html>");
assertNoErrors();
verify(indexSource);
assertResolvedIdentifier("ctrl", "MyController");
}
}
| [
"scheglov@google.com@260f80e4-7a28-3924-810f-c04153c831b5"
] | scheglov@google.com@260f80e4-7a28-3924-810f-c04153c831b5 |
a6686d08d66d6f80e6591cb9ca29fb35498a2099 | 2955a84548a6c294d084ea45d8f3d368ea27dde6 | /tongzijunjl/src/main/java/com/bm/util/SixPracticePanel.java | 2a8c3a2b552a68e46df62778ff932442763eecfd | [] | no_license | HuaZhongAndroid/HanShanJl | 82d6443f86358c77e42a298f01cce0cfc0cf82d8 | f5c0d0f06c3f040895b1f79efd7a98568e01a4bd | refs/heads/master | 2020-03-18T23:34:25.132048 | 2019-01-03T10:05:54 | 2019-01-03T10:05:54 | 135,411,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,887 | java | package com.bm.util;
import java.util.List;
import net.grobas.view.PolygonImageView;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import com.bm.app.App;
import com.bm.entity.Badge;
import com.richer.tzjjl.R;
import com.bm.tzj.fm.PullulateFm;
import com.nostra13.universalimageloader.core.ImageLoader;
/**
*
* 教练顾问的 六边形 图片显示
* @author wanghy
*
*/
public class SixPracticePanel {
static Handler handler;
public static void setViews(FrameLayout fm_view, List<Badge> list,Context context,Handler strHandler){
handler = strHandler;
List<List<Badge>> mlist = Util.subList(list,5);
for(int i = 0;i<mlist.size();i++){
View vm1 = LayoutInflater.from(context).inflate(R.layout.fm_view_six_item_practice, null);
fm_view.addView(vm1);
setViewId(vm1,mlist.get(i));
int width =View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED);
int height =View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED);
vm1.measure(width,height);
int heights=vm1.getMeasuredHeight()-80;
FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) vm1.getLayoutParams();
lp.setMargins(0, heights*i, 0, 0);
}
}
private static void setViewId(View v,List<Badge> list){
PolygonImageView iv_a,iv_b,iv_c,iv_d,iv_e;
LinearLayout ll_left,ll_right;
iv_a = (PolygonImageView)v.findViewById(R.id.iv_a);
iv_b = (PolygonImageView)v.findViewById(R.id.iv_b);
iv_c = (PolygonImageView)v.findViewById(R.id.iv_c);
iv_d = (PolygonImageView)v.findViewById(R.id.iv_d);
iv_e = (PolygonImageView)v.findViewById(R.id.iv_e);
ll_left = (LinearLayout)v.findViewById(R.id.ll_left);
ll_right = (LinearLayout)v.findViewById(R.id.ll_right);
if(list.size()>0){
ImageLoader.getInstance().displayImage(list.get(0).imageUrl, iv_a,App.getInstance().getListViewDisplayImageOptions());
iv_a.setOnClickListener(onclickView(list.get(0)));
}else{
iv_a.setVisibility(View.GONE);
ll_left.setVisibility(View.INVISIBLE);
ll_right.setVisibility(View.INVISIBLE);
}
if(list.size()>1){
ImageLoader.getInstance().displayImage(list.get(0).imageUrl, iv_b,App.getInstance().getListViewDisplayImageOptions());
iv_b.setOnClickListener(onclickView(list.get(1)));
}else{
iv_b.setVisibility(View.GONE);
ll_left.setVisibility(View.INVISIBLE);
ll_right.setVisibility(View.INVISIBLE);
}
if(list.size()>2){
ImageLoader.getInstance().displayImage(list.get(0).imageUrl, iv_c,App.getInstance().getListViewDisplayImageOptions());
iv_c.setOnClickListener(onclickView(list.get(2)));
}else{
iv_c.setVisibility(View.GONE);
ll_left.setVisibility(View.INVISIBLE);
ll_right.setVisibility(View.INVISIBLE);
}
if(list.size()>3){
ll_left.setVisibility(View.VISIBLE);
ll_right.setVisibility(View.VISIBLE);
ImageLoader.getInstance().displayImage(list.get(0).imageUrl, iv_d,App.getInstance().getListViewDisplayImageOptions());
iv_d.setOnClickListener(onclickView(list.get(3)));
}else{
iv_d.setVisibility(View.GONE);
}
if(list.size()>4){
ImageLoader.getInstance().displayImage(list.get(0).imageUrl, iv_e,App.getInstance().getListViewDisplayImageOptions());
iv_e.setOnClickListener(onclickView(list.get(4)));
}else{
iv_e.setVisibility(View.GONE);
}
}
private static OnClickListener onclickView(final Badge badge){
return new OnClickListener() {
@Override
public void onClick(View arg0) {
Message msg = new Message();
msg.what = PullulateFm.CLICK_STATES;
msg.arg1 = badge.id;
handler.sendMessage(msg);
}
};
}
}
| [
"376368673@qq.com"
] | 376368673@qq.com |
f381c16f5e507547ccd91b9addb565ae4d5602ac | 8d3afed96fff891cbda473ddfa6926180020a62f | /app 2/src/main/java/me/arifix/quizix/Utils/SharedPref.java | 12e28991b8d6ccc06d50b5d84b88e1bdc2205a7e | [] | no_license | softwrengr/Arabic-Quiz-App | 310a235b03ef888072de97b12ed3c824dcc1115c | 61f39ada0b616aa314d4b6310bdbadb69887dee4 | refs/heads/master | 2020-04-07T05:44:51.937206 | 2018-11-18T17:23:25 | 2018-11-18T17:23:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,423 | java | package me.arifix.quizix.Utils;
import android.content.Context;
import android.content.SharedPreferences;
/**
* Created by Arif Khan on 01/1/2018.
*/
public class SharedPref {
private static SharedPref myPreference;
private static SharedPreferences sharedPreferences;
private static SharedPreferences.Editor editor;
SharedPref(Context context) {
sharedPreferences = context.getSharedPreferences(Config.PROJECT_CODENAME, Context.MODE_PRIVATE);
editor = sharedPreferences.edit();
}
public static SharedPref getPreferences(Context context) {
if (myPreference == null)
myPreference = new SharedPref(context);
return myPreference;
}
// Put String Value
public void setStringData(String Key, String Value) {
editor.putString(Key, Value);
editor.apply();
editor.commit();
}
// Put Integer Value
public void setIntData(String Key, int Value) {
editor.putInt(Key, Value);
editor.apply();
editor.commit();
}
// Put Float Value
public void setFloatData(String Key, float Value) {
editor.putFloat(Key, Value);
editor.apply();
editor.commit();
}
// Put Boolean Value
public void setBoolData(String Key, boolean Value) {
editor.putBoolean(Key, Value);
editor.apply();
editor.commit();
}
// Put Long Value
public void setLongData(String Key, long Value) {
editor.putLong(Key, Value);
editor.apply();
editor.commit();
}
// Get String Value
public String getStringData(String Key, String Fallback) {
return sharedPreferences.getString(Key, Fallback);
}
// Get Integer Value
public int getIntData(String Key, int Fallback) {
return sharedPreferences.getInt(Key, Fallback);
}
// Get Float Value
public float getData(String Key, float Fallback) {
return sharedPreferences.getFloat(Key, Fallback);
}
// Get Boolean Value
public boolean getBoolData(String Key, boolean Fallback) {
return sharedPreferences.getBoolean(Key, Fallback);
}
// Get Long Value
public long getLongData(String Key, long Fallback) {
return sharedPreferences.getLong(Key, Fallback);
}
// Clear All Existing Room
public void setEmpty() {
editor.clear();
editor.commit();
}
}
| [
"softwrengr@gmail.com"
] | softwrengr@gmail.com |
7d6602af0622eb137d27e5dec0d76f5c719bdbd6 | ce54a65bd0a1206b49adcdc8706b114dc5c60dc8 | /src/main/java/com/xcs/phase2/response/compare/ComparePaymentDetailResponse.java | 34d19a562faa4edeac42d45d0605892c9dca277d | [] | no_license | Sitta-Dev/Excise_API | d961fa215ef59ed13b5749b010563e07bf00516c | c1657a342ac759e7acf8eae60a2c4ceefba73098 | refs/heads/master | 2023-01-13T12:05:50.060374 | 2020-11-19T05:58:08 | 2020-11-19T05:58:08 | 285,178,533 | 0 | 1 | null | 2020-08-05T09:22:54 | 2020-08-05T04:26:09 | Java | UTF-8 | Java | false | false | 174 | java | package com.xcs.phase2.response.compare;
import lombok.Data;
@Data
public class ComparePaymentDetailResponse extends CompareResponse{
private int PAYMENT_DETAIL_ID;
}
| [
"bakugan_chun@hotmail.com"
] | bakugan_chun@hotmail.com |
717670e3149200c2b0da6fb23120db5b33c8effa | c577f5380b4799b4db54722749cc33f9346eacc1 | /BugSwarm/twilio-twilio-java-243842923/buggy_files/src/main/java/com/twilio/rest/chat/v2/service/channel/MemberReader.java | 727d16a0fdc6ad3696a3b8761c268dc8c3d66329 | [] | no_license | tdurieux/BugSwarm-dissection | 55db683fd95f071ff818f9ca5c7e79013744b27b | ee6b57cfef2119523a083e82d902a6024e0d995a | refs/heads/master | 2020-04-30T17:11:52.050337 | 2019-05-09T13:42:03 | 2019-05-09T13:42:03 | 176,972,414 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,985 | java | /**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
package com.twilio.rest.chat.v2.service.channel;
import com.twilio.base.Page;
import com.twilio.base.Reader;
import com.twilio.base.ResourceSet;
import com.twilio.converter.Promoter;
import com.twilio.exception.ApiConnectionException;
import com.twilio.exception.ApiException;
import com.twilio.exception.RestException;
import com.twilio.http.HttpMethod;
import com.twilio.http.Request;
import com.twilio.http.Response;
import com.twilio.http.TwilioRestClient;
import com.twilio.rest.Domains;
import java.util.List;
public class MemberReader extends Reader<Member> {
private final String pathServiceSid;
private final String pathChannelSid;
private List<String> identity;
/**
* Construct a new MemberReader.
*
* @param pathServiceSid The service_sid
* @param pathChannelSid The channel_sid
*/
public MemberReader(final String pathServiceSid,
final String pathChannelSid) {
this.pathServiceSid = pathServiceSid;
this.pathChannelSid = pathChannelSid;
}
/**
* The identity.
*
* @param identity The identity
* @return this
*/
public MemberReader setIdentity(final List<String> identity) {
this.identity = identity;
return this;
}
/**
* The identity.
*
* @param identity The identity
* @return this
*/
public MemberReader setIdentity(final String identity) {
return setIdentity(Promoter.listOfOne(identity));
}
/**
* Make the request to the Twilio API to perform the read.
*
* @param client TwilioRestClient with which to make the request
* @return Member ResourceSet
*/
@Override
public ResourceSet<Member> read(final TwilioRestClient client) {
return new ResourceSet<>(this, client, firstPage(client));
}
/**
* Make the request to the Twilio API to perform the read.
*
* @param client TwilioRestClient with which to make the request
* @return Member ResourceSet
*/
@Override
@SuppressWarnings("checkstyle:linelength")
public Page<Member> firstPage(final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
Domains.CHAT.toString(),
"/v2/Services/" + this.pathServiceSid + "/Channels/" + this.pathChannelSid + "/Members",
client.getRegion()
);
addQueryParams(request);
return pageForRequest(client, request);
}
/**
* Retrieve the next page from the Twilio API.
*
* @param page current page
* @param client TwilioRestClient with which to make the request
* @return Next Page
*/
@Override
public Page<Member> nextPage(final Page<Member> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.CHAT.toString(),
client.getRegion()
)
);
return pageForRequest(client, request);
}
/**
* Generate a Page of Member Resources for a given request.
*
* @param client TwilioRestClient with which to make the request
* @param request Request to generate a page for
* @return Page for the Request
*/
private Page<Member> pageForRequest(final TwilioRestClient client, final Request request) {
Response response = client.request(request);
if (response == null) {
throw new ApiConnectionException("Member read failed: Unable to connect to server");
} else if (!TwilioRestClient.SUCCESS.apply(response.getStatusCode())) {
RestException restException = RestException.fromJson(response.getStream(), client.getObjectMapper());
if (restException == null) {
throw new ApiException("Server Error, no content");
}
throw new ApiException(
restException.getMessage(),
restException.getCode(),
restException.getMoreInfo(),
restException.getStatus(),
null
);
}
return Page.fromJson(
"members",
response.getContent(),
Member.class,
client.getObjectMapper()
);
}
/**
* Add the requested query string arguments to the Request.
*
* @param request Request to add query string arguments to
*/
private void addQueryParams(final Request request) {
if (identity != null) {
for (String prop : identity) {
request.addQueryParam("Identity", prop);
}
}
if (getPageSize() != null) {
request.addQueryParam("PageSize", Integer.toString(getPageSize()));
}
}
} | [
"durieuxthomas@hotmail.com"
] | durieuxthomas@hotmail.com |
3a2084f6858e5fe785a0ec6826f5f4f7f889dd44 | 886f62925cdffa4fd7a49f62e9de0ca7a713ae43 | /evergarden/violet/HTTPChunkedClient.java | 281b152f95252b16b3d639feed0b61efa4b8db11 | [
"MIT"
] | permissive | stackprobe/Java3 | b3b1ab732582e0b2e1b8b779268460fb0ac7a0aa | 5f79b07bd7887e4ea9b281301c700d63323561b3 | refs/heads/master | 2021-06-27T12:46:39.817798 | 2020-08-21T22:25:15 | 2020-08-21T22:25:15 | 99,795,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,045 | java | package evergarden.violet;
import java.io.OutputStream;
import charlotte.tools.ArrayTools;
import charlotte.tools.FileTools;
import charlotte.tools.HTTPResponse;
import charlotte.tools.IntTools;
import charlotte.tools.MathTools;
import charlotte.tools.SockClient;
import charlotte.tools.StringTools;
public class HTTPChunkedClient {
public static void main(String[] args) {
try {
//test01();
test02();
System.out.println("OK!");
}
catch(Throwable e) {
e.printStackTrace();
}
}
private static void test01() throws Exception {
perform(
"localhost",
80,
"/",
FileTools.readAllBytes("C:/var/20141007_GBCTunnel_Log.txt")
);
}
private static void test02() throws Exception {
chunkOfDeath(
"localhost",
80,
"/"
);
}
private static void perform(String domain, int portNo, String path, byte[] body) throws Exception {
SockClient client = null;
try {
client = new SockClient(domain, portNo, 20000, 20000);
OutputStream ws = client.getOutputStream();
write(ws, "POST " + path + " HTTP/1.1\r\n");
write(ws, "Host " + domain + ":" + portNo + "\r\n");
write(ws, "Content-Type: text/plain; charset=Shift_JIS\r\n");
write(ws, "Transfer-Encoding: chunked\r\n");
write(ws, "\r\n");
int rPos = 0;
while(rPos < body.length) {
int nextSize = MathTools.random(1, body.length - rPos);
System.out.println("nextSize: " + nextSize); // test
if(MathTools.random(2) == 0) {
write(ws, chunkSz2String(nextSize) + "\r\n");
}
else {
write(ws, chunkSz2String(nextSize) + "; dummy-chunked-extension; dummy-chunke-key = 'dummy-chunked-value'\r\n");
}
ws.write(ArrayTools.getBytes(body, rPos, nextSize));
write(ws, "\r\n");
rPos += nextSize;
}
if(MathTools.random(2) == 0) {
write(ws, "0\r\n");
}
else {
write(ws, "0; dummy-chunked-extension; dummy-chunke-key = 'dummy-chunked-value'\r\n");
}
while(MathTools.random(2) == 0) {
write(ws, "dummy-trailer-header: dummy-trailer-header-value\r\n");
}
write(ws, "\r\n");
HTTPResponse res = new HTTPResponse(client.getInputStream());
System.out.println("resBody: " + new String(res.getBody(), StringTools.CHARSET_ASCII));
}
finally {
FileTools.close(client);
}
}
private static String chunkSz2String(int size) {
return IntTools.toHex(size); // こっちが正解
//return "" + size;
}
private static void write(OutputStream ws, String str) throws Exception {
write(ws, str, StringTools.CHARSET_ASCII);
}
private static void write(OutputStream ws, String str, String charset) throws Exception {
ws.write(str.getBytes(charset));
}
private static void chunkOfDeath(String domain, int portNo, String path) throws Exception {
SockClient client = null;
try {
client = new SockClient(domain, portNo, 20000, 20000);
OutputStream ws = client.getOutputStream();
write(ws, "POST " + path + " HTTP/1.1\r\n");
write(ws, "Host " + domain + ":" + portNo + "\r\n");
write(ws, "Content-Type: text/plain; charset=US-ASCII\r\n");
write(ws, "Transfer-Encoding: chunked\r\n");
write(ws, "\r\n");
int nextSizeMax = 1000;
for(; ; ) {
int nextSize = MathTools.random(1, nextSizeMax);
System.out.println("nextSize: " + nextSize + " (nextSizeMax: " + nextSizeMax + ")"); // test
nextSizeMax = Math.min((int)(nextSizeMax * 1.1), IntTools.IMAX);
if(MathTools.random(2) == 0) {
write(ws, chunkSz2String(nextSize) + "\r\n");
}
else {
write(ws, chunkSz2String(nextSize) + "; dummy-chunked-extension; dummy-chunked-key = 'dummy-chunked-value'\r\n");
}
for(int c = 0; c < nextSize; c++) {
ws.write(nextDummyChar());
}
write(ws, "\r\n");
}
}
finally {
FileTools.close(client);
}
}
private static String _dummyChrs = StringTools.ASCII + "\r\n";
private static int _dummyChrIndex = -1;
private static int nextDummyChar() {
_dummyChrIndex++;
_dummyChrIndex %= _dummyChrs.length();
return _dummyChrs.charAt(_dummyChrIndex);
}
}
| [
"stackprobes@gmail.com"
] | stackprobes@gmail.com |
0fec81caded7df61cbf85802a35fae5dd5d4bfc0 | fe1b82b3d058231d94ea751ead87603e9e1e7723 | /pms/src/main/java/com/axboot/pms/domain/base/customer/Customer.java | 3205ec26067be0394b495108bc4591a7e816154b | [] | no_license | designreuse/projects | c5bf6ede5afd08be6804270ac24eaf07dcfd7fef | d4149db321840371d82a61adf927f68f8ac107cb | refs/heads/master | 2020-08-12T07:13:36.738560 | 2019-04-10T07:07:42 | 2019-04-10T07:07:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,316 | java | package com.axboot.pms.domain.base.customer;
import com.chequer.axboot.core.annotations.ColumnPosition;
import com.axboot.pms.domain.BaseJpaModel;
import com.axboot.pms.domain.base.customer.charge.CustomerCharge;
import lombok.*;
import org.apache.ibatis.type.Alias;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.chequer.axboot.core.annotations.Comment;
import java.util.List;
import javax.persistence.*;
@Setter
@Getter
@DynamicInsert
@DynamicUpdate
@Entity
@EqualsAndHashCode(callSuper = true)
@Table(name = "customer")
@Comment(value = "고객마스터 테이블")
@Alias("customer")
public class Customer extends BaseJpaModel<Integer> {
@Id
@Column(name = "NO_CUSTOMER", precision = 10, nullable = false)
@Comment(value = "")
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ColumnPosition(1)
private Integer noCustomer;
@Column(name = "NM_CUSTOMER", length = 50, nullable = false)
@Comment(value = "고객명")
@ColumnPosition(3)
private String nmCustomer;
@Column(name = "NM_CEO", length = 50)
@Comment(value = "대표자명")
@ColumnPosition(5)
private String nmCeo;
@Column(name = "NO_LICENSE", length = 20)
@Comment(value = "사업자등록번호")
@ColumnPosition(7)
private String noLicense;
@Column(name = "NO_TEL", length = 20)
@Comment(value = "대표번호")
@ColumnPosition(9)
private String noTel;
@Column(name = "NO_FAX", length = 20)
@Comment(value = "팩스번호")
@ColumnPosition(11)
private String noFax;
@Column(name = "ZIP_CODE", length = 10)
@Comment(value = "우편번호")
@ColumnPosition(13)
private String zipCode;
@Column(name = "ADDRESS", length = 255)
@Comment(value = "주소")
@ColumnPosition(15)
private String address;
@Column(name = "YN_TRADE", length = 1, nullable = false)
@Comment(value = "거래여부")
@ColumnPosition(17)
private String ynTrade;
@Column(name = "REMARK", length = 255)
@Comment(value = "")
@ColumnPosition(19)
private String remark;
@OneToMany
@JoinColumn(name="NO_CUSTOMER", referencedColumnName = "NO_CUSTOMER", insertable = false, updatable = false)
private List<CustomerCharge> chargeList;
@Transient
private List<CustomerCharge> chargeListq;
@Override
public Integer getId() {
return noCustomer;
}
} | [
"kwpark@localhost"
] | kwpark@localhost |
e37edd9f4c3135ec4f26b0ab34b9ef57f22450d7 | 30958a87db0bad59ae22b768e9fa75b62cf776b2 | /springcore/src/main/java/com/tyss/springcore/LifeCycle.java | 7a7d163437099115dbc0742928cff3656d9fdca5 | [] | no_license | SUPRITHHH/suprithhh97-gmail.com | 0029315b6f332ce2c8366b5c0547ff2769fe57fc | b38e6b2640ec29ec31fe10d28bcfc4a992a44758 | refs/heads/master | 2023-01-09T07:41:43.335998 | 2020-01-17T04:43:46 | 2020-01-17T04:43:46 | 223,109,002 | 0 | 0 | null | 2023-01-07T21:59:18 | 2019-11-21T06:58:11 | JavaScript | UTF-8 | Java | false | false | 467 | java | package com.tyss.springcore;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.tyss.springcore.di.Hello;
public class LifeCycle {
public static void main(String[] args) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
Hello hello = context.getBean(Hello.class);
System.out.println(hello.getMsg());
context.close();
}
}
| [
"suprithhh97@gmail.com"
] | suprithhh97@gmail.com |
ab5ee8ac19928ed8f1fbf05bfdb4c47fcfa3917e | 7d3a7140b5aa8986e6b274ef44e4f067ae210141 | /Introduction/src/addhoc2/Acm362.java | 8c472649232c3361ef0c14ec9d47c67fc183470c | [] | no_license | careermasud/UVA | 432ec0420f18fc5025384b39b5e784451f623a04 | 0a65c8036eaeda990bec12948ce4c73ccc75884d | refs/heads/master | 2021-01-01T15:50:05.334069 | 2013-05-14T11:52:56 | 2013-05-14T11:52:56 | 8,895,964 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,755 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package addhoc2;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* @author Masudul Haque
*/
public class Acm362 {
public static void main(String[] args) throws IOException {
BufferedReader buff=new BufferedReader(new InputStreamReader(System.in));
// BufferedReader buff=new BufferedReader(new FileReader(new File("362.txt")));
int num = 1;
long total_size = Long.parseLong(buff.readLine());
long packet_size, received_size, last5_size;
long elapsed;
StringBuffer sbuf = new StringBuffer();
while(total_size!=0) {
last5_size = 0;
elapsed = 0;
received_size = 0;
sbuf.append("Output for data set ");
sbuf.append(num);
sbuf.append(", ");
sbuf.append(total_size);
sbuf.append(" bytes:\n");
while(received_size<total_size) {
packet_size = Long.parseLong(buff.readLine());
last5_size += packet_size;
received_size += packet_size;
elapsed++;
if(elapsed%5==0) {
if(last5_size>0) {
long remaining = (total_size-received_size)*5;
if(remaining%last5_size==0) {
remaining /= last5_size;
} else {
remaining = remaining/last5_size+1;
}
sbuf.append(" Time remaining: ");
sbuf.append(remaining);
sbuf.append(" seconds\n");
last5_size = 0;
} else {
sbuf.append(" Time remaining: stalled\n");
}
}
}
sbuf.append("Total time: ");
sbuf.append(elapsed);
sbuf.append(" seconds\n\n");
total_size = Long.parseLong(buff.readLine());
num++;
}
System.out.print(sbuf);
}
}
| [
"masud.cse.05@gmail.com"
] | masud.cse.05@gmail.com |
9b93a70dbe829ca543acc0f0b5e3eac2418c2031 | 4f4790805c7d9bbaed5e22e64af663c7c8eb205c | /renren-api/src/main/java/io/renren/service/goods/impl/GoodsPropsKeyServiceImpl.java | 2ed43d6a8cab7d67adb4abceec02494c99ec2b97 | [
"Apache-2.0"
] | permissive | wanhao838088/vue-taobao | 5323151f827afda8fc0289d0da41a7462b00af19 | 0fe92ac7af5dff1e8e7a59bad06359445c77e722 | refs/heads/master | 2020-04-25T02:38:53.118307 | 2019-04-25T07:32:23 | 2019-04-25T07:32:23 | 172,447,358 | 15 | 3 | null | null | null | null | UTF-8 | Java | false | false | 762 | java | package io.renren.service.goods.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.entity.goods.GoodsPropsKey;
import io.renren.dao.goods.GoodsPropsKeyDao;
import io.renren.service.goods.GoodsPropsKeyService;
import io.renren.vo.GoodsPropsVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author admin
*/
@Service
@Transactional
public class GoodsPropsKeyServiceImpl extends ServiceImpl<GoodsPropsKeyDao, GoodsPropsKey> implements GoodsPropsKeyService {
@Override
@Transactional(readOnly = false)
public List<GoodsPropsVo> getByBrandId(Integer branId) {
return baseMapper.getByBrandId(branId);
}
}
| [
"838088516@qq.com"
] | 838088516@qq.com |
b57c607b22d716bc7bd7c2e4398eacd09bb481c5 | 70583bbcf0d17588e08dabd73387274385066bea | /src/main/java/management/employee/EmployeeHistoryController.java | 2828b431e6111975d767c02c34e90b8e7f1469c7 | [
"MIT"
] | permissive | ivantha/pos-system | 9e653022289a58e7bbda28af018e90d8de45b490 | ca8016901e63a5f4dd2206573b7d8ad23cc46da1 | refs/heads/master | 2022-11-08T09:17:09.835212 | 2020-07-03T06:00:18 | 2020-07-03T06:00:18 | 110,659,001 | 0 | 0 | MIT | 2020-07-03T05:50:48 | 2017-11-14T08:01:58 | Java | UTF-8 | Java | false | false | 1,818 | java | /*
* Copyright © 02.10.2015 by O.I.Mudannayake. All Rights Reserved.
*/
package management.employee;
import controller.Controller;
import database.sql.SQLFactory;
import database.sql.SQLStatement;
import database.sql.type.EmployeeManagementSQL;
import entity.Employee;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import javax.swing.table.DefaultTableModel;
import ui.support.Frame;
/**
*
* @author Ivantha
*/
public class EmployeeHistoryController implements Controller {
private final EmployeeHistory view = new EmployeeHistory();
private final EmployeeManagementSQL employeeManagementSQL = (EmployeeManagementSQL) SQLFactory.getSQLStatement(SQLStatement.EMPLOYEE_MANAGEMENT);
private final DefaultTableModel dtm;
public EmployeeHistoryController() {
dtm = (DefaultTableModel) view.employeeHistoryTable.getModel();
//Update view
view.updateViewInternalFrameListener(new InternalFrameAdapter() {
@Override
public void internalFrameActivated(InternalFrameEvent e) {
EmployeeHistoryController.this.updateView();
}
});
}
@Override
public void showView() {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public void showView(Employee employee) {
this.clearView();
view.employeeIDTextField.setText(employee.getEmployeeID());
view.nameTextField.setText(employee.getName());
employeeManagementSQL.showEmployeeHistory(employee, dtm);
Frame.showInternalFrame(view);
}
@Override
public void updateView() {
}
@Override
public void clearView() {
dtm.setRowCount(0);
}
}
| [
"oshan.ivantha@gmail.com"
] | oshan.ivantha@gmail.com |
6ef21b4b14ec61c7427a61e05beef48bfa4c806b | b44fba6ebcdf4166355d79ad1d7577f625593373 | /15.新闻轮播图/src/main/java/tanmu/itheima/com/myapplication/MainActivity.java | d2ccb831058ed0993f5e2e5628d407ee61cf0352 | [] | no_license | weifangtao/MyMVPlayer | 996c8d49e1b99eec7692075a7df6cca458647a4c | 68a6925847f5f11452ada1d753f0c1f5f75f4f27 | refs/heads/master | 2021-01-11T22:32:45.095140 | 2017-01-15T04:46:14 | 2017-01-15T04:46:14 | 78,987,752 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,430 | java | package tanmu.itheima.com.myapplication;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
public String TAG = "MainActivity";
private ViewPager viewPager;
private TextView title;
//图片数组
private int[] imageViews = {R.drawable.icon_1, R.drawable.icon_2,
R.drawable.icon_3, R.drawable.icon_4, R.drawable.icon_5,};
private LinearLayout dot_container;
//标题数组
private String[] titles = {"为梦想坚持", "我相信我是黑马", "黑马公开课", "google开发者大会", "辅导班"};
//选中小圆圈图标的选中状态 默认第一个被选中
private int markPostion = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//初始化视图
initView();
//初始化数据
initData();
//初始化事件
initEvent();
}
//初始化视图
public void initView() {
viewPager = (ViewPager) findViewById(R.id.viewPager);
dot_container = (LinearLayout) findViewById(R.id.dot_container);
title = (TextView) findViewById(R.id.title);
}
//初始化数据
public void initData() {
title.setText(titles[0]);
int dot_size = getResources().getDimensionPixelOffset(R.dimen.dot_size);
for (int i = 0; i < imageViews.length; i++) {
View view = new View(this);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(dot_size, dot_size);
params.leftMargin = 2 * dot_size;
view.setLayoutParams(params);
view.setBackgroundResource(R.drawable.dot_selector);
if (i == 0) {
view.setSelected(true);
}
//添加到容器中去
dot_container.addView(view);
}
}
//初始化事件
public void initEvent() {
viewPager.setAdapter(adapter);
//设置条目为中间值
viewPager.setCurrentItem(Integer.MAX_VALUE/2-Integer.MAX_VALUE/2%imageViews.length);
// Log.d(TAG, "initEvent: "+(Integer.MAX_VALUE/2-Integer.MAX_VALUE/2%imageViews.length));
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
/**
* 页面滚动
* @param position 滚动之前的位置
* @param positionOffset 滚动距离和Viewpager宽度的百分比
* @param positionOffsetPixels 滚动距离的像素
*/
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
// Log.d(TAG, "positionOffset="+positionOffset+"positionOffsetPixels="+positionOffsetPixels);
}
/**
* 页面选中状态
* @param position 页面选中的位置
*/
@Override
public void onPageSelected(int position) {
//防止索引越界
position = position % imageViews.length;
// Log.d(TAG, "onPageSelected: "+position);
title.setText(titles[position]);
Log.d(TAG, "onPageSelected: "+position);
dot_container.getChildAt(markPostion).setSelected(false);
dot_container.getChildAt(position).setSelected(true);
//重新赋值
markPostion = position;
}
/**
* 页面状态变化的时候
* @param state
* @see ViewPager#SCROLL_STATE_IDLE 空闲状态
* @see ViewPager#SCROLL_STATE_DRAGGING 拖拽状态
* @see ViewPager#SCROLL_STATE_SETTLING 中间状态
*/
@Override
public void onPageScrollStateChanged(int state) {
// switch (state){
// case ViewPager.SCROLL_STATE_IDLE:
// Log.d(TAG, "SCROLL_STATE_IDLE");
// break;
// case ViewPager.SCROLL_STATE_DRAGGING:
// Log.d(TAG, "SCROLL_STATE_DRAGGING");
// break;
// case ViewPager.SCROLL_STATE_SETTLING:
// Log.d(TAG, "SCROLL_STATE_SETTLING");
// break;
// }
}
});
}
private PagerAdapter adapter = new PagerAdapter() {
/**
* 获取Viewpager的个数
* @return
*/
@Override
public int getCount() {
return Integer.MAX_VALUE;
}
/**
* 是否要显示当前条目
* @param view 是否要显示的条目
* @param object 标记
* @return 要显示true 不显示false
*/
@Override
public boolean isViewFromObject(View view, Object object) {
return view == object;
}
/**
* 初始化Viewpager的一个条目
* @param container ViewPager 本身
* @param position 当前的位置
* @return 返回的是条目的对象
*/
@Override
public Object instantiateItem(ViewGroup container, int position) {
//防止索引越界
position = position % imageViews.length;
ImageView imageView = new ImageView(MainActivity.this);
imageView.setImageResource(imageViews[position]);
//添加到容器中
container.addView(imageView);
return imageView;
}
/**
* 要销毁的界面
* @param container ViewPager 本身
* @param position 要销毁界面的位置
* @param object 要销毁界面的标记(instantiateItem返回)
*/
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
// super.destroyItem(container, position, object);
container.removeView((View) object);
}
};
}
| [
"111"
] | 111 |
f4ad71689cc14b246bde13794ab247d8241ecacb | db39b23dc00f5b7a62ec74948c09e703a996e389 | /foilen-infra-system-core-system-common/src/main/java/com/foilen/infra/plugin/core/system/common/service/SecurityServiceConstantImpl.java | f15ca6326ce2ec0beb121feca4da52f5684480fd | [
"MIT"
] | permissive | foilen/foilen-infra-system | 026ef145000de50d847670562db2ed260717050f | d16f527123634fd5711f7bac76a96cf8ddf6cd00 | refs/heads/master | 2021-12-28T09:49:53.643366 | 2021-10-10T23:13:56 | 2021-10-10T23:13:56 | 135,091,113 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 656 | java | /*
Foilen Infra System
https://github.com/foilen/foilen-infra-system
Copyright (c) 2017-2021 Foilen (https://foilen.com)
The MIT License
http://opensource.org/licenses/MIT
*/
package com.foilen.infra.plugin.core.system.common.service;
import com.foilen.infra.plugin.v1.core.service.SecurityService;
/**
* Always uses the same value. THIS IS INSECURE AND ONLY FOR TESTS.
*/
public class SecurityServiceConstantImpl implements SecurityService {
@Override
public String getCsrfParameterName() {
return "_csrf";
}
@Override
public String getCsrfValue(Object request) {
return "UNIQUE";
}
}
| [
"simon@foilen.com"
] | simon@foilen.com |
c483c5855f91fb0477af57a97c188545c380fd71 | 5a254336d5d79c9383129c46a1d007ace6f7e30a | /src/java/play/learn/java/design/chain_of_responsibility/OrcOfficer.java | e34e15caefa12bc89e64b6cad3ae87834b9b5464 | [
"Apache-2.0"
] | permissive | jasonwee/videoOnCloud | 837b1ece7909a9a9d9a12f20f3508d05c37553ed | b896955dc0d24665d736a60715deb171abf105ce | refs/heads/master | 2023-09-03T00:04:51.115717 | 2023-09-02T18:12:55 | 2023-09-02T18:12:55 | 19,120,021 | 1 | 5 | null | 2015-06-03T11:11:00 | 2014-04-24T18:47:52 | Python | UTF-8 | Java | false | false | 454 | java | package play.learn.java.design.chain_of_responsibility;
public class OrcOfficer extends RequestHandler {
public OrcOfficer(RequestHandler handler) {
super(handler);
}
@Override
public void handleRequest(Request req) {
if (req.getRequestType().equals(RequestType.TORTURE_PRISONER)) {
printHandling(req);
req.markHandled();
} else {
super.handleRequest(req);
}
}
@Override
public String toString() {
return "Orc officer";
}
}
| [
"peichieh@gmail.com"
] | peichieh@gmail.com |
4ddc0acfb122ecea287ea0276a95adad7c476f23 | ff1aa80d76aeb6269d8b9e33bde24ada3768d574 | /library-model/src/main/java/com/library/app/category/exception/CategoryExistentException.java | 8e04bc6cd2f61811d9110922953af0f6a9c0492e | [] | no_license | wilferraciolli/LibraryAPI | d6922963d113dd9a880ec0cd79834103163b86f6 | 11cf3a755c515129c778adc31fa07aed7cd3fe79 | refs/heads/master | 2021-01-23T12:52:39.699449 | 2017-09-20T21:53:52 | 2017-09-20T21:53:52 | 102,653,573 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 673 | java | package com.library.app.category.exception;
import javax.ejb.ApplicationException;
/**
* This is and exception handler class that is very specific to handle duplication of a category by its name.
* This class is annotated with @ApplicationException because it is required that the runtime exception is thrown as application exception instead of 500 internal error9exception).
* It has to be an application exception because it is handled in CategoryResource.Java on the "add" method.
*
* @author wilferaciolli
*/
@ApplicationException
public class CategoryExistentException extends RuntimeException {
private static final long serialVersionUID = 1L;
}
| [
"wiliam334@hotmail.com"
] | wiliam334@hotmail.com |
0a3f5fde43056504452bcdaf4806cc368dfef302 | c9b14eb81bb60f430531d496d774fd3a383d631b | /highwrapper/src/main/java/com/panda/org/highwrapper/db/provider/VideoContentProvider.java | 248d555112b9e0431ba84b12e799171b39bd3078 | [] | no_license | MMLoveMeMM/AngryPandaAndroid | 3416722bb42b6a1a2acca0d98145fcb1dec99225 | 3b33a15c68cd31cb0d8cc3490f2d67c36cf6c728 | refs/heads/master | 2021-05-06T05:17:08.432264 | 2017-12-28T10:09:12 | 2017-12-28T10:09:12 | 115,001,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,970 | java | package com.panda.org.highwrapper.db.provider;
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.util.Log;
import com.panda.org.highwrapper.db.helper.AblumDatabaseHelper;
import com.panda.org.highwrapper.db.table.VideoTable;
public class VideoContentProvider extends ContentProvider {
private static final int TABLES = 1;
private static final int TABLE_ID = 2;
private static UriMatcher sUriMatcher = null;
static {
sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
sUriMatcher.addURI(VideoTable.AUTHORITY, VideoTable.TABLE_NAME, TABLES);
sUriMatcher.addURI(VideoTable.AUTHORITY, VideoTable.TABLE_NAME + "/#",
TABLE_ID);
};
private AblumDatabaseHelper mOpenHelper;
@Override
public boolean onCreate() {
// TODO Auto-generated method stub
mOpenHelper = new AblumDatabaseHelper(getContext());
return true;
}
@Override
public Cursor query(Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) {
// TODO Auto-generated method stub
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();// ��һ������SQL��ѯ���ĸ�����
switch (sUriMatcher.match(uri)) {
case TABLES:
qb.setTables(VideoTable.TABLE_NAME);
break;
case TABLE_ID:
qb.setTables(VideoTable.TABLE_NAME);
qb.appendWhere(VideoTable.VIDEO_NAME + "="
+ uri.getPathSegments().get(1));
break;
default:
throw new IllegalArgumentException("Unknown URI " + uri);
}
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
Cursor c = qb.query(db, projection, selection, selectionArgs, null,
null, sortOrder);
return c;
}
@Override
public String getType(Uri uri) {
// TODO Auto-generated method stub
switch (sUriMatcher.match(uri)) {
case TABLES:
return VideoTable.CONTENT_TYPE;
case TABLE_ID:
return VideoTable.CONTENT_ITEM_TYPE;
default:
throw new IllegalArgumentException("Unknown URI " + uri);
}
}
@Override
public Uri insert(Uri uri, ContentValues initialValues) {
// TODO Auto-generated method stub
ContentValues values;
if (initialValues != null) {
Log.i("##not null", "initialValues");
values = new ContentValues(initialValues);
} else {
Log.i("##null", "initialValues");
values = new ContentValues();
}
if (values.containsKey(VideoTable.VIDEO_NAME) == false) {
values.put(VideoTable.VIDEO_NAME, "title");
}
if (values.containsKey(VideoTable.VIDEO_PATH) == false) {
values.put(VideoTable.VIDEO_PATH, "path");
}
if (values.containsKey(VideoTable.TYPE) == false) {
values.put(VideoTable.TYPE, "type");
}
if (values.containsKey(VideoTable.MEDIA_TYPE) == false) {
values.put(VideoTable.MEDIA_TYPE, "4");
}
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
long rowId = db.insert(VideoTable.TABLE_NAME, VideoTable.VIDEO_NAME/*null*/,
values);
if (rowId > 0) {
Uri myUri = ContentUris.withAppendedId(VideoTable.CONTENT_URI,
rowId);
getContext().getContentResolver().notifyChange(uri, null);
return myUri;// ����ֵΪһ��uri
}
return null;
}
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
// TODO Auto-generated method stub
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
int ret=db.delete(VideoTable.TABLE_NAME, selection, selectionArgs);
getContext().getContentResolver().notifyChange(uri, null);
return ret;
}
@Override
public int update(Uri uri, ContentValues values, String selection,
String[] selectionArgs) {
// TODO Auto-generated method stub
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
int ret = db.update(VideoTable.TABLE_NAME, values, selection,
selectionArgs);
return ret;
}
}
| [
"270791800@qq.com"
] | 270791800@qq.com |
87f1118603bb1df1c83abca3f6b5e4b5760d6f0e | 86d08a80d217ad5a254734ec4127bb4571f31a33 | /src/test/java/com/fisc/declmarchetitre/web/rest/errors/ExceptionTranslatorIT.java | cc17b47e3846b0f33bbc3a4646cfa82ba7158e91 | [] | no_license | sandalothier/jhipster-declmarchetitre | 7e6977f97b6155207ed117c0fb56c01e4f2aba1c | c112756365c2f708b7aba554f989025fa46dd0ac | refs/heads/master | 2022-12-23T18:47:49.460989 | 2020-01-29T14:07:56 | 2020-01-29T14:07:56 | 229,045,634 | 0 | 0 | null | 2022-12-16T04:42:29 | 2019-12-19T12:01:07 | Java | UTF-8 | Java | false | false | 5,541 | java | package com.fisc.declmarchetitre.web.rest.errors;
import com.fisc.declmarchetitre.DeclmarchetitreApp;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Integration tests {@link ExceptionTranslator} controller advice.
*/
@SpringBootTest(classes = DeclmarchetitreApp.class)
public class ExceptionTranslatorIT {
@Autowired
private ExceptionTranslatorTestController controller;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
private MockMvc mockMvc;
@BeforeEach
public void setup() {
mockMvc = MockMvcBuilders.standaloneSetup(controller)
.setControllerAdvice(exceptionTranslator)
.setMessageConverters(jacksonMessageConverter)
.build();
}
@Test
public void testConcurrencyFailure() throws Exception {
mockMvc.perform(get("/test/concurrency-failure"))
.andExpect(status().isConflict())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE));
}
@Test
public void testMethodArgumentNotValid() throws Exception {
mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION))
.andExpect(jsonPath("$.fieldErrors.[0].objectName").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].field").value("test"))
.andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull"));
}
@Test
public void testMissingServletRequestPartException() throws Exception {
mockMvc.perform(get("/test/missing-servlet-request-part"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testMissingServletRequestParameterException() throws Exception {
mockMvc.perform(get("/test/missing-servlet-request-parameter"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"));
}
@Test
public void testAccessDenied() throws Exception {
mockMvc.perform(get("/test/access-denied"))
.andExpect(status().isForbidden())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.403"))
.andExpect(jsonPath("$.detail").value("test access denied!"));
}
@Test
public void testUnauthorized() throws Exception {
mockMvc.perform(get("/test/unauthorized"))
.andExpect(status().isUnauthorized())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.401"))
.andExpect(jsonPath("$.path").value("/test/unauthorized"))
.andExpect(jsonPath("$.detail").value("test authentication failed!"));
}
@Test
public void testMethodNotSupported() throws Exception {
mockMvc.perform(post("/test/access-denied"))
.andExpect(status().isMethodNotAllowed())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.405"))
.andExpect(jsonPath("$.detail").value("Request method 'POST' not supported"));
}
@Test
public void testExceptionWithResponseStatus() throws Exception {
mockMvc.perform(get("/test/response-status"))
.andExpect(status().isBadRequest())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.400"))
.andExpect(jsonPath("$.title").value("test response status"));
}
@Test
public void testInternalServerError() throws Exception {
mockMvc.perform(get("/test/internal-server-error"))
.andExpect(status().isInternalServerError())
.andExpect(content().contentType(MediaType.APPLICATION_PROBLEM_JSON))
.andExpect(jsonPath("$.message").value("error.http.500"))
.andExpect(jsonPath("$.title").value("Internal Server Error"));
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
178830c1f65b90d16b2df4e836f74a27dcc2057d | 252851ec3358c42892b69c579d863e7fb82b37e5 | /spark_project/src/main/java/com/cky/sparkproject/dao/ISessionDetailDAO.java | a9ee48409ea7f235a1bfff27e4ce89c3e2617335 | [] | no_license | salted-fish-cky/project_space | e613a3a2a1121d3c91554a2919fc3ae1e9b25eac | e1079b72e14d4b6e95d451e59c6ce250783569ef | refs/heads/master | 2022-12-21T14:31:46.945062 | 2019-07-08T08:32:56 | 2019-07-08T08:32:56 | 174,693,502 | 0 | 0 | null | 2022-12-16T11:56:07 | 2019-03-09T12:46:07 | JavaScript | UTF-8 | Java | false | false | 398 | java | package com.cky.sparkproject.dao;
import com.cky.sparkproject.domain.SessionDetail;
import java.util.List;
/**
* Session明细DAO接口
* @author Administrator
*
*/
public interface ISessionDetailDAO {
/**
* 插入一条session明细数据
* @param sessionDetail
*/
void insert(SessionDetail sessionDetail);
/**
* 批量插入
*/
void insert(List<SessionDetail> list);
}
| [
"1324775254@qq.com"
] | 1324775254@qq.com |
269f5919773e3513eda12b99821b9629f6385bc2 | 39a9902a511caf32b5c4626a97c610f5b383601f | /telegram-ob/src/main/java/ir/adventure/observer/client/core/org/telegram/api/input/messages/filter/TLAbsMessagesFilter.java | 45a86752eca5d61fbeea934ac791ef5f31f23819 | [] | no_license | rkeshmir/telegramCrawler | 3ef174efc79d7242ff528f7eacdebd56d94181c3 | fca7aa5114eb40efb95603d557fe9a325cdf775b | refs/heads/master | 2020-03-31T14:47:18.159838 | 2018-10-12T14:30:04 | 2018-10-12T14:30:04 | 152,309,274 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package ir.adventure.observer.client.core.org.telegram.api.input.messages.filter;
import ir.adventure.observer.client.core.org.telegram.tl.TLObject;
/**
* The type TL abs messages filter.
*/
public abstract class TLAbsMessagesFilter extends TLObject {
/**
* Instantiates a new TL abs messages filter.
*/
protected TLAbsMessagesFilter() {
super();
}
} | [
"autumn2014"
] | autumn2014 |
e1727bced5bc7dfab4c4035334e99625d5763b3e | 2092ca58e1a897c431be7f224307c8a7bd22c085 | /com/paypal/android/sdk/payments/dt.java | df2c994b69b2b7971a4c2ec431e26467d00d98da | [] | no_license | atresumes/Tele-1 | 33f4bc7445a136fc666d9c581d6b9395c1d8ec44 | 96aeb6b34e41d553ec79deaca332e974dea29c24 | refs/heads/master | 2020-03-21T11:24:53.093233 | 2018-06-24T18:19:24 | 2018-06-24T18:19:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 244 | java | package com.paypal.android.sdk.payments;
final class dt implements Runnable {
private /* synthetic */ ds f859a;
dt(ds dsVar) {
this.f859a = dsVar;
}
public final void run() {
this.f859a.f858a.m649b();
}
}
| [
"40494744+atresumes@users.noreply.github.com"
] | 40494744+atresumes@users.noreply.github.com |
914c47f8f1c4529fe80317bad3c048e80e281677 | 2c2d59b5b4abe56378d10df257b8db91ba197981 | /复兴/新希望/scf-bas-paren/scf-bas-dal/src/test/java/com/test/MainTest.java | 2ef394e7afdfe54de46d83473bbf4893843e2276 | [] | no_license | soldiers1989/documentResource | 52f58bf2ed0f4b63b9f92b07218facddebd92bcb | b7311ed9b3bc17e2580778c2d1b42cf9c4f35644 | refs/heads/master | 2020-03-28T08:58:27.430389 | 2018-09-07T09:17:23 | 2018-09-07T09:17:23 | 148,003,900 | 0 | 1 | null | 2018-09-09T07:43:35 | 2018-09-09T07:43:35 | null | UTF-8 | Java | false | false | 1,155 | java | package com.test;
/**
*
* 数据库操作测试类
*
* @author shuaixianxian
* @date 2016年9月23日
* @Copyright Shanghai Huateng Software Systems Co., Ltd.
*
* <pre>
* =================Modify Record=================
* Modifier date Content
* shuaixianxian 2016年9月23日 新增
*
* </pre>
*/
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration({"classpath:test_spring-dao.xml"})
//@Transactional
//@TransactionConfiguration(defaultRollback=true)
//public class MainTest{
//
// private Logger logger = LoggerFactory.getLogger(getClass());
// @Autowired
// ExtOrgUserDAO dao;
//
// @Before
// public void init() throws Exception{
// TraceNoUtils.newTraceNo();
// }
//
// @Test
// public void test(){
// logger.info("==========={},{},{},{}" , new Object[]{"123",231,"asdfas","234e532fdsf"});
// OrgUser record = new OrgUser();
// record.setUserName("11111111");
// String id = dao.insert(record);
//
// OrgUser user = dao.selectByPrimaryKey(id);
// Assert.assertTrue(user != null);
// Assert.assertTrue(user.getUserName().equalsIgnoreCase("11111111"));
// }
//} | [
"1545109330@qq.com"
] | 1545109330@qq.com |
1afde2af0cbdd3bddcd43ae325b528d91be313b5 | ad85131e9c580c62d34bf87dd44a9ec84743e6b1 | /Module_4/session_04_thymeleaf/exercise-product-management/src/main/java/com/soren/AppConfiguration.java | d185d3c973c9805cb6e2ca716a08a168eb74e99a | [] | no_license | Hoangtq1710/C1120G1-TranQuocHoang | 0c848b5773ce790456109322aad25d58b0094135 | efc975b1fc95ad0d804e2249a077e5365197ca75 | refs/heads/main | 2023-05-02T20:20:58.630250 | 2021-05-18T11:44:59 | 2021-05-18T11:44:59 | 316,412,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,169 | java | package com.soren;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.spring4.view.ThymeleafViewResolver;
import org.thymeleaf.templatemode.TemplateMode;
@Configuration
@EnableWebMvc
@ComponentScan("com.soren")
public class AppConfiguration extends WebMvcConfigurerAdapter implements ApplicationContextAware {
private ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
@Bean
public SpringResourceTemplateResolver templateResolver() {
SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
templateResolver.setApplicationContext(applicationContext);
templateResolver.setPrefix("/WEB-INF/views/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode(TemplateMode.HTML);
templateResolver.setCharacterEncoding("UTF-8");
return templateResolver;
}
@Bean
public TemplateEngine templateEngine() {
TemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver());
return templateEngine;
}
@Bean
public ThymeleafViewResolver viewResolver() {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine());
viewResolver.setCharacterEncoding("UTF-8");
return viewResolver;
}
}
| [
"hoangtq1710@gmail.com"
] | hoangtq1710@gmail.com |
8d568f3dcd9d0b502759b7c2bc5329536978b40e | 79a6c54645fc508b514aea1cf060661ed273b5ea | /L2J_Server_Tauti_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestGiveItemToPet.java | 32a72144a90f3c7415fd43655c8f406802ef53ae | [] | no_license | sandy1890/l2jkr | 571c0bcc84f1708bba96b09517374792e39d8829 | 27ea6baffa455ca427d8d51f007a1b91d953b642 | refs/heads/master | 2021-01-10T04:02:20.077563 | 2013-01-20T18:12:09 | 2013-01-20T18:12:09 | 48,476,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,625 | java | /*
* Copyright (C) 2004-2013 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.network.clientpackets;
import com.l2jserver.Config;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;
/**
* This class ...
* @version $Revision: 1.3.2.1.2.5 $ $Date: 2005/03/29 23:15:33 $
*/
public final class RequestGiveItemToPet extends L2GameClientPacket {
private static final String _C__95_REQUESTCIVEITEMTOPET = "[C] 95 RequestGiveItemToPet";
private int _objectId;
private long _amount;
@Override
protected void readImpl() {
_objectId = readD();
_amount = readQ();
}
@Override
protected void runImpl() {
final L2PcInstance player = getClient().getActiveChar();
if ((player == null) || !(player.getPet() instanceof L2PetInstance)) {
return;
}
if (!getClient().getFloodProtectors().getTransaction().tryPerformAction("giveitemtopet")) {
/*
* Move To MessageTable For L2JTW player.sendMessage("You are giving items to pet too fast.");
*/
player.sendMessage(289);
return;
}
if (player.getActiveEnchantItem() != null) {
return;
}
// Alt game - Karma punishment
if (!Config.ALT_GAME_KARMA_PLAYER_CAN_TRADE && (player.getKarma() > 0)) {
return;
}
if (player.getPrivateStoreType() != 0) {
/*
* player.sendMessage("You cannot exchange items while trading.");
*/
player.sendPacket(SystemMessageId.ITEMS_CANNOT_BE_DISCARDED_OR_DESTROYED_WHILE_OPERATING_PRIVATE_STORE_OR_WORKSHOP);
return;
}
final L2ItemInstance item = player.getInventory().getItemByObjectId(_objectId);
if (item == null) {
return;
}
if (item.isAugmented()) {
return;
}
if (item.isHeroItem() || !item.isDropable() || !item.isDestroyable() || !item.isTradeable()) {
player.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
return;
}
final L2PetInstance pet = (L2PetInstance) player.getPet();
if (pet.isDead()) {
player.sendPacket(SystemMessageId.CANNOT_GIVE_ITEMS_TO_DEAD_PET);
return;
}
if (_amount < 0) {
return;
}
if (!pet.getInventory().validateCapacity(item)) {
player.sendPacket(SystemMessageId.YOUR_PET_CANNOT_CARRY_ANY_MORE_ITEMS);
return;
}
if (!pet.getInventory().validateWeight(item, _amount)) {
player.sendPacket(SystemMessageId.UNABLE_TO_PLACE_ITEM_YOUR_PET_IS_TOO_ENCUMBERED);
return;
}
if (player.transferItem("Transfer", _objectId, _amount, pet.getInventory(), pet) == null) {
_log.warning("Invalid item transfer request: " + pet.getName() + "(pet) --> " + player.getName());
}
}
@Override
public String getType() {
return _C__95_REQUESTCIVEITEMTOPET;
}
}
| [
"lineage2kr@gmail.com"
] | lineage2kr@gmail.com |
17ee6fa434c20246be07bb7bc084e7f996572d51 | da1a4eab3f0747c415a67135685166a08c6bb324 | /mall-services/hpay-api-gateway/src/main/java/hmall/GatewayApplication.java | 24297f0678c78c17b6e793fbe037089d5f98c39e | [] | no_license | newbigTech/mk | ee3ea627c4ec8fca9b9f0c8166733c516e1554aa | 6bc5f34ce3ac35096596ddce8519f1bf4f4c9bab | refs/heads/master | 2020-03-30T06:39:57.542743 | 2018-04-01T08:53:10 | 2018-04-01T08:53:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,297 | java | package hmall;
import com.hand.hmall.dto.ResponseData;
import hmall.filter.InternetAccessFilter;
import hmall.filter.ProxyHeaderFilter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author 唐磊
* @Title:
* @Description:
* @date 2017/5/24 17:09
*/
@EnableZuulProxy
@RestController
@ComponentScan({"com.markor.unilog"})
@SpringBootApplication
@ImportResource(value = {"classpath:hsf/*.xml"})
public class GatewayApplication {
private static Logger logger = LogManager.getLogger(GatewayApplication.class);
@Autowired
private DiscoveryClient discoveryClient;
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
@GetMapping("error")
public ResponseData error() {
ResponseData responseData = new ResponseData(false);
responseData.setMsgCode("Time_Out");
return responseData;
}
@GetMapping(value = "services", produces = {MediaType.APPLICATION_JSON_VALUE})
public ResponseData getServiceName() {
List<String> services = discoveryClient.getServices();
logger.info("Get all services:");
for (String service : services) {
logger.info("service :" + service);
}
return new ResponseData(services);
}
/**
* 外网访问权限过滤器
*
* @return
*/
@Bean
public InternetAccessFilter internetAccessFilter() {
return new InternetAccessFilter();
}
@Bean
public ProxyHeaderFilter proxyHeaderFilter() {
return new ProxyHeaderFilter();
}
}
| [
"changbing.quan@hand-china.com"
] | changbing.quan@hand-china.com |
79d1bcec975dd5a8c2e79b4b516c6188716bafd9 | 9d8d146afc6021a05af4b9c1b484d57a2d7b2ce9 | /src/main/java/frc/robot/commands/VisionAngleCommand.java | 749c604c05ba8e4fe2f536a9e18a7d865acd3c3d | [] | no_license | Lakemonsters2635/ColorSensorBot | 6c4fa6b319a33b5485455b556a6f983fe7af8e40 | a9c8edc1a76f091a8b57b954418f2926ee200563 | refs/heads/master | 2020-12-09T13:16:54.104995 | 2020-02-06T04:25:46 | 2020-02-06T04:25:46 | 233,312,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,644 | java | /*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot.commands;
import edu.wpi.first.wpilibj.command.Command;
import frc.robot.Robot;
import frc.robot.RobotContainer;
public class VisionAngleCommand extends Command {
public VisionAngleCommand() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
RobotContainer.vision.ledOn();
}
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
RobotContainer.vision.data();
double angle = RobotContainer.vision.printXAngle();
//Robot.drivetrainSubsystem.holonomicDrive(0, , true);
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
}
// Called once after isFinished returns true
@Override
protected void end() {
RobotContainer.vision.ledOff();
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
end();
}
}
| [
"lakemonsters.software.team@gmail.com"
] | lakemonsters.software.team@gmail.com |
83f7aa2044ea8b7d47648fef1933ffb8376dee07 | 917fb0406cbbb3ce48bda939fd5e4d4bd1b01487 | /src/main/java/com/cpi/workflow/config/DatabaseConfiguration.java | ad704832ebcc59d67ac7044cd7e4257ab33fff96 | [] | no_license | cpikangbiao/cpiworkflow | d172bba91cd7b8570824da5269a86fdfa04e660b | b802087161ddc63afabc34410c213109e98b1a05 | refs/heads/master | 2022-12-17T06:40:04.218151 | 2019-06-19T05:37:01 | 2019-06-19T05:37:01 | 194,193,690 | 0 | 0 | null | 2022-12-16T04:59:48 | 2019-06-28T02:35:28 | JavaScript | UTF-8 | Java | false | false | 779 | java | package com.cpi.workflow.config;
import io.github.jhipster.config.JHipsterConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableJpaRepositories("com.cpi.workflow.repository")
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
public class DatabaseConfiguration {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
}
| [
"git"
] | git |
4e18d0134bec150ee2a3bc74e9d73683f599367d | 37f6d3588aa800c967ac36fabf0176ba7afe592a | /src/main/java/org/vs/geeksforgeeks/arrays/missingnumber/GFG.java | 97f7721f0d778cebf8381758f4753ebad39bb6e4 | [] | no_license | vishalsinha21/java-problems | 30d064bd1c58dacee9848d0de6b197c70cd6362e | dd3eb2222bc797b4b9639c4dddeaa14fcfa102e9 | refs/heads/master | 2023-04-16T12:20:59.684969 | 2023-03-31T13:28:27 | 2023-03-31T13:28:27 | 140,075,453 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 664 | java | package org.vs.geeksforgeeks.arrays.missingnumber;
import java.util.Scanner;
public class GFG {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int testCases = scanner.nextInt();
for (int i = 0; i < testCases; i++) {
int arrSize = scanner.nextInt();
int[] arr = new int[arrSize];
int sum = 0;
for (int j = 0; j < arrSize - 1; j++) {
arr[j] = scanner.nextInt();
sum += arr[i];
}
int totalSum = (arrSize * (arrSize + 1)) / 2;
System.out.println(totalSum - sum);
}
}
}
| [
"vishal.sinha21@gmail.com"
] | vishal.sinha21@gmail.com |
5a474162248ff81c1d79ca88c9a6a8c336ea0fa9 | a9ffada2a8189fcc7ddacc91ff8a078b2b0dec34 | /src/main/java/org/kiluyaqing/choice/service/InvestigationService.java | 64127bdf64525f3965fea0a9ac2d1f73b866428d | [] | no_license | kiluyaqing/choice | 1b23e260a9d8998ee37467ce366bc4da62026e8c | acd1926693669e58fade0231f35fe178c51b8284 | refs/heads/master | 2020-06-12T06:45:35.297200 | 2017-01-16T09:16:47 | 2017-01-16T09:16:47 | 75,600,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,045 | java | package org.kiluyaqing.choice.service;
import org.kiluyaqing.choice.service.dto.InvestigationDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.LinkedList;
import java.util.List;
/**
* Service Interface for managing Investigation.
*/
public interface InvestigationService {
/**
* Save a investigation.
*
* @param investigationDTO the entity to save
* @return the persisted entity
*/
InvestigationDTO save(InvestigationDTO investigationDTO);
/**
* Get all the investigations.
*
* @param pageable the pagination information
* @return the list of entities
*/
Page<InvestigationDTO> findAll(Pageable pageable);
/**
* Get the "id" investigation.
*
* @param id the id of the entity
* @return the entity
*/
InvestigationDTO findOne(Long id);
/**
* Delete the "id" investigation.
*
* @param id the id of the entity
*/
void delete(Long id);
}
| [
"kiluyaqing@gmail.com"
] | kiluyaqing@gmail.com |
ccfba02f66f51811cffd7cc3b3069d7725c2c003 | 0e0dae718251c31cbe9181ccabf01d2b791bc2c2 | /archive/SCT1/trunk/com.yakindu.statechart.codegenerator/examples/com.yakindu.statechart.codegenerator.examples.java/src-gen/com/yakindu/statechart/Guard.java | 74152e99d2985e304c02ac6ce88647b870d8ecbe | [] | no_license | huybuidac20593/yakindu | 377fb9100d7db6f4bb33a3caa78776c4a4b03773 | 304fb02b9c166f340f521f5e4c41d970268f28e9 | refs/heads/master | 2021-05-29T14:46:43.225721 | 2015-05-28T11:54:07 | 2015-05-28T11:54:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 496 | java | /**
* Copyright (c) 2010 committers of YAKINDU and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* committers of YAKINDU - initial API and implementation
*/
package com.yakindu.statechart;
public abstract class Guard {
public abstract boolean evaluate();
}
| [
"terfloth@itemis.de"
] | terfloth@itemis.de |
59ea225e7493aefa46b3091fafcc2d657cb39e9f | f942122d38f346ee7cd73b5c2ea3d99b2074595e | /book2/lanqiaobook2/src/com/ch6/test6_6_1/ShareData.java | 4e76b512370666d0a7f946f6df2b4cea6a5caece | [] | no_license | liaoshanggang/Practice | 4c5304d2e30593a771bda4b44e60b38fe9f5c1ac | ce8c7e9060d7b3588bc7b649aa45c889a8ed1091 | refs/heads/master | 2020-01-19T21:10:26.407801 | 2017-06-27T08:28:10 | 2017-06-27T08:29:23 | 94,212,204 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 884 | java | package com.ch6.test6_6_1;
public class ShareData {
static int data = 0;
public static void main(String[] args) {
ShareThread1 st1 = new ShareThread1();
ShareThread2 st2 = new ShareThread2();
new Thread(st1).start();
new Thread(st2).start();
}
//内部类,访问类中静态成员变量data
private static class ShareThread1 implements Runnable {
@Override
public void run() {
// TODO 自动生成的方法存根
while (data<10) {
try {
Thread.sleep(1000);
System.out.println("这个小于10的数据是:" + data++);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
//内部类,访问类中静态成员变量data
private static class ShareThread2 implements Runnable {
@Override
public void run() {
// TODO 自动生成的方法存根
while (data<100) {
data++;
}
}
}
}
| [
"787887060@qq.com"
] | 787887060@qq.com |
29d05c4e2c8aaec501b9c58295377b4631566c3e | cd48551346edeef17d95527f1acd78bb3d4c47f3 | /src/main/java/studio/ui/QuitHandler.java | 052f7be0f9b647925e36e9c15f2e667d9f5f04ca | [
"Apache-2.0"
] | permissive | tszielin/q-lab-editor | 56c387f5a8f2437857813754b1e17fcc9ecd4411 | eaf1baa4373d8ee476c0b8cfbc30c54fe0afbd46 | refs/heads/master | 2021-01-10T02:23:49.816445 | 2016-03-02T16:56:10 | 2016-03-02T16:56:10 | 52,768,617 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | /*
* Studio for kdb+ by Charles Skelton is licensed under a Creative Commons
* Attribution-Noncommercial-Share Alike 3.0 Germany License
* http://creativecommons.org/licenses/by-nc-sa/3.0 except for the netbeans components which retain
* their original copyright notice
*/
package studio.ui;
public class QuitHandler {
private Studio s;
public QuitHandler(Studio s) {
this.s = s;
}
public boolean quit() {
return s.quit();
}
}
| [
"thomas.zielinski@cognizant.com"
] | thomas.zielinski@cognizant.com |
2b1b7827be34cfde5275c617ab1be8a4fdd13572 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/naver--pinpoint/08c6f0bd3cf513d6bffd1cf767d8951db501bb4d/before/AbstractModifier.java | 4caa7a84bde6b05bd647f77c0c2b93ad74136a08 | [] | 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,646 | java | package com.profiler.modifier;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtConstructor;
import javassist.CtMethod;
public abstract class AbstractModifier {
public static void printClassInfo(String className) {
log("Printing Class Info of ["+className+"]");
try {
ClassPool pool=ClassPool.getDefault();
// pool.insertClassPath(new ClassClassPath(currentClass));
log("try");
String javaassistClassName = className.replace('/', '.');
log("replace");
CtClass cc=pool.get(javaassistClassName);
log("ClassName:"+javaassistClassName);
CtConstructor[] constructorList=cc.getConstructors();
for(CtConstructor cons:constructorList) {
try {
String signature=cons.getSignature();
System.out.println("Constructor signature:"+signature);
} catch(Exception e) {
e.printStackTrace();
}
}
CtMethod[] methodList=cc.getDeclaredMethods();
for(CtMethod tempMethod:methodList) {
try {
String methodName=tempMethod.getLongName();
log("MethodName:"+methodName);
CtClass[] params=tempMethod.getParameterTypes();
if(params.length!=0) {
int paramsLength=params.length;
for(int loop=paramsLength-1;loop>0;loop--) {
log("Param"+loop+":"+params[loop].getName());
}
} else {
log(" No params");
}
log("ReturnType="+tempMethod.getReturnType().getName());
} catch(Exception methodException) {
log("Exception : "+methodException.getMessage());
}
}
} catch(Exception e) {
log(e.getMessage());
e.printStackTrace();
}
}
public static byte[] addBeforeAfterLogics(ClassPool classPool,String javassistClassName) {
try {
CtClass cc = classPool.get(javassistClassName);
CtMethod[] methods=cc.getDeclaredMethods();
for(CtMethod method:methods) {
if(!method.isEmpty() ) {
String methodName=method.getName();
CtClass[] params=method.getParameterTypes();
StringBuilder sb=new StringBuilder();
if(params.length!=0) {
int paramsLength=params.length;
for(int loop=paramsLength-1;loop>0;loop--) {
sb.append(params[loop].getName()).append(",");
}
// sb.substring(0, sb.length()-2);
}
method.insertBefore("{System.out.println(\"*****"+javassistClassName+"."+methodName+"("+sb+") is started.\");}");
method.insertAfter("{System.out.println(\"*****"+javassistClassName+"."+methodName+"("+sb+") is finished.\");}");
} else {
log(method.getLongName()+" is empty !!!!!");
}
}
CtConstructor[] constructors=cc.getConstructors();
for(CtConstructor constructor:constructors) {
if(!constructor.isEmpty()) {
CtClass[] params=constructor.getParameterTypes();
StringBuilder sb=new StringBuilder();
if(params.length!=0) {
int paramsLength=params.length;
for(int loop=paramsLength-1;loop>0;loop--) {
sb.append(params[loop].getName()).append(",");
}
// sb.substring(0, sb.length()-2);
}
constructor.insertBefore("{System.out.println(\"*****"+javassistClassName+" Constructor:Param=("+sb+") is started.\");}");
constructor.insertAfter("{System.out.println(\"*****"+javassistClassName+" Constructor:Param=("+sb+") is finished.\");}");
} else {
log(constructor.getLongName()+" is empty !!!!!");
}
}
return cc.toBytecode();
} catch(Exception e) {
e.printStackTrace();
return null;
}
}
public static void log(String message) {
System.out.println("[AbstractModifier] "+message);
}
public static void printClassConvertComplete(String javassistClassName) {
log("@@@ "+javassistClassName+" class is converted !!!");
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
83b345428c537d39057d481887a988622a2a2fec | a95eba6c79375e7a6f068104d405613a52fe0fa5 | /BiglyBT/src/main/java/com/biglybt/android/client/adapter/TorrentPagerAdapter.java | d552100cc4b35a2ead9ffce122270944cd22c0e0 | [] | no_license | coen22/BiglyBT-Android | 56420008515808d3118f8775c73e164c3a635f6e | 16ec11198b339c2e2f1d0d417d93748e59729135 | refs/heads/master | 2020-04-10T14:43:19.971179 | 2018-12-12T12:55:22 | 2018-12-12T12:55:22 | 161,085,567 | 0 | 0 | null | 2018-12-09T22:03:50 | 2018-12-09T22:03:49 | null | UTF-8 | Java | false | false | 3,410 | 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.client.adapter;
import com.astuetz.PagerSlidingTabStrip;
import com.biglybt.android.client.AndroidUtils;
import com.biglybt.android.client.SetTorrentIdListener;
import com.biglybt.android.client.fragment.FragmentPagerListener;
import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.OnLifecycleEvent;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;
/**
* PagerAdapter for a torrent. Links up {@link ViewPager},
* {@link PagerSlidingTabStrip} and adapter.
* <p>
* Any page Fragments that implement {@link FragmentPagerListener} will
* get notified of activation/deactivation.
*/
public abstract class TorrentPagerAdapter
extends PagerAdapterForPagerSlidingTabStrip
{
private static final String TAG = "TorrentPagerAdapter";
private long torrentID = -1;
TorrentPagerAdapter(final FragmentManager fragmentManager,
Lifecycle lifecycle, Class<? extends Fragment>... pageItemClasses) {
super(fragmentManager, lifecycle, pageItemClasses);
}
/**
* Return the Fragment associated with a specified position.
* <p/>
* Only gets called once by {@link FragmentStatePagerAdapter} when creating
* fragment.
*/
@Override
public final Fragment getItem(int position) {
Fragment fragment = super.getItem(position);
if (fragment == null) {
return null;
}
fragment.getLifecycle().addObserver(new LifecycleObserver() {
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
public void onResume() {
// Does this get called after screen rotation?
if (AndroidUtils.DEBUG) {
Log.i(TAG, "onResume: GOT CALLED for tab " + position + "; torrentID="
+ torrentID);
}
if (fragment instanceof SetTorrentIdListener) {
((SetTorrentIdListener) fragment).setTorrentID(torrentID);
}
}
});
return fragment;
}
public void setSelection(long torrentID) {
this.torrentID = torrentID;
}
/* Since we are now using UpdatableFragmentPagerAdapter, let's assume
* TransactionTooLargeException is fixed
@Override
public Parcelable saveState() {
// Fix TransactionTooLargeException (See Solve 1 at https://medium.com/@mdmasudparvez/android-os-transactiontoolargeexception-on-nougat-solved-3b6e30597345 )
Bundle bundle = (Bundle) super.saveState();
if (bundle != null) {
bundle.putParcelableArray("states", null); // Never maintain any states from the base class, just null it out
}
return bundle;
}
*/
}
| [
"725353+TuxPaper@users.noreply.github.com"
] | 725353+TuxPaper@users.noreply.github.com |
28f29bc9561f81c194d07125480f5049b06ffb31 | d6267a448e056b47d79cc716d18edec6dd91154c | /modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheMessageWriteTimeoutTest.java | 0dd40797330816cb2ab00f510ebb8fef6c464b2b | [
"Apache-2.0",
"LicenseRef-scancode-gutenberg-2020",
"CC0-1.0",
"BSD-3-Clause"
] | permissive | sk8tz/ignite | 1635163cc2309aa0f9fd65734317af861679679f | 2774d879a72b0eeced862cc9a3fbd5d9c5ff2d72 | refs/heads/master | 2023-04-19T03:07:50.202953 | 2017-01-04T21:01:13 | 2017-01-04T21:01:13 | 78,094,618 | 0 | 0 | Apache-2.0 | 2023-04-17T19:45:36 | 2017-01-05T08:30:14 | Java | UTF-8 | Java | false | false | 4,422 | 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.ignite.internal.processors.cache.distributed;
import java.util.concurrent.Callable;
import java.util.concurrent.CyclicBarrier;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCompute;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteRunnable;
import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.apache.ignite.testframework.GridTestUtils;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
/**
*
*/
public class IgniteCacheMessageWriteTimeoutTest extends GridCommonAbstractTest {
/** */
private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
TcpCommunicationSpi commSpi = (TcpCommunicationSpi)cfg.getCommunicationSpi();
// Try provoke connection close on socket writeTimeout.
commSpi.setSharedMemoryPort(-1);
commSpi.setMessageQueueLimit(10);
commSpi.setSocketReceiveBuffer(40);
commSpi.setSocketSendBuffer(40);
commSpi.setSocketWriteTimeout(100);
commSpi.setUnacknowledgedMessagesBufferSize(1000);
commSpi.setConnectTimeout(10_000);
return cfg;
}
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
stopAllGrids();
super.afterTest();
}
/** {@inheritDoc} */
@Override protected long getTestTimeout() {
return 10 * 60_000;
}
/**
* @throws Exception If failed.
*/
public void testMessageQueueLimit() throws Exception {
for (int i = 0; i < 3; i++) {
log.info("Iteration: " + i);
startGridsMultiThreaded(3);
IgniteInternalFuture<?> fut1 = startJobThreads(50);
U.sleep(100);
IgniteInternalFuture<?> fut2 = startJobThreads(50);
fut1.get();
fut2.get();
stopAllGrids();
}
}
/**
* @param cnt Threads count.
* @return Future.
*/
private IgniteInternalFuture<?> startJobThreads(int cnt) {
final CyclicBarrier b = new CyclicBarrier(cnt);
return GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
@Override public Void call() throws Exception {
int idx = b.await();
Ignite node = ignite(idx % 3);
IgniteCompute comp = node.compute(node.cluster().forRemotes());
comp.run(new TestJob());
return null;
}
}, cnt, "job-thread");
}
/**
*
*/
static class TestJob implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
try {
long stop = System.currentTimeMillis() + 1000;
while (System.currentTimeMillis() < stop)
assertTrue(Math.sqrt(hashCode()) >= 0);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
}
| [
"sboikov@gridgain.com"
] | sboikov@gridgain.com |
e7267ae04bebc092ae562d98233583ab695e5cea | 11f60262a3cb72653d20e07e18d2b03d65fc4670 | /apollo_mq/apollo-core/src/main/java/com/fangcang/common/util/WeekUtil.java | 93f385cf74bd0eb66c28c1216773963ec1d7fa1d | [
"Apache-2.0"
] | permissive | GSIL-Monitor/hotel-1 | 59812e7c3983a9b6db31f7818f93d7b3a6ac683c | 4d170c01a86a23ebf3378d906cac4641ba1aefa9 | refs/heads/master | 2020-04-12T18:29:14.914311 | 2018-12-21T07:03:37 | 2018-12-21T07:03:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.fangcang.common.util;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Created by ASUS on 2018/5/24.
*/
public class WeekUtil {
public static List<Date> getSaleDate(Date startDate,Date endDate,String weeks){
List<Date> dates = new ArrayList<>();
if(null != startDate && null != endDate && StringUtil.isValidString(weeks)){
List<Date> dateList = DateUtil.getDateList(startDate, endDate);
for (Date date : dateList) {
String week = String.valueOf(DateUtil.getWeekOfDate(date));
if(weeks.contains(week)){
dates.add(date);
}
}
}
return dates;
}
}
| [
"961346704@qq.com"
] | 961346704@qq.com |
b1874b931224a4818a74d9a5dc92c965bf0de10f | 287daf8dc5337b53f18ded9aad350aa1c2b3e40f | /src/com/zj/business/po/Footer.java | d4331a6ce4b80ba768de5f907990edf0670ea9aa | [] | no_license | zhujiancom/FashionWebSite_Old | e8025c4fe757345c4f888c72dd783ee7beaafcbd | 9be254d59356a94f24141a2c20cb3f6ef9a8a456 | refs/heads/master | 2020-04-05T22:49:06.060625 | 2014-03-10T10:57:02 | 2014-03-10T10:57:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,050 | java | package com.zj.business.po;
import java.sql.Blob;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import com.zj.bigdefine.GlobalParam;
@Entity
@Table(name="BUS_FOOTER" , catalog = GlobalParam.CATALOG_DB)
@SequenceGenerator(name="commSEQ" , catalog=GlobalParam.CATALOG_DB ,allocationSize=1,initialValue=1)
public class Footer {
private long footerId;
private String aboutus_EN;
private String aboutus_CH;
private Blob legalstmt_EN;
private Blob legalstmt_CH;
private String links;
public Footer() {
super();
// TODO Auto-generated constructor stub
}
public Footer(long footerId) {
super();
this.footerId = footerId;
}
@Id
@Column(name="FOOTER_ID", nullable=false)
public long getFooterId() {
return footerId;
}
public void setFooterId(long footerId) {
this.footerId = footerId;
}
@Column(name="ABOUTUS_EN",length=2000)
public String getAboutus_EN() {
return aboutus_EN;
}
public void setAboutus_EN(String aboutus_EN) {
this.aboutus_EN = aboutus_EN;
}
@Column(name="ABOUTUS_CH",length=2000)
public String getAboutus_CH() {
return aboutus_CH;
}
public void setAboutus_CH(String aboutus_CH) {
this.aboutus_CH = aboutus_CH;
}
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name="LEGAL_STMT_EN", columnDefinition="blob")
public Blob getLegalstmt_EN() {
return legalstmt_EN;
}
public void setLegalstmt_EN(Blob legalstmt_EN) {
this.legalstmt_EN = legalstmt_EN;
}
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name="LEGAL_STMT_CH", columnDefinition="blob")
public Blob getLegalstmt_CH() {
return legalstmt_CH;
}
public void setLegalstmt_CH(Blob legalstmt_CH) {
this.legalstmt_CH = legalstmt_CH;
}
@Column(name="LINKS",length=500)
public String getLinks() {
return links;
}
public void setLinks(String links) {
this.links = links;
}
}
| [
"eric87com@gmail.com"
] | eric87com@gmail.com |
95563b207b4183a638271ceb845ec1b0333e2606 | ccf94dcb6b1500fcbbd56964ae8c4832a496b8b3 | /java/baiduads-sdk-auto/src/main/java/com/baidu/dev2/api/sdk/imagemanage/model/GetImageListResponseWrapper.java | 8601586105c4ccc99cf7c9d24c46a299a6633151 | [
"Apache-2.0"
] | permissive | baidu/baiduads-sdk | 24c36b5cf3da9362ec5c8ecd417ff280421198ff | 176363de5e8a4e98aaca039e4300703c3964c1c7 | refs/heads/main | 2023-06-08T15:40:24.787863 | 2023-05-20T03:40:51 | 2023-05-20T03:40:51 | 446,718,177 | 16 | 11 | Apache-2.0 | 2023-06-02T05:19:40 | 2022-01-11T07:23:17 | Python | UTF-8 | Java | false | false | 3,871 | java | /*
* dev2 api schema
* 'dev2.baidu.com' api schema
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.baidu.dev2.api.sdk.imagemanage.model;
import java.util.Objects;
import java.util.Arrays;
import com.baidu.dev2.api.sdk.imagemanage.model.GetImageListResponseWrapperBody;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* GetImageListResponseWrapper
*/
@JsonPropertyOrder({
GetImageListResponseWrapper.JSON_PROPERTY_HEADER,
GetImageListResponseWrapper.JSON_PROPERTY_BODY
})
@JsonTypeName("GetImageListResponseWrapper")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class GetImageListResponseWrapper {
public static final String JSON_PROPERTY_HEADER = "header";
private com.baidu.dev2.api.sdk.common.ApiResponseHeader header;
public static final String JSON_PROPERTY_BODY = "body";
private GetImageListResponseWrapperBody body;
public GetImageListResponseWrapper() {
}
public GetImageListResponseWrapper header(com.baidu.dev2.api.sdk.common.ApiResponseHeader header) {
this.header = header;
return this;
}
/**
* Get header
* @return header
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_HEADER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public com.baidu.dev2.api.sdk.common.ApiResponseHeader getHeader() {
return header;
}
@JsonProperty(JSON_PROPERTY_HEADER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setHeader(com.baidu.dev2.api.sdk.common.ApiResponseHeader header) {
this.header = header;
}
public GetImageListResponseWrapper body(GetImageListResponseWrapperBody body) {
this.body = body;
return this;
}
/**
* Get body
* @return body
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_BODY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public GetImageListResponseWrapperBody getBody() {
return body;
}
@JsonProperty(JSON_PROPERTY_BODY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setBody(GetImageListResponseWrapperBody body) {
this.body = body;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GetImageListResponseWrapper getImageListResponseWrapper = (GetImageListResponseWrapper) o;
return Objects.equals(this.header, getImageListResponseWrapper.header) &&
Objects.equals(this.body, getImageListResponseWrapper.body);
}
@Override
public int hashCode() {
return Objects.hash(header, body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GetImageListResponseWrapper {\n");
sb.append(" header: ").append(toIndentedString(header)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"jiangyuan04@baidu.com"
] | jiangyuan04@baidu.com |
30efd502438bbe8efa927ed63ea9bc83c28f98d7 | d4ba636068fc2ffbb45f313012103afb9080c4e3 | /Other/N2F/Src/Next2Friends.Social/src/j2me/src/App/Comment.java | 639de3dcac24bc04cdcec07d625a7d6207f1e68a | [] | no_license | SHAREVIEW/GenXSource | 785ae187531e757860748a2e49d9b6a175c97402 | 5e5fe1d5816560ac41a117210fd40a314536f7a4 | refs/heads/master | 2020-07-20T22:05:24.794801 | 2019-09-06T05:00:39 | 2019-09-06T05:00:39 | 206,716,265 | 0 | 0 | null | 2019-09-06T05:00:12 | 2019-09-06T05:00:12 | null | UTF-8 | Java | false | false | 2,107 | java | package App;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
public class Comment
{
public int questionId;
public String login;
public String text;
public int recordId;
private static String storage = "comments";
public Comment()
{
login = Core.storage.login;
text = "";
recordId = -1;
}
public void delete(int index)
{
recordId = Core.storage.getRecordId(storage, index);
Core.storage.deleteData(storage, recordId);
}
public void read(int index)
{
recordId = Core.storage.getRecordId(storage, index);
byte[] data = Core.storage.readData(storage, recordId);
ByteArrayInputStream is = new ByteArrayInputStream(data);
DataInputStream dis = new DataInputStream(is);
try
{
questionId = dis.readInt();
login = dis.readUTF();
text = dis.readUTF();
dis.close();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
public void save()
{
ByteArrayOutputStream os = new ByteArrayOutputStream(Const.QUESTION_MAXSIZE);
DataOutputStream dos = new DataOutputStream(os);
try
{
dos.writeInt(questionId);
dos.writeUTF(login);
dos.writeUTF(text);
dos.close();
Core.storage.writeData(os.toByteArray(), storage, recordId);
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
public static String[] getCommentsHeaders()
{
int count = Core.storage.countData(storage);
String[] out = new String[count];
for(int i = 0; i < count; ++i)
{
int recordId = Core.storage.getRecordId(storage, i);
byte[] data = Core.storage.readData(storage, recordId);
ByteArrayInputStream is = new ByteArrayInputStream(data);
DataInputStream dis = new DataInputStream(is);
try
{
dis.readInt();
dis.readUTF();
String header = dis.readUTF();
out[i] = header.substring(0, Math.min(header.length(), 15));
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
return out;
}
}
| [
"nystrom.anthony@gmail.com"
] | nystrom.anthony@gmail.com |
202a97a933b34aede7b95cf4d5cda296cc3696d9 | 5291b26e32544357bd2892c6e024c1cdc11178e0 | /src/main/java/org/mapdb/DBException.java | e9b137a6b4fe0bde6635af7b61214724075269d5 | [
"Apache-2.0",
"CC-PDDC",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | batterseapower/MapDB | 9fc0463214e58d94a8f897522cd0203a6db55897 | 388ced89fe82f5b230885d06e200433a6e79973d | refs/heads/master | 2020-12-29T01:00:12.544678 | 2015-04-19T11:48:38 | 2015-04-19T11:48:38 | 34,204,402 | 1 | 0 | null | 2015-04-19T11:42:41 | 2015-04-19T11:42:40 | null | UTF-8 | Java | false | false | 3,345 | java | package org.mapdb;
import java.io.IOException;
import java.nio.channels.ClosedByInterruptException;
/**
* General exception returned by MapDB if something goes wrong.
* Subclasses inform about specific failure.
*
*/
public class DBException extends RuntimeException{
public DBException(String message) {
super(message);
}
public DBException(String message, Throwable cause) {
super(message,cause);
}
public static class EngineGetVoid extends DBException{
public EngineGetVoid(){
super("Recid passed to Engine.get() does not exist. Possible data corruption!");
}
}
public static class EngineCompactUncommited extends DBException{
public EngineCompactUncommited(){
super("Engine.compact() called while there are uncommited data. Commit first, than compact!");
}
}
/** @see java.nio.channels.ClosedByInterruptException */
//TODO this thread was interrupted while doing IO?
public static class VolumeClosedByInterrupt extends VolumeClosed{
public VolumeClosedByInterrupt(ClosedByInterruptException cause){
super("Some thread was interrupted while doing IO, and FileChannel was closed in result.", cause);
}
}
public static class VolumeClosed extends DBException{
public VolumeClosed(IOException cause){
this("Volume (file or other device) was already closed.", cause);
}
protected VolumeClosed(String msg, IOException cause) {
super(msg,cause);
}
}
public static class VolumeIOError extends DBException{
public VolumeIOError(String msg){
super(msg);
}
public VolumeIOError(String msg, Throwable cause){
super(msg,cause);
}
public VolumeIOError(Throwable cause){
super("IO failed", cause);
}
}
public static class VolumeEOF extends VolumeIOError {
public VolumeEOF() {
super("Beyond End Of File accessed");
}
}
public static class OutOfMemory extends VolumeIOError{
public OutOfMemory(Throwable e){
super(
e.getMessage().equals("Direct buffer memory")?
"Out of Direct buffer memory. Increase it with JVM option '-XX:MaxDirectMemorySize=10G'":
e.getMessage(),
e);
}
}
public static class DataCorruption extends DBException{
public DataCorruption(String msg){
super(msg);
}
}
public static class ChecksumBroken extends DataCorruption{
public ChecksumBroken(){
super("CRC checksum is broken");
}
}
public static class HeadChecksumBroken extends DataCorruption{
public HeadChecksumBroken(){
super("Head checksum broken, perhaps db was not closed correctly?");
}
}
public static class PointerChecksumBroken extends DataCorruption{
public PointerChecksumBroken(){
super("Bit parity in file pointer is broken, data possibly corrupted.");
}
}
public static class Interrupted extends DBException {
public Interrupted(InterruptedException e) {
super("Thread interrupted",e);
}
}
}
| [
"jan@kotek.net"
] | jan@kotek.net |
90285a14464a616669879a941460486342104a8c | 5354abcd77f85fe8d2d88bf8f3875f99d6d889ec | /src/main/java/com/lys/utils/BaseUtil.java | d931baadde0ee415a2112bd9394c463af6e531a6 | [] | no_license | sengeiou/zjyk | 5f8c4c87a9bc6ba416f0566306888b50326d1c07 | 7e742e02aa9151cb61e123fa354020d4c0ecc9a0 | refs/heads/master | 2023-01-29T01:41:39.312923 | 2020-12-13T03:25:20 | 2020-12-13T03:25:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,901 | java | package com.lys.utils;
import java.awt.*;
public class BaseUtil
{
public static float scale(float value, double xisu)
{
return ((int) (value * xisu * 10 + 0.5)) / 10.0f;
}
public static int scale(int value, double xisu)
{
return (int) (value * xisu + 0.5);
}
public static SPTCard_Point scale(SPTCard_Point point, double xisu)
{
return pos(scale(point.x, xisu), scale(point.y, xisu));
}
public static SPTCard_Rect scale(SPTCard_Rect rect, double xisu)
{
return rectByPos(scale(rect.left, xisu), scale(rect.top, xisu), scale(rect.right, xisu), scale(rect.bottom, xisu));
}
public static Color color(int color)
{
return new Color(color);
}
public static boolean isZero(SPTCard_Point point)
{
return point.x == 0 && point.y == 0;
}
public static boolean isZero(SPTCard_Rect rect)
{
return rect.left == 0 && rect.top == 0 && rect.right == 0 && rect.bottom == 0;
}
public static SPTCard_Point pos(int x, int y)
{
return SPTCard_Point.create(x, y);
}
public static SPTCard_Point pos(SPTCard_Rect rect)
{
return SPTCard_Point.create(rect.left, rect.top);
}
public static SPTCard_Point center(SPTCard_Rect rect)
{
return SPTCard_Point.create((rect.left + rect.right) / 2, (rect.top + rect.bottom) / 2);
}
public static SPTCard_Size size(int width, int height)
{
return SPTCard_Size.create(width, height);
}
public static SPTCard_Rect rectByPos(Integer left, Integer top, Integer right, Integer bottom)
{
return SPTCard_Rect.create(left, top, right, bottom);
}
public static SPTCard_Rect rectBySize(Integer left, Integer top, Integer width, Integer height)
{
return SPTCard_Rect.create(left, top, left + width, top + height);
}
public static SPTCard_Rect rectByCenter(int xCenter, int yCenter, int sizeX, int sizeY)
{
return SPTCard_Rect.create(xCenter - sizeX / 2, yCenter - sizeY / 2, xCenter + sizeX / 2, yCenter + sizeY / 2);
}
public static SPTCard_Rect rectExpand(SPTCard_Rect rect, Integer expand)
{
return SPTCard_Rect.create(rect.left - expand, rect.top - expand, rect.right + expand, rect.bottom + expand);
}
public static SPTCard_Point offset(SPTCard_Point offset, SPTCard_Point pos)
{
return pos(offset.x + pos.x, offset.y + pos.y);
}
public static SPTCard_Rect offset(SPTCard_Point offset, SPTCard_Rect rect)
{
return rectBySize(offset.x + rect.left, offset.y + rect.top, rectWidth(rect), rectHeight(rect));
}
public static int rectWidth(SPTCard_Rect rect)
{
return rect.right - rect.left;
}
public static int rectHeight(SPTCard_Rect rect)
{
return rect.bottom - rect.top;
}
public static String rectStrPos(SPTCard_Rect rect)
{
return String.format("%d, %d, %d, %d", rect.left, rect.top, rect.right, rect.bottom);
}
public static String rectStrSize(SPTCard_Rect rect)
{
return String.format("%d, %d, %d, %d", rect.left, rect.top, rectWidth(rect), rectHeight(rect));
}
}
| [
"xnktyu@163.com"
] | xnktyu@163.com |
5f2ed6fe3635b7858077ad124aefbbcd53227216 | f9cfa81a99eef9ea9a3d5820a5cfc5cc765e8a94 | /src/main/java/com/arangodb/intellij/aql/grammar/generated/psi/AqlFunIsObject.java | 4dc885bad734565453bb89fd118bd581e0aa4cba | [
"Apache-2.0"
] | permissive | vlansco/aql-intellij-plugin | 5470cbd4b02ca8c8a9fccfb270b2446dbaa650a9 | 17d60a9bc3e3c8cb081688cf728bb657dcbe053b | refs/heads/master | 2020-08-19T02:58:35.441961 | 2019-10-16T13:08:38 | 2019-10-16T13:08:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 379 | java | // This is a generated file. Not intended for manual editing.
package com.arangodb.intellij.aql.grammar.generated.psi;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface AqlFunIsObject extends PsiElement {
@Nullable
AqlAnyType getAnyType();
@NotNull
PsiElement getFIsObject();
}
| [
"marijan.milicevic@bloomreach.com"
] | marijan.milicevic@bloomreach.com |
898beea915599980f24f2f257c5394c9c1398ad4 | 36838dfcd53c4d2c73b9a6b0b7a8a28e4a331517 | /cn/com/smartdevices/bracelet/gps/sync/C0471d.java | 737086fef59dd8d59e29afedd626b01b57d2fd1c | [] | no_license | ShahmanTeh/MiFit-Java | fbb2fd578727131b9ac7150b86c4045791368fe8 | 93bdf88d39423893b294dec2f5bf54708617b5d0 | refs/heads/master | 2021-01-20T13:05:10.408158 | 2016-02-03T21:02:55 | 2016-02-03T21:02:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | package cn.com.smartdevices.bracelet.gps.sync;
import org.json.JSONArray;
class C0471d {
public JSONArray a;
public int b;
public C0471d() {
this.a = null;
this.b = 0;
this.a = new JSONArray();
}
}
| [
"kasha_malaga@hotmail.com"
] | kasha_malaga@hotmail.com |
50506783e3630ee311223ef0a1575b2bedc7134e | 9903060a3d9d42485980868717146fcc9e89c02e | /src/main/java/packet/chapter05/UnderstandingTheZipFileSystemProvider.java | 6ade357f82d88572928dbf0076c052cd6b6bd0a2 | [] | no_license | 18965050/java7-new-features | a9f540ced33fe4a35d554681f45463405dc5f02c | 22b9584589ca55591c97cc91454ed3b8ce311bd5 | refs/heads/master | 2016-09-01T16:19:53.767038 | 2016-03-25T14:17:27 | 2016-03-25T14:17:27 | 54,640,929 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,158 | java | package packet.chapter05;
import java.io.IOException;
import java.net.URI;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
public class UnderstandingTheZipFileSystemProvider {
public static void main(String[] args) {
Map<String, String> attributes = new HashMap<>();
attributes.put("create", "true");
try {
URI zipFile = URI.create("jar:file:/home.zip");
try (FileSystem zipFileSys = FileSystems.newFileSystem(zipFile, attributes);) {
Path path = zipFileSys.getPath("docs");
Files.createDirectory(path);
try (DirectoryStream<Path> directoryStream =
Files.newDirectoryStream(zipFileSys.getPath("/"));) {
for (Path file : directoryStream) {
System.out.println(file.getFileName());
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"18965050@qq.com"
] | 18965050@qq.com |
aebe82aa699db282be92ee5526901966091d39fb | ec0b1aa98c30822885b24d299f0de7e4873d35c0 | /core/trino-parser/src/main/java/io/trino/sql/tree/Update.java | 0aa6419db423dff3d4d242d92fa7f5de19263cf2 | [
"Apache-2.0"
] | permissive | letmagnau/trino | 17b245475fc9a8143c6ec3859e140f90773882b8 | 2a9d851c06c0a2d1f968b490535712fbcda4dbde | refs/heads/master | 2023-03-09T07:25:02.614322 | 2021-01-23T20:12:22 | 2021-02-24T07:12:12 | 341,825,120 | 0 | 1 | Apache-2.0 | 2021-02-25T08:10:10 | 2021-02-24T08:07:53 | null | UTF-8 | Java | false | false | 3,153 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.sql.tree;
import com.google.common.collect.ImmutableList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static com.google.common.base.MoreObjects.toStringHelper;
import static java.util.Objects.requireNonNull;
public class Update
extends Statement
{
private final Table table;
private final List<UpdateAssignment> assignments;
private final Optional<Expression> where;
public Update(Table table, List<UpdateAssignment> assignments, Optional<Expression> where)
{
this(Optional.empty(), table, assignments, where);
}
public Update(NodeLocation location, Table table, List<UpdateAssignment> assignments, Optional<Expression> where)
{
this(Optional.of(location), table, assignments, where);
}
private Update(Optional<NodeLocation> location, Table table, List<UpdateAssignment> assignments, Optional<Expression> where)
{
super(location);
this.table = requireNonNull(table, "table is null");
this.assignments = requireNonNull(assignments, "targets is null");
this.where = requireNonNull(where, "where is null");
}
public Table getTable()
{
return table;
}
public List<UpdateAssignment> getAssignments()
{
return assignments;
}
public Optional<Expression> getWhere()
{
return where;
}
@Override
public List<? extends Node> getChildren()
{
ImmutableList.Builder<Node> nodes = ImmutableList.builder();
nodes.addAll(assignments);
where.ifPresent(nodes::add);
return nodes.build();
}
@Override
public <R, C> R accept(AstVisitor<R, C> visitor, C context)
{
return visitor.visitUpdate(this, context);
}
@Override
public boolean equals(Object o)
{
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Update update = (Update) o;
return table.equals(update.table) &&
assignments.equals(update.assignments) &&
where.equals(update.where);
}
@Override
public int hashCode()
{
return Objects.hash(table, assignments, where);
}
@Override
public String toString()
{
return toStringHelper(this)
.add("table", table)
.add("assignments", assignments)
.add("where", where.orElse(null))
.omitNullValues()
.toString();
}
}
| [
"david@acz.org"
] | david@acz.org |
16defd92cd1928d815c1231eda54dfc3b2eef443 | 283871055016179ec2f82db537d9a933f6d31f7a | /Session3/src/InheritanceDemo.java | f7c64abcf5a5426a64ab2de4f2f43afe34ea2aeb | [] | no_license | sriharikadali/edureka6jan2018 | ab6130ababfb22034d5dcf7b87e0972d80579bd5 | 8229492ecf4327e438c1ceb5903cf5115e31c2de | refs/heads/master | 2021-09-07T05:28:39.582970 | 2018-02-18T04:24:04 | 2018-02-18T04:24:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | class NewUser{
// Attributes
String name;
int age;
NewUser(){
name = "NA";
age = 10;
System.out.println("NewUser is Created..");
}
void showUser(){
System.out.println(name+" is "+age+" years old !! ");
}
}
// Constructors are not inherited..
// If you inherit Object of Parent is created first and then the object of child is created...
class FBUser extends NewUser{
FBUser(){
System.out.println("FaceBook User Created..");
}
}
public class InheritanceDemo {
public static void main(String[] args) {
//NewUser u1 = new NewUser();
//u1.showUser();
FBUser u1 = new FBUser();
u1.showUser();
}
}
| [
"er.ishant@gmail.com"
] | er.ishant@gmail.com |
ea945ee7ae834091b66c0f6852ef8e5714ca7ab9 | cf5972e8c1e2f78441868de343e8c0a853af37d4 | /JUC1/src/TestCopyOnWriteArrayList.java | adb5e4ecdae712ff9e47932b6e244574b025be59 | [] | no_license | doctning/learnforJUC | a5e36e98453e28f8f996c57f28de8483be99f035 | 61918393a0e7928ecc29ba7f7c8cb8c66099ab35 | refs/heads/master | 2023-03-15T15:58:03.025436 | 2020-07-30T07:59:29 | 2020-07-30T07:59:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 956 | java | import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
/*
* CopyOnWriteArrayList/CopyOnWriteArraySet : “写入并复制”
* 注意:添加操作多时,效率低,因为每次添加时都会进行复制,开销非常的大。并发迭代操作多时可以选择。
*/
public class TestCopyOnWriteArrayList {
public static void main(String[] args) {
HelloThread ht = new HelloThread();
for (int i = 0; i < 10; i++) {
new Thread(ht).start();
}
}
}
class HelloThread implements Runnable{
// private static List<String> list = Collections.synchronizedList(new ArrayList<String>());
private static CopyOnWriteArrayList<String> list = new CopyOnWriteArrayList<>();
static{
list.add("AA");
list.add("BB");
list.add("CC");
}
@Override
public void run() {
Iterator<String> it = list.iterator();
while(it.hasNext()){
System.out.println(it.next());
list.add("AA");
}
}
} | [
"‘396330646@qq.com’"
] | ‘396330646@qq.com’ |
caf25b96d436f0e45a3a52a255d19faa0964dc44 | c37ef54d151f8e70b6d521575f0b3b300b55525c | /support/cas-server-support-gauth-mongo/src/main/java/org/apereo/cas/adaptors/gauth/GoogleAuthenticatorMongoDbTokenRepository.java | bbcea69e0835abd75f29d352287ebebd6a43a50f | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | viswatejan/cas | f29c02f4b4ccfe73800012439f06dfdf9e2bffcc | 671ffd44cd8ebee06c3815502b73cbd56fa46b5b | refs/heads/master | 2020-03-22T18:27:33.912304 | 2018-07-10T19:36:28 | 2018-07-10T19:36:28 | 140,461,569 | 0 | 0 | Apache-2.0 | 2018-07-10T16:42:51 | 2018-07-10T16:42:50 | null | UTF-8 | Java | false | false | 2,059 | java | package org.apereo.cas.adaptors.gauth;
import lombok.RequiredArgsConstructor;
import lombok.val;
import lombok.extern.slf4j.Slf4j;
import org.apereo.cas.adaptors.gauth.token.GoogleAuthenticatorToken;
import org.apereo.cas.authentication.OneTimeToken;
import org.apereo.cas.otp.repository.token.BaseOneTimeTokenRepository;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import javax.persistence.NoResultException;
import java.time.LocalDateTime;
/**
* This is {@link GoogleAuthenticatorMongoDbTokenRepository}.
*
* @author Misagh Moayyed
* @since 5.1.0
*/
@Slf4j
@RequiredArgsConstructor
public class GoogleAuthenticatorMongoDbTokenRepository extends BaseOneTimeTokenRepository {
private final MongoOperations mongoTemplate;
private final String collectionName;
private final long expireTokensInSeconds;
@Override
public void store(final OneTimeToken token) {
this.mongoTemplate.save(token, this.collectionName);
}
@Override
public GoogleAuthenticatorToken get(final String uid, final Integer otp) {
try {
val query = new Query();
query.addCriteria(Criteria.where("userId").is(uid).and("token").is(otp));
val r = this.mongoTemplate.findOne(query, GoogleAuthenticatorToken.class, this.collectionName);
return r;
} catch (final NoResultException e) {
LOGGER.debug("No record could be found for google authenticator id [{}]", uid);
}
return null;
}
@Override
protected void cleanInternal() {
try {
val query = new Query();
query.addCriteria(Criteria.where("issuedDateTime").gte(LocalDateTime.now().minusSeconds(this.expireTokensInSeconds)));
this.mongoTemplate.remove(query, GoogleAuthenticatorToken.class, this.collectionName);
} catch (final Exception e) {
LOGGER.warn(e.getMessage(), e);
}
}
}
| [
"mmoayyed@unicon.net"
] | mmoayyed@unicon.net |
228e0758d9ad88225434c3329f4d6aada3a27034 | 2d77c7a446a8af8e2025a5390bc20d1d2de6218e | /src/main/java/oop/obj/Employee.java | 125c5d41f54634a60e46e57f9d323f931516c5c4 | [] | no_license | Eugene1992/java-essential-04 | cd690cfae719d229cbec6d69a921807cba45fcf2 | f82efeee623bdc5acf2d5c5896fb83cfd472c2c5 | refs/heads/master | 2021-01-20T16:54:38.352724 | 2016-08-12T15:02:28 | 2016-08-12T15:02:28 | 63,860,806 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,261 | java | package oop.obj;
public class Employee implements Cloneable{
private String name;
private int age;
private int salary;
private static String privateField = "XXX";
public Employee(String name, int age, int salary) {
this.name = name;
this.age = age;
this.salary = salary;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Employee employee = (Employee) o;
if (age != employee.age) return false;
if (salary != employee.salary) return false;
if (name != null) {
return name.equals(employee.name);
} else {
return employee.name == null;
}
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + age;
result = 31 * result + salary;
return result;
}
@Override
public String toString() {
return "Employee{ " + name + " - " + age + " - " + salary + " }";
}
public void doSomething(){
}
@Override
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
| [
"deyneko55@gmail.com"
] | deyneko55@gmail.com |
959e2ce43f8ac399704f798df5a037e2dad22299 | 7d70c8868713090bd33aa150949a52004dc63675 | /jOOQ-test/src/org/jooq/test/cubrid/generatedclasses/tables/records/VBookRecord.java | 590ef9fa0708e8d1b43d63a3794d389ce871b9dc | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | Crustpunk/jOOQ | 07ff1d2c4dedf0ad783900416a8e51536fbc053e | ca8e85fe19acebc05b73dd5a4671225de79096f2 | refs/heads/master | 2021-01-20T22:59:36.616694 | 2012-11-27T16:01:17 | 2012-11-27T16:01:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,056 | java | /**
* This class is generated by jOOQ
*/
package org.jooq.test.cubrid.generatedclasses.tables.records;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings("all")
public class VBookRecord extends org.jooq.impl.TableRecordImpl<org.jooq.test.cubrid.generatedclasses.tables.records.VBookRecord> {
private static final long serialVersionUID = 760474427;
/**
* The table column <code>DBA.v_book.id</code>
*/
public void setId(java.lang.Integer value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.ID, value);
}
/**
* The table column <code>DBA.v_book.id</code>
*/
public java.lang.Integer getId() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.ID);
}
/**
* The table column <code>DBA.v_book.author_id</code>
*/
public void setAuthorId(java.lang.Integer value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.AUTHOR_ID, value);
}
/**
* The table column <code>DBA.v_book.author_id</code>
*/
public java.lang.Integer getAuthorId() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.AUTHOR_ID);
}
/**
* The table column <code>DBA.v_book.co_author_id</code>
*/
public void setCoAuthorId(java.lang.Integer value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.CO_AUTHOR_ID, value);
}
/**
* The table column <code>DBA.v_book.co_author_id</code>
*/
public java.lang.Integer getCoAuthorId() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.CO_AUTHOR_ID);
}
/**
* The table column <code>DBA.v_book.details_id</code>
*/
public void setDetailsId(java.lang.Integer value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.DETAILS_ID, value);
}
/**
* The table column <code>DBA.v_book.details_id</code>
*/
public java.lang.Integer getDetailsId() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.DETAILS_ID);
}
/**
* The table column <code>DBA.v_book.title</code>
*/
public void setTitle(java.lang.String value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.TITLE, value);
}
/**
* The table column <code>DBA.v_book.title</code>
*/
public java.lang.String getTitle() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.TITLE);
}
/**
* The table column <code>DBA.v_book.published_in</code>
*/
public void setPublishedIn(java.lang.Integer value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.PUBLISHED_IN, value);
}
/**
* The table column <code>DBA.v_book.published_in</code>
*/
public java.lang.Integer getPublishedIn() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.PUBLISHED_IN);
}
/**
* The table column <code>DBA.v_book.language_id</code>
*/
public void setLanguageId(java.lang.Integer value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.LANGUAGE_ID, value);
}
/**
* The table column <code>DBA.v_book.language_id</code>
*/
public java.lang.Integer getLanguageId() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.LANGUAGE_ID);
}
/**
* The table column <code>DBA.v_book.content_text</code>
*/
public void setContentText(java.lang.String value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.CONTENT_TEXT, value);
}
/**
* The table column <code>DBA.v_book.content_text</code>
*/
public java.lang.String getContentText() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.CONTENT_TEXT);
}
/**
* The table column <code>DBA.v_book.content_pdf</code>
*/
public void setContentPdf(byte[] value) {
setValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.CONTENT_PDF, value);
}
/**
* The table column <code>DBA.v_book.content_pdf</code>
*/
public byte[] getContentPdf() {
return getValue(org.jooq.test.cubrid.generatedclasses.tables.VBook.CONTENT_PDF);
}
/**
* Create a detached VBookRecord
*/
public VBookRecord() {
super(org.jooq.test.cubrid.generatedclasses.tables.VBook.V_BOOK);
}
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
c39df7a30159a12d3692df1207f5194c6c58ab6c | 82494955d4eab0dce3cb0f3a1df0e011d1f6f481 | /vertx-gaia/vertx-up/src/main/java/io/vertx/up/VertxApplication.java | a8c7fca532a13769661c17e80cd97d2d74e12435 | [
"Apache-2.0"
] | permissive | guodawei223/vertx-zero | b3de2fd598b27190439ed33810415c70ad891c23 | 37d5f748e181f78dbb1ea6261c12fd1ede0044a9 | refs/heads/master | 2020-03-24T06:05:36.392657 | 2018-07-26T16:07:17 | 2018-07-26T16:07:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,255 | java | package io.vertx.up;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.tp.etcd.center.EtcdData;
import io.vertx.up.annotations.Up;
import io.vertx.up.boot.DansApplication;
import io.vertx.up.concurrent.Runner;
import io.vertx.up.eon.em.ServerType;
import io.vertx.up.log.Annal;
import io.vertx.up.web.ZeroLauncher;
import io.vertx.up.web.anima.*;
import io.vertx.zero.config.ServerVisitor;
import io.vertx.zero.exception.EtcdNetworkException;
import io.vertx.zero.exception.MicroModeUpException;
import io.vertx.zero.exception.UpClassArgsException;
import io.vertx.zero.exception.UpClassInvalidException;
import io.vertx.zero.micro.config.DynamicVisitor;
import io.vertx.zero.mirror.Anno;
import io.zero.epic.Ut;
import io.zero.epic.fn.Fn;
import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* Vertx Application start information
*/
public class VertxApplication {
private static final Annal LOGGER = Annal.get(VertxApplication.class);
private transient final Class<?> clazz;
private transient ConcurrentMap<String, Annotation> annotationMap = new ConcurrentHashMap<>();
private VertxApplication(final Class<?> clazz) {
// Must not null
Fn.outUp(
null == clazz,
LOGGER,
UpClassArgsException.class, this.getClass());
this.clazz = clazz;
this.annotationMap = Anno.get(clazz);
// Must be invalid
Fn.outUp(
!this.annotationMap.containsKey(Up.class.getName()),
LOGGER,
UpClassInvalidException.class, this.getClass(), clazz.getName());
}
public static void run(final Class<?> clazz, final Object... args) {
Fn.shuntRun(() -> {
// Precheck mode
ensureEtcd(clazz);
// Run vertx application.
if (isGateway()) {
// Api Gateway
DansApplication.run(clazz);
} else {
// Service Node
new VertxApplication(clazz).run(args);
}
}, LOGGER);
}
private static boolean isGateway() {
// Secondary Scanned for Api Gateway
final Set<Integer> apiScanned = new HashSet<>();
Fn.outUp(() -> {
final ServerVisitor<HttpServerOptions> visitor =
Ut.singleton(DynamicVisitor.class);
apiScanned.addAll(visitor.visit(ServerType.API.toString()).keySet());
}, LOGGER);
return !apiScanned.isEmpty();
}
private static void ensureEtcd(final Class<?> clazz) {
if (EtcdData.enabled()) {
try {
EtcdData.create(clazz);
} catch (final EtcdNetworkException ex) {
Fn.outUp(true, LOGGER,
MicroModeUpException.class, clazz, ex.getMessage());
}
}
}
private void run(final Object... args) {
final Launcher<Vertx> launcher = Ut.singleton(ZeroLauncher.class);
launcher.start(vertx -> {
/** 1.Find Agent for deploy **/
Runner.run(() -> {
final Scatter<Vertx> scatter = Ut.singleton(AgentScatter.class);
scatter.connect(vertx);
}, "agent-runner");
/** 2.Find Worker for deploy **/
Runner.run(() -> {
final Scatter<Vertx> scatter = Ut.singleton(WorkerScatter.class);
scatter.connect(vertx);
}, "worker-runner");
/** 3.Initialize Infix **/
Runner.run(() -> {
// Infix
Scatter<Vertx> scatter = Ut.singleton(InfixScatter.class);
scatter.connect(vertx);
// Injection
scatter = Ut.singleton(AffluxScatter.class);
scatter.connect(vertx);
}, "infix-afflux-runner");
/** 4.Rule started **/
Runner.run(() -> {
final Scatter<Vertx> scatter = Ut.singleton(CodexScatter.class);
scatter.connect(vertx);
}, "codex-engine-runner");
});
}
}
| [
"silentbalanceyh@126.com"
] | silentbalanceyh@126.com |
84ef23a965bafea26ab77aaea36a653953742cc5 | 8367ecef15b2d54db132c3fda957bab1f903154c | /datastore-reactor/src/main/java/com/holonplatform/datastore/mongo/reactor/ReactiveMongoDatastore.java | c796d8475546b8a7251fe02a08759b3e64d433a5 | [
"Apache-2.0"
] | permissive | holon-platform/holon-datastore-mongo | fb602103feb2c96426a2cac14d2477d8cde2651c | 14c5fc11d56b6da3ca9704b9c2f6434522909b98 | refs/heads/master | 2022-12-05T09:38:04.465746 | 2020-07-21T09:26:08 | 2020-07-21T09:26:08 | 93,382,719 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,651 | java | /*
* Copyright 2016-2018 Axioma srl.
*
* 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.holonplatform.datastore.mongo.reactor;
import com.holonplatform.datastore.mongo.core.async.BaseAsyncMongoDatastore;
import com.holonplatform.datastore.mongo.reactor.internal.DefaultReactiveMongoDatastore;
import com.holonplatform.datastore.mongo.reactor.tx.ReactiveMongoTransaction;
import com.holonplatform.reactor.datastore.ReactiveDatastore;
import com.holonplatform.reactor.datastore.transaction.ReactiveTransactional;
/**
* MongoDB {@link ReactiveDatastore} implementation, using Project Reactor APIs.
*
* @since 5.2.0
*/
public interface ReactiveMongoDatastore extends BaseAsyncMongoDatastore, ReactiveDatastore, ReactiveTransactional {
/**
* Get a builder to create a {@link ReactiveMongoDatastore} instance.
* @return Datastore builder
*/
static Builder builder() {
return new DefaultReactiveMongoDatastore.DefaultBuilder();
}
/**
* {@link ReactiveDatastore} builder.
*/
public interface Builder
extends BaseAsyncMongoDatastore.Builder<ReactiveMongoDatastore, ReactiveMongoTransaction, Builder> {
}
}
| [
"rr9379@gmail.com"
] | rr9379@gmail.com |
c1229682bfbe42fbbe760a83f4af808c43f26fa7 | f8d31528e4dca2a6340b434bffd5ba6a2cacafcd | /jdk9src/src/main/java/org/omg/PortableInterceptor/ServerIdHelper.java | c9f1a295cb18419199053fa63900b369e15c01f3 | [] | no_license | uptonking/jdksrc | 1871ad9c312845f6873d741db2f13837f046232d | d628a733240986c59d96185acef84283e1b5aff5 | refs/heads/master | 2021-09-15T00:10:18.103059 | 2018-03-03T12:31:24 | 2018-03-03T12:31:24 | 109,384,307 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,578 | java | package org.omg.PortableInterceptor;
/**
* org/omg/PortableInterceptor/ServerIdHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /build/openjdk-9-argm_o/openjdk-9-9~b114/src/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/Interceptors.idl
* Thursday, April 14, 2016 7:54:06 PM UTC
*/
// Should be type string
abstract public class ServerIdHelper
{
private static String _id = "IDL:omg.org/PortableInterceptor/ServerId:1.0";
public static void insert (org.omg.CORBA.Any a, String 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 String 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_string_tc (0);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.PortableInterceptor.ServerIdHelper.id (), "ServerId", __typeCode);
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static String read (org.omg.CORBA.portable.InputStream istream)
{
String value = null;
value = istream.read_string ();
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, String value)
{
ostream.write_string (value);
}
}
| [
"jinyaoo86@gmail.com"
] | jinyaoo86@gmail.com |
2bfe3a0250802bf25a3d5fbbd575c3b8fb756432 | c94f888541c0c430331110818ed7f3d6b27b788a | /deps/java/src/main/java/com/antgroup/antchain/openapi/deps/models/CreateAppVersionRequest.java | e9ee8ccfcf07718747298921580291dd202b84d1 | [
"Apache-2.0",
"MIT"
] | permissive | alipay/antchain-openapi-prod-sdk | 48534eb78878bd708a0c05f2fe280ba9c41d09ad | 5269b1f55f1fc19cf0584dc3ceea821d3f8f8632 | refs/heads/master | 2023-09-03T07:12:04.166131 | 2023-09-01T08:56:15 | 2023-09-01T08:56:15 | 275,521,177 | 9 | 10 | MIT | 2021-03-25T02:35:20 | 2020-06-28T06:22:14 | PHP | UTF-8 | Java | false | false | 4,086 | java | // This file is auto-generated, don't edit it. Thanks.
package com.antgroup.antchain.openapi.deps.models;
import com.aliyun.tea.*;
public class CreateAppVersionRequest extends TeaModel {
// OAuth模式下的授权token
@NameInMap("auth_token")
public String authToken;
@NameInMap("tenant")
public String tenant;
// 目标应用完整名称
@NameInMap("application_name")
@Validation(required = true)
public String applicationName;
// 应用部署包文件16字节md5值,以32位十六进制字符表示,不区分大小写。如果提供,APPMS下载应用部署包完成后,将会以此md5值进行校验,检验不通过则认为下载失败
//
@NameInMap("file_md5")
public String fileMd5;
// 应用部署包文件路径。长度不超过1024个单字节字符
@NameInMap("file_path")
@Validation(required = true, maxLength = 1024)
public String filePath;
// 应用部署包文件大小,单位字节。取值范围[1,524288000],即最大支持500M, 524288000 = 500 x 1024 x 1024
//
@NameInMap("file_size")
@Validation(required = true, maximum = 524288000, minimum = 1)
public Integer fileSize;
// 文件交换源id
@NameInMap("file_source")
@Validation(required = true)
public String fileSource;
// 版本备注。长度不超过100个双字节字符
@NameInMap("version_memo")
@Validation(maxLength = 100)
public String versionMemo;
// 版本号。长度不超过50个单字节字符
@NameInMap("version_no")
@Validation(required = true, maxLength = 50)
public String versionNo;
// 目标工作空间名称
@NameInMap("workspace")
@Validation(required = true)
public String workspace;
public static CreateAppVersionRequest build(java.util.Map<String, ?> map) throws Exception {
CreateAppVersionRequest self = new CreateAppVersionRequest();
return TeaModel.build(map, self);
}
public CreateAppVersionRequest setAuthToken(String authToken) {
this.authToken = authToken;
return this;
}
public String getAuthToken() {
return this.authToken;
}
public CreateAppVersionRequest setTenant(String tenant) {
this.tenant = tenant;
return this;
}
public String getTenant() {
return this.tenant;
}
public CreateAppVersionRequest setApplicationName(String applicationName) {
this.applicationName = applicationName;
return this;
}
public String getApplicationName() {
return this.applicationName;
}
public CreateAppVersionRequest setFileMd5(String fileMd5) {
this.fileMd5 = fileMd5;
return this;
}
public String getFileMd5() {
return this.fileMd5;
}
public CreateAppVersionRequest setFilePath(String filePath) {
this.filePath = filePath;
return this;
}
public String getFilePath() {
return this.filePath;
}
public CreateAppVersionRequest setFileSize(Integer fileSize) {
this.fileSize = fileSize;
return this;
}
public Integer getFileSize() {
return this.fileSize;
}
public CreateAppVersionRequest setFileSource(String fileSource) {
this.fileSource = fileSource;
return this;
}
public String getFileSource() {
return this.fileSource;
}
public CreateAppVersionRequest setVersionMemo(String versionMemo) {
this.versionMemo = versionMemo;
return this;
}
public String getVersionMemo() {
return this.versionMemo;
}
public CreateAppVersionRequest setVersionNo(String versionNo) {
this.versionNo = versionNo;
return this;
}
public String getVersionNo() {
return this.versionNo;
}
public CreateAppVersionRequest setWorkspace(String workspace) {
this.workspace = workspace;
return this;
}
public String getWorkspace() {
return this.workspace;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
49b47657d9c34f1c998c2a3edc1a015cac8dff31 | b6cc26e4338559055b45057eefd2162c67bf1cb8 | /core/runtime/src/main/java/uk/co/objectconnexions/expressiveobjects/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java | 09d9e8bc57b71ce1be6b228a5b5dd54e0c877bd8 | [
"Apache-2.0"
] | permissive | objectconnexions/expressive-objects | 6aa36611138ee33e4dbf855531c85c4b8b7db0e8 | a5ced6694cfb2daf24ba09c94cc4e1864384224c | refs/heads/master | 2023-08-07T18:29:15.670839 | 2019-11-14T07:20:19 | 2019-11-14T07:20:19 | 215,518,136 | 0 | 0 | Apache-2.0 | 2023-07-22T18:56:10 | 2019-10-16T10:12:57 | Java | UTF-8 | Java | false | false | 1,471 | 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 uk.co.objectconnexions.expressiveobjects.core.runtime.system.transaction;
/**
* Convenience adapter providing no-op implementations of {@link #onSuccess()}
* and {@link #onFailure()}.
*/
public abstract class TransactionalClosureWithReturnAbstract<T> implements TransactionalClosureWithReturn<T> {
/**
* No-op implementation; does nothing.
*/
@Override
public void preExecute() {
}
/**
* No-op implementation; does nothing.
*/
@Override
public void onSuccess() {
}
/**
* No-op implementation; does nothing.
*/
@Override
public void onFailure() {
}
}
| [
"rmatthews@objectconnexions.co.uk"
] | rmatthews@objectconnexions.co.uk |
6e070cba94de57089aa939d804f17d08c955a2b0 | a8d19866f2fc047c5efc6f6a1eadc633838f2dcb | /samples/comparison/src/main/java/com/facebook/samples/comparison/adapters/GlideAdapter.java | f8ec1dd10aea0586fbaee3a2a0a39aca81f8cd8c | [
"BSD-3-Clause"
] | permissive | gavanx/l-fres | e3464f961cab7492f9fb455166376f217b73cdcb | b2de0f052f6074069bded3080bcce0b2a68bf11e | refs/heads/master | 2021-01-17T17:19:35.253905 | 2016-06-17T07:22:17 | 2016-06-17T07:22:17 | 61,353,580 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,573 | java | /*
* This file provided by Facebook is for non-commercial testing and evaluation
* purposes only. Facebook reserves all rights not expressly granted.
*
* 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
* FACEBOOK 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.facebook.samples.comparison.adapters;
import com.bumptech.glide.Glide;
import com.facebook.samples.comparison.holders.GlideHolder;
import com.facebook.samples.comparison.instrumentation.InstrumentedImageView;
import com.facebook.samples.comparison.instrumentation.PerfListener;
import android.content.Context;
import android.view.ViewGroup;
/**
* RecyclerView Adapter for Glide
*/
public class GlideAdapter extends ImageListAdapter {
public GlideAdapter(Context context, PerfListener perfListener) {
super(context, perfListener);
}
@Override
public GlideHolder onCreateViewHolder(ViewGroup parent, int viewType) {
final InstrumentedImageView instrumentedImageView = new InstrumentedImageView(getContext());
return new GlideHolder(getContext(), parent, instrumentedImageView, getPerfListener());
}
@Override
public void shutDown() {
Glide.get(getContext()).clearMemory();
}
}
| [
"gavan@leoedu.cn"
] | gavan@leoedu.cn |
bcb46c98aef173ec71b78b9205da81fa33254aa5 | 49e97bd66338d86d634099c78044e7647eb71c93 | /src/main/java/com/example/entity/Response.java | eb402d1f391a4048651726227360746422e9fe8e | [] | no_license | langrenbule/InvocationRestfulService | 0506a62bbcb88c6c56dc2b7c328cf959dbfa9f0c | 640b0ea1b3d0f4ff73a7101c308d2afad9aa1129 | refs/heads/master | 2020-12-25T14:59:16.695882 | 2016-08-18T15:22:38 | 2016-08-18T15:22:38 | 66,008,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,527 | java | package com.example.entity;
/**
* Project: Invocation
* Author: Sendya <18x@loacg.com>
* Time: 8/18/2016 11:09 AM
*/
public class Response {
private static final long serialVersionUID = -8670328647557340122L;
private int status = 200;
private Object data; // 返回数据
private String message; // 消息内容
public static Response build() {
return new Response();
}
public Response() {
this.message = "Request failed";
this.status = 200;
}
public Response(String message, int status) {
if (message != null)
this.message = message;
this.status = status;
}
public int getStatus() {
return status;
}
public Response setStatus(int status) {
this.status = status;
return this;
}
public Response setStatus(String message, int status) {
this.message = message;
this.status = status;
return this;
}
public String getMessage() {
return message;
}
public Response setMessage(String message) {
this.message = message;
return this;
}
public Object getData() {
return data;
}
public Response setData(Object data) {
this.data = data;
return this;
}
@Override
public String toString() {
return "Data{" +
"status=" + status +
", data=" + data +
", message='" + message + '\'' +
'}';
}
}
| [
"546024423@qq.com"
] | 546024423@qq.com |
2815c2b9ea92309b95a52440cb76ab5f77762586 | 83527bc3bbda00fb9a2ebc2793ef669c0f4c8fd4 | /src/main/java/com/github/vimcmd/javaFundamentals/p02_classesAndLibrariesUsage/ch10_collections/sub01_list/ItemEnumFull.java | 64464dfdef0f0662890afe76035aef7aed207efa | [] | no_license | vimcmd/JavaFundamentals | d5dd7c3e108fc57c5bb1a1fd3ac3f254a0181e3d | 52fa30ee914a039a2129cfaf9a082d0868c5f06c | refs/heads/master | 2020-04-16T10:57:27.931920 | 2016-08-26T08:54:12 | 2016-08-26T08:54:12 | 53,472,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 508 | java | package com.github.vimcmd.javaFundamentals.p02_classesAndLibrariesUsage.ch10_collections.sub01_list;
/* # 10 # enum, which provides ability to sort ASC/DESC for all class fields */
public enum ItemEnumFull {
ITEM_ID(true), PRICE(false), NAME(true);
private boolean ascend;
private ItemEnumFull(boolean ascend) {
this.ascend = ascend;
}
public boolean isAscend() {
return ascend;
}
public void setAscend(boolean ascend) {
this.ascend = ascend;
}
}
| [
"vim.cmd@gmail.com"
] | vim.cmd@gmail.com |
a58ff010ef6c91060b57ddab5961634b28a439dd | 05b3e5ad846c91bbfde097c32d5024dced19aa1d | /JavaProgramming/src/ch06/exam08/Calculator.java | ad94fc093435e2772aa1e59d52a8439ac9db5777 | [] | no_license | yjs0511/MyRepository | 4c2b256cb8ac34869cce8dfe2b1d2ab163b0e5ec | 63bbf1f607f9d91374649bb7cacdf532b52e613b | refs/heads/master | 2020-04-12T03:05:29.993060 | 2016-11-17T04:34:51 | 2016-11-17T04:34:51 | 65,808,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 374 | java | package ch06.exam08;
public class Calculator {
//메소드
void powerOn(){
System.out.println("전원을 켭니다.");
}
int plus(int x, int y){
int result = x + y;
return result;
}
double divide(int x, int y){
double result = (double) x/ y;
return result;
}
void powerOff(){
System.out.println("전원을 끕니다.");
}
}
| [
"hypermega22@gmail.com"
] | hypermega22@gmail.com |
ba098e3fde1848d5f7e440a63de8bf4163c297f8 | b61588087cc459979611982abbcae3f01449818c | /app/src/main/java/com/ruslanlyalko/agency/presentation/ui/dashboard/DashboardView.java | e54f8015fd168aa93fd8c95a175d722728ddd0dc | [] | no_license | DevRL1/Agency | d4075da7f1135b64e95541eb84d296d112b9e584 | e818b1ffa7aaee843f2c39479ef1f22e8a45dcea | refs/heads/master | 2021-05-07T20:57:22.312529 | 2017-10-31T13:53:20 | 2017-10-31T13:53:20 | 108,979,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package com.ruslanlyalko.agency.presentation.ui.dashboard;
import com.ruslanlyalko.agency.presentation.base.view.BaseView;
/**
* Created by Ruslan Lyalko
* on 23.10.2017.
*/
public interface DashboardView extends BaseView<DashboardPresenter> {
}
| [
"ruslan.lyalko2@gmail.com"
] | ruslan.lyalko2@gmail.com |
3604d77b2db7c812d7d53a527b9a7ff8ddd12cf1 | b7367c314e3a91f150db64a272906e83651d89e4 | /src/main/resources/archetype-resources/webapp/src/main/java/webapp/action/subproject/AptypesJsonAction.java | 4aa9b43d782307f416093b22e0edd76cb9752d13 | [] | no_license | lichao20000/dayatang-multi-module-archetype | 93c14930b2a6ff7f7105176d9db87f4d89f17220 | a7491e848014f3aee0ae2910a36c55363f5ce1be | refs/heads/master | 2021-12-05T15:59:53.354819 | 2015-07-21T04:59:42 | 2015-07-21T04:59:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.webapp.action.subproject;
import ${package}.domain.Dictionary;
import ${package}.domain.DictionaryCategory;
import ${package}.webapp.action.BaseAction;
import java.util.List;
/**
* 得到所有接入类型的json数据
* User: zjzhai
* Date: 13-4-24
* Time: 下午5:21
*/
public class AptypesJsonAction extends BaseAction {
/**
*
*/
private static final long serialVersionUID = 2048247311593102586L;
private List<Dictionary> results;
@Override
public String execute() throws Exception {
results = Dictionary.findByCategory(DictionaryCategory.AP_TYPE);
return JSON;
}
public List<Dictionary> getResults() {
return results;
}
}
| [
"gdyangyu@gmail.com"
] | gdyangyu@gmail.com |
f1caf015d0883789f2d185eaa191766c6a58e9e0 | 5e518e80a8be4bc6ce2d9b7067500ff71707864f | /java/spring/cors/src/test/java/com/github/signed/spring/cors/DemoApplicationTests.java | b5930df63691c4e93ef4a0d342e50b01c6c2a38e | [] | no_license | signed/sandboxes | 7a510b4ee421f0eb9478dac2e0f952ab6dd4ce41 | a662ff7e5483b75ac52a1c356effe9bedf83b4f7 | refs/heads/master | 2023-08-17T04:06:51.490936 | 2023-08-15T19:42:55 | 2023-08-15T19:42:55 | 4,309,543 | 1 | 0 | null | 2014-06-01T10:01:47 | 2012-05-12T20:34:47 | Java | UTF-8 | Java | false | false | 344 | java | package com.github.signed.spring.cors;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class DemoApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"thomas.heilbronner@gmail.com"
] | thomas.heilbronner@gmail.com |
b84e9e4ae33fa7ff30a2840e22b6488d0dd2d127 | c474b03758be154e43758220e47b3403eb7fc1fc | /apk/decompiled/com.tinder_2018-07-26_source_from_JADX/sources/com/tinder/model/GalleryItem.java | 93839c5d60b5cfbf70048de09c8a11c13a5b7eb1 | [] | no_license | EstebanDalelR/tinderAnalysis | f80fe1f43b3b9dba283b5db1781189a0dd592c24 | 941e2c634c40e5dbf5585c6876ef33f2a578b65c | refs/heads/master | 2020-04-04T09:03:32.659099 | 2018-11-23T20:41:28 | 2018-11-23T20:41:28 | 155,805,042 | 0 | 0 | null | 2018-11-18T16:02:45 | 2018-11-02T02:44:34 | null | UTF-8 | Java | false | false | 244 | java | package com.tinder.model;
public class GalleryItem {
public int count;
public String filePath;
public String name;
public Source source;
public String url;
public enum Source {
Device,
Facebook
}
}
| [
"jdguzmans@hotmail.com"
] | jdguzmans@hotmail.com |
769e8e4641fe25be3a807984c6312b3ee2e1c8d9 | c4b56742efe25b0fb6ab64b4445351adc0493ffd | /casta-searchengine/casta-searchengine/org/castafiore/shoppingmall/orders/EXFilterOptions.java | 1d78435bb6c232dcb005c212f9dd758a57a492d8 | [] | no_license | nuving/castafioreframework | 459332ad67554617445b3476471c89803ce5b0ab | 775a4c535d7910a7335aa8cddebcd1b7c95c5e13 | refs/heads/master | 2021-01-15T19:22:25.042926 | 2013-09-08T16:43:36 | 2013-09-08T16:43:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package org.castafiore.shoppingmall.orders;
import org.castafiore.ui.ex.EXContainer;
public class EXFilterOptions extends EXContainer{
public EXFilterOptions(String name) {
super(name, "div");
}
}
| [
"kureem@gmail.com"
] | kureem@gmail.com |
447eee0bd24e6ae863085e579e8b670cd293381b | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MATH-38b-6-4-FEMO-WeightedSum:TestLen:CallDiversity/org/apache/commons/math/optimization/direct/BaseAbstractMultivariateSimpleBoundsOptimizer_ESTest_scaffolding.java | 217e01c5ac83ebafee930a965bea892cd9125f64 | [] | 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 | 6,528 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Jan 20 14:02:17 UTC 2020
*/
package org.apache.commons.math.optimization.direct;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class BaseAbstractMultivariateSimpleBoundsOptimizer_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math.optimization.direct.BaseAbstractMultivariateSimpleBoundsOptimizer";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(BaseAbstractMultivariateSimpleBoundsOptimizer_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.math.exception.MathIllegalStateException",
"org.apache.commons.math.linear.BlockFieldMatrix",
"org.apache.commons.math.exception.NumberIsTooSmallException",
"org.apache.commons.math.util.Incrementor",
"org.apache.commons.math.exception.NullArgumentException",
"org.apache.commons.math.exception.util.ExceptionContext",
"org.apache.commons.math.util.Incrementor$MaxCountExceededCallback",
"org.apache.commons.math.optimization.SimpleScalarValueChecker",
"org.apache.commons.math.optimization.AbstractConvergenceChecker",
"org.apache.commons.math.linear.MatrixUtils",
"org.apache.commons.math.exception.NotStrictlyPositiveException",
"org.apache.commons.math.linear.RealMatrix",
"org.apache.commons.math.optimization.direct.BOBYQAOptimizer$PathIsExploredException",
"org.apache.commons.math.linear.MatrixDimensionMismatchException",
"org.apache.commons.math.linear.RealLinearOperator",
"org.apache.commons.math.exception.MathIllegalArgumentException",
"org.apache.commons.math.util.CompositeFormat",
"org.apache.commons.math.linear.AbstractFieldMatrix",
"org.apache.commons.math.exception.MultiDimensionMismatchException",
"org.apache.commons.math.exception.MathParseException",
"org.apache.commons.math.optimization.direct.BaseAbstractMultivariateOptimizer",
"org.apache.commons.math.exception.DimensionMismatchException",
"org.apache.commons.math.exception.MathIllegalNumberException",
"org.apache.commons.math.linear.ArrayRealVector",
"org.apache.commons.math.optimization.MultivariateOptimizer",
"org.apache.commons.math.analysis.MultivariateFunction",
"org.apache.commons.math.analysis.BivariateRealFunction",
"org.apache.commons.math.linear.RealVectorFormat",
"org.apache.commons.math.optimization.ConvergenceChecker",
"org.apache.commons.math.analysis.UnivariateFunction",
"org.apache.commons.math.exception.OutOfRangeException",
"org.apache.commons.math.linear.AnyMatrix",
"org.apache.commons.math.exception.NumberIsTooLargeException",
"org.apache.commons.math.exception.NoDataException",
"org.apache.commons.math.linear.RealVector$2",
"org.apache.commons.math.exception.ZeroException",
"org.apache.commons.math.exception.TooManyEvaluationsException",
"org.apache.commons.math.linear.Array2DRowRealMatrix",
"org.apache.commons.math.linear.RealMatrixPreservingVisitor",
"org.apache.commons.math.analysis.SincFunction",
"org.apache.commons.math.optimization.BaseMultivariateOptimizer",
"org.apache.commons.math.optimization.BaseOptimizer",
"org.apache.commons.math.linear.SparseRealMatrix",
"org.apache.commons.math.analysis.SumSincFunction",
"org.apache.commons.math.linear.FieldMatrixPreservingVisitor",
"org.apache.commons.math.exception.util.Localizable",
"org.apache.commons.math.analysis.DifferentiableUnivariateFunction",
"org.apache.commons.math.linear.NonSquareMatrixException",
"org.apache.commons.math.linear.AbstractRealMatrix",
"org.apache.commons.math.util.Incrementor$1",
"org.apache.commons.math.optimization.RealPointValuePair",
"org.apache.commons.math.exception.MaxCountExceededException",
"org.apache.commons.math.linear.FieldVector",
"org.apache.commons.math.exception.MathArithmeticException",
"org.apache.commons.math.analysis.DifferentiableMultivariateFunction",
"org.apache.commons.math.analysis.MultivariateVectorFunction",
"org.apache.commons.math.linear.Array2DRowFieldMatrix",
"org.apache.commons.math.linear.BlockRealMatrix",
"org.apache.commons.math.optimization.BaseMultivariateSimpleBoundsOptimizer",
"org.apache.commons.math.analysis.SincFunction$1",
"org.apache.commons.math.exception.util.LocalizedFormats",
"org.apache.commons.math.linear.RealVector",
"org.apache.commons.math.optimization.direct.BaseAbstractMultivariateSimpleBoundsOptimizer",
"org.apache.commons.math.linear.RealMatrixChangingVisitor",
"org.apache.commons.math.linear.FieldMatrix",
"org.apache.commons.math.optimization.direct.BOBYQAOptimizer",
"org.apache.commons.math.exception.util.ExceptionContextProvider",
"org.apache.commons.math.linear.OpenMapRealMatrix",
"org.apache.commons.math.optimization.GoalType",
"org.apache.commons.math.exception.util.ArgUtils"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
b5cc7ba5d261089593013d26bcf29ad75963854e | 988c9b6eeb4589e3fd412f34a4bf92a16704b5d6 | /completed/uva/uva11753.java | 3cb3a83b441c9821d6d305420f19ad4fb8a77d67 | [] | no_license | greenstripes4/USACO | 3bf08c97767e457ace8f24c61117271028802693 | 24cd71c6d1cd168d76b27c2d6edd0c6abeeb7a83 | refs/heads/master | 2023-02-07T17:54:26.563040 | 2023-02-06T03:29:17 | 2023-02-06T03:29:17 | 192,225,457 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,219 | java | import java.io.*;
import java.util.*;
import java.io.*;
import java.util.*;
public class Main{
private static int K;
private static int solve(int[] sequence, int pointer1, int pointer2, int move) {
if(move>K) return Integer.MAX_VALUE;
if(pointer1 >= pointer2) {
return move;
}
if(sequence[pointer1] == sequence[pointer2]) {
return solve(sequence, pointer1+1, pointer2-1, move);
} else {
int D1 = solve(sequence, pointer1 + 1, pointer2, move+1);
int D2 = solve(sequence, pointer1, pointer2 - 1, move+1);
return Math.min(D1,D2);
}
}
public static void main(String[] args) throws IOException{
//Scanner f = new Scanner(new File("uva.in"));
//Scanner f = new Scanner(System.in);
//BufferedReader f = new BufferedReader(new FileReader("uva.in"));
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
int T = Integer.parseInt(f.readLine());
for(int t = 1; t <= T; t++) {
StringTokenizer st = new StringTokenizer(f.readLine());
int N = Integer.parseInt(st.nextToken());
K = Integer.parseInt(st.nextToken());
st = new StringTokenizer(f.readLine());
int[] sequence = new int[N];
for(int i = 0; i < N; i++) {
sequence[i] = Integer.parseInt(st.nextToken());
}
int D = solve(sequence, 0, N-1, 0);
out.print("Case " + t + ": ");
if(D == 0) {
out.println("Too easy");
} else if(D > K) {
out.println("Too difficult");
} else {
out.println(D);
}
}
f.close();
out.close();
}
}
/*
public class Main{
private static int[][] memo;
private static int solve(int[] sequence, int pointer1, int pointer2, int K) {
if(pointer1 >= pointer2) {
return 0;
}
if(memo[pointer1][pointer2] <=20) {
return memo[pointer1][pointer2];
}
if(sequence[pointer1] == sequence[pointer2]) {
int D = solve(sequence, pointer1+1, pointer2-1, K);
memo[pointer1][pointer2] = D;
} else {
if(K>0) {
int D1 = solve(sequence, pointer1 + 1, pointer2, K - 1);
int D2 = solve(sequence, pointer1, pointer2 - 1, K - 1);
memo[pointer1][pointer2] = Math.min(D1, D2) + 1;
}
}
return memo[pointer1][pointer2];
}
public static void main(String[] args) throws IOException{
//Scanner f = new Scanner(new File("uva.in"));
//Scanner f = new Scanner(System.in);
BufferedReader f = new BufferedReader(new FileReader("uva.in"));
//BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
long start = System.nanoTime();
int T = Integer.parseInt(f.readLine());
for(int t = 1; t <= T; t++) {
StringTokenizer st = new StringTokenizer(f.readLine());
int N = Integer.parseInt(st.nextToken());
int K = Integer.parseInt(st.nextToken());
st = new StringTokenizer(f.readLine());
int[] sequence = new int[N];
for(int i = 0; i < N; i++) {
sequence[i] = Integer.parseInt(st.nextToken());
}
memo = new int[N][N];
for(int i = 0; i < N; i++) {
Arrays.fill(memo[i], 100);
}
int D = solve(sequence, 0, N-1, K);
out.print("Case " + t + ": ");
if(D == 0) {
out.println("Too easy");
} else if(D > K) {
out.println("Too difficult");
} else {
out.println(D);
}
}
long end = System.nanoTime();
long ms = ((end - start) / 1000000);
out.println(ms);
f.close();
out.close();
}
}
*/ | [
"strongheart404@gmail.com"
] | strongheart404@gmail.com |
ec14225f5a1395209fcfc5bf0c01f5bb7a764c2d | 0a532b9d7ebc356ab684a094b3cf840b6b6a17cd | /design-patterns/src/main/java/com/factory/abstractFactory/FactoryB.java | 378916e558039a43a4931c191ae230104bdc6c15 | [
"Apache-2.0"
] | permissive | XWxiaowei/JavaCode | ac70d87cdb0dfc6b7468acf46c84565f9d198e74 | a7e7cd7a49c36db3ee479216728dd500eab9ebb2 | refs/heads/master | 2022-12-24T10:21:28.144227 | 2020-08-22T08:01:43 | 2020-08-22T08:01:43 | 98,070,624 | 10 | 4 | Apache-2.0 | 2022-12-16T04:23:38 | 2017-07-23T02:51:51 | Java | UTF-8 | Java | false | false | 294 | java | package com.factory.abstractFactory;
/**
* @author xiang.wei
* @create 2018/4/8 11:03
*/
public class FactoryB implements Factory {
public ProductA createProductA() {
return new ProductA2();
}
public ProductB createProductB() {
return new ProductB2();
}
}
| [
"2809641033@qq.com"
] | 2809641033@qq.com |
7aab580441a5186e729a95f823ccf1fd276941c6 | eda33f47b09f29f30cfafbd4392717922f867026 | /Back-End/VeterinarioApi/src/dialogflow/telegram/Animation.java | c25452b3ec39888088156ce4efec646d9de07481 | [
"MIT"
] | permissive | SaraPerezSoler/VetClinic | 19cf14b32b5d02c438c6a780c4494727a0e53ccd | 58b512b63683346624917ca180373cdc1bc4707a | refs/heads/master | 2023-04-28T23:55:46.651615 | 2020-06-24T09:07:17 | 2020-06-24T09:07:17 | 271,035,216 | 1 | 0 | MIT | 2023-04-14T17:17:40 | 2020-06-09T15:07:57 | Java | UTF-8 | Java | false | false | 966 | java | package dialogflow.telegram;
public class Animation extends File implements Dimension, Duration, Mime, Thumb {
private PhotoSize thumb;
private String mime_type;
private int duration;
private int width;
private int height;
public Animation() {
}
@Override
public PhotoSize getThumb() {
return thumb;
}
@Override
public void setThumb(PhotoSize thumb) {
this.thumb = thumb;
}
@Override
public String getMime_type() {
return mime_type;
}
@Override
public void setMime_type(String mime_type) {
this.mime_type = mime_type;
}
@Override
public int getDuration() {
return duration;
}
@Override
public void setDuration(int duration) {
this.duration = duration;
}
@Override
public int getWidth() {
return width;
}
@Override
public void setWidth(int width) {
this.width = width;
}
@Override
public int getHeight() {
return height;
}
@Override
public void setHeight(int height) {
this.height = height;
}
}
| [
"saraperezsoler@gmail.com"
] | saraperezsoler@gmail.com |
85f23c8deaec966889ae2bbb05e2f27c8e75b8e6 | 65befe28d69189681a2c79c77d9fcbdceab3dc27 | /Algorithms/SWTest/src/swExpert/Sudoku.java | ac1169fa380a8746601ebf864d114bea834365fc | [] | no_license | solwish/TIL | 554a67f79c66ed5d5a5075f08b6f0369aa363249 | 4314767fa763de73238aa141e105a5cf3641a9fc | refs/heads/master | 2023-01-08T01:11:34.677452 | 2021-01-07T13:43:56 | 2021-01-07T13:43:56 | 101,876,124 | 10 | 0 | null | 2023-01-03T14:41:06 | 2017-08-30T12:03:25 | CSS | UTF-8 | Java | false | false | 1,158 | java | package swExpert;
import java.util.Scanner;
public class Sudoku {
static int sw;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
int cnt;
int num;
for (int test_case = 0; test_case < T; test_case++) {
sw = 1;
int[][] A = new int[9][9];
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
num = sc.nextInt();
A[i][j] = num;
}
}
for (int i = 0; i < 9; i++) {
if (sw == 0)
break;
for (int j = 0; j < 9; j++) {
cnt = 0;
for (int k = 0; k < 9; k++) {
if (A[i][j] == A[i][k] || A[i][j] == A[k][j]) {
cnt = cnt + 1;
}
}
if (cnt > 2) {
sw = 0;
break;
}
}
}
if (sw == 1) {
for (int i = 0; i < 9; i = i + 3) {
if (sw == 0)
break;
for (int j = 0; j < 9; j = j + 3) {
int[] count = new int[10];
for (int x = i; x < i + 3; x++) {
for (int y = j; y < j + 3; y++) {
count[A[x][y]]++;
if (count[A[x][y]] > 1)
sw = 0;
}
}
}
}
}
System.out.println("#" + (test_case + 1) + " " + sw);
}
}
}
| [
"solwish90@gmail.com"
] | solwish90@gmail.com |
abf3f3060b57ce02bf87b4b537fb14ebe0eba679 | bceba483c2d1831f0262931b7fc72d5c75954e18 | /src/qubed/corelogic/MESSAGEEXTENSION.java | 4069cfcceed64942534ca7f301ffd97464bb0452 | [] | 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,433 | 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:46:29 AM CAT
//
package qubed.corelogic;
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 MESSAGE_EXTENSION complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MESSAGE_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 = "MESSAGE_EXTENSION", propOrder = {
"mismo",
"other"
})
public class MESSAGEEXTENSION {
@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 |
ea61b825288843a1d18ad09894dccc1164f5e8a3 | c47cc7963d51b1dcb3e9c64af47c451586b7453d | /zutils/src/main/java/top/toly/zutils/core/ui/common/VUtils.java | 70b8e18b82a5823a4e2735122b40d8fcf8afea20 | [] | no_license | toly1994328/FivePoint | 5397f8c7f1b45656b659614eacf5137a12cf6ba6 | 9d2c4dabee6b20defb274a4b148a179400bd7bcc | refs/heads/master | 2021-09-26T23:23:51.102842 | 2018-11-04T12:44:44 | 2018-11-04T12:44:44 | 155,958,218 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 676 | java | package top.toly.zutils.core.ui.common;
import android.view.View;
/**
* 作者:张风捷特烈<br/>
* 时间:2018/10/23 0023:8:40<br/>
* 邮箱:1981462002@qq.com<br/>
* 说明:视图工具类
*/
public class VUtils {
/**
* 显示若干视图
*
* @param views 视图
*/
public static void showView(View... views) {
for (View view : views) {
view.setVisibility(View.VISIBLE);
}
}
/**
* 隐藏若干视图
*
* @param views 视图
*/
public static void hideView(View... views) {
for (View view : views) {
view.setVisibility(View.GONE);
}
}
}
| [
"1981462002@qq.com"
] | 1981462002@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.