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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4e200513a9c0fa6811a4301cb7ad381ea922cbe8
|
53a26e090cb3695a924e68a03c821ec140750b51
|
/src/test/java/biweekly/io/scribe/property/CannotParseScribe.java
|
beef69dc581a7c9c5a0c712c70734c6c47b04273
|
[
"BSD-2-Clause",
"BSD-2-Clause-Views"
] |
permissive
|
dinomite/biweekly
|
dfbacf7f17b0560fc13a732579904b086ee11500
|
fe09433fed146e45aa7d569dde5d39a855f8f81e
|
refs/heads/master
| 2022-12-16T08:05:27.484839
| 2020-06-03T18:12:11
| 2020-06-03T18:12:11
| 297,668,664
| 0
| 0
|
BSD-2-Clause
| 2020-09-22T14:07:25
| 2020-09-22T14:07:24
| null |
UTF-8
|
Java
| false
| false
| 2,804
|
java
|
package biweekly.io.scribe.property;
import biweekly.ICalDataType;
import biweekly.io.CannotParseException;
import biweekly.io.ParseContext;
import biweekly.io.WriteContext;
import biweekly.io.json.JCalValue;
import biweekly.io.xml.XCalElement;
import biweekly.parameter.ICalParameters;
import biweekly.property.CannotParseProperty;
/*
Copyright (c) 2013-2018, Michael Angstadt
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.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/
/**
* A scribe that always throws a {@link CannotParseException}.
* @author Michael Angstadt
*/
public class CannotParseScribe extends ICalPropertyScribe<CannotParseProperty> {
public CannotParseScribe() {
super(CannotParseProperty.class, "CANNOTPARSE", null);
}
@Override
protected String _writeText(CannotParseProperty property, WriteContext context) {
return "value";
}
@Override
protected CannotParseProperty _parseText(String value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
throw new CannotParseException("");
}
@Override
protected CannotParseProperty _parseXml(XCalElement element, ICalParameters parameters, ParseContext context) {
throw new CannotParseException("");
}
@Override
protected CannotParseProperty _parseJson(JCalValue value, ICalDataType dataType, ICalParameters parameters, ParseContext context) {
throw new CannotParseException("");
}
}
|
[
"mike.angstadt@gmail.com"
] |
mike.angstadt@gmail.com
|
8d07d0d3a908c0c4c72a3f86503f0b8c53f712e0
|
fcfcfccc2db5cc08c2e634c0bdd055fe1fd2699c
|
/entity/pyx-entity-server/src/main/java/com/pyx4j/entity/server/query/QueryBinderBuilder.java
|
aa891bd7cfcaf4c5d02f25b42d7e6028920590f5
|
[] |
no_license
|
michaellif/pyx4j
|
45ae006e8785e5a245a619ad9b43d5c9946a86d4
|
cc8699d5d70ba618ec812b963e338d4bbe39df20
|
refs/heads/master
| 2020-03-26T06:10:36.655951
| 2016-04-29T05:25:25
| 2016-04-29T05:25:25
| 144,593,106
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,744
|
java
|
/*
* Pyx4j framework
* Copyright (C) 2008-2015 pyx4j.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.
*
* Created on Apr 21, 2015
* @author vlads
*/
package com.pyx4j.entity.server.query;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.pyx4j.entity.core.EntityFactory;
import com.pyx4j.entity.core.IEntity;
import com.pyx4j.entity.core.IPrimitive;
import com.pyx4j.entity.core.Path;
import com.pyx4j.entity.core.query.IEntityCondition;
import com.pyx4j.entity.core.query.IQuery;
import com.pyx4j.entity.core.query.QueryBinder;
public class QueryBinderBuilder<E extends IEntity, C extends IQuery<E>> {
protected final Class<C> criteriaClass;
protected final C criteriaProto;
protected final E proto;
private final Map<Path, Path> pathBinding = new HashMap<>();
@SuppressWarnings("unchecked")
public QueryBinderBuilder(Class<C> criteriaClass) {
this.criteriaClass = criteriaClass;
criteriaProto = EntityFactory.getEntityPrototype(criteriaClass);
proto = EntityFactory.getEntityPrototype((Class<E>) criteriaProto.proto().getValueClass());
}
public final C criteriaProto() {
return criteriaProto;
}
public final E proto() {
return proto;
}
public final <TYPE extends Serializable, TC extends IEntity> void map(IPrimitive<TYPE> boMember, TC criteriaMember) {
assert criteriaMember.getPath().getRootEntityClass() == criteriaClass;
assert boMember.getPath().getRootEntityClass() == proto().getValueClass() : "BO member expected; got path from " + boMember.getPath();
pathBinding.put(criteriaMember.getPath(), boMember.getPath());
}
public final <T extends IEntity, EC extends IEntityCondition<T>> void map(T boMember, EC criteriaMember) {
assert criteriaMember.getPath().getRootEntityClass() == criteriaClass;
assert boMember.getPath().getRootEntityClass() == proto().getValueClass() : "BO member expected; got path from " + boMember.getPath();
pathBinding.put(criteriaMember.getPath(), boMember.getPath());
}
public QueryBinder<E, C> build() {
return new DefaultQueryCriteriaBinder<>(criteriaClass, pathBinding);
}
}
|
[
"vlads@propertyvista.com"
] |
vlads@propertyvista.com
|
25efc264f72af4c29c0e005eb9525ac7ec214d67
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/ant_cluster/5238/src_0.java
|
1b87b9c0d13a7080410ea47dd2cc020b71702803
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,745
|
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.tools.ant.filters.util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import com.sun.org.apache.bcel.internal.classfile.ClassParser;
import com.sun.org.apache.bcel.internal.classfile.ConstantValue;
import com.sun.org.apache.bcel.internal.classfile.JavaClass;
// CheckStyle:HideUtilityClassConstructorCheck OFF - bc
/**
* Helper class that filters constants from a Java Class
*
*/
public final class JavaClassHelper {
/** System specific line separator. */
private static final String LS = System.getProperty("line.separator");
/**
* Get the constants declared in a file as name=value
*
* @param bytes the class as a array of bytes
* @return a StringBuffer contains the name=value pairs
* @exception IOException if an error occurs
*/
public static StringBuffer getConstants(byte[] bytes)
throws IOException {
final StringBuffer sb = new StringBuffer();
final ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
final ClassParser parser = new ClassParser(bis, "");
final JavaClass javaClass = parser.parse();
final Field[] fields = javaClass.getFields();
for (int i = 0; i < fields.length; i++) {
final Field field = fields[i];
if (field != null) {
final ConstantValue cv = field.getConstantValue();
if (cv != null) {
String cvs = cv.toString();
//Remove start and end quotes if field is a String
if (cvs.startsWith("\"") && cvs.endsWith("\"")) {
cvs = cvs.substring(1, cvs.length() - 1);
}
sb.append(field.getName());
sb.append('=');
sb.append(cvs);
sb.append(LS);
}
}
}
return sb;
}
}
|
[
"375833274@qq.com"
] |
375833274@qq.com
|
8aba14f3e6caa25a5ac19548c2b0791b5727d4e3
|
bddb35c6f69712cbacfc5a6700c36e125ebcdba1
|
/src/main/java/threadpools/thread/IntervalPrint2.java
|
bd2deb6a10577b13004a191d044b5f6eb482a3f4
|
[] |
no_license
|
wushaohao/DailyDetails
|
97624dee0d731b47e1db2e7192e9f1eb2544b8c1
|
14abf1572351e282dad659f6e09f9c601aafc5e4
|
refs/heads/master
| 2022-10-30T15:47:27.950088
| 2022-10-08T06:38:15
| 2022-10-08T06:38:15
| 119,624,059
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,128
|
java
|
package threadpools.thread;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
/**
* @author:wuhao
* @description:3个间隔打印(ReentrantLock实现交通灯信号)
* @date:18/9/1
*/
public class IntervalPrint2 implements Runnable {
/**
* 线程编号,Thread Number
*/
private int tNum = 1;
private ReentrantLock lock = new ReentrantLock();
private Condition redCon = lock.newCondition();
private Condition greenCon = lock.newCondition();
private Condition yellowCon = lock.newCondition();
public static void main(String[] args) {
new Thread(new IntervalPrint2()).start();
}
/**
* When an object implementing interface <code>Runnable</code> is used
* to create a thread, starting the thread causes the object's
* <code>run</code> method to be called in that separately executing
* thread.
* <p>
* The general contract of the method <code>run</code> is that it may
* take any action whatsoever.
*
* @see Thread#run()
*/
@Override
public void run() {
new Thread(new RedLight(), "red light").start();
new Thread(new GreenLight(), "green light").start();
new Thread(new YellowLight(), "yellow light").start();
}
class RedLight implements Runnable {
/**
* When an object implementing interface <code>Runnable</code> is used
* to create a thread, starting the thread causes the object's
* <code>run</code> method to be called in that separately executing
* thread.
* <p>
* The general contract of the method <code>run</code> is that it may
* take any action whatsoever.
*
* @see Thread#run()
*/
@Override
public void run() {
while (true) {
lock.lock();
while (tNum != 1) {
try {
redCon.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println(Thread.currentThread().getName() + " is flashing...");
// 停留时间,便于从控制台观看
try {
TimeUnit.SECONDS.sleep(1);
tNum = 2;
greenCon.signal();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
class GreenLight implements Runnable {
/**
* When an object implementing interface <code>Runnable</code> is used
* to create a thread, starting the thread causes the object's
* <code>run</code> method to be called in that separately executing
* thread.
* <p>
* The general contract of the method <code>run</code> is that it may
* take any action whatsoever.
*
* @see Thread#run()
*/
@Override
public void run() {
while (true) {
lock.lock();
while (tNum != 2) {
try {
greenCon.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println(Thread.currentThread().getName() + " is flashing...");
// 停留时间,便于从控制台观看
try {
TimeUnit.SECONDS.sleep(1);
tNum = 3;
yellowCon.signal();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
class YellowLight implements Runnable {
/**
* When an object implementing interface <code>Runnable</code> is used
* to create a thread, starting the thread causes the object's
* <code>run</code> method to be called in that separately executing
* thread.
* <p>
* The general contract of the method <code>run</code> is that it may
* take any action whatsoever.
*
* @see Thread#run()
*/
@Override
public void run() {
while (true) {
lock.lock();
while (tNum != 3) {
try {
yellowCon.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println(Thread.currentThread().getName() + " is flashing...");
// 停留时间,便于从控制台观看
try {
TimeUnit.SECONDS.sleep(1);
tNum = 1;
redCon.signal();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
|
[
"wuhaodeyx@163.com"
] |
wuhaodeyx@163.com
|
08a76f1a6a31abfadc384d63b0e629fda063c304
|
b39d7e1122ebe92759e86421bbcd0ad009eed1db
|
/sources/com/android/internal/view/animation/HasNativeInterpolator.java
|
f8247cb6c03d7391c023bda9e02b7ebfbe9a9d95
|
[] |
no_license
|
AndSource/miuiframework
|
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
|
cd456214274c046663aefce4d282bea0151f1f89
|
refs/heads/master
| 2022-03-31T11:09:50.399520
| 2020-01-02T09:49:07
| 2020-01-02T09:49:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 327
|
java
|
package com.android.internal.view.animation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface HasNativeInterpolator {
}
|
[
"shivatejapeddi@gmail.com"
] |
shivatejapeddi@gmail.com
|
34a399d5a96cc0e0cffabcc7f10b58162873b12c
|
2bbb960a9793f473a95614410afb6ba6e02dee63
|
/src/test/java/com/brandstreet/foreignexchange/web/rest/errors/ExceptionTranslatorTestController.java
|
5e23869ff72e4ee6dcd32479e02eafc06e91099d
|
[] |
no_license
|
dankogaric/foreign-exchange-application
|
2a65d614a0467b1253519b45f0209247f69701e7
|
df613f334d10195483e8838c0dfd84c50bf3472a
|
refs/heads/main
| 2023-01-20T14:44:18.868658
| 2020-11-29T22:57:53
| 2020-11-29T22:57:53
| 316,512,989
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,081
|
java
|
package com.brandstreet.foreignexchange.web.rest.errors;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/api/exception-translator-test")
public class ExceptionTranslatorTestController {
@GetMapping("/concurrency-failure")
public void concurrencyFailure() {
throw new ConcurrencyFailureException("test concurrency failure");
}
@PostMapping("/method-argument")
public void methodArgument(@Valid @RequestBody TestDTO testDTO) {}
@GetMapping("/missing-servlet-request-part")
public void missingServletRequestPartException(@RequestPart String part) {}
@GetMapping("/missing-servlet-request-parameter")
public void missingServletRequestParameterException(@RequestParam String param) {}
@GetMapping("/access-denied")
public void accessdenied() {
throw new AccessDeniedException("test access denied!");
}
@GetMapping("/unauthorized")
public void unauthorized() {
throw new BadCredentialsException("test authentication failed!");
}
@GetMapping("/response-status")
public void exceptionWithResponseStatus() {
throw new TestResponseStatusException();
}
@GetMapping("/internal-server-error")
public void internalServerError() {
throw new RuntimeException();
}
public static class TestDTO {
@NotNull
private String test;
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
}
@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "test response status")
@SuppressWarnings("serial")
public static class TestResponseStatusException extends RuntimeException {}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
d49d9cea89a581f4b359de52a7730411b05f3466
|
a00326c0e2fc8944112589cd2ad638b278f058b9
|
/src/main/java/000/135/794/CWE369_Divide_by_Zero__float_database_modulo_54e.java
|
0a37f7ab4fb56bc56f30404845312a5df4634ca3
|
[] |
no_license
|
Lanhbao/Static-Testing-for-Juliet-Test-Suite
|
6fd3f62713be7a084260eafa9ab221b1b9833be6
|
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
|
refs/heads/master
| 2020-08-24T13:34:04.004149
| 2019-10-25T09:26:00
| 2019-10-25T09:26:00
| 216,822,684
| 0
| 1
| null | 2019-11-08T09:51:54
| 2019-10-22T13:37:13
|
Java
|
UTF-8
|
Java
| false
| false
| 1,583
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE369_Divide_by_Zero__float_database_modulo_54e.java
Label Definition File: CWE369_Divide_by_Zero__float.label.xml
Template File: sources-sinks-54e.tmpl.java
*/
/*
* @description
* CWE: 369 Divide by zero
* BadSource: database Read data from a database
* GoodSource: A hardcoded non-zero number (two)
* Sinks: modulo
* GoodSink: Check for zero before modulo
* BadSink : Modulo by a value that may be zero
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
public class CWE369_Divide_by_Zero__float_database_modulo_54e
{
public void badSink(float data ) throws Throwable
{
/* POTENTIAL FLAW: Possibly modulo by zero */
int result = (int)(100.0 % data);
IO.writeLine(result);
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(float data ) throws Throwable
{
/* POTENTIAL FLAW: Possibly modulo by zero */
int result = (int)(100.0 % data);
IO.writeLine(result);
}
/* goodB2G() - use badsource and goodsink */
public void goodB2GSink(float data ) throws Throwable
{
/* FIX: Check for value of or near zero before modulo */
if (Math.abs(data) > 0.000001)
{
int result = (int)(100.0 % data);
IO.writeLine(result);
}
else
{
IO.writeLine("This would result in a modulo by zero");
}
}
}
|
[
"anhtluet12@gmail.com"
] |
anhtluet12@gmail.com
|
db586c92404803d8323d340c4fc8d6e0f03c2a07
|
7bea7fb60b5f60f89f546a12b43ca239e39255b5
|
/src/java/util/zip/ZipCoder.java
|
a59f4724877166281205ba307f348fb05b171b81
|
[] |
no_license
|
sorakeet/fitcorejdk
|
67623ab26f1defb072ab473f195795262a8ddcdd
|
f946930a826ddcd688b2ddbb5bc907d2fc4174c3
|
refs/heads/master
| 2021-01-01T05:52:19.696053
| 2017-07-15T01:33:41
| 2017-07-15T01:33:41
| 97,292,673
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,036
|
java
|
/**
* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package java.util.zip;
import sun.nio.cs.ArrayDecoder;
import sun.nio.cs.ArrayEncoder;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.*;
import java.util.Arrays;
final class ZipCoder{
private Charset cs;
private CharsetDecoder dec;
private CharsetEncoder enc;
private boolean isUTF8;
private ZipCoder utf8;
private ZipCoder(Charset cs){
this.cs=cs;
this.isUTF8=cs.name().equals(StandardCharsets.UTF_8.name());
}
static ZipCoder get(Charset charset){
return new ZipCoder(charset);
}
String toString(byte[] ba){
return toString(ba,ba.length);
}
String toString(byte[] ba,int length){
CharsetDecoder cd=decoder().reset();
int len=(int)(length*cd.maxCharsPerByte());
char[] ca=new char[len];
if(len==0)
return new String(ca);
// UTF-8 only for now. Other ArrayDeocder only handles
// CodingErrorAction.REPLACE mode. ZipCoder uses
// REPORT mode.
if(isUTF8&&cd instanceof ArrayDecoder){
int clen=((ArrayDecoder)cd).decode(ba,0,length,ca);
if(clen==-1) // malformed
throw new IllegalArgumentException("MALFORMED");
return new String(ca,0,clen);
}
ByteBuffer bb=ByteBuffer.wrap(ba,0,length);
CharBuffer cb=CharBuffer.wrap(ca);
CoderResult cr=cd.decode(bb,cb,true);
if(!cr.isUnderflow())
throw new IllegalArgumentException(cr.toString());
cr=cd.flush(cb);
if(!cr.isUnderflow())
throw new IllegalArgumentException(cr.toString());
return new String(ca,0,cb.position());
}
private CharsetDecoder decoder(){
if(dec==null){
dec=cs.newDecoder()
.onMalformedInput(CodingErrorAction.REPORT)
.onUnmappableCharacter(CodingErrorAction.REPORT);
}
return dec;
}
// assume invoked only if "this" is not utf8
byte[] getBytesUTF8(String s){
if(isUTF8)
return getBytes(s);
if(utf8==null)
utf8=new ZipCoder(StandardCharsets.UTF_8);
return utf8.getBytes(s);
}
byte[] getBytes(String s){
CharsetEncoder ce=encoder().reset();
char[] ca=s.toCharArray();
int len=(int)(ca.length*ce.maxBytesPerChar());
byte[] ba=new byte[len];
if(len==0)
return ba;
// UTF-8 only for now. Other ArrayDeocder only handles
// CodingErrorAction.REPLACE mode.
if(isUTF8&&ce instanceof ArrayEncoder){
int blen=((ArrayEncoder)ce).encode(ca,0,ca.length,ba);
if(blen==-1) // malformed
throw new IllegalArgumentException("MALFORMED");
return Arrays.copyOf(ba,blen);
}
ByteBuffer bb=ByteBuffer.wrap(ba);
CharBuffer cb=CharBuffer.wrap(ca);
CoderResult cr=ce.encode(cb,bb,true);
if(!cr.isUnderflow())
throw new IllegalArgumentException(cr.toString());
cr=ce.flush(bb);
if(!cr.isUnderflow())
throw new IllegalArgumentException(cr.toString());
if(bb.position()==ba.length) // defensive copy?
return ba;
else
return Arrays.copyOf(ba,bb.position());
}
private CharsetEncoder encoder(){
if(enc==null){
enc=cs.newEncoder()
.onMalformedInput(CodingErrorAction.REPORT)
.onUnmappableCharacter(CodingErrorAction.REPORT);
}
return enc;
}
String toStringUTF8(byte[] ba,int len){
if(isUTF8)
return toString(ba,len);
if(utf8==null)
utf8=new ZipCoder(StandardCharsets.UTF_8);
return utf8.toString(ba,len);
}
boolean isUTF8(){
return isUTF8;
}
}
|
[
"panxiaoping@9af151c5-2e68-9a40-a710-8967c58c11f7"
] |
panxiaoping@9af151c5-2e68-9a40-a710-8967c58c11f7
|
147427648468b50fe89b2fbefe39c73b7e2d2f20
|
30dff2c7e9c18ef0d218c327e91b7d78f051e185
|
/src/main/java/fun/peri/service/ICityService.java
|
2625d4122d2683ad25cd1cff880d2a7b774dc7a2
|
[] |
no_license
|
helloBosom/TravelWeb
|
6bddd1cd2fe7cd6ed346d01eab4dc85bb23183c0
|
c39604f47db59ef09942de84293e72840a4cad3e
|
refs/heads/master
| 2021-04-26T21:49:05.591988
| 2018-04-19T06:23:41
| 2018-04-19T06:23:41
| 124,161,916
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 471
|
java
|
package fun.peri.service;
import fun.peri.model.City;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public interface ICityService {
public List<City> queryall();
public City getbyId(int id);
public City queryCityById(int parseInt);
public void updateCity(City city);
public List<City> queryCityByCondition(Object[] parameters);
public void addCity(City city);
public void deleteCity(int parseInt);
}
|
[
"13572186526@163.com"
] |
13572186526@163.com
|
c6cab325b588bb66c46542964e3ce9c2a7505ad4
|
ed24d6d364c6868ff955c05770498c81f3bca541
|
/labs/examples/empapp/EmployeeWebApp/src/main/java/com/examples/spring/boot/web/service/EmployeeService.java
|
28d8e4dda66cc765579f5b7e38dca8dfec303910
|
[] |
no_license
|
cumaha/socgen_cloud-aws
|
5ad8714c80c8948fb5a334ea482f5853b58f2247
|
082fbcb9847a14c1a4279301197aceed268c299e
|
refs/heads/master
| 2020-09-06T08:14:34.829593
| 2019-05-28T01:01:04
| 2019-05-28T01:01:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,104
|
java
|
package com.examples.spring.boot.web.service;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.examples.spring.boot.web.model.Employee;
import com.examples.spring.boot.web.repository.EmployeeRepository;
@Component
public class EmployeeService {
// private static Map<String, Employee> employees = new LinkedHashMap<String,
// Employee>();
@Autowired
EmployeeRepository repository;
public void add(Employee employee) {
repository.save(employee);
}
public void update(Employee employee) {
repository.save(employee);
}
public Employee get(int empId) {
Optional<Employee> employee = repository.findById(empId);
return employee.get();
}
public void delete(int empId) {
repository.deleteById(empId);
}
public List<Employee> list() {
List<Employee> target = new ArrayList<>();
repository.findAll().forEach(target::add);
return target;
}
}
|
[
"saravana.anbarasu@gmail.com"
] |
saravana.anbarasu@gmail.com
|
5858a53daeb1b57ec4d17bbddcd363203b433fea
|
d26f11c1611b299e169e6a027f551a3deeecb534
|
/ui/forms/org/fdesigner/forms/internal/forms/css/dom/SectionElement.java
|
08770afaf2e47e6ee330afea4083437b095f757e
|
[] |
no_license
|
WeControlTheFuture/fdesigner-ui
|
1bc401fd71a57985544220b9f9e42cf18db6491d
|
62efb51e57e5d7f25654e67ef8b2762311b766b6
|
refs/heads/master
| 2020-11-24T15:00:24.450846
| 2019-12-27T08:47:23
| 2019-12-27T08:47:23
| 228,199,674
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,327
|
java
|
/*******************************************************************************
* Copyright (c) 2014, 2015 vogella GmbH and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Vogel <Lars.Vogel@gmail.com> - initial API and implementation
*******************************************************************************/
package org.fdesigner.forms.internal.forms.css.dom;
import org.fdesigner.e4.ui.css.core.dom.CSSStylableElement;
import org.fdesigner.e4.ui.css.core.engine.CSSEngine;
import org.fdesigner.e4.ui.css.swt.dom.CompositeElement;
import org.fdesigner.forms.widgets.Section;
/**
* {@link CSSStylableElement} implementation which wrap SWT {@link Section}.
*
*/
public class SectionElement extends CompositeElement {
public SectionElement(Section section, CSSEngine engine) {
super(section, engine);
}
@Override
public void reset() {
Section section = (Section) getWidget();
section.setTitleBarForeground(null);
section.setToggleColor(null);
section.setActiveToggleColor(null);
super.reset();
}
}
|
[
"491676539@qq.com"
] |
491676539@qq.com
|
234751d3ee839c4cab390a227e3da47a057d1986
|
4810a15f89f4481fa2f600386a73983e48c3fdfe
|
/java-86th-master/java-86th-master/java-basic/src/day13/exam/CalendarUI.java
|
5a5237f0f4eadf80e33fe2c81e9dc018d2e695ac
|
[] |
no_license
|
fship1124/java86
|
54d779e46f8296ce6fb5e38dd58bd5d8ead92d05
|
d116fa70af0829675e281f90fc6baa8128f60cc5
|
refs/heads/master
| 2022-12-08T17:20:16.713751
| 2020-08-20T12:18:30
| 2020-08-20T12:18:30
| 288,993,715
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,150
|
java
|
package day13.exam;
import java.util.Calendar;
import java.util.Scanner;
public class CalendarUI {
private int thisYear;
private int thisMonth;
private int maxDay;
private int firstDay;
Scanner sc = new Scanner(System.in);
public void year() {
Calendar c = Calendar.getInstance();
System.out.print("년도를 입력하세요 : ");
int year = Integer.parseInt(sc.nextLine());
c.set(Calendar.YEAR, year);
thisYear = c.get(Calendar.YEAR);
for (int i = 0 ; i < 12; i++) {
c.set(Calendar.MONTH, i);
thisMonth = c.get(Calendar.MONTH);
maxDay = c.getActualMaximum(Calendar.DATE);
c.set(Calendar.DAY_OF_MONTH, 1);
firstDay = c.get(Calendar.DAY_OF_WEEK);
System.out.println("======================");
printCalendar();
System.out.println();
System.out.println("======================");
}
}
public void month() {
Calendar c = Calendar.getInstance();
System.out.print("년도를 입력하세요 : ");
int year = Integer.parseInt(sc.nextLine());
c.set(Calendar.YEAR, year);
thisYear = c.get(Calendar.YEAR);
System.out.print("월을 입력하세요 : ");
int month = Integer.parseInt(sc.nextLine());
c.set(Calendar.MONTH, month-1);
thisMonth = c.get(Calendar.MONTH);
maxDay = c.getActualMaximum(Calendar.DATE);
c.set(Calendar.DAY_OF_MONTH, 1);
firstDay = c.get(Calendar.DAY_OF_WEEK);
System.out.println("======================");
printCalendar();
System.out.println();
System.out.println("======================");
}
public void printCalendar() {
System.out.printf("%d년 %d월\n", thisYear, thisMonth + 1);
System.out.println("----------------------");
System.out.println(" 일 월 화 수 목 금 토");
System.out.println("----------------------");
int count = 0;
int x = 1;
outer: while (true) {
if (count == 0) {
x = firstDay;
for (int i = 1; i < x; i++) {
System.out.print(" ");
}
} else {
x = 1;
}
for (int i = x; i < 8; i++) {
System.out.printf("%2d ", count + 1);
if (count++ == maxDay - 1) {
break outer;
}
}
System.out.println();
}
}
}
|
[
"fship1124@gmail.com"
] |
fship1124@gmail.com
|
69e049687f43c73bbf9c450829b08842def51565
|
ec916afcb972c345208f4388694e06801a28221c
|
/kin-framework-java/src/main/java/org/kin/framework/proxy/ByteBuddyFactory.java
|
cd084193acd363bbc2c0892c768bbe59a6fd9257
|
[
"Apache-2.0"
] |
permissive
|
kaizhiyu/kin-framework
|
2ddac699dc44ba32a775731b2d373f058ea1b1f0
|
1fa365b7cf61446afdd26e89e86519738eda249b
|
refs/heads/master
| 2023-02-13T03:13:55.458432
| 2021-01-17T13:07:57
| 2021-01-17T13:07:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,696
|
java
|
package org.kin.framework.proxy;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.ClassFileVersion;
import net.bytebuddy.description.type.TypeDefinition;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.implementation.FieldAccessor;
import net.bytebuddy.implementation.MethodCall;
import net.bytebuddy.implementation.bytecode.assign.Assigner;
import net.bytebuddy.matcher.ElementMatchers;
import org.kin.framework.utils.ExceptionUtils;
import org.kin.framework.utils.SysUtils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
/**
* 利用byte buddy字节码技术增强代理类 调用速度更快
*
* @author huangjianqin
* @date 2020/12/22
*/
public class ByteBuddyFactory implements ProxyFactory {
/** 单例 */
public static final ByteBuddyFactory INSTANCE = new ByteBuddyFactory();
/** 代理类中, 实现类默认字段名 */
public static final String DEFAULT_SERVICE_FIELD_NAME = "service";
/** 代理类中, 实现代理方法(Method实例)默认字段名 */
public static final String DEFAULT_METHOD_FIELD_NAME = "method";
private ByteBuddyFactory() {
}
/**
* 增强代理某个方法的代理类
*/
@Override
@SuppressWarnings("unchecked")
public <T> ProxyInvoker<T> enhanceMethod(MethodDefinition<T> definition) {
T service = definition.getService();
Class<?> serviceClass = service.getClass();
Method target = definition.getMethod();
String packageName = serviceClass.getPackage().getName();
String className = packageName.concat(".").concat(serviceClass.getSimpleName().concat("$").concat(target.getName())).concat("$ByteBuddyProxy");
;
try {
//设置泛型ProxyInvoker接口
List<TypeDefinition> genericArgDefinitions = Collections.singletonList(new TypeDescription.ForLoadedType(serviceClass));
TypeDescription.Generic generic = Optional.ofNullable(ProxyInvoker.class.getDeclaringClass())
.map(TypeDefinition.Sort::describe)
.orElse(null);
TypeDefinition proxyType = TypeDescription.Generic.Builder.parameterizedType(
new TypeDescription.ForLoadedType(ProxyInvoker.class)
, generic, genericArgDefinitions).build();
return (ProxyInvoker<T>) new ByteBuddy(ClassFileVersion.ofThisVm(ClassFileVersion.JAVA_V8))
.subclass(Object.class)
.implement(proxyType)
.name(className)
//定义field
.defineField(DEFAULT_SERVICE_FIELD_NAME, serviceClass, Modifier.PRIVATE + Modifier.FINAL)
.defineField(DEFAULT_METHOD_FIELD_NAME, Method.class, Modifier.PRIVATE + Modifier.FINAL)
//定义constructor
.defineConstructor(Modifier.PUBLIC)
.withParameters(serviceClass, Method.class)
.intercept(MethodCall.invoke(Object.class.getDeclaredConstructor())
.andThen(FieldAccessor.ofField(DEFAULT_SERVICE_FIELD_NAME).setsArgumentAt(0))
.andThen(FieldAccessor.ofField(DEFAULT_METHOD_FIELD_NAME).setsArgumentAt(1)))
//定义方法, 与ProxyInvoker接口方法一致
.method(ElementMatchers.named("getProxyObj"))
.intercept(FieldAccessor.ofField(DEFAULT_SERVICE_FIELD_NAME))
.method(ElementMatchers.named("getMethod"))
.intercept(FieldAccessor.ofField(DEFAULT_METHOD_FIELD_NAME))
.method(ElementMatchers.named("invoke"))
.intercept(MethodCall.invoke(target)
.onField(DEFAULT_SERVICE_FIELD_NAME)
.withArgumentArrayElements(0)
.withAssigner(Assigner.DEFAULT, Assigner.Typing.DYNAMIC))
.make()
.load(SysUtils.getClassLoader(ProxyInvoker.class))
.getLoaded()
.getConstructor(serviceClass, target.getClass())
.newInstance(service, target);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
ExceptionUtils.throwExt(e);
}
//never reach
throw new IllegalStateException("encounter unknown error");
}
/**
* 生成代理某个类(接口)的代理类, 仅仅实现该interfaceClass的public(接口)方法
*/
@Override
@SuppressWarnings("unchecked")
public <P> P enhanceClass(ClassDefinition<P> definition) {
P service = definition.getService();
Class<?> serviceClass = service.getClass();
Class<P> interfaceClass = definition.getInterfaceClass();
String packageName = interfaceClass.getPackage().getName();
if (!interfaceClass.isAssignableFrom(serviceClass)) {
throw new IllegalArgumentException(serviceClass.getCanonicalName() + " is not implement " + interfaceClass.getName());
}
String proxyClassName = packageName.concat(".").concat(interfaceClass.getSimpleName()).concat("$ByteBuddyProxy");
try {
ByteBuddy byteBuddy = new ByteBuddy(ClassFileVersion.ofThisVm(ClassFileVersion.JAVA_V8));
Class<?> supperClass;
DynamicType.Builder<P> builder;
if (interfaceClass.isInterface()) {
supperClass = Object.class;
builder = (DynamicType.Builder<P>) byteBuddy.subclass(supperClass).implement(interfaceClass);
} else {
supperClass = interfaceClass;
builder = byteBuddy.subclass(interfaceClass);
}
builder = builder.name(proxyClassName)
//定义field
.defineField(DEFAULT_SERVICE_FIELD_NAME, serviceClass, Modifier.PRIVATE + Modifier.FINAL)
//定义constructor
.defineConstructor(Modifier.PUBLIC)
.withParameters(serviceClass)
//只适用于父类有无参构造器
.intercept(MethodCall.invoke(supperClass.getDeclaredConstructor())
.andThen(FieldAccessor.ofField(DEFAULT_SERVICE_FIELD_NAME).setsArgumentAt(0)));
for (Method method : interfaceClass.getMethods()) {
if (javassist.Modifier.isFinal(method.getModifiers())) {
//跳过final 方法
continue;
}
builder.method(ElementMatchers.is(method))
.intercept(MethodCall.invoke(method)
.onField(DEFAULT_SERVICE_FIELD_NAME)
.withArgumentArrayElements(0)
.withAssigner(Assigner.DEFAULT, Assigner.Typing.DYNAMIC));
}
return (P) builder
.make()
.load(SysUtils.getClassLoader(interfaceClass))
.getLoaded()
.getConstructor(interfaceClass)
.newInstance(service);
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
ExceptionUtils.throwExt(e);
}
//never reach
throw new IllegalStateException("encounter unknown error");
}
}
|
[
"18814127639@163.com"
] |
18814127639@163.com
|
17964038c48e33ff4f99fb4601920ab2bc54ec77
|
1f0bb4d862f24fe7dda5af468a4f71dd4c2c8f3c
|
/src/main/java/org/mikeneck/graalvm/NativeImageTask.java
|
30ae7ef235a4307afdb53820ed16aeb6101d1aa0
|
[] |
no_license
|
baptistemesta/graalvm-native-image-plugin
|
352606fb2d2a5df3e2d8b73afdbfffcccd62d42a
|
b846c64b40e510b1a6df3f5a11fc9d61d0a98f7d
|
refs/heads/master
| 2023-01-19T05:57:40.357777
| 2020-10-22T00:17:17
| 2020-10-22T00:17:17
| 312,507,337
| 0
| 0
| null | 2020-11-13T08:37:36
| 2020-11-13T07:47:44
| null |
UTF-8
|
Java
| false
| false
| 2,344
|
java
|
/*
* Copyright 2020 Shinya Mochida
*
* Licensed under the Apache License,Version2.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.mikeneck.graalvm;
import java.io.File;
import java.nio.file.Path;
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.file.Directory;
import org.gradle.api.file.ProjectLayout;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Nested;
import org.gradle.api.tasks.bundling.Jar;
import org.jetbrains.annotations.NotNull;
import org.mikeneck.graalvm.nativeimage.NativeImageArguments;
public interface NativeImageTask extends Task, NativeImageConfig {
@NotNull
@Nested
NativeImageArguments getNativeImageArguments();
@Override
void setGraalVmHome(String graalVmHome);
@Override
void setJarTask(Jar jarTask);
@Override
void setMainClass(String mainClass);
@Override
void setExecutableName(String name);
@Override
void setRuntimeClasspath(Configuration configuration);
@Override
default void setOutputDirectory(File directory) {
Project project = getProject();
ProjectLayout projectLayout = project.getLayout();
Provider<Directory> dir = projectLayout.dir(project.provider(() -> directory));
setOutputDirectory(dir);
}
@Override
default void setOutputDirectory(Path directory) {
setOutputDirectory(directory.toFile());
}
@Override
default void setOutputDirectory(String directory) {
File dir = getProject().file(directory);
setOutputDirectory(dir);
}
@Override
void setOutputDirectory(Provider<Directory> directory);
void withConfigFiles(@NotNull Action<NativeImageConfigurationFiles> configuration);
@Override
void arguments(String... arguments);
}
|
[
"jkrt3333@gmail.com"
] |
jkrt3333@gmail.com
|
9e51e96aa307bed2cc8038c3dc8fd27773fef569
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/spring-projects--spring-framework/8072497ce24062c78b48122495349179508d2d32/before/CastingUtils.java
|
2953dd97853ff3a9ad19554d8b9244ab8fd142d3
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,095
|
java
|
/*
* Copyright 2002-2016 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.web.reactive.function;
import org.springframework.http.codec.HttpMessageReader;
/**
* @author Arjen Poutsma
*/
@SuppressWarnings("unchecked")
abstract class CastingUtils {
public static <T> HttpMessageReader<T> cast(HttpMessageReader<?> messageReader) {
return (HttpMessageReader<T>) messageReader;
}
public static <T> HandlerFunction<T> cast(HandlerFunction<?> handlerFunction) {
return (HandlerFunction<T>) handlerFunction;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
4011eb55dbf16ebbed38e7a0a13ec34024c83c6e
|
63466378149a04f92181f5cda7364df42dcb83e2
|
/src/test/java/org/centralplains/daas/DaasApplicationTests.java
|
db45f3431091d6d1164dbfc130e4df03529f6883
|
[] |
no_license
|
lifeifeixz/daas-f
|
b2c43d585ffbf5d55fb9fd7499bef184f7a80cac
|
d61f849a1f928bac1d3edb60d41678237ff0f409
|
refs/heads/master
| 2020-04-14T10:48:58.484772
| 2019-04-26T12:29:05
| 2019-04-26T12:29:05
| 163,797,006
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,822
|
java
|
package org.centralplains.daas;
import org.assertj.core.util.DateUtil;
import org.centralplains.daas.beans.Product;
import org.centralplains.daas.dao.ProductRepository;
import org.centralplains.daas.service.ProductService;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.io.IOException;
import java.util.Date;
@RunWith(SpringRunner.class)
@SpringBootTest
public class DaasApplicationTests {
private int k = 434;
@Autowired
private ProductRepository productRepository;
@Autowired
private ProductService productService;
@SuppressWarnings("all")
@Test
public void contextLoads() throws IOException {
}
@Test
public void insert() {
for (int j = this.k; j <= 434; j++) {
String url = "http://nc.mofcom.gov.cn/channel/jghq2017/price_list.shtml?par_craft_index=13075&craft_index=13214&par_p_index=&p_index=&startTime=2018-09-14&endTime=2018-12-13&page=" + j;
Connection connection = Jsoup.connect(url);
Document document = null;
try {
document = connection.get();
} catch (Exception e) {
System.out.println("家在超时,休息10秒钟,继续加载...");
this.k = j;
try {
Thread.sleep(10000);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
insert();
}
Element table = document.getElementsByClass("table-01").first();
if (table == null) {
this.k = j;
System.out.println("数据抓取出现异常,休息60秒。");
try {
Thread.sleep(60000);
} catch (InterruptedException e) {
System.out.println("----");
}
insert();
}
Elements trs = table.children().first().children();
for (int i = 1; i < trs.size(); i++) {
Element tr = trs.get(i);
Elements tds = tr.children();
String date = tds.get(0).text();
String name = tds.get(1).text();
Double price = Double.valueOf(tds.get(2).getElementsByClass("c-orange").eq(0).text());
String seller = tds.get(3).text();
String uri = tds.get(4).getElementsByTag("a").eq(0).attr("href");
//解析mark1
String priceTrend = uri.substring(uri.indexOf("mark1=") + 6, uri.indexOf("&"));
Product product = new Product();
product.setDate(DateUtil.parse(date));
product.setName(name);
product.setPrice(price);
product.setPriceTrend(productService.reqPriceTrend(priceTrend));
product.setSeller(seller);
product.setCreateDate(new Date());
productRepository.save(product);
System.out.println("持续采集中....");
}
System.out.println("第" + j + "页已经完成!");
if (j % 30 == 0) {
System.out.println("程序进入休息状态---------");
System.out.println("持续休息30秒");
try {
Thread.sleep(1000 * 30);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
}
|
[
"lifeifeixz@sina.cn"
] |
lifeifeixz@sina.cn
|
3d5554acb177406c68137c54ac7e043498737144
|
e4ef8f38104c080892e482a99cee7f2fdb08a7c4
|
/orange-demo-single/orange-demo-single-service/common/common-core/src/main/java/com/orangeforms/common/core/exception/MapCacheAccessException.java
|
2d8251164d3e271da977fc2cab96bb4a1cabe359
|
[
"Apache-2.0"
] |
permissive
|
orange-form/orange-admin
|
79f28385658d2635df28fe7a029b987972eb85fb
|
13bf4764d13ed32b564e3ea4442c4b6c53557113
|
refs/heads/master
| 2022-07-27T03:21:03.311959
| 2021-12-26T04:37:09
| 2021-12-26T04:37:09
| 254,990,100
| 234
| 57
|
Apache-2.0
| 2022-06-21T04:20:21
| 2020-04-12T01:53:58
|
CSS
|
UTF-8
|
Java
| false
| false
| 477
|
java
|
package com.orangeforms.common.core.exception;
/**
* 内存缓存访问失败。比如:获取分布式数据锁超时、等待线程中断等。
*
* @author Jerry
* @date 2020-09-24
*/
public class MapCacheAccessException extends RuntimeException {
/**
* 构造函数。
*
* @param msg 错误信息。
* @param cause 原始异常。
*/
public MapCacheAccessException(String msg, Throwable cause) {
super(msg, cause);
}
}
|
[
"707344974@qq.com"
] |
707344974@qq.com
|
28aecfd82fd5c6c5720f4cb4fcaa15118a5de0d1
|
440c9752c30ea2514c2ccbe45cd0a336c4e111a1
|
/ProblemSolving/450DSA/Java/src/main/java/org/redquark/techinterview/dsa/matrix/FindMedianInARowWiseSortedMatrix.java
|
a7dbae8d3c200bd72cf7d5af2cea5a5097d641c0
|
[] |
no_license
|
Snehal2605/Technical-Interview-Preparation
|
b6c6e578a42fcac5ac42c8ea7745637575e7ed2b
|
0069669790f561bdcedbe5c2900d03ff7d3f218d
|
refs/heads/master
| 2023-08-02T16:59:35.479401
| 2021-08-23T13:40:14
| 2021-08-23T13:40:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,686
|
java
|
package org.redquark.techinterview.dsa.matrix;
import java.util.Arrays;
/**
* @author Anirudh Sharma
* <p>
* Given a row wise sorted matrix of size RxC where R and C are always odd,
* find the median of the matrix.
* <p>
* Constraints:
* 1<= R,C <=150
* 1<= matrix[i][j] <=1000
*/
public class FindMedianInARowWiseSortedMatrix {
private static int findMedian(int[][] matrix) {
// Rows and columns in the matrix
int rows = matrix.length;
int columns = matrix[0].length;
// Special cases
if (rows == 1 && columns == 1) {
return matrix[rows - 1][columns - 1];
}
// Maximum and minimum elements in the matrix
int minimumElement = Integer.MAX_VALUE;
int maximumElement = Integer.MIN_VALUE;
// Loop through all the rows
for (int[] row : matrix) {
minimumElement = Math.min(minimumElement, row[0]);
maximumElement = Math.max(maximumElement, row[columns - 1]);
}
// Since now we have a range of minimum and maximum elements
// in the matrix, we would run binary search on this range to
// find the number of elements which are less than our median
// index (rows + columns + 1) / 2.
// Desired median index
int desiredIndex = (rows * columns + 1) / 2;
while (minimumElement < maximumElement) {
// Middle element
int middleElement = minimumElement + (maximumElement - minimumElement) / 2;
// Count of elements less than middleElement
int count = 0;
// Loop for each row
for (int[] row : matrix) {
// Index of middle element in a row
int middleElementIndex = Arrays.binarySearch(row, middleElement);
// If element is not found in the row
if (middleElementIndex < 0) {
middleElementIndex = Math.abs(middleElementIndex) - 1;
} else {
// If element is found in the array
while (middleElementIndex < columns && row[middleElementIndex] == middleElement) {
middleElementIndex++;
}
}
count += middleElementIndex;
}
if (count < desiredIndex) {
minimumElement = middleElement + 1;
} else {
maximumElement = middleElement;
}
}
return minimumElement;
}
public static void main(String[] args) {
int[][] matrix = {{1, 3, 5}, {2, 6, 9}, {3, 6, 9}};
System.out.println(findMedian(matrix));
}
}
|
[
"anirudh03sharma@gmail.com"
] |
anirudh03sharma@gmail.com
|
224f550d08130af9969aaf675d4f83448a233f26
|
aded9c5e99d627b6ff7090c13b55bb91f31fb26e
|
/app/src/main/java/com/haoche51/sales/workreport/AlbumViewPager.java
|
f1fede847cd5a996cab8c7eb90c186d375a35e2a
|
[] |
no_license
|
pengxinaglin/maiche
|
f47964884393bcd7823550b8392ee4621c78fa5e
|
4b36e2ef5f45df9879843e2ce98acdacc4f7eb33
|
refs/heads/master
| 2021-01-21T10:12:33.595132
| 2017-02-28T05:08:54
| 2017-02-28T05:08:54
| 83,391,921
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,179
|
java
|
package com.haoche51.sales.workreport;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Hacky fix for Issue #4 and
* http://code.google.com/p/android/issues/detail?id=18990
* <p>
* ScaleGestureDetector seems to mess up the touch events, which means that
* ViewGroups which make use of onInterceptTouchEvent throw a lot of
* IllegalArgumentException: pointerIndex out of range.
* <p>
* There's not much I can do in my code for now, but we can mask the result by
* just catching the problem and ignoring it.
*
* @author Chris Banes
*/
public class AlbumViewPager extends ViewPager {
public AlbumViewPager(Context context) {
super(context);
}
public AlbumViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
try {
return super.onInterceptTouchEvent(ev);
} catch (Exception e) {
//TODO zhangyaqing
//GJApplication.getUserTracer().onEvent(620);
return false;
}
}
}
|
[
"pengxianglin@haoche51.com"
] |
pengxianglin@haoche51.com
|
cd5baf4445227fe7aa251d77b5cc9abc16c23540
|
b5365904737296ec5cb06c090aa82fdfd14ff512
|
/android/support/v4/app/af.java
|
c9cd841d68bd1dc279669f777a7cecaab19bb581
|
[] |
no_license
|
Ravinther/alarmclock
|
80b8a2206c4309aae4481724c7f1dd03d5638023
|
3ba5aee4e0c10487ec67bb238a2a06a0a3b182b8
|
refs/heads/master
| 2021-01-19T02:33:57.314201
| 2016-08-11T16:27:54
| 2016-08-11T16:27:54
| 65,484,422
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 512
|
java
|
package android.support.v4.app;
import android.os.Bundle;
class af {
/* renamed from: android.support.v4.app.af.a */
public static abstract class C0052a {
/* renamed from: android.support.v4.app.af.a.a */
public interface C0046a {
}
protected abstract String m153a();
protected abstract CharSequence m154b();
protected abstract CharSequence[] m155c();
protected abstract boolean m156d();
protected abstract Bundle m157e();
}
}
|
[
"m.ravinther@yahoo.com"
] |
m.ravinther@yahoo.com
|
3e81f93b5beee7fcd7911643f60ed034e10b4a12
|
704507754a9e7f300dfab163e97cd976b677661b
|
/src/com/sun/java/swing/plaf/windows/WindowsLabelUI.java
|
e3d271e06613a3985a43d91c7937ed9d61cc0fe1
|
[] |
no_license
|
ossaw/jdk
|
60e7ca5e9f64541d07933af25c332e806e914d2a
|
b9d61d6ade341b4340afb535b499c09a8be0cfc8
|
refs/heads/master
| 2020-03-27T02:23:14.010857
| 2019-08-07T06:32:34
| 2019-08-07T06:32:34
| 145,785,700
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,164
|
java
|
/*
* Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.sun.java.swing.plaf.windows;
import sun.swing.SwingUtilities2;
import sun.awt.AppContext;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicLabelUI;
/**
* Windows rendition of the component.
* <p>
* <strong>Warning:</strong> Serialized objects of this class will not be
* compatible with future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running the
* same version of Swing. A future release of Swing will provide support for
* long term persistence.
*/
public class WindowsLabelUI extends BasicLabelUI {
private static final Object WINDOWS_LABEL_UI_KEY = new Object();
// ********************************
// Create PLAF
// ********************************
public static ComponentUI createUI(JComponent c) {
AppContext appContext = AppContext.getAppContext();
WindowsLabelUI windowsLabelUI = (WindowsLabelUI) appContext.get(WINDOWS_LABEL_UI_KEY);
if (windowsLabelUI == null) {
windowsLabelUI = new WindowsLabelUI();
appContext.put(WINDOWS_LABEL_UI_KEY, windowsLabelUI);
}
return windowsLabelUI;
}
protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY) {
int mnemonicIndex = l.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
if (WindowsLookAndFeel.isMnemonicHidden() == true) {
mnemonicIndex = -1;
}
g.setColor(l.getForeground());
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex, textX, textY);
}
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY) {
int mnemonicIndex = l.getDisplayedMnemonicIndex();
// W2K Feature: Check to see if the Underscore should be rendered.
if (WindowsLookAndFeel.isMnemonicHidden() == true) {
mnemonicIndex = -1;
}
if (UIManager.getColor("Label.disabledForeground") instanceof Color && UIManager.getColor(
"Label.disabledShadow") instanceof Color) {
g.setColor(UIManager.getColor("Label.disabledShadow"));
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex, textX + 1, textY + 1);
g.setColor(UIManager.getColor("Label.disabledForeground"));
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex, textX, textY);
} else {
Color background = l.getBackground();
g.setColor(background.brighter());
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex, textX + 1, textY + 1);
g.setColor(background.darker());
SwingUtilities2.drawStringUnderlineCharAt(l, g, s, mnemonicIndex, textX, textY);
}
}
}
|
[
"jianghao7625@gmail.com"
] |
jianghao7625@gmail.com
|
64f64872f53f57a1c79ec0d105d89c3f3ccf40f8
|
58a8ed34f613c281a5faaaefe5da1788f5739d17
|
/Application_code_source/eMybaby/sources/a/e/a/a/l.java
|
31e8dcbad981522d61f6ff56272375a5701f92fb
|
[] |
no_license
|
wagnerwave/Dossier_Hacking_de_peluche
|
01c78629e52a94ed6a208e11ff7fcd268e10956e
|
514f81b1e72d88e2b8835126b2151e368dcad7fb
|
refs/heads/main
| 2023-03-31T13:28:06.247243
| 2021-03-25T23:03:38
| 2021-03-25T23:03:38
| 351,597,654
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,032
|
java
|
package a.e.a.a;
import android.os.Binder;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
public interface l extends IInterface {
public static abstract class a extends Binder implements l {
/* renamed from: a.e.a.a.l$a$a reason: collision with other inner class name */
public static class C0075a implements l {
/* renamed from: a reason: collision with root package name */
public IBinder f3232a;
public C0075a(IBinder iBinder) {
this.f3232a = iBinder;
}
public IBinder asBinder() {
return this.f3232a;
}
public void p(int i, Bundle bundle) {
Parcel obtain = Parcel.obtain();
Parcel obtain2 = Parcel.obtain();
try {
obtain.writeInterfaceToken("com.inuker.bluetooth.library.IResponse");
obtain.writeInt(i);
obtain.writeInt(1);
bundle.writeToParcel(obtain, 0);
this.f3232a.transact(1, obtain, obtain2, 0);
obtain2.readException();
if (obtain2.readInt() != 0) {
bundle.readFromParcel(obtain2);
}
} finally {
obtain2.recycle();
obtain.recycle();
}
}
}
public a() {
attachInterface(this, "com.inuker.bluetooth.library.IResponse");
}
public static l e(IBinder iBinder) {
if (iBinder == null) {
return null;
}
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.inuker.bluetooth.library.IResponse");
return (queryLocalInterface == null || !(queryLocalInterface instanceof l)) ? new C0075a(iBinder) : (l) queryLocalInterface;
}
public IBinder asBinder() {
return this;
}
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) {
if (i == 1) {
parcel.enforceInterface("com.inuker.bluetooth.library.IResponse");
int readInt = parcel.readInt();
Bundle bundle = parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null;
p(readInt, bundle);
parcel2.writeNoException();
if (bundle != null) {
parcel2.writeInt(1);
bundle.writeToParcel(parcel2, 1);
} else {
parcel2.writeInt(0);
}
return true;
} else if (i != 1598968902) {
return super.onTransact(i, parcel, parcel2, i2);
} else {
parcel2.writeString("com.inuker.bluetooth.library.IResponse");
return true;
}
}
}
void p(int i, Bundle bundle);
}
|
[
"alexandre1.wagner@epitech.eu"
] |
alexandre1.wagner@epitech.eu
|
1377ea28c8b926225a7295b36e23d5fb9bfeb68f
|
10394daf9386b13fe89279e69f5fcac5c840a70c
|
/app/src/main/java/com/Vander/Vanderapp/Activity/ContactUs_Activity.java
|
37a2cf62018e2f5d2926dd84d48bd3b339fe6e20
|
[] |
no_license
|
Omender123/VanderApp
|
538d20c024f57e427768a4e8eca2e62f82a4ca38
|
da9e81c76051d8a0c0a2aa300b469cd3332ebeed
|
refs/heads/master
| 2023-03-22T12:37:16.326999
| 2021-03-13T13:03:10
| 2021-03-13T13:03:10
| 340,869,966
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,291
|
java
|
package com.Vander.Vanderapp.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import com.Vander.Vanderapp.MainActivity;
import com.Vander.Vanderapp.R;
public class ContactUs_Activity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_contact_us);
chanageStatusBar();
}
@Override
public void onBackPressed() {
super.onBackPressed();
Intent intent = new Intent(ContactUs_Activity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
public void back(View view) {
Intent intent = new Intent(ContactUs_Activity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
}
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// todo: goto back activity from here
Intent intent = new Intent(ContactUs_Activity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
finish();
return true;
default:
}
return super.onOptionsItemSelected(item);
}
public void chanageStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(getResources().getColor(R.color.status_color));
}
}
}
|
[
"Os7290915329@gmail.com"
] |
Os7290915329@gmail.com
|
fc266334776b64a6b2c37e0928f7eab25cdb41ca
|
0eb7dcb0459de31871e2357cf5c713a53ea5f015
|
/BusPrototype/nl/cwi/term/test/TestTerm.java
|
ee530ebc9372db472c6d7f423991c8c72f339f48
|
[] |
no_license
|
cwi-swat/meta-environment
|
a87055da2a6825c97c7744cdd84c08d39d9f3f66
|
eea9a90fdb52415f43430a89adc7acddba2be0a4
|
refs/heads/master
| 2021-01-19T08:42:05.812049
| 2012-11-15T14:16:54
| 2012-11-15T14:16:54
| 5,178,544
| 8
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,000
|
java
|
package nl.cwi.term.test;
import nl.cwi.term.IntTerm;
import nl.cwi.term.ListTerm;
import nl.cwi.term.StringTerm;
import nl.cwi.term.Term;
/**
* Test for the term, that just prints some stuff into the console.
*
* @author Arnold Lankamp
*/
public class TestTerm{
/**
* Default constructor.
*/
public TestTerm(){
super();
}
/**
* Entrypoint
*
* @param args
* The arguments
*/
public static void main(String[] args){
// Construct
ListTerm term = new ListTerm();
Term term2 = new StringTerm("stringterm");
Term term3 = new IntTerm(14795343);
term.addChild(term2);
term.addChild(term3);
// Serializing
System.out.println("Signature: " + term.getSignature());
System.out.println("Matches to itself: " + term.match(term.getSignature()));
System.out.println("Serialized: " + term.serialize());
// Deserializing
Term t = Term.parse(term.serialize());
System.out.println("Serialized -> Deserialized -> Serialized: " + t.serialize());
}
}
|
[
"arnold.lankamp@gmail.com"
] |
arnold.lankamp@gmail.com
|
e34e65d2a3cee45ca85b86fa999fb7f1f219995c
|
202cd298430d3d0db62618ee7b944286d3cde12d
|
/platform/lang-impl/src/com/intellij/execution/services/ServiceSingleView.java
|
f630f58e2b8d2cee8af41dfbc2edc4476deb9903
|
[
"Apache-2.0"
] |
permissive
|
llzxcv2014/intellij-community
|
2e4c9fc7339d92216961262f7272c6b0bc17c4c3
|
7aedec109e6dba1393fe067171633efa30da4fda
|
refs/heads/master
| 2021-08-06T23:08:26.280264
| 2020-09-29T08:01:22
| 2020-09-29T08:01:22
| 222,669,602
| 1
| 0
|
Apache-2.0
| 2020-09-29T08:01:31
| 2019-11-19T10:27:26
| null |
UTF-8
|
Java
| false
| false
| 3,813
|
java
|
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution.services;
import com.intellij.execution.services.ServiceModel.ServiceViewItem;
import com.intellij.execution.services.ServiceViewModel.ServiceViewModelListener;
import com.intellij.openapi.application.AppUIExecutor;
import com.intellij.openapi.project.Project;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.concurrency.Promise;
import org.jetbrains.concurrency.Promises;
import java.awt.*;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
class ServiceSingleView extends ServiceView {
private final AtomicReference<ServiceViewItem> myRef = new AtomicReference<>();
private boolean mySelected;
private final ServiceViewModelListener myListener;
ServiceSingleView(@NotNull Project project, @NotNull ServiceViewModel model, @NotNull ServiceViewUi ui) {
super(new BorderLayout(), project, model, ui);
ui.setServiceToolbar(ServiceViewActionProvider.getInstance());
add(ui.getComponent(), BorderLayout.CENTER);
myListener = this::updateItem;
model.addModelListener(myListener);
model.getInvoker().invokeLater(this::updateItem);
}
@NotNull
@Override
Promise<Void> select(@NotNull Object service,
@NotNull Class<?> contributorClass) {
ServiceViewItem item = myRef.get();
if (item == null || !item.getValue().equals(service)) {
return Promises.rejectedPromise("Service not found");
}
showContent();
return Promises.resolvedPromise();
}
@Override
Promise<Void> expand(@NotNull Object service, @NotNull Class<?> contributorClass) {
ServiceViewItem item = myRef.get();
return item == null || !item.getValue().equals(service) ? Promises.rejectedPromise("Service not found") : Promises.resolvedPromise();
}
@Override
void onViewSelected() {
showContent();
}
@Override
void onViewUnselected() {
mySelected = false;
ServiceViewItem item = myRef.get();
if (item != null) {
item.getViewDescriptor().onNodeUnselected();
}
}
@NotNull
@Override
List<ServiceViewItem> getSelectedItems() {
ServiceViewItem item = myRef.get();
return item == null ? Collections.emptyList() : Collections.singletonList(item);
}
@Override
void jumpToServices() {
}
@Override
public void dispose() {
getModel().removeModelListener(myListener);
}
private void updateItem() {
WeakReference<ServiceViewItem> oldValueRef = new WeakReference<>(myRef.get());
ServiceViewItem newValue = ContainerUtil.getOnlyItem(getModel().getRoots());
WeakReference<ServiceViewItem> newValueRef = new WeakReference<>(newValue);
myRef.set(newValue);
AppUIExecutor.onUiThread().expireWith(getProject()).submit(() -> {
if (mySelected) {
ServiceViewItem value = newValueRef.get();
if (value != null) {
ServiceViewDescriptor descriptor = value.getViewDescriptor();
if (oldValueRef.get() == null) {
onViewSelected(descriptor);
}
myUi.setDetailsComponent(descriptor.getContentComponent());
}
}
});
}
private void showContent() {
if (mySelected) return;
mySelected = true;
ServiceViewItem item = myRef.get();
if (item != null) {
ServiceViewDescriptor descriptor = item.getViewDescriptor();
onViewSelected(descriptor);
myUi.setDetailsComponent(descriptor.getContentComponent());
}
}
@Override
List<Object> getChildrenSafe(@NotNull List<Object> valueSubPath) {
return Collections.emptyList();
}
}
|
[
"intellij-monorepo-bot-no-reply@jetbrains.com"
] |
intellij-monorepo-bot-no-reply@jetbrains.com
|
330a69b5f32ec2ca6a7b6baff40561c307346e8d
|
53a4b190dde859d5a26fbba9facfa4a851a8380b
|
/src/main/java/ru/gorbach/hw14/city/exception/unchecked/DeleteCityException.java
|
b91db47435c221b62a6e9a8bfc40c8a18d905705
|
[] |
no_license
|
gorbach-d-v/EpamCourse
|
d73beca26473abc16f7317f6a5dcf3af443017a9
|
1a684682ce25aea2f31456fb4fdcdc24710d9102
|
refs/heads/master
| 2020-04-24T19:48:09.162768
| 2019-04-15T12:19:45
| 2019-04-15T12:19:45
| 172,223,682
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 505
|
java
|
package ru.gorbach.hw14.city.exception.unchecked;
import ru.gorbach.hw14.city.exception.CityExceptionMeta;
import ru.gorbach.hw14.common.business.exception.ReservationUncheckedException;
public class DeleteCityException extends ReservationUncheckedException {
public DeleteCityException(int code, String message) {
super(message, code);
}
public DeleteCityException(CityExceptionMeta exceptionMeta) {
super(exceptionMeta.getDescription(), exceptionMeta.getCode());
}
}
|
[
"gorbach.d.v@yandex.ru"
] |
gorbach.d.v@yandex.ru
|
ec68f804f5356902a261353d535f6e4c29e291dc
|
8c9b743f156307cfb8781f95d2039f3697305b78
|
/src/com/gargoylesoftware/htmlunit/javascript/host/svg/SVGComponentTransferFunctionElement.java
|
4bafc9f8d47e5ae5df23b9817746825c64f350f3
|
[] |
no_license
|
jiafenggit/HtmlUnitTao
|
f8fbd9065b03b6cd0f3a4ce1db6b4fbfd4941000
|
ede3e10603d16f022b60798ea340c392f57495f7
|
refs/heads/master
| 2021-04-28T23:46:58.642674
| 2016-03-15T08:08:02
| 2016-03-15T08:08:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,645
|
java
|
/*
* Copyright (c) 2002-2015 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gargoylesoftware.htmlunit.javascript.host.svg;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.CHROME;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.FF;
import static com.gargoylesoftware.htmlunit.javascript.configuration.BrowserName.IE;
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass;
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstant;
import com.gargoylesoftware.htmlunit.javascript.configuration.JsxConstructor;
import com.gargoylesoftware.htmlunit.javascript.configuration.WebBrowser;
/**
* A JavaScript object for {@code SVGComponentTransferFunctionElement}.
*
* @version $Revision: 10722 $
* @author Ahmed Ashour
*/
@JsxClass(browsers = { @WebBrowser(CHROME), @WebBrowser(FF), @WebBrowser(value = IE, minVersion = 11) })
public class SVGComponentTransferFunctionElement extends SVGElement {
/** Constant for {@code SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN}. */
@JsxConstant
public static final int SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN = 0;
/** Constant for {@code SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY}. */
@JsxConstant
public static final int SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
/** Constant for {@code SVG_FECOMPONENTTRANSFER_TYPE_TABLE}. */
@JsxConstant
public static final int SVG_FECOMPONENTTRANSFER_TYPE_TABLE = 2;
/** Constant for {@code SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE}. */
@JsxConstant
public static final int SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
/** Constant for {@code SVG_FECOMPONENTTRANSFER_TYPE_LINEAR}. */
@JsxConstant
public static final int SVG_FECOMPONENTTRANSFER_TYPE_LINEAR = 4;
/** Constant for {@code SVG_FECOMPONENTTRANSFER_TYPE_GAMMA}. */
@JsxConstant
public static final int SVG_FECOMPONENTTRANSFER_TYPE_GAMMA = 5;
/**
* Creates an instance.
*/
@JsxConstructor({ @WebBrowser(CHROME), @WebBrowser(FF) })
public SVGComponentTransferFunctionElement() {
}
}
|
[
"jeruen@gmail.com"
] |
jeruen@gmail.com
|
1117d90428206e61bd6fcada70f46f27044c5bf4
|
cc328476eba0f9dcbac108688cf1b97d1d06c189
|
/src/main/java/com/cisco/policyconversiontool/dto/wsa/asyncos805/Favorites.java
|
4ab2d7006dae7423a97a72fee986c1888550734c
|
[] |
no_license
|
SecurView/cws-wsa
|
b9278caee8d52afd9f71b925516bc18380b5c331
|
c3e9c245722f89d9a3189bf7bc9700e8b4c7f1d6
|
refs/heads/master
| 2016-09-06T21:35:20.674191
| 2014-12-19T14:45:23
| 2014-12-19T14:45:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,646
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// 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: 2014.11.15 at 08:28:02 PM IST
//
package com.cisco.policyconversiontool.dto.wsa.asyncos805;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"favorite"
})
@XmlRootElement(name = "favorites")
public class Favorites {
protected List<Favorite> favorite;
/**
* Gets the value of the favorite property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the favorite property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getFavorite().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Favorite }
*
*
*/
public List<Favorite> getFavorite() {
if (favorite == null) {
favorite = new ArrayList<Favorite>();
}
return this.favorite;
}
}
|
[
"kgadekar@securview.com"
] |
kgadekar@securview.com
|
0fbe9d2de1c6dfb1bef38a65e9756940028f53e3
|
3122ac39f1ce0a882b48293a77195476299c2a3b
|
/clients/jaxrs-jersey/generated/src/gen/java/org/openapitools/model/PipelinelatestRunartifacts.java
|
3246c43c0ab29c77f0ac69a44f67132b65cc1727
|
[
"MIT"
] |
permissive
|
miao1007/swaggy-jenkins
|
4e6fe28470eda2428cbc584dcd365a21caa606ef
|
af79438c120dd47702b50d51c42548b4db7fd109
|
refs/heads/master
| 2020-08-30T16:50:27.474383
| 2019-04-10T13:47:17
| 2019-04-10T13:47:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,890
|
java
|
/*
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* OpenAPI spec version: 1.1.1
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
/**
* PipelinelatestRunartifacts
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJerseyServerCodegen", date = "2019-04-10T13:31:48.444Z[GMT]")
public class PipelinelatestRunartifacts {
@JsonProperty("name")
private String name = null;
@JsonProperty("size")
private Integer size = null;
@JsonProperty("url")
private String url = null;
@JsonProperty("_class")
private String propertyClass = null;
public PipelinelatestRunartifacts name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@JsonProperty("name")
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public PipelinelatestRunartifacts size(Integer size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@JsonProperty("size")
@ApiModelProperty(value = "")
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public PipelinelatestRunartifacts url(String url) {
this.url = url;
return this;
}
/**
* Get url
* @return url
**/
@JsonProperty("url")
@ApiModelProperty(value = "")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public PipelinelatestRunartifacts propertyClass(String propertyClass) {
this.propertyClass = propertyClass;
return this;
}
/**
* Get propertyClass
* @return propertyClass
**/
@JsonProperty("_class")
@ApiModelProperty(value = "")
public String getPropertyClass() {
return propertyClass;
}
public void setPropertyClass(String propertyClass) {
this.propertyClass = propertyClass;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PipelinelatestRunartifacts pipelinelatestRunartifacts = (PipelinelatestRunartifacts) o;
return Objects.equals(this.name, pipelinelatestRunartifacts.name) &&
Objects.equals(this.size, pipelinelatestRunartifacts.size) &&
Objects.equals(this.url, pipelinelatestRunartifacts.url) &&
Objects.equals(this.propertyClass, pipelinelatestRunartifacts.propertyClass);
}
@Override
public int hashCode() {
return Objects.hash(name, size, url, propertyClass);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PipelinelatestRunartifacts {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"cliffano@gmail.com"
] |
cliffano@gmail.com
|
a12dbe29fc0de9099401b218bb4192d1bc02412a
|
c70a0d971e136dd36e6d15cc81f5511d599f4bc3
|
/src/day03/practice/class1/Main.java
|
60ce1ac22d447111c75aca36e4ea0ac50225cb98
|
[] |
no_license
|
somyungsub/edu-javabasic
|
b2d96d62f3a1f58a483b417cd62255ebdebb30af
|
c33ed64e239a7b4f100f77d9ef66f2b8367b7c69
|
refs/heads/master
| 2021-07-09T06:18:58.102545
| 2018-10-13T15:56:16
| 2018-10-13T15:56:16
| 135,389,030
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,131
|
java
|
package day03.practice.class1;
import java.util.Scanner;
/*
도형관련 객체 만들어보기
*/
public class Main {
public static void main(String[] args) {
/*
연습해보기! (상속x)
1. Rectangle 과 Triangle 객체를 생성하여
2. 각 객체의 가로 세로의 길이를 입력받고 넓이 구하기.
3. 가로세로의 길이는 Point 클래스에 정의하여 Rectangle과 Triangle 클래스에서 has a 관계(집합관계)를 맺어 활용합니다.
*/
Scanner scanner = new Scanner(System.in);
// 로직구현
while (true) {
System.out.print("1. 삼각형\t2. 사각형\t 이외(종료) : ");
String select = scanner.next();
// contains 메서드는 String 클래스의 메서드 입니다.
// 내용은 A문자열.contains(B문자열) -> B문자열이 A문자열에 포함되어 있으면 true 아니면 false
if (!"1,2".contains(select)) {
System.out.println("잘못 입력하여 프로그램을 종료합니다.");
break;
}
System.out.print("가로 세로 입력 EX(10 20).. : "); // 공백을 구분하여 x, y에 순차적으로 들어가집니다.
Point point = new Point(scanner.nextInt(), scanner.nextInt()); // x, y 입력 받은 Point 클래스
// 선택별 분기처리 -> 지금 같이 어떤 시점만 체크 할 때는 switch로도 가능
if ("1".equals(select)) {
// 삼각형 -> 메서드 체인을 이용 (이렇게 간단히 사용할 경우 활용 가능)
System.out.println("삼각형의 넓이 : " + new Triangle(point).area()); // 객체 생성후 바로 area메서드 호출
} else if ("2".equals(select)) {
// 사각형 -> 일반적인 방식(1.선언 2.생성 및 초기화 3.사용)
Rectangle rectangle = new Rectangle(point);
System.out.println("사각형의 넓이 : " + rectangle.area());
}
}
}
}
|
[
"gkdldy5@naver.com"
] |
gkdldy5@naver.com
|
cb3e0f09fa7f30f4f4e127910b9e544b9900dc3e
|
ef6b1db102352cd3969a840054cbd31804a4a972
|
/src/main/java/com/sishuok/jiangzh/archi/designs/decorator/demo/v2/V2MonthPrizeDecorator.java
|
481f9731f4abb62062c91517344c25d6aff7e930
|
[] |
no_license
|
woaijiadanoo/archi-project
|
c3217a20144c215d6970fcee657e86b0f1acc247
|
9acbd6bc7ff99f9a439e8849fd51a1918a143229
|
refs/heads/master
| 2023-01-01T06:58:41.585813
| 2020-10-25T14:41:38
| 2020-10-25T14:41:38
| 288,897,676
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 531
|
java
|
package com.sishuok.jiangzh.archi.designs.decorator.demo.v2;
import com.sishuok.jiangzh.archi.designs.decorator.demo.DecoratorDB;
public class V2MonthPrizeDecorator extends V2Decorator{
public V2MonthPrizeDecorator(V2Prize prize) {
super(prize);
}
/*
计算月度奖金
*/
@Override
public double calcPrize(String user) {
// 初始奖金额
double initPrize = super.calcPrize(user);
initPrize += DecoratorDB.db.get(user);
return initPrize * 0.03;
}
}
|
[
"jiangzh@sina.com"
] |
jiangzh@sina.com
|
f8d6bd07f7b111136bc1e985a34c3746b7c56d63
|
d6a624c60e3bb7c2b6aff2874b35abc3191f8260
|
/src/main/java/org/thymeleaf/processor/AttributeNameProcessorMatcher.java
|
2d2db3370e174f1826f24c2b3cb816da7854df92
|
[
"Apache-2.0"
] |
permissive
|
oliverlietz/thymeleaf
|
82e94db557225759b9cd7aea9164e7595ddf7242
|
bd9324f7140e19da9e8ebc131bbfcfc44e4cf890
|
refs/heads/2.1-master
| 2021-01-22T19:55:18.746249
| 2017-03-30T21:38:43
| 2017-03-30T21:38:43
| 29,087,551
| 0
| 0
| null | 2015-01-11T09:57:48
| 2015-01-11T09:57:48
| null |
UTF-8
|
Java
| false
| false
| 5,799
|
java
|
/*
* =============================================================================
*
* Copyright (c) 2011-2014, The THYMELEAF team (http://www.thymeleaf.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* =============================================================================
*/
package org.thymeleaf.processor;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.thymeleaf.dom.Attribute;
import org.thymeleaf.dom.Element;
import org.thymeleaf.dom.NestableAttributeHolderNode;
import org.thymeleaf.dom.Node;
import org.thymeleaf.util.Validate;
/**
*
* @author Daniel Fernández
*
* @since 2.0.0
*
*/
public final class AttributeNameProcessorMatcher implements IAttributeNameProcessorMatcher {
private final String attributeName;
private final String elementNameFilter;
private final Map<String,String> attributeValuesByNameFilter;
public AttributeNameProcessorMatcher(final String attributeName) {
this(attributeName, null, null);
}
public AttributeNameProcessorMatcher(final String attributeName, final String elementNameFilter) {
this(attributeName, elementNameFilter, null);
}
public AttributeNameProcessorMatcher(final String attributeName,
final String elementNameFilter, final String filterAttributeName, final String filterAttributeValue) {
this(attributeName, elementNameFilter, Collections.singletonMap(filterAttributeName, filterAttributeValue));
}
public AttributeNameProcessorMatcher(final String attributeName,
final String elementNameFilter, final Map<String,String> attributeValuesByNameFilter) {
super();
Validate.notEmpty(attributeName, "Attribute name cannot be null or empty");
this.attributeName = Attribute.normalizeAttributeName(attributeName);
this.elementNameFilter = Element.normalizeElementName(elementNameFilter);
if (attributeValuesByNameFilter == null || attributeValuesByNameFilter.size() == 0) {
this.attributeValuesByNameFilter = null;
} else {
final Map<String, String> newAttributeValuesByNameFilter = new HashMap<String, String>(attributeValuesByNameFilter.size() + 1, 1.0f);
newAttributeValuesByNameFilter.putAll(attributeValuesByNameFilter);
this.attributeValuesByNameFilter = Collections.unmodifiableMap(newAttributeValuesByNameFilter);
}
}
public String[] getAttributeNames(final ProcessorMatchingContext context) {
return Attribute.applyPrefixToAttributeName(this.attributeName, context.getDialectPrefix());
}
public String getElementNameFilter() {
return this.elementNameFilter;
}
public Map<String,String> getAttributeValuesByNameFilter() {
return this.attributeValuesByNameFilter;
}
public boolean matches(final Node node, final ProcessorMatchingContext context) {
if (!(node instanceof NestableAttributeHolderNode)) {
return false;
}
final NestableAttributeHolderNode attributeHolderNode = (NestableAttributeHolderNode) node;
final String prefix = context.getDialectPrefix();
if (!attributeHolderNode.hasNormalizedAttribute(prefix, this.attributeName)) {
return false;
}
if (this.elementNameFilter != null) {
if (attributeHolderNode instanceof Element) {
final Element element = (Element) attributeHolderNode;
if (!element.getNormalizedName().equals(this.elementNameFilter)) {
return false;
}
} else {
// if node is not an element (because it probably is a group of nodes, it has no
// "element/tag name", and therefore does not match if this matcher specifies one.
return false;
}
}
if (this.attributeValuesByNameFilter != null) {
for (final Map.Entry<String,String> filterAttributeEntry : this.attributeValuesByNameFilter.entrySet()) {
final String filterAttributeName = filterAttributeEntry.getKey();
final String filterAttributeValue = filterAttributeEntry.getValue();
if (!attributeHolderNode.hasAttribute(filterAttributeName)) {
if (filterAttributeValue != null) {
return false;
}
continue;
}
final String elementAttributeValue = attributeHolderNode.getAttributeValue(filterAttributeName);
if (elementAttributeValue == null) {
if (filterAttributeValue != null) {
return false;
}
} else {
if (!elementAttributeValue.equals(filterAttributeValue)) {
return false;
}
}
}
}
return true;
}
public Class<? extends NestableAttributeHolderNode> appliesTo() {
return NestableAttributeHolderNode.class;
}
}
|
[
"daniel.fernandez@11thlabs.org"
] |
daniel.fernandez@11thlabs.org
|
d4f2b60f45619f17d8ef996bfee630728b96c5d0
|
8cc1bbe55fb795b75c5e455d4bd26d0e51321575
|
/src/main/java/org/apache/ibatis/type/JdbcType.java
|
b38e8434f9886867e69bab4a8df84b1590607e62
|
[
"BSD-3-Clause",
"Apache-2.0"
] |
permissive
|
liupjie/mybatis
|
e74e034cb051144a4a57e276496147c5b09d1986
|
ba863886c3ee8b7ece58b1debb16def8e2473f27
|
refs/heads/master
| 2023-07-19T13:10:53.520255
| 2021-09-15T03:18:30
| 2021-09-15T03:18:30
| 392,498,207
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,614
|
java
|
/**
* Copyright ${license.git.copyrightYears} the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.ibatis.type;
import java.sql.Types;
import java.util.HashMap;
import java.util.Map;
/**
* @author Clinton Begin
*/
public enum JdbcType {
/*
* This is added to enable basic support for the
* ARRAY data type - but a custom type handler is still required
*/
ARRAY(Types.ARRAY),
BIT(Types.BIT),
TINYINT(Types.TINYINT),
SMALLINT(Types.SMALLINT),
INTEGER(Types.INTEGER),
BIGINT(Types.BIGINT),
FLOAT(Types.FLOAT),
REAL(Types.REAL),
DOUBLE(Types.DOUBLE),
NUMERIC(Types.NUMERIC),
DECIMAL(Types.DECIMAL),
CHAR(Types.CHAR),
VARCHAR(Types.VARCHAR),
LONGVARCHAR(Types.LONGVARCHAR),
DATE(Types.DATE),
TIME(Types.TIME),
TIMESTAMP(Types.TIMESTAMP),
BINARY(Types.BINARY),
VARBINARY(Types.VARBINARY),
LONGVARBINARY(Types.LONGVARBINARY),
NULL(Types.NULL),
OTHER(Types.OTHER),
BLOB(Types.BLOB),
CLOB(Types.CLOB),
BOOLEAN(Types.BOOLEAN),
CURSOR(-10), // Oracle
UNDEFINED(Integer.MIN_VALUE + 1000),
NVARCHAR(Types.NVARCHAR), // JDK6
NCHAR(Types.NCHAR), // JDK6
NCLOB(Types.NCLOB), // JDK6
STRUCT(Types.STRUCT),
JAVA_OBJECT(Types.JAVA_OBJECT),
DISTINCT(Types.DISTINCT),
REF(Types.REF),
DATALINK(Types.DATALINK),
ROWID(Types.ROWID), // JDK6
LONGNVARCHAR(Types.LONGNVARCHAR), // JDK6
SQLXML(Types.SQLXML), // JDK6
DATETIMEOFFSET(-155), // SQL Server 2008
TIME_WITH_TIMEZONE(Types.TIME_WITH_TIMEZONE), // JDBC 4.2 JDK8
TIMESTAMP_WITH_TIMEZONE(Types.TIMESTAMP_WITH_TIMEZONE); // JDBC 4.2 JDK8
public final int TYPE_CODE;
private static Map<Integer, JdbcType> codeLookup = new HashMap<>();
static {
for (JdbcType type : JdbcType.values()) {
codeLookup.put(type.TYPE_CODE, type);
}
}
JdbcType(int code) {
this.TYPE_CODE = code;
}
public static JdbcType forCode(int code) {
return codeLookup.get(code);
}
}
|
[
"374299590@qq.com"
] |
374299590@qq.com
|
1afbe5619364864c0411a8106e70c9408555dbc0
|
de446b31e18cf4b0ca602fedd96c2171ef232059
|
/src/test/java/com/huawei/cloudcampus/api/service/LSWStpNorthboundApiTest.java
|
50315df426278893eb8198a11823b0235f1c95c0
|
[] |
no_license
|
qqfbleach/cloud-campus-sdk
|
c2b79d194e499704b959c1f4354f9b05ff010918
|
3f0a17edd852441013696fe2ddb7997c4e248808
|
refs/heads/master
| 2022-11-24T01:37:07.757152
| 2020-02-18T12:08:56
| 2020-02-18T12:08:56
| 238,686,821
| 0
| 0
| null | 2022-11-16T09:23:44
| 2020-02-06T12:43:50
|
Java
|
UTF-8
|
Java
| false
| false
| 4,179
|
java
|
/*
* 交换机STP配置
* LSW STP配置北向接口,主要特性: · 查询交换STP配置信息 · 修改交换机STP配置 · 删除交换机STP配置
*
* OpenAPI spec version: 1.0.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.huawei.cloudcampus.api.service;
import com.huawei.cloudcampus.api.ApiException;
import com.huawei.cloudcampus.api.model.DelStpDto;
import com.huawei.cloudcampus.api.model.IncreStpDto;
import com.huawei.cloudcampus.api.model.StpDto;
import com.huawei.cloudcampus.api.model.StpResponseDto;
import java.util.UUID;
import org.junit.Test;
import org.junit.Ignore;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* API tests for LSWStpNorthboundApi
*/
@Ignore
public class LSWStpNorthboundApiTest {
private final LSWStpNorthboundApi api = new LSWStpNorthboundApi();
/**
* 全量修改站点内交换机的STP配置
*
* ## 典型场景 ## 提供配置参数的接口,修改交换机STP配置。 ## 接口功能 ## 全量修改交换机STP配置,不支持并发。 ## 接口约束 ## 该接口必须在租户内,存在交换机设备的站点内使用。
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void configTest() throws ApiException {
UUID siteId = null;
StpDto body = null;
StpResponseDto response = api.config(siteId, body);
// TODO: test validations
}
/**
* 删除站点内交换机的STP配置
*
* ## 典型场景 ## 提供配置参数的接口,删除交换机MSTP配置。 1、若只传入regionId,删除对应的MSTPregion; 2、若只传入regionId和instanceId,则删除指定regionId下的instanceId对应的mstpRegionInstance; 3、若只传入regionId和deviceId,则删除指定regionId下的regionDeviceList中的deviceId,且会删除指定regionID下,所有instance下的deviceId对应的regionInstanceDevice; 4、若传入regionId、instanceId和deviceId,只删除指定regionId下指定instanceId下的regionInstanceDevice,instanceId为0的树无法删除。 ## 接口功能 ## 删除交换机STP配置。 ## 接口约束 ## 该接口必须在租户内,存在交换机设备的站点内使用。
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void deleteTest() throws ApiException {
UUID siteId = null;
DelStpDto body = null;
StpResponseDto response = api.delete(siteId, body);
// TODO: test validations
}
/**
* 查询站点内交换机的STP配置
*
* ## 典型场景 ## 提供查询配置参数的接口,查询LSW的STP配置信息。 ## 接口功能 ## 获取STP配置。 ## 接口约束 ## 该接口必须在租户内,存在交换机设备的站点内使用。
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void getConfigTest() throws ApiException {
UUID siteId = null;
StpResponseDto response = api.getConfig(siteId);
// TODO: test validations
}
/**
* 增量修改站点内交换机的STP配置
*
* ## 典型场景 ## 提供配置参数的接口,增量修改交换机MSTP配置,根据regionId\\instanceId\\deviceId将输入的内容进行修改,未输入的内容保持不变;若要向树中加入该域未包含的设备,需要同时将该设备加入域(regionDeviceList)中。 ## 接口功能 ## 增量修改交换机STP配置。 ## 接口约束 ## 该接口必须在租户内,存在交换机设备的站点内使用。
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void increConfigTest() throws ApiException {
UUID siteId = null;
IncreStpDto body = null;
StpResponseDto response = api.increConfig(siteId, body);
// TODO: test validations
}
}
|
[
"qianqifeng@hotmail.com"
] |
qianqifeng@hotmail.com
|
461c32f2f19e8b2cd0db5bdcef4b6938eae8e542
|
4365604e3579b526d473c250853548aed38ecb2a
|
/modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/v202011/SamSessionError.java
|
3d48c16de93e31ad6162ece3a61c7f088eed7f6d
|
[
"Apache-2.0"
] |
permissive
|
lmaeda/googleads-java-lib
|
6e73572b94b6dcc46926f72dd4e1a33a895dae61
|
cc5b2fc8ef76082b72f021c11ff9b7e4d9326aca
|
refs/heads/master
| 2023-08-12T19:03:46.808180
| 2021-09-28T16:48:04
| 2021-09-28T16:48:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,177
|
java
|
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.admanager.jaxws.v202011;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for SamSessionError complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="SamSessionError">
* <complexContent>
* <extension base="{https://www.google.com/apis/ads/publisher/v202011}ApiError">
* <sequence>
* <element name="reason" type="{https://www.google.com/apis/ads/publisher/v202011}SamSessionError.Reason" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SamSessionError", propOrder = {
"reason"
})
public class SamSessionError
extends ApiError
{
@XmlSchemaType(name = "string")
protected SamSessionErrorReason reason;
/**
* Gets the value of the reason property.
*
* @return
* possible object is
* {@link SamSessionErrorReason }
*
*/
public SamSessionErrorReason getReason() {
return reason;
}
/**
* Sets the value of the reason property.
*
* @param value
* allowed object is
* {@link SamSessionErrorReason }
*
*/
public void setReason(SamSessionErrorReason value) {
this.reason = value;
}
}
|
[
"christopherseeley@users.noreply.github.com"
] |
christopherseeley@users.noreply.github.com
|
ff4cf3d3f7707831ad784cd72677f115810454a2
|
abd312d23dc919a9357392a9b6f9660c0f9aec6a
|
/lystore/src/main/java/com/store/zerone/zeronestore/ScanQrCodeGetGoods.java
|
645c206fcc3fd70d949d496b432bcf866a661db1
|
[] |
no_license
|
lxwguoba/zeroneStore06
|
7fe5d4b5e95a7b60dc13aec67b26538b4591e17f
|
27293ceaa916e0c87cd98fe875a1b9b0da92b6d1
|
refs/heads/master
| 2020-03-11T23:20:38.997235
| 2018-04-20T02:01:53
| 2018-04-20T02:01:53
| 130,318,996
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,974
|
java
|
package com.store.zerone.zeronestore;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Camera;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.uuzuche.lib_zxing.activity.CaptureActivity;
import com.uuzuche.lib_zxing.activity.CodeUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Created by on 2018/3/15 0015 10 18.
* Author LiuXingWen
*/
public class ScanQrCodeGetGoods extends AppCompatActivity {
private List list;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrscan);
initView();
// /**
// * 执行扫面Fragment的初始化操作
// */
// CaptureFragment captureFragment = new CaptureFragment();
// // 为二维码扫描界面设置定制化界面
// CodeUtils.setFragmentArgs(captureFragment, R.layout.my_camera);
// captureFragment.setAnalyzeCallback(analyzeCallback);
// /**
// * 替换我们的扫描控件
// */
// getSupportFragmentManager().beginTransaction().replace(R.id.fl_my_container, captureFragment).commit();
list = new ArrayList<String>();
Intent intent = new Intent(this, CaptureActivity.class);
startActivityForResult(intent, 520);
}
private void initView() {
Button btn= (Button) findViewById(R.id.second_button1);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ScanQrCodeGetGoods.this.finish();
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 520) {
//处理扫描结果(在界面上显示)
if (null != data) {
Bundle bundle = data.getExtras();
if (bundle == null) {
return;
}
if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) {
String result = bundle.getString(CodeUtils.RESULT_STRING);
list.add(result);
Toast.makeText(this, "解析结果:" + result, Toast.LENGTH_LONG).show();
} else if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_FAILED) {
Toast.makeText(ScanQrCodeGetGoods.this, "解析二维码失败", Toast.LENGTH_LONG).show();
}
}
Message ms=new Message();
ms.what=10;
mHandler.sendMessage(ms);
}
}
/**
*
* 二维码解析回调函数
*
*/
CodeUtils.AnalyzeCallback analyzeCallback = new CodeUtils.AnalyzeCallback() {
@Override
public void onAnalyzeSuccess(Bitmap mBitmap, String result) {
Toast.makeText(ScanQrCodeGetGoods.this, result, Toast.LENGTH_LONG).show();
// Intent resultIntent = new Intent();
// Bundle bundle = new Bundle();
// bundle.putInt(CodeUtils.RESULT_TYPE, CodeUtils.RESULT_SUCCESS);
// bundle.putString(CodeUtils.RESULT_STRING, result);
// resultIntent.putExtras(bundle);
// ScanQR.this.setResult(RESULT_OK, resultIntent);
// ScanQR.this.finish();
}
@Override
public void onAnalyzeFailed() {
Intent resultIntent = new Intent();
Bundle bundle = new Bundle();
bundle.putInt(CodeUtils.RESULT_TYPE, CodeUtils.RESULT_FAILED);
bundle.putString(CodeUtils.RESULT_STRING, "");
resultIntent.putExtras(bundle);
ScanQrCodeGetGoods.this.setResult(RESULT_OK, resultIntent);
ScanQrCodeGetGoods.this.finish();
}
};
Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what){
case 10:
Intent intent = new Intent(ScanQrCodeGetGoods.this, CaptureActivity.class);
startActivityForResult(intent, 520);
break;
}
}
};
// Runnable runnable = new Runnable() {
//
// @Override
// public void run() {
// // handler自带方法实现定时器
// try {
// Thread.sleep(1000);
// } catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// System.out.println("exception...");
// }
// }
// };
}
|
[
"liuxingwen_0511@163.com"
] |
liuxingwen_0511@163.com
|
3c4aae1711a9ac6f3f7f818f6673a93c836e64c6
|
23de2c10f72a30ade795ac8d4d7923036c575de5
|
/src/com/google/android/gms/internal/dj.java
|
8dcc0c30cf35585c90be02305b55226c1f7ec4a6
|
[] |
no_license
|
PARTHIBANMS/com.divmob.doodlebubble
|
a2c179ad9aa762668c69c0302bb17958e895148e
|
4718ee64c5edc9bcfc95861754ad9b876bd7fd5d
|
refs/heads/master
| 2020-06-04T22:30:50.560385
| 2014-07-17T10:39:23
| 2014-07-17T10:39:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,735
|
java
|
package com.google.android.gms.internal;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import java.util.List;
import java.util.Map;
public abstract interface dj
extends IInterface
{
public abstract void a(Map paramMap, long paramLong, String paramString, List<di> paramList)
throws RemoteException;
public abstract void bk()
throws RemoteException;
public abstract String getVersion()
throws RemoteException;
public static abstract class a
extends Binder
implements dj
{
public static dj r(IBinder paramIBinder)
{
if (paramIBinder == null) {
return null;
}
IInterface localIInterface = paramIBinder.queryLocalInterface("com.google.android.gms.analytics.internal.IAnalyticsService");
if ((localIInterface != null) && ((localIInterface instanceof dj))) {
return (dj)localIInterface;
}
return new a(paramIBinder);
}
public boolean onTransact(int paramInt1, Parcel paramParcel1, Parcel paramParcel2, int paramInt2)
throws RemoteException
{
switch (paramInt1)
{
default:
return super.onTransact(paramInt1, paramParcel1, paramParcel2, paramInt2);
case 1598968902:
paramParcel2.writeString("com.google.android.gms.analytics.internal.IAnalyticsService");
return true;
case 1:
paramParcel1.enforceInterface("com.google.android.gms.analytics.internal.IAnalyticsService");
a(paramParcel1.readHashMap(getClass().getClassLoader()), paramParcel1.readLong(), paramParcel1.readString(), paramParcel1.createTypedArrayList(di.CREATOR));
paramParcel2.writeNoException();
return true;
case 2:
paramParcel1.enforceInterface("com.google.android.gms.analytics.internal.IAnalyticsService");
bk();
paramParcel2.writeNoException();
return true;
}
paramParcel1.enforceInterface("com.google.android.gms.analytics.internal.IAnalyticsService");
String str = getVersion();
paramParcel2.writeNoException();
paramParcel2.writeString(str);
return true;
}
private static class a
implements dj
{
private IBinder ky;
a(IBinder paramIBinder)
{
this.ky = paramIBinder;
}
public void a(Map paramMap, long paramLong, String paramString, List<di> paramList)
throws RemoteException
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
try
{
localParcel1.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
localParcel1.writeMap(paramMap);
localParcel1.writeLong(paramLong);
localParcel1.writeString(paramString);
localParcel1.writeTypedList(paramList);
this.ky.transact(1, localParcel1, localParcel2, 0);
localParcel2.readException();
return;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
public IBinder asBinder()
{
return this.ky;
}
public void bk()
throws RemoteException
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
try
{
localParcel1.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
this.ky.transact(2, localParcel1, localParcel2, 0);
localParcel2.readException();
return;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
public String getVersion()
throws RemoteException
{
Parcel localParcel1 = Parcel.obtain();
Parcel localParcel2 = Parcel.obtain();
try
{
localParcel1.writeInterfaceToken("com.google.android.gms.analytics.internal.IAnalyticsService");
this.ky.transact(3, localParcel1, localParcel2, 0);
localParcel2.readException();
String str = localParcel2.readString();
return str;
}
finally
{
localParcel2.recycle();
localParcel1.recycle();
}
}
}
}
}
/* Location: C:\Users\PARTHIBAN\Desktop\source\dex2jar-0.0.9.15\classes_dex2jar.jar
* Qualified Name: com.google.android.gms.internal.dj
* JD-Core Version: 0.7.0.1
*/
|
[
"bsauniv30@BSAs-iMac-93.local"
] |
bsauniv30@BSAs-iMac-93.local
|
e1a704bfcd75ebc73925252bbae4ad579fea39a0
|
e68bbc077e62033e90d15886f4a858e2eaf5bf78
|
/adapter_pattern/src/TurkeyAdapter.java
|
dd45d3f8eeb86cd7d67d454b28dbd3ad2adaa796
|
[] |
no_license
|
datadiskpfv/java_reference
|
eba22583c3e5298040015898174fe0b84fa48b76
|
8ec37dc0e4447a046e0d4b5dedbff897cd093fe7
|
refs/heads/master
| 2021-01-19T16:35:22.383117
| 2017-07-08T16:44:59
| 2017-07-08T16:44:59
| 88,274,962
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 351
|
java
|
/**
* Created by vallep on 02/07/2017.
*/
public class TurkeyAdapter implements Duck {
Turkey turkey;
public TurkeyAdapter(Turkey turkey) {
this.turkey = turkey;
}
public void quack() {
turkey.gobble();
}
public void fly() {
for (int i = 0; i < 5; i++) {
turkey.fly();
}
}
}
|
[
"paul.valle@datadisk.co.uk"
] |
paul.valle@datadisk.co.uk
|
12ed91fe7ab25c71a5ec1fb30d89adf8c4cb1788
|
91adc264eb26be39c656f054005ec740d07900bd
|
/easthope_project/ehpta/src/private/nc/bs/pub/action/N_HQ13_SAVE.java
|
c2d503455dbc8069498c347b0959f5240255ac72
|
[] |
no_license
|
xhrise/nc-workspaces
|
9f30caf273e932bd1b4c2d419ac6bef4ef55e1cc
|
d5fcbce810ba4d4b5405edabfb5a26c36a19e7f8
|
refs/heads/master
| 2020-05-19T10:43:29.058686
| 2013-06-20T02:40:27
| 2013-06-20T02:40:27
| 37,459,512
| 0
| 1
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,899
|
java
|
package nc.bs.pub.action;
import nc.vo.pub.pf.PfUtilActionVO;
import nc.bs.pub.compiler.*;
import nc.vo.pub.compiler.PfParameterVO;
import java.math.*;
import java.util.*;
import nc.vo.pub.lang.*;
import nc.bs.pub.pf.PfUtilTools;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.BusinessException;
import nc.vo.uap.pf.PFBusinessException;
/**
* 备注:仓储装卸费结算的提交
单据动作执行中的动态执行类的动态执行类。
*
* 创建日期:(2012-9-17)
* @author 平台脚本生成
*/
public class N_HQ13_SAVE extends AbstractCompiler2 {
private java.util.Hashtable m_methodReturnHas=new java.util.Hashtable();
private Hashtable m_keyHas=null;
/**
* N_HQ13_SAVE 构造子注解。
*/
public N_HQ13_SAVE() {
super();
}
/*
* 备注:平台编写规则类
* 接口执行类
*/
public Object runComClass(PfParameterVO vo) throws BusinessException {
try{
super.m_tmpVo=vo;
//####本脚本必须含有返回值,返回DLG和PNL的组件不允许有返回值####
Object retObj =runClass( "nc.bs.trade.comstatus.BillCommit", "commitBill", "nc.vo.pub.AggregatedValueObject:01",vo,m_keyHas,m_methodReturnHas);
return retObj;
} catch (Exception ex) {
if (ex instanceof BusinessException)
throw (BusinessException) ex;
else
throw new PFBusinessException(ex.getMessage(), ex);
}
}
/*
* 备注:平台编写原始脚本
*/
public String getCodeRemark(){
return " //####本脚本必须含有返回值,返回DLG和PNL的组件不允许有返回值####\n Object retObj =runClassCom@ \"nc.bs.trade.comstatus.BillCommit\", \"commitBill\", \"nc.vo.pub.AggregatedValueObject:01\"@;\n return retObj;\n";}
/*
* 备注:设置脚本变量的HAS
*/
private void setParameter(String key,Object val) {
if (m_keyHas==null){
m_keyHas=new Hashtable();
}
if (val!=null) {
m_keyHas.put(key,val);
}
}
}
|
[
"comicme_yanghe@126.com"
] |
comicme_yanghe@126.com
|
b58a2703d5a2803ae0769d5570e2aa165f4e4e9b
|
82f148d0b2dbd80fbcb70f8c4b4ccecc861bebb2
|
/src/net/ko/http/views/KobjectHttpAbstractForm.java
|
07fd39f16411f0464813fcada4c57c2b30bf961b
|
[] |
no_license
|
jcheron/kobject
|
7f9b5b36cb2ec89b09989e7468bcacce32ce39d5
|
f6c7f750da7e70a4a5ec6914963e9dc10d8b3cd3
|
refs/heads/master
| 2021-01-10T18:01:35.379173
| 2016-03-24T18:37:26
| 2016-03-24T18:37:26
| 43,245,845
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,360
|
java
|
package net.ko.http.views;
import javax.servlet.http.HttpServletRequest;
import net.ko.dao.IGenericDao;
import net.ko.db.KDataBase;
import net.ko.displays.KObjectDisplay;
import net.ko.framework.Ko;
import net.ko.http.objects.KRequest;
import net.ko.kobject.KConstraint;
import net.ko.kobject.KConstraintHasAndBelongsToMany;
import net.ko.kobject.KConstraintHasMany;
import net.ko.kobject.KConstraintHasManyBelongsTo;
import net.ko.kobject.KListObject;
import net.ko.kobject.KObject;
public abstract class KobjectHttpAbstractForm<T extends KObject> extends
KobjectHttpAbstractView<T> {
public KobjectHttpAbstractForm(T ko, HttpServletRequest request) {
super(ko, request);
}
@Override
protected KObjectDisplay getKobjectDisplay() {
KObjectDisplay koDisplay = null;
if (ko != null) {
Class<? extends KObject> clazz = ko.getClass();
koDisplay = Ko.koDisplays.get(clazz.getSimpleName());
if (koDisplay == null)
koDisplay = Ko.defaultKoDisplay();
} else
koDisplay = Ko.defaultKoDisplay();
return koDisplay;
}
public KHttpListForm addHttpListForm(String member, boolean readonly) {
return addHttpListForm(member, false, readonly);
}
@SuppressWarnings("unchecked")
public KHttpListForm addHttpListForm(String member, boolean allValues, boolean readonly) {
KHttpListForm klistform = null;
boolean many = false;
if (ko != null) {
try {
KConstraint koConstraint = null;
koConstraint = ko.getConstraints().getConstraint(member);
if (koConstraint != null) {
many = koConstraint.getClass().equals(KConstraintHasManyBelongsTo.class);
KListObject<KObject> kl = (KListObject<KObject>) ko.getAttribute(member);
if (kl == null) {
IGenericDao<T> dao = (IGenericDao<T>) Ko.getDao(ko.getClass());
dao.read(ko);
dao.close();
// ko.loadOne(KoHttp.kdatabase());
kl = (KListObject<KObject>) ko.getAttribute(member);
}
if (kl != null) {
if (many && allValues) {
KConstraintHasManyBelongsTo cbt = (KConstraintHasManyBelongsTo) koConstraint;
klistform = new KHttpListForm(kl, request, member, cbt);
} else {
klistform = new KHttpListForm(kl, request, member);
if (koConstraint != null && koConstraint instanceof KConstraintHasMany)
klistform.setcHasMany((KConstraintHasMany) koConstraint);
}
klistform.setReadonly(readonly);
klistform.init();
klistform.setAllValues(allValues);
klistform.setId(member);
klistform.setHasFieldSet(false);
klistform.setInnerForm(true);
String fkField = koConstraint.getDestFieldKey();
String pkField = koConstraint.getFieldKey();
klistform.addWhere(fkField, ko.getAttribute(pkField) + "");
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
return klistform;
}
/**
* Retourne une KPageList correspondant à une KListObject membre associée à
* une relation hasMany Le mode d'affichage par défaut de la liste est dans
* ce cas pris dans les paramètres de la requête
*
* @param member
* membre de données de la classe de l'objet ko de type
* KListObject définit par une relation de type
* hasAndBelongsToMany
* @return Liste des objets en relation (hasAndBelongsToMany) affichés dans
* une KPageList
*/
public KPageList hasAndBelongsToManyList(String member) {
return hasAndBelongsToManyList(member, KRequest.GETPOST("_mode", request, 1));
}
/**
* Retourne une KPageList correspondant à une KListObject membre associée à
* une relation hasAndBelongsToMany
*
* @param member
* membre de données de la classe de l'objet ko de type
* KListObject définit par une relation de type
* hasAndBelongsToMany
* @param mode
* définit le mode d'affichage (1 pour liste, 2 pour formulaire,
* 3 pour mise à jour et affichage de message)
* @return Liste des objets en relation (hasAndBelongsToMany) affichés dans
* une KPageList
*/
@SuppressWarnings("unchecked")
public KPageList hasAndBelongsToManyList(String member, int mode) {
KPageList kpage = null;
if (ko != null) {
KConstraint koConstraint = ko.getConstraints().getConstraint(member, KConstraintHasAndBelongsToMany.class);
if (koConstraint != null) {
try {
kpage = new KPageList(koConstraint.getClazz(), request, "", "", mode);
kpage.setDao(dao);
if (kpage.getMode() == 1) {
KDataBase db = dao.getDatabase();
if (db != null) {
koConstraint.load(db);
db.close();
}
KListObject<KObject> kl = (KListObject<KObject>) ko.getAttribute(member);
if (kl != null)
kpage.setValue(kl.getKeyValuesForHasAndBelongsToMany(";"));
}
kpage.setFormModal(false);
kpage.setEditable(true);
kpage.setHasAddBtn(false);
String tableName = ko.getSimpleTableName();
String fkField = koConstraint.getFkField();
kpage.removeField(tableName);
kpage.removeField(fkField);
if (kpage.getForm() != null) {
kpage.formRemoveFieldControl(fkField);
kpage.formRemoveFieldControl(tableName);
}
kpage.setName(member);
kpage.setId(member);
kpage.removeFieldControl("_filtre");
kpage.removeFieldControl("_navBarre");
kpage.removeFieldControl("_pageCounter");
kpage.setLoaded(true);
kpage.setChecked(true);
} catch (Exception e) {
}
}
}
return kpage;
}
/**
* Retourne une KPageList correspondant à une KListObject membre associée à
* une relation hasMany
*
* @param member
* membre de données de la classe de l'objet ko de type
* KListObject définit par une relation de type hasMany
* @return Liste des objets en relation (hasMany) affichés dans une
* KPageList
*/
public KPageList hasManyList(String member) {
return hasManyList(member, true);
}
/**
* Retourne une KPageList correspondant à une KListObject membre associée à
* une relation hasMany
*
* @param member
* membre de données de la classe de l'objet ko de type
* KListObject définit par une relation de type hasMany
* @param addBtn
* vrai si la liste doit afficher un bouton ajouter
* @return Liste des objets en relation (hasMany) affichés dans une
* KPageList
*/
public KPageList hasManyList(String member, boolean addBtn) {
KPageList kpage = null;
if (ko != null) {
KConstraint koConstraint = ko.getConstraints().getConstraint(member, KConstraintHasMany.class);
if (koConstraint != null) {
try {
kpage = new KPageList(koConstraint.getClazz(), request, koConstraint.getSql(getDao().quote()));
kpage.setFormModal(false);
kpage.setEditable(true);
kpage.setHasAddBtn(addBtn);
String tableName = ko.getSimpleTableName();
String fkField = koConstraint.getFkField();
kpage.removeField(tableName);
kpage.removeField(fkField);
if (kpage.getForm() != null) {
kpage.formRemoveFieldControl(fkField);
kpage.formRemoveFieldControl(tableName);
}
kpage.removeFieldControl("_filtre");
kpage.removeFieldControl("_navBarre");
kpage.removeFieldControl("_pageCounter");
kpage.setLoaded(true);
} catch (Exception e) {
}
}
}
return kpage;
}
}
|
[
"myaddressmail@gmail.com"
] |
myaddressmail@gmail.com
|
160c5520522d8fcda223a1dac2a649b5ed25ee9a
|
794473ff2ba2749db9c0782f5d281b00dd785a95
|
/.svn/pristine/02/027c2f433867a9c40e3f18910260d99f10d1f80a.svn-base
|
8d253711cd9155df935a200d95b65be1e25761cd
|
[] |
no_license
|
hexilei/qbt
|
a0fbc9c1870da1bf1ec24bba0f508841ca1b9750
|
040e5fcc9fbb27d52712cc1678d71693b5c85cce
|
refs/heads/master
| 2021-05-05T23:03:20.377229
| 2018-01-12T03:33:12
| 2018-01-12T03:33:12
| 116,363,833
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,143
|
package com.qbt.common.spring.resolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
import com.qbt.common.logback.LogCvt;
public class MySimpleMappingExceptionResolver extends SimpleMappingExceptionResolver{
/**
* 全局异常处理
* @Title: doResolveException
* @Description: TODO
* @author: share 2014年10月11日
* @modify: share 2014年10月11日
* @param @param request
* @param @param response
* @param @param handler
* @param @param ex
* @param @return
* @throws
* @see org.springframework.web.servlet.handler.SimpleMappingExceptionResolver#doResolveException(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, java.lang.Exception)
*/
protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
{
LogCvt.error("Spring 全局异常捕获:", ex);
return null;
}
}
|
[
"louis.he@missionsky.com"
] |
louis.he@missionsky.com
|
|
2d1e83ed4d807f05180a0e91ae606b33cb222ce1
|
b7d00d4cce06fd692aa3b45d9fd269b61c7b4421
|
/ajah-spring-mvc/src/main/java/com/ajah/spring/mvc/AjahDispatcherServlet.java
|
b1952f83eb222368cd59b20632beed3254d6780f
|
[
"Apache-2.0"
] |
permissive
|
efsavage/ajah
|
6aeb210230b91e43418909df7ceae23a3aa72be0
|
8d6c0233061a185194c742c58b6b4158210dc23d
|
refs/heads/master
| 2022-10-04T13:15:34.548378
| 2020-02-12T03:18:15
| 2020-02-12T03:18:15
| 1,445,299
| 2
| 2
|
Apache-2.0
| 2022-09-01T22:57:08
| 2011-03-06T04:00:15
|
Java
|
UTF-8
|
Java
| false
| false
| 264
|
java
|
package com.ajah.spring.mvc;
import org.springframework.web.servlet.DispatcherServlet;
/**
* Entry point for SpringMVC webapps.
*
* @author Eric F. Savage <code@efsavage.com>
*
*/
public class AjahDispatcherServlet extends DispatcherServlet {
// Empty
}
|
[
"code@efsavage.com"
] |
code@efsavage.com
|
1bb1944802f0f7fd9c65b563cd65b699905c05b6
|
9a9fcafa9bbc28c9f1930e01c46af8f023955aea
|
/JavaEE就业班面向对象IO阶段/day03/day03/code/day03/src/cn/itcast/ligangtest/LiGang.java
|
4531c721f4c68ebbc4c4562335f633a4177d6452
|
[] |
no_license
|
zhengbingyanbj/JavaSE
|
84cd450ef5525050809c78a8b6660b9495c072db
|
671ac02dcafe81d425c3c191c313b6040e8ae557
|
refs/heads/master
| 2021-09-01T18:20:49.082475
| 2017-12-28T07:13:30
| 2017-12-28T07:13:30
| 115,139,599
| 0
| 0
| null | null | null | null |
WINDOWS-1252
|
Java
| false
| false
| 215
|
java
|
package cn.itcast.ligangtest;
public class LiGang extends LiGangDie{
int age = 25;
public void teach(){
System.out.println("½Ìlol");
}
public void playGame(){
System.out.println("Íæ LOL");
}
}
|
[
"zhengbingyanbj@163.com"
] |
zhengbingyanbj@163.com
|
72b79af98fef2b6d0b59e920832095155bbe325d
|
784420293504203e0485674947e252b9a884f9cf
|
/asciidoctor-editor-plugin/src/main/java-eclipse/de/jcup/asciidoctoreditor/document/VariableDefKeyWordDetector.java
|
baa0705e3d7c03b809fd824765589dc95ce464b7
|
[
"Apache-2.0"
] |
permissive
|
de-jcup/eclipse-asciidoctor-editor
|
db5515421613e8ccfec749318fb6366b1f838e76
|
5dbbb4fdeac0634eec94c1cb6773246457ac2c3f
|
refs/heads/master
| 2023-02-16T00:20:39.858165
| 2023-02-10T21:52:39
| 2023-02-10T21:52:54
| 125,332,958
| 49
| 18
|
NOASSERTION
| 2022-08-21T23:26:15
| 2018-03-15T08:06:29
|
Java
|
UTF-8
|
Java
| false
| false
| 1,135
|
java
|
/*
* Copyright 2017 Albert Tregnaghi
*
* 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 de.jcup.asciidoctoreditor.document;
import org.eclipse.jface.text.rules.IWordDetector;
public class VariableDefKeyWordDetector implements IWordDetector {
@Override
public boolean isWordStart(char c) {
if (!Character.isLetter(c)) {
return false;
}
return true;
}
@Override
public boolean isWordPart(char c) {
if (c == '=') {
return true;
}
if (!Character.isLetter(c)) {
return false;
}
return true;
}
}
|
[
"albert.tregnaghi@gmail.com"
] |
albert.tregnaghi@gmail.com
|
86639b93aa3d393d6ed9def67317f3b8f042c80e
|
0f11a58f4f8957d611e03b6a7ba200105332bcca
|
/oiscn-carepath/src/main/java/com/varian/oiscn/carepath/assembler/ActivityInstanceDueDateComparator.java
|
7add3d346b08c557f7fe3376f46cdea6c1713e42
|
[] |
no_license
|
yugezi-gjw/SDCH-server-release-2
|
955c82dac6c888c2c69e80146476245607af1237
|
d78aa8a0ee0376aaf688201688ef009ec4179b65
|
refs/heads/master
| 2020-03-25T04:11:43.980187
| 2018-08-03T07:04:45
| 2018-08-03T07:04:45
| 143,382,229
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,170
|
java
|
package com.varian.oiscn.carepath.assembler;
import com.varian.oiscn.core.carepath.ActivityInstance;
import java.util.Comparator;
import java.util.Date;
import static org.apache.http.util.TextUtils.isEmpty;
/**
* Created by gbt1220 on 7/19/2017.
*/
public class ActivityInstanceDueDateComparator implements Comparator<ActivityInstance> {
@Override
public int compare(ActivityInstance firstInstance, ActivityInstance secondInstance) {
if (isEmpty(firstInstance.getInstanceID())) {
return -1;
} else if (isEmpty(secondInstance.getInstanceID())) {
return 1;
} else {
Date tmpDate = new Date();
Date dueDateOfFirstInstance = firstInstance.getDueDateOrScheduledStartDate();
if(dueDateOfFirstInstance == null){
dueDateOfFirstInstance = tmpDate;
}
Date dueDateOfSecondInstance = secondInstance.getDueDateOrScheduledStartDate();
if(dueDateOfSecondInstance == null){
dueDateOfSecondInstance = tmpDate;
}
return dueDateOfFirstInstance.compareTo(dueDateOfSecondInstance);
}
}
}
|
[
"gbt1220@varian.com"
] |
gbt1220@varian.com
|
5b3951379291f6c75186fe18561f84dd9c0e79a2
|
019c6c620cc43663f95e6caea075dbecbf15b165
|
/pcap4j-core/src/main/java/org/pcap4j/packet/IllegalIpV6RoutingData.java
|
5b48cf73ad8b7f52afa24e1845647c15f2ec42aa
|
[
"MIT"
] |
permissive
|
Mehrkat/pcap4j
|
280d5881e744382ecb587c9e5295d47ea0eec933
|
ebdd6560eea080397b461c04cec38094e015b361
|
refs/heads/master
| 2020-12-11T07:33:59.370775
| 2015-06-09T05:49:05
| 2015-06-09T05:49:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,118
|
java
|
/*_##########################################################################
_##
_## Copyright (C) 2012-2014 Pcap4J.org
_##
_##########################################################################
*/
package org.pcap4j.packet;
import java.util.Arrays;
import org.pcap4j.packet.IpV6ExtRoutingPacket.IpV6RoutingData;
import org.pcap4j.util.ByteArrays;
/**
* @author Kaito Yamada
* @since pcap4j 0.9.11
*/
public final class IllegalIpV6RoutingData implements IpV6RoutingData {
/**
*
*/
private static final long serialVersionUID = -6359533865311266265L;
private final byte[] rawData;
/**
* A static factory method.
* This method validates the arguments by {@link ByteArrays#validateBounds(byte[], int, int)},
* which may throw exceptions undocumented here.
*
* @param rawData
* @param offset
* @param length
* @return a new IllegalIpV6RoutingData object.
*/
public static IllegalIpV6RoutingData newInstance(byte[] rawData, int offset, int length) {
ByteArrays.validateBounds(rawData, offset, length);
return new IllegalIpV6RoutingData(rawData, offset, length);
}
private IllegalIpV6RoutingData(byte[] rawData, int offset, int length) {
this.rawData = new byte[length];
System.arraycopy(rawData, offset, this.rawData, 0, length);
}
@Override
public int length() { return rawData.length; }
@Override
public byte[] getRawData() {
byte[] copy = new byte[rawData.length];
System.arraycopy(rawData, 0, copy, 0, rawData.length);
return copy;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[illegal data: ")
.append(ByteArrays.toHexString(rawData, ""))
.append("]");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (obj == this) { return true; }
if (!this.getClass().isInstance(obj)) { return false; }
IllegalIpV6RoutingData other = (IllegalIpV6RoutingData)obj;
return Arrays.equals(other.rawData, rawData);
}
@Override
public int hashCode() {
return Arrays.hashCode(rawData);
}
}
|
[
"kaitoy@pcap4j.org"
] |
kaitoy@pcap4j.org
|
4bf90fd3b507816c1a740d8facbd591a1a4d9713
|
baba7ae4f32f0e680f084effcd658890183e7710
|
/Studies/JAccounting/src/com/spaceprogram/accounting/model/CustomerInvoice.java
|
01ebe8a701f6f44b97a52995244870dcedf71335
|
[] |
no_license
|
TUBS-ISF/MutationAnalysisForDBC-FormaliSE21
|
75972c823c3c358494d2a2e9ec12e0a00e26d771
|
de825bc9e743db851f5ec1c5133dca3f04d20bad
|
refs/heads/main
| 2023-04-22T21:29:28.165271
| 2021-05-17T07:43:22
| 2021-05-17T07:43:22
| 368,096,901
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 458
|
java
|
package com.spaceprogram.accounting.model;
/**
* @author Travis Reeder - travis@spaceprogram.com
* Date: Nov 17
* @author 2003
* Time: 12:59:40 PM
* @version 0.1
*/
public class CustomerInvoice extends CompanyCheck{
Integer id;
protected String perform2() throws Exception {
return SUCCESS;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
|
[
"a.knueppel@tu-bs.de"
] |
a.knueppel@tu-bs.de
|
136000812c8ea5a9a5424dcfe01a52f1132ca849
|
62aaa67a468107022635b566cbcf1109d3e4e648
|
/srgk/src/client/nc/ui/hkjt/srgk/huiguan/tiaozheng/ace/handler/AceOrgChangeHandler.java
|
6f79810ec262b60384f594768db5d2337b7ff7ca
|
[] |
no_license
|
boblee821226/hongkun
|
f17a90221683f816f382443f5c223347b41afefc
|
46c02ab124924f2c976044c5f31e632f706e61cf
|
refs/heads/master
| 2021-06-25T03:57:28.516510
| 2021-02-22T05:42:07
| 2021-02-22T05:42:07
| 204,677,636
| 1
| 1
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,070
|
java
|
package nc.ui.hkjt.srgk.huiguan.tiaozheng.ace.handler;
import nc.ui.pubapp.uif2app.event.IAppEventHandler;
import nc.ui.pubapp.uif2app.event.OrgChangedEvent;
import nc.ui.pubapp.uif2app.view.BillForm;
import nc.ui.pubapp.uif2app.view.util.BillPanelUtils;
import nc.vo.uif2.LoginContext;
/**
* <b> 组织切换事件 </b>
*
* @author author
* @version tempProject version
*/
public class AceOrgChangeHandler implements IAppEventHandler<OrgChangedEvent> {
private BillForm billForm;
@Override
public void handleAppEvent(OrgChangedEvent e) {
if (this.billForm.isEditable()) {
// 在编辑状态下,主组织切换时,清空界面数据,自动表体增行,并设置行号
this.billForm.addNew();
}
LoginContext context = this.billForm.getModel().getContext();
// 进行参照过滤
BillPanelUtils.setOrgForAllRef(this.billForm.getBillCardPanel(),
context);
}
public BillForm getBillForm() {
return billForm;
}
public void setBillForm(BillForm billForm) {
this.billForm = billForm;
}
}
|
[
"441814246@qq.com"
] |
441814246@qq.com
|
886a6748730810f5cdffe47c7ad36359e3370fdc
|
104cda8eafe0617e2a5fa1e2b9f242d78370521b
|
/aliyun-java-sdk-vod/src/main/java/com/aliyuncs/vod/model/v20170321/DeleteVodDomainRequest.java
|
8e6c6dfe541ae958808270689273916710786264
|
[
"Apache-2.0"
] |
permissive
|
SanthosheG/aliyun-openapi-java-sdk
|
89f9b245c1bcdff8dac0866c36ff9a261aa40684
|
38a910b1a7f4bdb1b0dd29601a1450efb1220f79
|
refs/heads/master
| 2020-07-24T00:00:59.491294
| 2019-09-09T23:00:27
| 2019-09-11T04:29:56
| 207,744,099
| 2
| 0
|
NOASSERTION
| 2019-09-11T06:55:58
| 2019-09-11T06:55:58
| null |
UTF-8
|
Java
| false
| false
| 2,501
|
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.vod.model.v20170321;
import com.aliyuncs.RpcAcsRequest;
/**
* @author auto create
* @version
*/
public class DeleteVodDomainRequest extends RpcAcsRequest<DeleteVodDomainResponse> {
public DeleteVodDomainRequest() {
super("vod", "2017-03-21", "DeleteVodDomain", "vod");
}
private String securityToken;
private String ownerAccount;
private String domainName;
private Long ownerId;
public String getBizSecurityToken() {
return this.securityToken;
}
public void setBizSecurityToken(String securityToken) {
this.securityToken = securityToken;
if(securityToken != null){
putQueryParameter("SecurityToken", securityToken);
}
}
/**
* @deprecated use getBizSecurityToken instead of this.
*/
@Deprecated
public String getSecurityToken() {
return this.securityToken;
}
/**
* @deprecated use setBizSecurityToken instead of this.
*/
@Deprecated
public void setSecurityToken(String securityToken) {
this.securityToken = securityToken;
if(securityToken != null){
putQueryParameter("SecurityToken", securityToken);
}
}
public String getOwnerAccount() {
return this.ownerAccount;
}
public void setOwnerAccount(String ownerAccount) {
this.ownerAccount = ownerAccount;
if(ownerAccount != null){
putQueryParameter("OwnerAccount", ownerAccount);
}
}
public String getDomainName() {
return this.domainName;
}
public void setDomainName(String domainName) {
this.domainName = domainName;
if(domainName != null){
putQueryParameter("DomainName", domainName);
}
}
public Long getOwnerId() {
return this.ownerId;
}
public void setOwnerId(Long ownerId) {
this.ownerId = ownerId;
if(ownerId != null){
putQueryParameter("OwnerId", ownerId.toString());
}
}
@Override
public Class<DeleteVodDomainResponse> getResponseClass() {
return DeleteVodDomainResponse.class;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
6e6d0b546a50dc56d6207298a670fccca0b6cc15
|
4e1689e4ca255a2219c71d3705a821755b6ef83e
|
/deya/src/com/deya/license/tools/MacAddress.java
|
c1336bfbe5b26946452a92eb5e918bccd41a49ba
|
[] |
no_license
|
373974360/oldCms
|
2578a53aafa93ea12a3188ea4a3d52f8c0d75a72
|
5c1e8a158273ad408a5b92f7458b6b4a070d7ab3
|
refs/heads/master
| 2020-12-30T07:41:03.640662
| 2019-07-26T07:44:39
| 2019-07-26T07:44:39
| 238,907,158
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,218
|
java
|
package com.deya.license.tools;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MacAddress {
private static final String[] windowsCommand = {"ipconfig", "/all"};
private static final String[] linuxCommand = {"/sbin/ifconfig", "-a"};
private static final Pattern macPattern = Pattern.compile(".*((:?[0-9a-f]{2}[-:]){5}[0-9a-f]{2}).*", 2);
private static final List<String> getMacAddressList() throws IOException {
ArrayList macAddressList = new ArrayList();
String os = System.getProperty("os.name");
String[] command;
if (os.startsWith("Windows")) {
command = windowsCommand;
} else {
if (os.startsWith("Linux"))
command = linuxCommand;
else
throw new IOException("Unknown operating system: " + os);
}
Process process = Runtime.getRuntime().exec(command);
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
for (String line = null; (line = reader.readLine()) != null; ) {
Matcher matcher = macPattern.matcher(line);
if (!matcher.matches())
continue;
macAddressList.add(matcher.group(1).replaceAll("[-:]", ""));
}
reader.close();
return macAddressList;
}
public static String getMacAddress() {
try {
List addressList = getMacAddressList();
StringBuffer sb = new StringBuffer();
for (Iterator iter = addressList.iterator(); iter.hasNext(); ) {
sb.append((String) iter.next());
}
return sb.toString();
} catch (IOException e) {
}
return null;
}
public static final void main(String[] args) {
try {
//System.out.println(" MAC Address: " + getMacAddress());
} catch (Throwable t) {
t.printStackTrace();
}
}
}
|
[
"373974360@qq.com"
] |
373974360@qq.com
|
cf9f5f46a999df9983443b3ddc2bdaecf9c49f5f
|
d19dc7e85ccddd789add06e741e8e0865fce9a76
|
/javabasic/day09-code/src/cn/itcast/day09/demo04/Demo01ExtendsMethod.java
|
3e9e6e160c5c5a8ed6179b8f8467503617719ac5
|
[] |
no_license
|
sjtuwyf/java-basic-code
|
6cd7b812cf1e221077c551368b3260ea6d2c9ae2
|
51047c659f66099937e095597c7e71cf726f1ff0
|
refs/heads/main
| 2023-03-31T13:32:59.573720
| 2021-04-04T04:07:41
| 2021-04-04T04:07:41
| 342,221,770
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 216
|
java
|
package cn.itcast.day09.demo04;
public class Demo01ExtendsMethod {
public static void main(String[] args) {
Zi zi = new Zi();
zi.methodZi();
zi.methodFu();
zi.method();
}
}
|
[
"sjtuwyf@126.com"
] |
sjtuwyf@126.com
|
af0fd2eadb8bc6d49f0752fd7532c4f2404e7a71
|
358588de52a2ad83dc30418b0b022ba121d060db
|
/src/test/java/com/victormeng/leetcode/house_rubber/TesterRunner.java
|
b85c36b087f466187618a2c3cbaf806c82612ad9
|
[
"MIT"
] |
permissive
|
victormeng24/LeetCode-Java
|
c53e852ea47049328397e4896319edd0ce0cf48a
|
16bc2802e89d5c9d6450d598f0f41a7f6261d7b6
|
refs/heads/master
| 2023-08-05T02:33:18.990663
| 2021-02-04T13:31:48
| 2021-02-04T13:31:48
| 327,479,246
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,442
|
java
|
/**
* Leetcode - house_rubber
*/
package com.victormeng.leetcode.house_rubber;
// basic util
import java.util.*;
import com.ciaoshen.leetcode.util.*;
// leetcode-helper library
import com.ciaoshen.leetcode.helper.PropertyScanner;
// junit
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
// log4j
import org.apache.log4j.PropertyConfigurator;
// slf4j
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* In most case you DO NOT NEED TO CHANGE ANYTHING in this class.
*/
public class TesterRunner {
// use this Object to print the log (call from slf4j facade)
private static final Logger LOGGER = LoggerFactory.getLogger(TesterRunner.class);
// both log4j and slf4j are included in leetcode-helper.jar
private static final String LOG4J = "log4j.properties";
public static void main(String[] args) {
// use log4j as Logger implementation
Properties log4jProps = PropertyScanner.load(LOG4J); // PropertyScanner load "log4j.properties" for us
PropertyConfigurator.configure(log4jProps);
// run Tester.class
Result result = JUnitCore.runClasses(Tester.class);
for (Failure failure : result.getFailures()) {
System.out.println(failure);
}
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Pass all JUnit test? {}", result.wasSuccessful());
}
}
}
|
[
"victormeng24@gmail.com"
] |
victormeng24@gmail.com
|
f3734ce611bde5608a17443c3961b8b82da41560
|
54bcbdc3250e6e8152ac1746f709ec134e798305
|
/src/test/lock/Lock_condition_await_signal.java
|
6036e3e0537f9533c384698bfa78bb241826451c
|
[] |
no_license
|
TANGMONK-MEAT/jdk-src-demo
|
78bed79d8a3819bf48d5eed399b869ac090138a4
|
4b4fa0779b67c7079b8d263ada2bb514c366a3e8
|
refs/heads/master
| 2023-03-02T21:35:09.758995
| 2021-02-16T07:39:26
| 2021-02-16T07:39:26
| 268,969,374
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,001
|
java
|
package test.lock;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
/**
* Description:
* 模拟 Lock 和 Condition 实现精准唤醒, 其实还要一个标志位
* @author zwl
* @version 1.0
* @date 2021/2/14 17:49
*/
public class Lock_condition_await_signal {
public static void main(String[] args) {
Data data = new Data();
new Thread(() -> {
for (int i = 0; i < 10; i++) {
data.printA();
}
}, "A").start();
new Thread(() -> {
for (int i = 0; i < 10; i++) {
data.printB();
}
}, "B").start();
new Thread(() -> {
for (int i = 0; i < 10; i++) {
data.printC();
}
}, "C").start();
}
static class Data{
// 公平锁,但是,可能会出现即饥饿现象
private final ReentrantLock lock = new ReentrantLock(true);
// lock 监视器
private final Condition condition1 = lock.newCondition();
private final Condition condition2 = lock.newCondition();
private final Condition condition3 = lock.newCondition();
// 标志位
private int number = 1;
public void printA(){
lock.lock();
try {
while (number != 1){
condition1.await();
}
System.out.println("[" + Thread.currentThread().getName() + "] A");
// 标志位设置为 2,代表 Thread2 符合运行条件
number = 2;
// 通唤醒Thread2
condition2.signal();
}catch (Exception e){
e.printStackTrace();
}finally {
lock.unlock();
}
}
public void printB(){
lock.lock();
try {
while (number != 2){
condition2.await();
}
System.out.println("[" + Thread.currentThread().getName() + "] B");
// 标志位设置为 2,代表 Thread2 符合运行条件
number = 3;
// 通唤醒Thread2
condition3.signal();
}catch (Exception e){
e.printStackTrace();
}finally {
lock.unlock();
}
}
public void printC(){
lock.lock();
try {
while (number != 3){
condition3.await();
}
System.out.println("[" + Thread.currentThread().getName() + "] C");
// 标志位设置为 2,代表 Thread2 符合运行条件
number = 1;
// 通唤醒Thread2
condition1.signal();
}catch (Exception e){
e.printStackTrace();
}finally {
lock.unlock();
}
}
}
}
|
[
"58246525+tangsengrou01@users.noreply.github.com"
] |
58246525+tangsengrou01@users.noreply.github.com
|
3a8160eb2c2db9db08f470d5abbdc099373dd6ac
|
2e7f183e5cff6bbfc8c50f66e307138f6e3282e7
|
/trunk/sources/minecraft/net/minecraft/src/EntityWaterMob.java
|
03d91084c38f2855d1946049ff119b52b12a5893
|
[] |
no_license
|
BGCX261/zombie-craft-svn-to-git
|
2e7aee87c90711139e1aa41d2c240c4f4bc1a3f1
|
72217710ec9f899339478b01f021e2c10b38474c
|
refs/heads/master
| 2016-09-05T10:03:04.075184
| 2015-08-25T15:22:26
| 2015-08-25T15:22:26
| 41,586,607
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 859
|
java
|
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
public class EntityWaterMob extends EntityCreature
{
public EntityWaterMob(World world)
{
super(world);
}
public boolean canBreatheUnderwater()
{
return true;
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
public boolean getCanSpawnHere()
{
return worldObj.checkIfAABBIsClear(boundingBox);
}
public int func_421_b()
{
return 120;
}
}
|
[
"you@example.com"
] |
you@example.com
|
6147dcf4aac5479663a7338868f574bec034f5de
|
e64e86c058ba18c19178d99d7cb099ff8228aa1a
|
/src/main/java/org/apache/sysml/api/jmlc/JMLCProxy.java
|
b17857b207358da323563af8706c30f1932da604
|
[
"Apache-2.0"
] |
permissive
|
iamzken/systemml
|
67a1ba236dc6f173d38b84bdce09892fb6aaa2fb
|
3f3e927b88265be3c265fba896cb149b3aacf3e4
|
refs/heads/master
| 2021-03-27T15:16:34.150088
| 2017-09-04T23:08:16
| 2017-09-04T23:08:36
| 102,442,283
| 1
| 0
| null | 2017-09-05T06:22:07
| 2017-09-05T06:22:07
| null |
UTF-8
|
Java
| false
| false
| 1,741
|
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.sysml.api.jmlc;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import org.apache.sysml.runtime.instructions.Instruction;
/**
* This proxy provides thread-local access to output variables per connection
* in order to enable dynamic recompilation in JMLC.
*/
public class JMLCProxy
{
private static ThreadLocal<HashSet<String>> _outputs = new ThreadLocal<HashSet<String>>() {
@Override
protected HashSet<String> initialValue() {
return null;
}
};
public static void setActive(String[] output) {
if( output != null )
_outputs.set(new HashSet<String>(Arrays.asList(output)));
else
_outputs.remove();
}
public static boolean isActive() {
return (_outputs.get() != null);
}
public static ArrayList<Instruction> performCleanupAfterRecompilation(ArrayList<Instruction> tmp) {
return JMLCUtils.cleanupRuntimeInstructions(tmp, _outputs.get());
}
}
|
[
"mboehm7@gmail.com"
] |
mboehm7@gmail.com
|
f51559a734e6885e829e7125912002aca398427b
|
3cd63aba77b753d85414b29279a77c0bc251cea9
|
/main/plugins/org.talend.designer.components.libs/libs_src/talend-mscrm/src/main/java/com/microsoft/schemas/xrm/_2011/contracts/impl/ParameterCollectionImpl.java
|
870cb2a5889c30dc0988f6c8372abee0461c313b
|
[
"Apache-2.0"
] |
permissive
|
195858/tdi-studio-se
|
249bcebb9700c6bbc8905ccef73032942827390d
|
4fdb5cfb3aeee621eacfaef17882d92d65db42c3
|
refs/heads/master
| 2021-04-06T08:56:14.666143
| 2018-10-01T14:11:28
| 2018-10-01T14:11:28
| 124,540,962
| 1
| 0
| null | 2018-10-01T14:11:29
| 2018-03-09T12:59:25
|
Java
|
UTF-8
|
Java
| false
| false
| 5,856
|
java
|
/*
* XML Type: ParameterCollection
* Namespace: http://schemas.microsoft.com/xrm/2011/Contracts
* Java type: com.microsoft.schemas.xrm._2011.contracts.ParameterCollection
*
* Automatically generated - do not modify.
*/
package com.microsoft.schemas.xrm._2011.contracts.impl;
/**
* An XML ParameterCollection(@http://schemas.microsoft.com/xrm/2011/Contracts).
*
* This is a complex type.
*/
public class ParameterCollectionImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.microsoft.schemas.xrm._2011.contracts.ParameterCollection
{
private static final long serialVersionUID = 1L;
public ParameterCollectionImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType);
}
private static final javax.xml.namespace.QName KEYVALUEPAIROFSTRINGANYTYPE$0 =
new javax.xml.namespace.QName("http://schemas.microsoft.com/xrm/2011/Contracts", "KeyValuePairOfstringanyType");
/**
* Gets array of all "KeyValuePairOfstringanyType" elements
*/
public org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType[] getKeyValuePairOfstringanyTypeArray()
{
synchronized (monitor())
{
check_orphaned();
java.util.List targetList = new java.util.ArrayList();
get_store().find_all_element_users(KEYVALUEPAIROFSTRINGANYTYPE$0, targetList);
org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType[] result = new org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType[targetList.size()];
targetList.toArray(result);
return result;
}
}
/**
* Gets ith "KeyValuePairOfstringanyType" element
*/
public org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType getKeyValuePairOfstringanyTypeArray(int i)
{
synchronized (monitor())
{
check_orphaned();
org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType target = null;
target = (org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType)get_store().find_element_user(KEYVALUEPAIROFSTRINGANYTYPE$0, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
return target;
}
}
/**
* Returns number of "KeyValuePairOfstringanyType" element
*/
public int sizeOfKeyValuePairOfstringanyTypeArray()
{
synchronized (monitor())
{
check_orphaned();
return get_store().count_elements(KEYVALUEPAIROFSTRINGANYTYPE$0);
}
}
/**
* Sets array of all "KeyValuePairOfstringanyType" element WARNING: This method is not atomicaly synchronized.
*/
public void setKeyValuePairOfstringanyTypeArray(org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType[] keyValuePairOfstringanyTypeArray)
{
check_orphaned();
arraySetterHelper(keyValuePairOfstringanyTypeArray, KEYVALUEPAIROFSTRINGANYTYPE$0);
}
/**
* Sets ith "KeyValuePairOfstringanyType" element
*/
public void setKeyValuePairOfstringanyTypeArray(int i, org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType keyValuePairOfstringanyType)
{
synchronized (monitor())
{
check_orphaned();
org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType target = null;
target = (org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType)get_store().find_element_user(KEYVALUEPAIROFSTRINGANYTYPE$0, i);
if (target == null)
{
throw new IndexOutOfBoundsException();
}
target.set(keyValuePairOfstringanyType);
}
}
/**
* Inserts and returns a new empty value (as xml) as the ith "KeyValuePairOfstringanyType" element
*/
public org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType insertNewKeyValuePairOfstringanyType(int i)
{
synchronized (monitor())
{
check_orphaned();
org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType target = null;
target = (org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType)get_store().insert_element_user(KEYVALUEPAIROFSTRINGANYTYPE$0, i);
return target;
}
}
/**
* Appends and returns a new empty value (as xml) as the last "KeyValuePairOfstringanyType" element
*/
public org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType addNewKeyValuePairOfstringanyType()
{
synchronized (monitor())
{
check_orphaned();
org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType target = null;
target = (org.datacontract.schemas._2004._07.system_collections_generic.KeyValuePairOfstringanyType)get_store().add_element_user(KEYVALUEPAIROFSTRINGANYTYPE$0);
return target;
}
}
/**
* Removes the ith "KeyValuePairOfstringanyType" element
*/
public void removeKeyValuePairOfstringanyType(int i)
{
synchronized (monitor())
{
check_orphaned();
get_store().remove_element(KEYVALUEPAIROFSTRINGANYTYPE$0, i);
}
}
}
|
[
"dmytro.chmyga@synapse.com"
] |
dmytro.chmyga@synapse.com
|
c619a59019490ca04ee2952aaf851ed7c3ee8b34
|
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
|
/src/testcases/CWE563_Unused_Variable/CWE563_Unused_Variable__unused_value_long_81a.java
|
ea23648c316459924d0d140e668d9f2e4ddbed08
|
[] |
no_license
|
bqcuong/Juliet-Test-Case
|
31e9c89c27bf54a07b7ba547eddd029287b2e191
|
e770f1c3969be76fdba5d7760e036f9ba060957d
|
refs/heads/master
| 2020-07-17T14:51:49.610703
| 2019-09-03T16:22:58
| 2019-09-03T16:22:58
| 206,039,578
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,415
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE563_Unused_Variable__unused_value_long_81a.java
Label Definition File: CWE563_Unused_Variable__unused_value.label.xml
Template File: sources-sinks-81a.tmpl.java
*/
/*
* @description
* CWE: 563 Unused Variable
* BadSource: Initialize data
* GoodSource: Initialize and use data
* Sinks:
* GoodSink: Use data
* BadSink : re-initialize and use data
* Flow Variant: 81 Data flow: data passed in a parameter to an abstract method
*
* */
package testcases.CWE563_Unused_Variable;
import testcasesupport.*;
public class CWE563_Unused_Variable__unused_value_long_81a extends AbstractTestCase
{
public void bad() throws Throwable
{
long data;
/* POTENTIAL FLAW: Initialize, but do not use data */
data = 5L;
CWE563_Unused_Variable__unused_value_long_81_base baseObject = new CWE563_Unused_Variable__unused_value_long_81_bad();
baseObject.action(data );
}
public void good() throws Throwable
{
goodG2B();
goodB2G();
}
/* goodG2B() - use GoodSource and BadSink */
private void goodG2B() throws Throwable
{
long data;
/* FIX: Initialize and use data before it is overwritten */
data = 5L;
IO.writeLine("" + data);
CWE563_Unused_Variable__unused_value_long_81_base baseObject = new CWE563_Unused_Variable__unused_value_long_81_goodG2B();
baseObject.action(data );
}
/* goodB2G() - use BadSource and GoodSink */
private void goodB2G() throws Throwable
{
long data;
/* POTENTIAL FLAW: Initialize, but do not use data */
data = 5L;
CWE563_Unused_Variable__unused_value_long_81_base baseObject = new CWE563_Unused_Variable__unused_value_long_81_goodB2G();
baseObject.action(data );
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"bqcuong2212@gmail.com"
] |
bqcuong2212@gmail.com
|
b4217e51b5f37ecf691400f5ae2ea339e7f89926
|
71c4e3fe1217d49194a4332fed7069ecf990b378
|
/src/test/java/ru/elcoder/leetcode/BinaryWatchSolutionTest.java
|
2d609ab8a6d69c8cbd79537baf731e8a6d7d6b59
|
[] |
no_license
|
xuthus/leetcode-java
|
610c8957927d99a3d38bea4c98506405e615a9c0
|
7aa359b3145c15acb4a7a33c63d41b111ed5adbf
|
refs/heads/master
| 2023-01-23T07:21:53.271172
| 2023-01-16T06:57:54
| 2023-01-16T06:57:54
| 90,063,882
| 1
| 0
| null | 2021-04-02T04:34:33
| 2017-05-02T18:13:37
|
Java
|
UTF-8
|
Java
| false
| false
| 810
|
java
|
package ru.elcoder.leetcode;
import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static ru.elcoder.leetcode.utils.Utils.arrayOf;
public class BinaryWatchSolutionTest {
@Test
public void readBinaryWatch1() {
final BinaryWatchSolution solution = new BinaryWatchSolution();
assertArrayEquals(
arrayOf("0:01", "0:02", "0:04", "0:08", "0:16", "0:32", "1:00", "2:00", "4:00", "8:00"),
solution.readBinaryWatch(1).toArray(new String[0])
);
}
@Test
public void readBinaryWatch2() {
final BinaryWatchSolution solution = new BinaryWatchSolution();
assertEquals(
0,
solution.readBinaryWatch(9).size()
);
}
}
|
[
"xuthus@yandex.ru"
] |
xuthus@yandex.ru
|
49c5979ca03e8311947d21b7b839b5cffa5a836c
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/22/22_fbab613151ebab0b6f23855f77b9194cd81d7fff/Wrapper/22_fbab613151ebab0b6f23855f77b9194cd81d7fff_Wrapper_t.java
|
7c60a6a66ec2f14acb25985cc3a2b5b3042abfb5
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 1,231
|
java
|
package com.noodlesandwich.streams.implementations;
import java.util.Iterator;
import com.noodlesandwich.streams.EndOfStreamException;
import com.noodlesandwich.streams.Stream;
public final class Wrapper<T> extends Stream<T> {
private final Iterator<T> iterator;
private final boolean isNil;
private T head;
private boolean fetchedHead = false;
private Stream<T> tail;
private boolean fetchedTail = false;
public Wrapper(Iterable<T> iterable) {
this(iterable.iterator());
}
private Wrapper(Iterator<T> iterator) {
this.iterator = iterator;
this.isNil = !iterator.hasNext();
}
@Override
public boolean isNil() {
return isNil;
}
@Override
public T head() {
if (isNil) {
throw new EndOfStreamException();
}
if (!fetchedHead) {
head = iterator.next();
fetchedHead = true;
}
return head;
}
@Override
public Stream<T> tail() {
head();
if (!fetchedTail) {
tail = new Wrapper<T>(iterator);
fetchedTail = true;
}
return tail;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
f3a07e8c082311496ead3c12deb87f9ac722598a
|
f80fcb5ba1de922083a5a17311b53fc4f9e5a7dd
|
/src/test/java/org/jboss/cache/api/mvcc/read_committed/NodeAPIMVCCTest.java
|
574eda8d3fffde1754840e14a68c0009753bc6ca
|
[] |
no_license
|
SummaNetworks/jbosscache-core
|
c93d588aebab91f94cf36470c2939799e7b3717c
|
7d880bbe35274d1a00bd6b06a00d9416005f871e
|
refs/heads/master
| 2020-04-05T12:08:14.889656
| 2019-09-25T15:44:22
| 2019-09-25T15:44:22
| 156,860,363
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,218
|
java
|
package org.jboss.cache.api.mvcc.read_committed;
import javax.transaction.TransactionManager;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Node;
import org.jboss.cache.api.NodeAPITest;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.interceptors.MVCCLockingInterceptor;
import org.jboss.cache.interceptors.OptimisticNodeInterceptor;
import org.jboss.cache.interceptors.PessimisticLockInterceptor;
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.lock.IsolationLevel;
import org.testng.annotations.Test;
import java.util.List;
/**
* An MVCC version of {@link org.jboss.cache.api.NodeAPITest}
*/
@Test(groups = {"functional", "mvcc"}, testName = "api.mvcc.read_committed.NodeAPIMVCCTest")
public class NodeAPIMVCCTest extends NodeAPITest
{
protected NodeLockingScheme getNodeLockingScheme()
{
return NodeLockingScheme.MVCC;
}
@Override
protected void configure(Configuration c)
{
c.setIsolationLevel(IsolationLevel.READ_COMMITTED);
}
protected void assertNodeLockingScheme()
{
assert cache.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.MVCC;
boolean interceptorChainOK = false;
List<CommandInterceptor> chain = cache.getInterceptorChain();
for (CommandInterceptor i : chain)
{
if (i instanceof PessimisticLockInterceptor) assert false : "Not an MVCC locking chain!!";
if (i instanceof OptimisticNodeInterceptor) assert false : "Not an MVCC locking chain!!";
if (i instanceof MVCCLockingInterceptor) interceptorChainOK = true;
}
assert interceptorChainOK : "Not an MVCC locking chain!!";
}
@Override
public void testLocking()
{
// no op - this is tested separately
}
@Override
protected void childrenUnderTxCheck() throws Exception
{
assert cache.getNode(A_B) != null;
assert cache.getNode(A_C) != null;
assert cache.getInvocationContext().getLocks().contains(A);
assert cache.getInvocationContext().getLocks().contains(A_B);
assert cache.getInvocationContext().getLocks().contains(A_C);
}
}
|
[
"blackpent@gmail.com"
] |
blackpent@gmail.com
|
f9972dccd62f5a32eeac664b2b31d5a8ed8719fa
|
c297da7e9108cbb221c7c48a407ff2819410e041
|
/src/main/java/org/springframework/cloud/deployer/spi/kubernetes/KubernetesHttpClient.java
|
12c3460a67730e17ccb1d0c5bb97b1d0976147f0
|
[
"Apache-2.0"
] |
permissive
|
shahbour/spring-cloud-deployer-kubernetes
|
055068efa90eaa0040175316f06a1f271628fce7
|
a02680e054416b59968b69233333974378af3195
|
refs/heads/master
| 2021-04-15T08:09:22.519576
| 2018-03-27T09:28:28
| 2018-03-27T09:28:28
| 126,804,783
| 0
| 0
|
Apache-2.0
| 2018-03-27T09:28:29
| 2018-03-26T09:23:36
|
Java
|
UTF-8
|
Java
| false
| false
| 2,762
|
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.springframework.cloud.deployer.spi.kubernetes;
import io.fabric8.kubernetes.client.BaseClient;
import io.fabric8.kubernetes.client.KubernetesClient;
import okhttp3.Call;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.IOException;
/**
* Wraps the {@link KubernetesClient} http client to send raw REST requests
* @author David Turanski
**/
class KubernetesHttpClient {
private static final Log logger = LogFactory.getLog(KubernetesHttpClient.class);
private final OkHttpClient client;
private final String masterUrl;
KubernetesHttpClient(KubernetesClient client) {
this.client = ((BaseClient)client).getHttpClient();
this.masterUrl = client.getMasterUrl().toString();
}
public Response post(String resourceEndpoint, String json) {
String url = this.masterUrl + resourceEndpoint;
logger.debug("Posting to " + url);
Request post = new Request.Builder().post(RequestBody.create(MediaType.parse("application/json"), json))
.url(url).build();
Response response = execute((this.client.newCall(post)));
response.close();
return response;
}
public Response get(String resourceEndpoint, String appId) {
String url = this.masterUrl + resourceEndpoint + "/" + appId;
logger.debug("Getting " + url);
Request get = new Request.Builder().get().url(url).build();
return execute((this.client.newCall(get)));
}
public Response delete(String resourceEndpoint, String appId) {
String url = this.masterUrl + resourceEndpoint + "/" + appId;
logger.debug("Deleting " + url);
Request delete = new Request.Builder().delete().url(url).build();
Response response = execute((this.client.newCall(delete)));
response.close();
return response;
}
private Response execute(Call call) {
Response response;
try {
response = call.execute();
logger.debug("Response code: " + response.code());
}
catch (IOException e) {
throw new RuntimeException(e);
}
return response;
}
}
|
[
"viniciusccarvalho@gmail.com"
] |
viniciusccarvalho@gmail.com
|
7d420e84e49b4928141ac19c3586aacb6fabf41b
|
0f7534fbb377acfd883fc6e2c46fc03bccde3ed5
|
/sso/sso-server/src/main/java/com/springcloud/learn/listener/LogoutListener.java
|
dc5d464c7b6e4b309cbdafc8500dd2395d3a00a3
|
[
"MIT"
] |
permissive
|
fujiangwei/springcloud-learn
|
994e20fae1a2a80fefcdba27332aa19f5f9986c5
|
5fd7e5974a90bd9701c7fde02cf09901358596bf
|
refs/heads/master
| 2021-06-09T11:57:39.116328
| 2021-01-13T09:21:16
| 2021-01-13T09:21:16
| 178,652,954
| 0
| 1
|
MIT
| 2021-06-04T03:04:29
| 2019-03-31T06:49:47
|
Java
|
UTF-8
|
Java
| false
| false
| 794
|
java
|
package com.springcloud.learn.listener;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
/**
* @Description: 文件描述
* @author kingson
* @date
**/
@WebListener
@Slf4j(topic = "LogoutListener")
public class LogoutListener implements HttpSessionListener {
@Override
public synchronized void sessionCreated(HttpSessionEvent sessionEvent) {
// log.info("LogoutListener sessionCreated sessionIs: {}", sessionEvent.getSession().getId());
}
@Override
public synchronized void sessionDestroyed(HttpSessionEvent sessionEvent) {
// log.info("LogoutListener sessionDestroyed sessionIs: {}", sessionEvent.getSession().getId());
}
}
|
[
"2444179219@qq.com"
] |
2444179219@qq.com
|
67e555c9582618638e9c8499df600b332819d542
|
8b0b9c5441b49d45adc4c8ac86d4e08503a6f1be
|
/backend/data-fetching/src/main/java/ro/cineseuita/data/contract/auction/entity/detailed/Section22New.java
|
70d1d7ff883e8d6b78417f5d9bc07bb46f79d1e2
|
[
"Apache-2.0"
] |
permissive
|
AlexBondor/seaplol
|
17ecf9e3af19e634e4db7bd5668bd1a062bf2d3b
|
d1ca376f19bed6dd8c8e75fd4269c79fd7d53774
|
refs/heads/master
| 2023-08-03T14:38:34.478600
| 2021-09-21T11:01:21
| 2021-09-21T11:01:21
| 295,366,270
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,720
|
java
|
package ro.cineseuita.data.contract.auction.entity.detailed;
import com.fasterxml.jackson.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"showPublishingAgreedSection",
"previousPublication",
"descriptionList",
"canEdit",
"caNoticeId",
"sectionName",
"sectionCode",
"noticePreviousPublication"
})
public class Section22New {
@JsonProperty("showPublishingAgreedSection")
private Boolean showPublishingAgreedSection;
@JsonProperty("previousPublication")
private Boolean previousPublication;
@JsonProperty("descriptionList")
private List<DescriptionList> descriptionList = null;
@JsonProperty("canEdit")
private Boolean canEdit;
@JsonProperty("caNoticeId")
private Long caNoticeId;
@JsonProperty("sectionName")
private Object sectionName;
@JsonProperty("sectionCode")
private Object sectionCode;
@JsonProperty("noticePreviousPublication")
private Object noticePreviousPublication;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("showPublishingAgreedSection")
public Boolean getShowPublishingAgreedSection() {
return showPublishingAgreedSection;
}
@JsonProperty("showPublishingAgreedSection")
public void setShowPublishingAgreedSection(Boolean showPublishingAgreedSection) {
this.showPublishingAgreedSection = showPublishingAgreedSection;
}
@JsonProperty("previousPublication")
public Boolean getPreviousPublication() {
return previousPublication;
}
@JsonProperty("previousPublication")
public void setPreviousPublication(Boolean previousPublication) {
this.previousPublication = previousPublication;
}
@JsonProperty("descriptionList")
public List<DescriptionList> getDescriptionList() {
return descriptionList;
}
@JsonProperty("descriptionList")
public void setDescriptionList(List<DescriptionList> descriptionList) {
this.descriptionList = descriptionList;
}
@JsonProperty("canEdit")
public Boolean getCanEdit() {
return canEdit;
}
@JsonProperty("canEdit")
public void setCanEdit(Boolean canEdit) {
this.canEdit = canEdit;
}
@JsonProperty("caNoticeId")
public Long getCaNoticeId() {
return caNoticeId;
}
@JsonProperty("caNoticeId")
public void setCaNoticeId(Long caNoticeId) {
this.caNoticeId = caNoticeId;
}
@JsonProperty("sectionName")
public Object getSectionName() {
return sectionName;
}
@JsonProperty("sectionName")
public void setSectionName(Object sectionName) {
this.sectionName = sectionName;
}
@JsonProperty("sectionCode")
public Object getSectionCode() {
return sectionCode;
}
@JsonProperty("sectionCode")
public void setSectionCode(Object sectionCode) {
this.sectionCode = sectionCode;
}
@JsonProperty("noticePreviousPublication")
public Object getNoticePreviousPublication() {
return noticePreviousPublication;
}
@JsonProperty("noticePreviousPublication")
public void setNoticePreviousPublication(Object noticePreviousPublication) {
this.noticePreviousPublication = noticePreviousPublication;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
|
[
"alexx.cosma@gmail.com"
] |
alexx.cosma@gmail.com
|
2926971ed5be3116ed9f160b5f9ee9bc0888cef2
|
87e29d47c275b9575e1298adf9558d00e3302716
|
/vsp/src/main/java/playground/vsp/andreas/bvgAna/mrieser/analysis/RouteTimeDiagram.java
|
22838196f14779a91e4ab73d75cfffa289f4ea6b
|
[] |
no_license
|
nanddesai99/vsp-playgrounds
|
d2255352ea485c5044bce432c6ed2ff0a2f59381
|
0052c80f612737ab3e477e74b0cf95dcb32fb76e
|
refs/heads/master
| 2020-05-26T11:26:28.078351
| 2019-05-21T15:24:14
| 2019-05-21T15:24:25
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,062
|
java
|
/* *********************************************************************** *
* project: org.matsim.*
* RouteTimeDiagram.java
* *
* *********************************************************************** *
* *
* copyright : (C) 2009 by the members listed in the COPYING, *
* LICENSE and WARRANTY file. *
* email : info at matsim dot org *
* *
* *********************************************************************** *
* *
* 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. *
* See also COPYING, LICENSE and WARRANTY file *
* *
* *********************************************************************** */
package playground.vsp.andreas.bvgAna.mrieser.analysis;
import java.awt.Color;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYItemRenderer;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.matsim.api.core.v01.Id;
import org.matsim.core.api.experimental.events.VehicleArrivesAtFacilityEvent;
import org.matsim.core.api.experimental.events.VehicleDepartsAtFacilityEvent;
import org.matsim.core.api.experimental.events.handler.VehicleArrivesAtFacilityEventHandler;
import org.matsim.core.api.experimental.events.handler.VehicleDepartsAtFacilityEventHandler;
import org.matsim.core.utils.collections.Tuple;
import org.matsim.pt.transitSchedule.api.Departure;
import org.matsim.pt.transitSchedule.api.TransitRoute;
import org.matsim.pt.transitSchedule.api.TransitRouteStop;
/**
* Collects data to create Route-Time-Diagrams based on the actual simulation.
* A Route-Time-Diagram shows the position along one transit route of one or
* more vehicles over the lapse of time.
*
* @author mrieser
*/
public class RouteTimeDiagram implements VehicleArrivesAtFacilityEventHandler, VehicleDepartsAtFacilityEventHandler {
/**
* Map containing for each vehicle a list of positions, stored as StopFacility Ids and the time.
*/
private final Map<Id, List<Tuple<Id, Double>>> positions = new HashMap<Id, List<Tuple<Id, Double>>>();
public void handleEvent(final VehicleArrivesAtFacilityEvent event) {
List<Tuple<Id, Double>> list = this.positions.get(event.getVehicleId());
if (list == null) {
list = new ArrayList<Tuple<Id, Double>>();
this.positions.put(event.getVehicleId(), list);
}
list.add(new Tuple<Id, Double>(event.getFacilityId(), Double.valueOf(event.getTime())));
}
public void handleEvent(final VehicleDepartsAtFacilityEvent event) {
List<Tuple<Id, Double>> list = this.positions.get(event.getVehicleId());
if (list == null) {
list = new ArrayList<Tuple<Id, Double>>();
this.positions.put(event.getVehicleId(), list);
}
list.add(new Tuple<Id, Double>(event.getFacilityId(), Double.valueOf(event.getTime())));
}
public void reset(final int iteration) {
this.positions.clear();
}
public void writeData() {
for (List<Tuple<Id, Double>> list : this.positions.values()) {
for (Tuple<Id, Double> info : list) {
System.out.println(info.getFirst().toString() + "\t" + info.getSecond().toString());
}
System.out.println();
}
}
public void createGraph(final String filename, final TransitRoute route) {
HashMap<Id, Integer> stopIndex = new HashMap<Id, Integer>();
int idx = 0;
for (TransitRouteStop stop : route.getStops()) {
stopIndex.put(stop.getStopFacility().getId(), idx);
idx++;
}
HashSet<Id> vehicles = new HashSet<Id>();
for (Departure dep : route.getDepartures().values()) {
vehicles.add(dep.getVehicleId());
}
XYSeriesCollection dataset = new XYSeriesCollection();
int numSeries = 0;
double earliestTime = Double.POSITIVE_INFINITY;
double latestTime = Double.NEGATIVE_INFINITY;
for (Map.Entry<Id, List<Tuple<Id, Double>>> entry : this.positions.entrySet()) {
if (vehicles.contains(entry.getKey())) {
XYSeries series = new XYSeries("t", false, true);
for (Tuple<Id, Double> pos : entry.getValue()) {
Integer stopIdx = stopIndex.get(pos.getFirst());
if (stopIdx != null) {
double time = pos.getSecond().doubleValue();
series.add(stopIdx.intValue(), time);
if (time < earliestTime) {
earliestTime = time;
}
if (time > latestTime) {
latestTime = time;
}
}
}
dataset.addSeries(series);
numSeries++;
}
}
JFreeChart c = ChartFactory.createXYLineChart("Route-Time Diagram, Route = " + route.getId(), "stops", "time",
dataset, PlotOrientation.VERTICAL,
false, // legend?
false, // tooltips?
false // URLs?
);
c.setBackgroundPaint(new Color(1.0f, 1.0f, 1.0f, 1.0f));
XYPlot p = (XYPlot) c.getPlot();
p.getRangeAxis().setInverted(true);
p.getRangeAxis().setRange(earliestTime, latestTime);
XYItemRenderer renderer = p.getRenderer();
for (int i = 0; i < numSeries; i++) {
renderer.setSeriesPaint(i, Color.black);
}
try {
ChartUtilities.saveChartAsPNG(new File(filename), c, 1024, 768, null, true, 9);
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
[
"bischoff@vsp.tu-berlin.de"
] |
bischoff@vsp.tu-berlin.de
|
4d96f4f52a5087e5184d3e56d3679a8aef0c6ff6
|
8825c4e8eec7a3ba1d13f3bcdc0d5c3d3103a152
|
/aula12-decorator/src/test/java/app/test/model/Account.java
|
a558ed5c63941626d9b0317929c89a1a7a9df773
|
[] |
no_license
|
isel-leic-mpd/mpd-2013-i41n
|
048e8609d72123f69aa3ddecee9849eb82d14e27
|
1a8fe1e095b1b8188409436e8a144484bf6aabe3
|
refs/heads/master
| 2021-01-10T10:24:40.254414
| 2013-06-11T22:07:08
| 2013-06-11T22:07:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 267
|
java
|
package app.test.model;
public class Account {
public long balance;
public int nr;
public String holder;
public Account(long balance, int nr, String holder) {
super();
this.balance = balance;
this.nr = nr;
this.holder = holder;
}
}
|
[
"mcarvalho@cc.isel.ipl.pt"
] |
mcarvalho@cc.isel.ipl.pt
|
db31cf7305f4bcb115f9d167a77cfde15d7d7fa3
|
ba883df1628d64d5b5d92f39fa19e73d6d3b1244
|
/eMoflon/fr.tpt.mem4csd.mtbench.aadl2aadl.eMoflon.tgg.tests/src/fr/tpt/mem4csd/mtbench/aadl2aadl/eMoflon/tgg/tests/BatchTest.java
|
571fb4d28e4074a338c54a7777c98cd388a41733
|
[] |
no_license
|
INCMOTRANS-Benchmark/IMTBENCH
|
d10f3f748095dddb952d0c7f163b5a39fdee8128
|
14728ddb1e3681c43bed87b2adfe464d1208a1bb
|
refs/heads/master
| 2022-11-20T00:21:26.974656
| 2020-07-21T15:06:48
| 2020-07-21T15:06:48
| 281,428,289
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,384
|
java
|
package fr.tpt.mem4csd.mtbench.aadl2aadl.eMoflon.tgg.tests;
import java.io.IOException;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.eclipse.emf.ecore.resource.Resource;
public class BatchTest extends AbstractAadl2AadlTest {
protected BatchTest(final String baseDir, final String predefinedAadlResDir) throws IOException {
super(baseDir, predefinedAadlResDir);
}
@SuppressWarnings("unchecked")
protected Resource executeAadl2AadlTransformation(int testNumber, Result res) throws Exception {
long[] runsOfBatch = new long[res.runtimes];
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.OFF);
long t0, t1;
BatchTest init_fwd = new BatchTest(filename, BASE_RESOURCES_DIR);
System.out.println("Test " + testNumber + " Performing transformation:");
for (int i = 0; i < res.runtimes; i++) {
t0 = System.nanoTime();
init_fwd.forward();
t1 = System.nanoTime();
runsOfBatch[i] = t1 - t0;
}
res.setExecutionTimes((testNumber - 1), res.getMedian(runsOfBatch));
System.out.println("Test " + testNumber + " in " + res.getMedian(runsOfBatch) + " ns");
init_fwd.saveModels();
init_fwd.terminate();
System.out.println("Transformation finished.");
return init_fwd.getResourceHandler().getTargetResource();
}
}
|
[
"mkaouar.hana@gmail.com"
] |
mkaouar.hana@gmail.com
|
47015ac9c7120f76e0922cc562a69c9887825595
|
70a4873e00e37d461fca4b7a6f07a73396717167
|
/louismall-product/src/main/java/com/louisblogs/louismall/product/vo/SkuItemVo.java
|
1bfb8938906af1fab22a838595194a88b20fc0c6
|
[
"Apache-2.0"
] |
permissive
|
QuricoLouis/louismall
|
006426937fd9616b15a99945ad7c7930119af752
|
42652c14a5bbda4dbb15a65047226a70370f8dae
|
refs/heads/master
| 2023-06-22T16:45:45.213152
| 2021-07-03T00:49:50
| 2021-07-03T00:49:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 923
|
java
|
package com.louisblogs.louismall.product.vo;
import com.baomidou.mybatisplus.annotation.TableId;
import com.louisblogs.louismall.product.entity.SkuImagesEntity;
import com.louisblogs.louismall.product.entity.SkuInfoEntity;
import com.louisblogs.louismall.product.entity.SpuInfoDescEntity;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* @author :luqi
* @description:TODO
* @date :2021/6/22 19:45
*/
@Data
public class SkuItemVo {
//1、sku基本信息获取 pms_sku_info
SkuInfoEntity info;
boolean hasStock = true;
//2、sku的图片信息 pms_sku_images
List<SkuImagesEntity> images;
//3、获取spu的销售属性组合
List<SkuItemSaleAttrVo> saleAttr;
//4、获取spu的介绍
SpuInfoDescEntity desp;
//5、获取spu的规格参数信息
List<SpuItemAttrGroupVo> groupAttrs;
//6 当前商品秒杀的优惠信息
private SeckillSkuInfoVo seckillSkuInfoVo;
}
|
[
"lq844040753@163.com"
] |
lq844040753@163.com
|
a6836e6ea3a10282b255fbc49dd520957756aed9
|
5f42d999715deeccb6e6af533247b891f461d871
|
/idea_test/code_duotai/src/com/xingcan/AnimalDemo.java
|
a6ae27781b4c710486496bac658c472e189a003e
|
[] |
no_license
|
flexibleq/JavaRepository
|
6c5ee21f2cebeae1449bec84f8dc419e4a8b8bc6
|
e44378a4f3cce87c522caf4f5f20feaa570f0ffa
|
refs/heads/master
| 2021-08-06T22:21:39.319653
| 2019-12-08T00:39:19
| 2019-12-08T00:39:19
| 226,594,549
| 0
| 0
| null | 2020-10-13T18:03:12
| 2019-12-08T00:35:11
|
Java
|
UTF-8
|
Java
| false
| false
| 280
|
java
|
package com.xingcan;
public class AnimalDemo {
public static void main(String[] args) {
AnimalOperator ao = new AnimalOperator();
Animal a = new Dog();
ao.useAnimal(a);
a.eat();
Animal aaa = ao.getAnimal();
aaa.eat();
}
}
|
[
"freeantwalk@163.com"
] |
freeantwalk@163.com
|
93903bf9db8a8d2a89868d4571d8237a12219261
|
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
|
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/presenter/contract/FinderLiveWeCoinHotConstract$ViewCallback$$ExternalSyntheticLambda2.java
|
95a3d426bbdb04629348107930a25fbf5613ab3f
|
[] |
no_license
|
tsuzcx/qq_apk
|
0d5e792c3c7351ab781957bac465c55c505caf61
|
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
|
refs/heads/main
| 2022-07-02T10:32:11.651957
| 2022-02-01T12:41:38
| 2022-02-01T12:41:38
| 453,860,108
| 36
| 9
| null | 2022-01-31T09:46:26
| 2022-01-31T02:43:22
|
Java
|
UTF-8
|
Java
| false
| false
| 569
|
java
|
package com.tencent.mm.plugin.finder.presenter.contract;
import android.view.View;
import android.view.View.OnClickListener;
public final class FinderLiveWeCoinHotConstract$ViewCallback$$ExternalSyntheticLambda2
implements View.OnClickListener
{
public final void onClick(View arg1) {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar
* Qualified Name: com.tencent.mm.plugin.finder.presenter.contract.FinderLiveWeCoinHotConstract.ViewCallback..ExternalSyntheticLambda2
* JD-Core Version: 0.7.0.1
*/
|
[
"98632993+tsuzcx@users.noreply.github.com"
] |
98632993+tsuzcx@users.noreply.github.com
|
7248215e05c384f54b5c77ca785185e905e376db
|
31ef45ee1c5bd25ad21fdffbd2dcac8166a051b1
|
/app/src/main/java/com/pouyaheydari/learning/sematecandroidbasicdey99/TestStaticFtagmentActivity.java
|
f7cc0cf99d3256e0348c14e6ce5a726bc3416042
|
[] |
no_license
|
SirLordPouya/SematecAndroidBasicDey99
|
da6113189b7acd4195f7be2ce42b8e4b5b3f0ed2
|
90333f58a90645b51f8757a7d40dbd1b941ccdd8
|
refs/heads/master
| 2023-02-27T13:53:26.745729
| 2021-02-12T14:05:45
| 2021-02-12T14:05:45
| 329,932,745
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 393
|
java
|
package com.pouyaheydari.learning.sematecandroidbasicdey99;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class TestStaticFtagmentActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test_static_ftagment);
}
}
|
[
"pouyaheydary@gmail.com"
] |
pouyaheydary@gmail.com
|
f4bda5946f47a23dab12bb295ec5cca8c5c1e6c4
|
cfad7007e300dce438c1cf47dede2f96799c4e34
|
/Hibernate Mapping/Many to Many/src/com/javatpoint/StoreData.java
|
d3dc54ff53e606a60fffd2e243ba2cea914c8fd4
|
[] |
no_license
|
shoumitro-cse/Hibernate-small-projects
|
16db23ec4ba55abac4194153081583b131257b54
|
2966b6f716d7229206e4841dd03ed5e9a2988131
|
refs/heads/main
| 2023-03-16T18:11:15.325348
| 2021-03-09T16:11:56
| 2021-03-09T16:11:56
| 346,066,277
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,282
|
java
|
package com.javatpoint;
import java.util.ArrayList;
import org.hibernate.*;
import org.hibernate.boot.Metadata;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
public class StoreData {
public static void main(String[] args) {
StandardServiceRegistry ssr=new StandardServiceRegistryBuilder().configure("hibernate.cfg.xml").build();
Metadata meta=new MetadataSources(ssr).getMetadataBuilder().build();
SessionFactory factory=meta.getSessionFactoryBuilder().build();
Session session=factory.openSession();
Transaction t=session.beginTransaction();
Answer an1=new Answer();
an1.setAnswername("Java is a programming language");
an1.setPostedBy("Ravi Malik");
Answer an2=new Answer();
an2.setAnswername("Java is a platform");
an2.setPostedBy("Sudhir Kumar");
Question q1=new Question();
q1.setQname("What is Java?");
ArrayList<Answer> l1=new ArrayList<Answer>();
l1.add(an1);
l1.add(an2);
q1.setAnswers(l1);
Answer ans3=new Answer();
ans3.setAnswername("Servlet is an Interface");
ans3.setPostedBy("Jai Kumar");
Answer ans4=new Answer();
ans4.setAnswername("Servlet is an API");
ans4.setPostedBy("Arun");
Answer ans5=new Answer();
ans5.setAnswername("Servlet is an Web API for Java");
ans5.setPostedBy("Shoumitro Roy");
Question q2=new Question();
q2.setQname("What is Servlet?");
ArrayList<Answer> l2=new ArrayList<Answer>();
l2.add(ans3);
l2.add(ans4);
q2.setAnswers(l2);
session.persist(an1);
session.persist(an2);
session.persist(ans3);
session.persist(ans4);
session.persist(ans5);
session.persist(q1);
session.persist(q2);
t.commit();
session.close();
System.out.println("success");
factory.close();
}
}
|
[
"shoumitro26@gmail.com"
] |
shoumitro26@gmail.com
|
1f6f8e132c37185dde36699e79bbbc27a95fd641
|
f9072ab1f05e576766bf259dc12b490d87b2d316
|
/pedido/src/main/java/com/github/fabriciolfj/pedido/domain/model/TransacaoDistribuida.java
|
01e67f99765d4ec03b0344b73dbd39fccce8a228
|
[] |
no_license
|
fabriciolfj/transacao-distribuida
|
c2653bd28924cec52684080097043e790d6e5666
|
e93cf42bf8226074a8e34d3dfebb4431765b2aa4
|
refs/heads/main
| 2023-06-03T11:59:38.573597
| 2021-06-24T01:25:34
| 2021-06-24T01:25:34
| 320,124,903
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 318
|
java
|
package com.github.fabriciolfj.pedido.domain.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class TransacaoDistribuida {
private String transactionId;
private String status;
}
|
[
"fabricio.jacob@outlook.com"
] |
fabricio.jacob@outlook.com
|
9da3c40e7a88a60e556b8a7a856ca2dfcd574c25
|
c4309936f65a4e90fd8efd24ed01a9d128566cc9
|
/AddBinary/src/classes/Solution.java
|
39ba7b045205a3588604b56d62e45031262d872b
|
[] |
no_license
|
schnarbiemeows/CodingChallenges
|
91af6d0caaca521fb7990af9dd5f7b632a4d6cb4
|
9413afcb1e656b1a50244c4d2b48048f1dd046d1
|
refs/heads/master
| 2023-03-31T00:13:26.548315
| 2023-03-26T14:03:50
| 2023-03-26T14:03:50
| 161,564,825
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,524
|
java
|
package classes;
import java.util.Map;
/*
* 8:19 - .... ~ 10:25 (I took breaks, but at least an hour to do)
* did not finish, solution is in Solution 2
* Speed =
* memory =
*
*/
public class Solution {
public String addBinary(String a, String b) {
char[] achar = a.toCharArray();
char[] bchar = b.toCharArray();
int diff = achar.length-bchar.length;
int[] temp = new int[Math.max(achar.length, bchar.length)];
StringBuilder sb = new StringBuilder();
int carry = 0;
for(int i = achar.length;i>0;i--) {
temp[achar.length-i] = achar[i-1];
}
int index = 0;
for(int j = bchar.length-1;j>=0;j--) {
int sum = carry+temp[index]+bchar[j];
if(sum==1 || sum==3) {
sb.insert(0,"1");
} else {
sb.insert(0,"0");
}
carry=0;
if(sum>1) {
carry=1;
}
index++;
}
if(achar.length> bchar.length) {
for(int i = bchar.length; i<achar.length;i++) {
int sum = carry+temp[i];
if(sum==1 || sum==3) {
sb.insert(0,"1");
} else {
sb.insert(0,"0");
}
carry=0;
if(sum>1) {
carry=1;
}
}
}
if(carry>0) {
sb.insert(0,"1");
}
return sb.toString();
}
}
|
[
"dylnksslr53@gmail.com"
] |
dylnksslr53@gmail.com
|
8edd0bd43022dfa1f5979aaf00c92153cac2903a
|
35b0617b410b9144c8a171ef0650069c8ca583dc
|
/src/main/java/cn/yl/service/impl/ManagerServiceImpl.java
|
42d9a7ccc7685e2cf534eff5921666238a550964
|
[] |
no_license
|
lllyl2012/bilibili
|
638a01eab2b44adf7ef6533eb66ea2cf40b4f482
|
46bf1b5386a85c259bc000c0a9cab7cdf0c1eaa5
|
refs/heads/master
| 2021-09-04T04:57:40.845716
| 2018-01-10T07:28:13
| 2018-01-10T07:54:31
| 116,366,356
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,415
|
java
|
package cn.yl.service.impl;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import javax.annotation.Resource;
import javax.mail.Address;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.http.Cookie;
import org.springframework.stereotype.Service;
import cn.yl.dao.UserDao;
import cn.yl.entity.HistoryPro;
import cn.yl.entity.Product;
import cn.yl.entity.User;
import cn.yl.service.ManagerService;
@Service("managerService")
public class ManagerServiceImpl implements ManagerService{
@Resource
UserDao dao;
public User Login(User user) {
User user1 = dao.selectUserByMobile(user.getMobile());
if(user1==null) {
return null;
}else {
if(user.getPassword().equals(user1.getPassword())) {
return user1;
}else {
return null;
}
}
}
public int[] getAfterAndBefore(int pageNum,int pageAll) {
int beforePage = 0;
int afterPage = 0;
if((pageNum-1)<=0) {
beforePage = 1;
}else {
beforePage = pageNum - 1;
}
if((pageNum+1)>=pageAll) {
afterPage = pageAll;
}else {
afterPage = pageNum + 1;
}
int[] arr = new int[2];
arr[0] = beforePage;
arr[1] = afterPage;
return arr;
}
public List<User> getAllUsers(int pageNum) {
List<User> list = dao.selectAllUser((pageNum-1)*7);
return list;
}
public Integer getPages() {
Integer num = dao.countUserNum();
int pages = num/7;
if(num%7!=0) {
pages++;
}
return pages;
}
public Integer getCurrentPage(Cookie[] cookies,int pageAll, String currentPage) {
String page = "1";
page = currentPage;
if(page==null) {
if(cookies!=null) {
for(Cookie c:cookies) {
if("page".equals(c.getName())){
try {
page =URLDecoder.decode(c.getValue(),"utf-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
c.setMaxAge(0);
}
}
}
}
if(page ==null) {
page = "1";
}
int pageNum = Integer.parseInt(page);
if(pageNum>pageAll) {
pageNum = pageAll;
}
page = ""+pageNum;
return Integer.parseInt(page);
}
public List<List<String>> getUserHistory(User user) {
List<HistoryPro> list = dao.selectHistory(user);
Collections.sort(list,new Comparator<HistoryPro>() {
public int compare(HistoryPro p1,HistoryPro p2) {
return (int)(p1.getReadtime().getTime() - p2.getReadtime().getTime());
}
});
int length = list.size();
if(length>6) {
list = list.subList(0, 6);
}else if(length==0){
list = list;
}else{
list = list.subList(0, length-1);
}
List<List<String>> all = new ArrayList<List<String>>();
List<String> todayList = new ArrayList<String>();
List<String> yesterdayList = new ArrayList<String>();
List<String> weekList = new ArrayList<String>();
Calendar todayCalendar = Calendar.getInstance();
Calendar thatCalendar = Calendar.getInstance();
int today = todayCalendar.get(Calendar.DAY_OF_YEAR);
for (HistoryPro historyPro : list) {
Date date = historyPro.getReadtime();
thatCalendar.setTime(date);
int thatDay = thatCalendar.get(Calendar.DAY_OF_YEAR);
if(today - thatDay ==0) {
todayList.add(historyPro.getProductname());
}else if(today - thatDay==1){
yesterdayList.add(historyPro.getProductname());
}else {
weekList.add(historyPro.getProductname());
}
}
all.add(todayList);
all.add(yesterdayList);
all.add(weekList);
return all;
}
public User selectUserByMobile(String mobile) {
User user1 = dao.selectUserByMobile(mobile);
return user1;
}
public boolean sendAdviceMail(String advice) {
Context initCtx;
System.out.println(1);
Transport transport = null;
try {
initCtx = new InitialContext();
System.out.println("initCtx:"+initCtx);
Context envCtx = (Context) initCtx.lookup("java:comp/env");
System.out.println("envCtx:"+envCtx);
Session session = (Session)envCtx.lookup("mail/Session");
System.out.println("session:"+session);
Message msg= new MimeMessage(session);
msg.setSubject("gaga");
msg.setText(advice);
msg.setFrom(new InternetAddress("lllyl2012@sina.com","武帝","utf-8"));
msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress("229707363@qq.com"));
transport = session.getTransport();
transport.connect("lllyl2012","yl82662422");
transport.sendMessage(msg, new Address[]{new InternetAddress("229707363@qq.com")});
return true;
//
} catch (Exception e) {
e.printStackTrace();
return false;
}finally {
try {
transport.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public boolean removeUser(User user) {
int num = dao.deleteUser(user.getMobile());
if(num==1) {
return true;
}else {
return false;
}
}
public User changeInfo(User user) {
int num = dao.updateUser(user);
if(num==1) {
User user1 = dao.selectUserByMobile(user.getMobile());
return user1;
}else {
return user;
}
}
}
|
[
"229707363@qq.com"
] |
229707363@qq.com
|
827de3648f94baf7bf75cbc606ceb1d21e08d3e2
|
2586f3b8626c14aa53e9f87ac0844689b22a8b48
|
/src/javax/swing/plaf/nimbus/ToolBarNorthState.java
|
905f1fc379f0f275fdc856bfcad968599f28aa30
|
[] |
no_license
|
shaoxiongdu/LearningJDK
|
46fd841471f5d0e2737ebcd3570ef6f018a90ddb
|
406e4de55d107648ed6497d625239c637227aa66
|
refs/heads/master
| 2022-11-12T14:30:01.400708
| 2022-11-08T13:00:17
| 2022-11-08T13:00:17
| 350,005,058
| 18
| 11
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,619
|
java
|
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.swing.plaf.nimbus;
import java.awt.*;
import javax.swing.*;
class ToolBarNorthState extends State<JComponent> {
ToolBarNorthState() {
super("North");
}
@Override protected boolean isInState(JComponent c) {
return (c instanceof JToolBar) &&
NimbusLookAndFeel.resolveToolbarConstraint((JToolBar)c) == BorderLayout.NORTH;
}
}
|
[
"kangjianwei1990@qq.com"
] |
kangjianwei1990@qq.com
|
6586bb926290e94022d6e7a8761c7685fab3d1b2
|
bfac99890aad5f43f4d20f8737dd963b857814c2
|
/reg4/v0/xwiki-platform-core/xwiki-platform-panels/xwiki-platform-panels-api/src/main/java/org/xwiki/panels/internal/PanelWikiUIExtensionComponentBuilder.java
|
4ecef4e682cfe4072cb88f21e87f97178d9a5974
|
[] |
no_license
|
STAMP-project/dbug
|
3b3776b80517c47e5cac04664cc07112ea26b2a4
|
69830c00bba4d6b37ad649aa576f569df0965c72
|
refs/heads/master
| 2021-01-20T03:59:39.330218
| 2017-07-12T08:03:40
| 2017-07-12T08:03:40
| 89,613,961
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,795
|
java
|
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.panels.internal;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import javax.inject.Singleton;
import org.xwiki.bridge.DocumentAccessBridge;
import org.xwiki.component.annotation.Component;
import org.xwiki.component.manager.ComponentLookupException;
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.component.wiki.WikiComponent;
import org.xwiki.component.wiki.WikiComponentBuilder;
import org.xwiki.component.wiki.WikiComponentException;
import org.xwiki.component.wiki.internal.bridge.ContentParser;
import org.xwiki.model.reference.DocumentReference;
import org.xwiki.model.reference.DocumentReferenceResolver;
import org.xwiki.query.Query;
import org.xwiki.query.QueryManager;
import org.xwiki.rendering.block.XDOM;
import org.xwiki.rendering.syntax.Syntax;
import com.xpn.xwiki.XWikiContext;
/**
* Allows to build {@link PanelWikiUIExtension} components.
*
* @version $Id: a6408fce5c1cb1ff390fd16170801a3f24094c52 $
* @since 4.3M1
*/
@Component
@Singleton
@Named("panels")
public class PanelWikiUIExtensionComponentBuilder implements WikiComponentBuilder
{
/**
* The query manager, used to search for documents defining panels.
*/
@Inject
private QueryManager queryManager;
/**
* The component manager.
*/
@Inject
private ComponentManager componentManager;
/**
* Document access bridge.
*/
@Inject
private DocumentAccessBridge documentAccessBridge;
/**
* Content parser used to parse the panel content.
*/
@Inject
private ContentParser parser;
@Inject
@Named("current")
private DocumentReferenceResolver<String> currentResolver;
@Inject
private Provider<XWikiContext> xcontextProvider;
@Override
public List<DocumentReference> getDocumentReferences()
{
List<DocumentReference> references = new ArrayList<DocumentReference>();
try {
Query query =
queryManager.createQuery("select doc.fullName from Document doc, doc.object(Panels.PanelClass) "
+ "as panel", Query.XWQL);
List<String> results = query.execute();
for (String fullName : results) {
references.add(this.currentResolver.resolve(fullName));
}
} catch (Exception e) {
// Fail "silently"
e.printStackTrace();
}
return references;
}
@Override
public List<WikiComponent> buildComponents(DocumentReference reference) throws WikiComponentException
{
XWikiContext xcontext = this.xcontextProvider.get();
List<WikiComponent> components = new ArrayList<WikiComponent>();
DocumentReference panelXClass = new DocumentReference(xcontext.getWikiId(), "Panels", "PanelClass");
String content = (String) documentAccessBridge.getProperty(reference, panelXClass, "content");
Syntax syntax = null;
DocumentReference authorReference;
try {
syntax = documentAccessBridge.getDocument(reference).getSyntax();
authorReference = xcontext.getWiki().getDocument(reference, xcontext).getAuthorReference();
XDOM xdom = parser.parse(content, syntax, reference);
components.add(new PanelWikiUIExtension(reference, authorReference, xdom, syntax, componentManager));
} catch (WikiComponentException e) {
throw e;
} catch (ComponentLookupException e) {
throw new WikiComponentException(String.format("Failed to initialize Panel UI extension [%s]", reference),
e);
} catch (Exception e) {
throw new WikiComponentException(String.format("Failed to retrieve panel document [%s]", reference), e);
}
return components;
}
}
|
[
"caroline.landry@inria.fr"
] |
caroline.landry@inria.fr
|
cc4cde4d0059be1b17ac4bf14cd288151c0b949b
|
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
|
/genny_JavaWithLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava2/Foo168.java
|
5da44454449992ac12fb5575cde2af26f2dcd3c7
|
[] |
no_license
|
NikitaKozlov/generated-project-for-desugaring
|
0bc1443ab3ddc84cd289331c726761585766aea7
|
81506b3711004185070ca4bb9a93482b70011d36
|
refs/heads/master
| 2020-03-20T00:35:06.996525
| 2018-06-12T09:30:37
| 2018-06-12T09:30:37
| 137,049,317
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 575
|
java
|
package applicationModulepackageJava2;
public class Foo168 {
public void foo0() {
final Runnable anything0 = () -> System.out.println("anything");
new applicationModulepackageJava2.Foo167().foo9();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
public void foo6() {
foo5();
}
public void foo7() {
foo6();
}
public void foo8() {
foo7();
}
public void foo9() {
foo8();
}
}
|
[
"nikita.e.kozlov@gmail.com"
] |
nikita.e.kozlov@gmail.com
|
6f998b978e12d6b71bd40e3a8d4531da2ce903bc
|
c25e23ef29c7cfc0ad65cca639ecf9d6f012061d
|
/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailPostProcessActionTest.java
|
c9a165525744f71f74f5ea61cc270ccd5fc80995
|
[
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-unknown",
"Apache-2.0"
] |
permissive
|
sarvex/camel
|
e8bfe583d8220155492ed0caecad70e66e86ea87
|
1d2b4ec72403dc787d2515862a3511f9adbb3c9d
|
refs/heads/master
| 2023-05-11T18:05:22.102302
| 2023-05-02T02:06:27
| 2023-05-02T02:06:27
| 32,274,776
| 0
| 0
|
Apache-2.0
| 2023-05-02T02:06:28
| 2015-03-15T17:46:52
|
Java
|
UTF-8
|
Java
| false
| false
| 4,415
|
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.camel.component.mail;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.Store;
import javax.mail.internet.MimeMessage;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
import org.jvnet.mock_javamail.Mailbox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Tests if post process action is called if it is set
*/
public class MailPostProcessActionTest extends CamelTestSupport {
private static final Logger LOG = LoggerFactory.getLogger(MailPostProcessActionTest.class);
private TestPostProcessAction action;
@Override
public void setUp() throws Exception {
prepareMailbox();
action = new TestPostProcessAction();
super.setUp();
}
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
jndi.bind("postProcessAction", action);
return jndi;
}
@Test
public void testActionCalled() throws Exception {
Mailbox mailbox = Mailbox.get("bill@localhost");
assertEquals(1, mailbox.size());
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceivedInAnyOrder("TestText");
assertMockEndpointsSatisfied();
waitForActionCalled();
}
private void waitForActionCalled() throws InterruptedException {
// Wait for a maximum of 500 ms for the action to be called
for (int i = 0; i < 50; i++) {
if (action.hasBeenCalled()) {
break;
}
LOG.debug("Sleeping for 10 millis to wait for action call");
Thread.sleep(10);
}
assertEquals(true, action.hasBeenCalled());
}
private void prepareMailbox() throws Exception {
// connect to mailbox
Mailbox.clearAll();
JavaMailSender sender = new DefaultJavaMailSender();
Store store = sender.getSession().getStore("pop3");
store.connect("localhost", 25, "bill", "secret");
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_WRITE);
folder.expunge();
// inserts 1 new message
Message[] messages = new Message[1];
messages[0] = new MimeMessage(sender.getSession());
messages[0].setSubject("TestSubject");
messages[0].setText("TestText");
folder.appendMessages(messages);
folder.close(true);
}
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("pop3://bill@localhost?password=secret&postProcessAction=#postProcessAction").to("mock:result");
}
};
}
private class TestPostProcessAction implements MailBoxPostProcessAction {
private boolean called;
@Override
public void process(Folder folder) throws Exception {
// Assert that we are looking at the correct folder with our message
final Message[] messages = folder.getMessages();
assertEquals(1, messages.length);
assertEquals("TestSubject", messages[0].getSubject());
// And mark ourselves as "called"
called = true;
}
/**
* @return true if the action has been called
*/
public boolean hasBeenCalled() {
return called;
}
}
}
|
[
"willem.jiang@gmail.com"
] |
willem.jiang@gmail.com
|
de9f1b48fdf3a1697554051d396859a2e6b89145
|
3b29f755737aba6c34f1acbfffbea5afdc3373bb
|
/backend/ProyService1/src/main/java/com/dhl/serv/security/Http401UnauthorizedEntryPoint.java
|
d6f9ab2c7a51a4b0b114bab4fa8d4032dc0ef591
|
[
"Apache-2.0"
] |
permissive
|
gcorreageek/dhl
|
49061e89a87f067f776c4cc57eff8c11feaf171e
|
675f64b1cebd3ff098f96ae31aca732c6bd56959
|
refs/heads/master
| 2021-01-17T20:00:06.573510
| 2016-12-08T01:25:46
| 2016-12-08T01:25:46
| 69,813,084
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,105
|
java
|
package com.dhl.serv.security;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Returns a 401 error code (Unauthorized) to the client.
*/
@Component
public class Http401UnauthorizedEntryPoint implements AuthenticationEntryPoint {
private final Logger log = LoggerFactory.getLogger(Http401UnauthorizedEntryPoint.class);
/**
* Always returns a 401 error code to the client.
*/
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException arg2)
throws IOException,
ServletException {
log.debug("Pre-authenticated entry point called. Rejecting access");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Access Denied");
}
}
|
[
"gcorreageek@gmail.com"
] |
gcorreageek@gmail.com
|
fe90e5876c64f221ea975364b0ac52ec546efad0
|
74d6190633fbbc11805d6f665bacc692a30f1de0
|
/src/com/emitrom/ti4j/desktop/client/notification/NotificationObject.java
|
10d7f532dc46c526bff1ce650c1aa9950bb275c8
|
[
"Apache-2.0"
] |
permissive
|
sksastry/titanium4j
|
82c9d34fecb8555dda22f11abaf5453855c64f8a
|
0147de71a8746be60b3170f1258da62014281664
|
refs/heads/master
| 2021-01-18T04:34:01.384587
| 2014-02-02T21:31:40
| 2014-02-02T21:31:40
| 13,526,003
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,417
|
java
|
/************************************************************************
* NotificationObject.java is part of Ti4j 3.1.0 Copyright 2013 Emitrom LLC
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
**************************************************************************/
package com.emitrom.ti4j.desktop.client.notification;
import com.emitrom.ti4j.core.client.Function;
import com.emitrom.ti4j.core.client.ProxyObject;
import com.google.gwt.core.client.JavaScriptObject;
/**
* An object representing a Desktop notification.
*
* @author Ekambi
*
*/
public class NotificationObject extends ProxyObject {
protected NotificationObject(JavaScriptObject obj) {
jsObj = obj;
}
/**
* Set the notification message
*
* @param message
* , notification message text
* @return
*/
public final native String setMessage(String message)/*-{
var obj = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
return obj.setMessage(message);
}-*/;
/**
* Hide obj Notification.
*
* @return
*/
public final native boolean hide()/*-{
var obj = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
return obj.hide();
}-*/;
/**
* Set a callback function fired when notification is clicked.
*
* @param callback
* , function to execute when notification is clicked
* @return
*/
public final native String setCallback(Function callback)/*-{
return obj.setCallback(function() {
callback.@com.emitrom.ti4j.core.client.Function::execute()();
});
}-*/;
/**
* Set the notification icon image.
*
* @param icon
* , path to the icon image
* @return
*/
public final native String setIcon(String icon)/*-{
var obj = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
return obj.setIcon(icon);
}-*/;
/**
* Set the timeout before the notification expires.
*
* @param value
* , Timeout in seconds. (-1 = use system default
* @return
*/
public final native String setTimeout(int value)/*-{
var obj = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
return obj.setTimeout(value);
}-*/;
/**
* Set the notification title
*
* @param value
* , the notification title text
* @return
*/
public final native String setTitle(String value)/*-{
var obj = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
return obj.setTitle(value);
}-*/;
/**
* Display the notification
*/
public final native void show()/*-{
var obj = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
obj.show();
}-*/;
}
|
[
"jazzmatadazz@gmail.com"
] |
jazzmatadazz@gmail.com
|
ac064ed41b0111fb263620728ae853f637a4c13d
|
c7fb8e2272b1dd1212b45ad17fd76bbd8a9fd69a
|
/app/src/main/java/com/git/hubreeh/pojo/user/JobUserPOJO.java
|
62a85c01547ae4998a85a89e6a3dac5fb7e082aa
|
[] |
no_license
|
vishwakarmasunil68/hubreeh
|
ced28ef5791b343f665ee9f316dca1128aa4dbf1
|
616a7244c95ecf639586ac561ece86eaf186d8fc
|
refs/heads/master
| 2020-03-20T21:23:48.896055
| 2018-06-18T10:27:31
| 2018-06-18T10:27:31
| 137,738,638
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,806
|
java
|
package com.git.hubreeh.pojo.user;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class JobUserPOJO {
@SerializedName("user_id")
@Expose
private String userId;
@SerializedName("email")
@Expose
private String email;
@SerializedName("password")
@Expose
private String password;
@SerializedName("title")
@Expose
private String title;
@SerializedName("first_name")
@Expose
private String firstName;
@SerializedName("last_name")
@Expose
private String lastName;
@SerializedName("dob")
@Expose
private String dob;
@SerializedName("mobile")
@Expose
private String mobile;
@SerializedName("otp")
@Expose
private String otp;
@SerializedName("is_uae")
@Expose
private String isUae;
@SerializedName("category_id")
@Expose
private String categoryId;
@SerializedName("rate")
@Expose
private String rate;
@SerializedName("is_agree")
@Expose
private String isAgree;
@SerializedName("is_full")
@Expose
private String isFull;
@SerializedName("image")
@Expose
private String image;
@SerializedName("about_me")
@Expose
private String aboutMe;
@SerializedName("hear_us")
@Expose
private String hearUs;
@SerializedName("insurence")
@Expose
private String insurence;
@SerializedName("date_situation")
@Expose
private String dateSituation;
@SerializedName("student_loan")
@Expose
private String studentLoan;
@SerializedName("status")
@Expose
private String status;
@SerializedName("is_active")
@Expose
private String isActive;
@SerializedName("device_id")
@Expose
private String deviceId;
@SerializedName("os_type")
@Expose
private String osType;
@SerializedName("fcm_token")
@Expose
private String fcmToken;
@SerializedName("is_register")
@Expose
private String isRegister;
@SerializedName("latitude")
@Expose
private String latitude;
@SerializedName("longitude")
@Expose
private String longitude;
@SerializedName("created_on")
@Expose
private String createdOn;
@SerializedName("updated_on")
@Expose
private String updatedOn;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getDob() {
return dob;
}
public void setDob(String dob) {
this.dob = dob;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getOtp() {
return otp;
}
public void setOtp(String otp) {
this.otp = otp;
}
public String getIsUae() {
return isUae;
}
public void setIsUae(String isUae) {
this.isUae = isUae;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId;
}
public String getRate() {
return rate;
}
public void setRate(String rate) {
this.rate = rate;
}
public String getIsAgree() {
return isAgree;
}
public void setIsAgree(String isAgree) {
this.isAgree = isAgree;
}
public String getIsFull() {
return isFull;
}
public void setIsFull(String isFull) {
this.isFull = isFull;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getAboutMe() {
return aboutMe;
}
public void setAboutMe(String aboutMe) {
this.aboutMe = aboutMe;
}
public String getHearUs() {
return hearUs;
}
public void setHearUs(String hearUs) {
this.hearUs = hearUs;
}
public String getInsurence() {
return insurence;
}
public void setInsurence(String insurence) {
this.insurence = insurence;
}
public String getDateSituation() {
return dateSituation;
}
public void setDateSituation(String dateSituation) {
this.dateSituation = dateSituation;
}
public String getStudentLoan() {
return studentLoan;
}
public void setStudentLoan(String studentLoan) {
this.studentLoan = studentLoan;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getIsActive() {
return isActive;
}
public void setIsActive(String isActive) {
this.isActive = isActive;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getOsType() {
return osType;
}
public void setOsType(String osType) {
this.osType = osType;
}
public String getFcmToken() {
return fcmToken;
}
public void setFcmToken(String fcmToken) {
this.fcmToken = fcmToken;
}
public String getIsRegister() {
return isRegister;
}
public void setIsRegister(String isRegister) {
this.isRegister = isRegister;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getCreatedOn() {
return createdOn;
}
public void setCreatedOn(String createdOn) {
this.createdOn = createdOn;
}
public String getUpdatedOn() {
return updatedOn;
}
public void setUpdatedOn(String updatedOn) {
this.updatedOn = updatedOn;
}
}
|
[
"vishwakarmasunil68@gmail.com"
] |
vishwakarmasunil68@gmail.com
|
8a8558b30303613492865d159a9011a51c04d011
|
db97ce70bd53e5c258ecda4c34a5ec641e12d488
|
/src/main/java/com/alipay/api/response/AlipayOpenIotDeviceUnbindResponse.java
|
8f454864465d4079f586f992acd8f18ff7404309
|
[
"Apache-2.0"
] |
permissive
|
smitzhang/alipay-sdk-java-all
|
dccc7493c03b3c937f93e7e2be750619f9bed068
|
a835a9c91e800e7c9350d479e84f9a74b211f0c4
|
refs/heads/master
| 2022-11-23T20:32:27.041116
| 2020-08-03T13:03:02
| 2020-08-03T13:03:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 369
|
java
|
package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.iot.device.unbind response.
*
* @author auto create
* @since 1.0, 2020-06-12 22:52:28
*/
public class AlipayOpenIotDeviceUnbindResponse extends AlipayResponse {
private static final long serialVersionUID = 6384457932321734637L;
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
70d495e32b2e654279d6e11e6691724a4c7f46ec
|
ed5159d056e98d6715357d0d14a9b3f20b764f89
|
/src/irvine/oeis/a302/A302351.java
|
a74c55161331f4c862cf50b5c314b512fe4db9c0
|
[] |
no_license
|
flywind2/joeis
|
c5753169cf562939b04dd246f8a2958e97f74558
|
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
|
refs/heads/master
| 2020-09-13T18:34:35.080552
| 2019-11-19T05:40:55
| 2019-11-19T05:40:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 478
|
java
|
package irvine.oeis.a302;
// Generated by gen_pattern.pl - DO NOT EDIT here!
import irvine.oeis.GeneratingFunctionSequence;
/**
* A302351 Hyper-Wiener index of body-centered cubic grid cells in a row.
* @author Georg Fischer
*/
public class A302351 extends GeneratingFunctionSequence {
/** Construct the sequence. */
public A302351() {
super(1, new long[] {0, 92, -83, 163, -90, 18, 50, -250, 500, -500, 250, -50},
new long[] {1, -5, 10, -10, 5, -1});
}
}
|
[
"sean.irvine@realtimegenomics.com"
] |
sean.irvine@realtimegenomics.com
|
64dfa761d20273ac4827626ad90adb4c1a79ba97
|
8910b49b7d5346d813825293dcba64e0ac1561e6
|
/src/LC5236.java
|
b26f64ef0f93333069464b9187490a4e0caa0f57
|
[] |
no_license
|
TaurusGGBOY/AlgorithmCode
|
253242d31d3c61d12c479111a2e225d0896cd70b
|
e58f1b7af51184ec69a5687e40a778a38f654b85
|
refs/heads/master
| 2023-08-05T07:49:02.811106
| 2023-07-30T03:03:16
| 2023-07-30T03:03:16
| 131,671,067
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 406
|
java
|
class Solution {
public int minDeletion(int[] nums) {
int i = 0;
int count = 0;
for (; i < nums.length - 1; ) {
int j = i + 1;
if (nums[i] == nums[j]) {
count++;
i++;
continue;
}
i = j + 1;
}
if ((nums.length - count) % 2 == 1) count++;
return count;
}
}
|
[
"854357635@qq.com"
] |
854357635@qq.com
|
c2fb00990ab5414a74bb6406943abca4edf23ebc
|
e7565cd8276c3e2da6fa5c7229baf91563799bbd
|
/server/ngb-cli/src/main/java/com/epam/ngb/cli/manager/command/handler/CommandHandler.java
|
e8b90c12ed162e22e5e080f55539624fd2c3c20c
|
[
"MIT"
] |
permissive
|
epam/NGB
|
a89b12d24fd289a63d511c4bbd79cc6966ea910d
|
cb8fc7e95d1d0e064f4eb2b2f487f853c0234592
|
refs/heads/develop
| 2023-08-31T22:49:54.667420
| 2023-08-31T10:30:01
| 2023-08-31T10:30:01
| 72,222,405
| 153
| 61
|
MIT
| 2023-09-14T13:37:11
| 2016-10-28T16:07:22
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 1,776
|
java
|
/*
* MIT License
*
* Copyright (c) 2016 EPAM Systems
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.epam.ngb.cli.manager.command.handler;
import java.util.List;
import com.epam.ngb.cli.app.ApplicationOptions;
/**
* {@code CommandHandler} provides an interface for checking input command line arguments and options
* and running CLi commands.
*/
public interface CommandHandler {
/**
* Checks input command line arguments and options
* @param arguments from command line
* @param options from command line
*/
void parseAndVerifyArguments(List<String> arguments, ApplicationOptions options);
/**
* Launches command execution
* @return 0 on success
*/
int runCommand();
}
|
[
"aleksandr_sidoruk@epam.com"
] |
aleksandr_sidoruk@epam.com
|
b297f6c1b386da6c6ee056ac1d95697d800d0f18
|
680a1f11f125387b815d4b09b62a3e57a253a804
|
/library/src/main/java/com/qianyilc/library/http/client/RequestCallBack.java
|
8b3cf7266456d88351fdb6f7600f50da26bcdd64
|
[] |
no_license
|
dvlp-news/dvlpTrunk
|
99d0b5d1ae230adf6d56f6114d466d515b748061
|
1c03d294431ce96aa913666a08e2e0edf16c7ff0
|
refs/heads/master
| 2020-03-11T08:11:29.110338
| 2018-04-22T10:04:16
| 2018-04-22T10:04:16
| 129,877,223
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 171
|
java
|
package com.qianyilc.library.http.client;
/**
* Created by leju on 2015/2/3.
*/
public interface RequestCallBack <M>{
void onResult(M m, Object... objects) ;
}
|
[
"你的邮箱"
] |
你的邮箱
|
92e2918ea6ae97849435a3910749c6d61ad111a0
|
315af64ea65cc45354e8a393ab2b9aa13337b446
|
/cofpasgers/src/main/java/com/huiketong/cofpasgers/repository/OrderRepository.java
|
9aa09dc0e59944f85279eca7a8843be8f3299491
|
[
"Apache-2.0"
] |
permissive
|
ZuofeiGithub/javaweb_huiketong
|
3d7d3777f9081101fa1fc4ac6bdb25ff96010b23
|
0c2e630fd1be9a0ecf02230acf6b82e9b6bc8b2c
|
refs/heads/master
| 2020-04-19T08:01:30.179765
| 2019-05-28T07:58:26
| 2019-05-28T07:58:26
| 168,064,380
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 675
|
java
|
package com.huiketong.cofpasgers.repository;
import com.huiketong.cofpasgers.entity.Order;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
/**
* @Author: 左飞
* @Date: 2019/1/14 14:35
* @Version 1.0
*/
@Repository
public interface OrderRepository extends JpaRepository<Order, Integer> {
@Override
<S extends Order> S save(S entity);
@Query(value = "update t_order set status = ?1 where order_id = ?2", nativeQuery = true)
void updateOrderStatus(Integer status, String out_trade_no);
Order findOrderByOrderId(String orderId);
}
|
[
"348068347@qq.com"
] |
348068347@qq.com
|
dab38be8d63e941ac349c5b05ba9232f46bf39d9
|
ee95f1ef9a2b121b3cbc001e1bdc5e9dfe7c1699
|
/one/src/main/java/com/skysport/interfaces/model/jc/IJcOilProofService.java
|
9f6da77dfed8eae19f4f76d209f47c269f01bb17
|
[
"Apache-2.0"
] |
permissive
|
CQJGY/open-erp
|
a7d164b7854ef0b996846ef8937f95fdbe5b3f3e
|
1104916fabcb33d91d29bd2397ba4a50b72249c4
|
refs/heads/master
| 2022-11-14T04:51:50.569530
| 2020-07-09T03:55:42
| 2020-07-09T03:55:42
| 278,257,720
| 0
| 1
|
Apache-2.0
| 2020-07-09T03:54:50
| 2020-07-09T03:54:50
| null |
UTF-8
|
Java
| false
| false
| 289
|
java
|
package com.skysport.interfaces.model.jc;
import com.skysport.core.model.common.ICommonService;
import com.skysport.interfaces.bean.jc.JcOilProof;
/**
* 类说明:
* Created by zhangjh on 2016-7-7 14:01:39
*/
public interface IJcOilProofService extends ICommonService<JcOilProof> {
}
|
[
"firebata@gmail.com"
] |
firebata@gmail.com
|
13b7364163bbd211ce206f64cc92f6fc4ab8b57a
|
62e334192393326476756dfa89dce9f0f08570d4
|
/tk_code/morphling/morphling-server/src/main/java/com/huatu/morphling/spring/security/SecurityUser.java
|
41da2f3fa443268b03ff57a561e6115dc5c1172c
|
[] |
no_license
|
JellyB/code_back
|
4796d5816ba6ff6f3925fded9d75254536a5ddcf
|
f5cecf3a9efd6851724a1315813337a0741bd89d
|
refs/heads/master
| 2022-07-16T14:19:39.770569
| 2019-11-22T09:22:12
| 2019-11-22T09:22:12
| 223,366,837
| 1
| 2
| null | 2022-06-30T20:21:38
| 2019-11-22T09:15:50
|
Java
|
UTF-8
|
Java
| false
| false
| 1,809
|
java
|
package com.huatu.morphling.spring.security;
import com.huatu.morphling.bean.UserInfo;
import org.springframework.security.core.CredentialsContainer;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.util.Assert;
import java.util.Collection;
import java.util.stream.Collectors;
import static com.huatu.morphling.common.consts.SecurityConsts.ROLE_PREFIX;
/**
* @author hanchao
* @date 2017/11/6 10:56
*/
public class SecurityUser implements UserDetails,CredentialsContainer {
private UserInfo userInfo;
private Collection<? extends GrantedAuthority> authorities;
public SecurityUser(UserInfo userInfo){
Assert.notNull(userInfo,"userinfo cant be null");
this.userInfo = userInfo;
authorities = userInfo.getRoles().stream().map(role -> new SimpleGrantedAuthority(ROLE_PREFIX+role)).collect(Collectors.toSet());
}
public UserInfo getUserInfo() {
return userInfo;
}
@Override
public Collection<? extends GrantedAuthority> getAuthorities() {
return authorities;
}
@Override
public String getPassword() {
return null;
}
@Override
public String getUsername() {
return userInfo.getUsername();
}
@Override
public boolean isAccountNonExpired() {
return true;
}
@Override
public boolean isAccountNonLocked() {
return true;
}
@Override
public boolean isCredentialsNonExpired() {
return true;
}
@Override
public boolean isEnabled() {
return true;
}
@Override
public void eraseCredentials() {
//nothing to do
}
}
|
[
"jelly_b@126.com"
] |
jelly_b@126.com
|
17db9bcbfd5984edad948683bd23b2ec7706709b
|
9452fb44a123d727d3797029d25d32ff3aa0d961
|
/core/src/ua/gram/munhauzen/interaction/timer2/animation/Bomb.java
|
3c5ed1cfc12fc84bd5ba0502934f5d1310b4316c
|
[] |
no_license
|
gram7gram/Munhauzen
|
5fa03a8987cae93f022731cdefd9fbfeabd0fb55
|
34ab3c5b7e60180fea377d57602b4497a286d368
|
refs/heads/release2
| 2021-06-22T13:04:15.325915
| 2020-11-14T21:19:50
| 2020-11-14T21:19:50
| 179,847,699
| 2
| 2
| null | 2020-11-08T10:04:18
| 2019-04-06T15:04:04
|
Objective-C
|
UTF-8
|
Java
| false
| false
| 620
|
java
|
package ua.gram.munhauzen.interaction.timer2.animation;
import com.badlogic.gdx.graphics.Texture;
import ua.gram.munhauzen.MunhauzenGame;
import ua.gram.munhauzen.ui.FitImage;
/**
* @author Gram <gram7gram@gmail.com>
*/
public class Bomb extends FitImage {
public Bomb(Texture texture) {
super(texture);
float width = MunhauzenGame.WORLD_WIDTH / 8f;
float scale = 1f * width / getDrawable().getMinWidth();
float height = 1f * getDrawable().getMinHeight() * scale;
setSize(width, height);
setPosition(0, MunhauzenGame.WORLD_HEIGHT / 4f - height / 2f);
}
}
|
[
"gram7gram@gmail.com"
] |
gram7gram@gmail.com
|
ed26517a3f883274a47d200c73cdbcfdf1260d47
|
cfe730168e490e35962aa885cce7353f01bcc8d3
|
/src/test/java/com/github/akurilov/commons/concurrent/throttle/SequentialWeightsThrottleTest.java
|
54b71adb5acd7a8d63a5fd36fa0caa7122ce7470
|
[
"Apache-2.0"
] |
permissive
|
akurilov/java-commons
|
d46a54312d015030fe453bb1ff87697d58fd3f63
|
b398cb351930738c55d5070871e576b576a0f138
|
refs/heads/master
| 2021-01-22T17:39:28.707173
| 2019-04-08T14:52:31
| 2019-04-08T14:52:31
| 100,730,592
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,811
|
java
|
package com.github.akurilov.commons.concurrent.throttle;
import org.junit.Test;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.LongAdder;
import static org.junit.Assert.assertEquals;
/**
Created by andrey on 06.11.16.
*/
public class SequentialWeightsThrottleTest {
private static final int WRITE = 0;
private static final int READ = 1;
private final int[] weights = new int[] {
80,
20
};
private final LongAdder[] resultCounters = new LongAdder[] {
new LongAdder(),
new LongAdder()
};
private final SequentialWeightsThrottle wt = new SequentialWeightsThrottle(weights);
@Test
public void testRequestApprovalFor()
throws Exception {
final ExecutorService es = Executors.newFixedThreadPool(2);
es.submit(new SubmTask(WRITE, wt, resultCounters));
es.submit(new SubmTask(READ, wt, resultCounters));
es.awaitTermination(10, TimeUnit.SECONDS);
es.shutdownNow();
final double writes = resultCounters[WRITE].sum();
final long reads = resultCounters[READ].sum();
assertEquals(80/20, writes / reads, 0.01);
System.out.println("Write rate: " + writes / 10 + " Hz, read rate: " + reads / 10 + " Hz");
}
@Test
public void testRequestBatchApprovalFor()
throws Exception {
final ExecutorService es = Executors.newFixedThreadPool(2);
es.submit(new BatchSubmTask(WRITE, wt, resultCounters));
es.submit(new BatchSubmTask(READ, wt, resultCounters));
es.awaitTermination(10, TimeUnit.SECONDS);
es.shutdownNow();
final double writes = resultCounters[WRITE].sum();
final long reads = resultCounters[READ].sum();
assertEquals(80/20, writes / reads, 0.01);
System.out.println("Write rate: " + writes / 10 + " Hz, read rate: " + reads / 10 + " Hz");
}
}
|
[
"andrey.kurilov@emc.com"
] |
andrey.kurilov@emc.com
|
d7958632369050115f7b4f1c2efd3cd9dcb1892a
|
5997633f833b5c0172b7f774eeb2350f64cedbd7
|
/webapp/src/main/java/com/box/l10n/mojito/service/blobstorage/Retention.java
|
f3b4e5bd592bdad40bb31b9509384877fe723b32
|
[
"Apache-2.0"
] |
permissive
|
boxmoji/mojito
|
42b5cceffba891ec3750d1bcf8a8160af21608ce
|
03b3c9f8602697b37278dcee131cf9cb9b53bb5c
|
refs/heads/master
| 2023-08-09T21:43:44.325425
| 2020-09-01T19:18:35
| 2020-09-01T20:07:54
| 70,105,535
| 0
| 0
|
Apache-2.0
| 2020-09-15T03:26:28
| 2016-10-05T22:48:30
|
Java
|
UTF-8
|
Java
| false
| false
| 273
|
java
|
package com.box.l10n.mojito.service.blobstorage;
/**
* Retention policy for blobs.
*/
public enum Retention {
/**
* For blobs that must be kept forever
*/
PERMANENT,
/**
* For blobs that should be kept at least one day
*/
MIN_1_DAY
}
|
[
"aurambaj@users.noreply.github.com"
] |
aurambaj@users.noreply.github.com
|
9697f9179a58edb105f6638f03fb4e6ad1007c7b
|
acd9b11687fd0b5d536823daf4183a596d4502b2
|
/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.java
|
7ec49eec46cc6d99e02f7dde5d3bc0a99ca269f5
|
[
"Apache-2.0"
] |
permissive
|
szabosteve/elasticsearch-java
|
75be71df80a4e010abe334a5288b53fa4a2d6d5e
|
79a1249ae77be2ce9ebd5075c1719f3c8be49013
|
refs/heads/main
| 2023-08-24T15:36:51.047105
| 2021-10-01T14:23:34
| 2021-10-01T14:23:34
| 399,091,850
| 0
| 0
|
Apache-2.0
| 2021-08-23T12:15:19
| 2021-08-23T12:15:19
| null |
UTF-8
|
Java
| false
| false
| 5,809
|
java
|
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. 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.
*/
//----------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------
package co.elastic.clients.elasticsearch.indices;
import co.elastic.clients.base.ElasticsearchError;
import co.elastic.clients.base.Endpoint;
import co.elastic.clients.base.SimpleEndpoint;
import co.elastic.clients.elasticsearch._types.ExpandWildcardOptions;
import co.elastic.clients.elasticsearch._types.RequestBase;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.ObjectBuilderDeserializer;
import co.elastic.clients.json.ObjectDeserializer;
import co.elastic.clients.util.ModelTypeHelper;
import co.elastic.clients.util.ObjectBuilder;
import jakarta.json.stream.JsonGenerator;
import java.lang.String;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
// typedef: indices.data_streams_stats.Request
public final class DataStreamsStatsRequest extends RequestBase {
@Nullable
private final String name;
@Nullable
private final List<ExpandWildcardOptions> expandWildcards;
// ---------------------------------------------------------------------------------------------
public DataStreamsStatsRequest(Builder builder) {
this.name = builder.name;
this.expandWildcards = ModelTypeHelper.unmodifiable(builder.expandWildcards);
}
public DataStreamsStatsRequest(Function<Builder, Builder> fn) {
this(fn.apply(new Builder()));
}
/**
* A comma-separated list of data stream names; use <code>_all</code> or empty
* string to perform the operation on all data streams
* <p>
* API name: {@code name}
*/
@Nullable
public String name() {
return this.name;
}
/**
* API name: {@code expand_wildcards}
*/
@Nullable
public List<ExpandWildcardOptions> expandWildcards() {
return this.expandWildcards;
}
// ---------------------------------------------------------------------------------------------
/**
* Builder for {@link DataStreamsStatsRequest}.
*/
public static class Builder implements ObjectBuilder<DataStreamsStatsRequest> {
@Nullable
private String name;
@Nullable
private List<ExpandWildcardOptions> expandWildcards;
/**
* A comma-separated list of data stream names; use <code>_all</code> or empty
* string to perform the operation on all data streams
* <p>
* API name: {@code name}
*/
public Builder name(@Nullable String value) {
this.name = value;
return this;
}
/**
* API name: {@code expand_wildcards}
*/
public Builder expandWildcards(@Nullable List<ExpandWildcardOptions> value) {
this.expandWildcards = value;
return this;
}
/**
* API name: {@code expand_wildcards}
*/
public Builder expandWildcards(ExpandWildcardOptions... value) {
this.expandWildcards = Arrays.asList(value);
return this;
}
/**
* Add a value to {@link #expandWildcards(List)}, creating the list if needed. 4
*/
public Builder addExpandWildcards(ExpandWildcardOptions value) {
if (this.expandWildcards == null) {
this.expandWildcards = new ArrayList<>();
}
this.expandWildcards.add(value);
return this;
}
/**
* Builds a {@link DataStreamsStatsRequest}.
*
* @throws NullPointerException
* if some of the required fields are null.
*/
public DataStreamsStatsRequest build() {
return new DataStreamsStatsRequest(this);
}
}
// ---------------------------------------------------------------------------------------------
/**
* Endpoint "{@code indices.data_streams_stats}".
*/
public static final Endpoint<DataStreamsStatsRequest, DataStreamsStatsResponse, ElasticsearchError> ENDPOINT = new SimpleEndpoint<>(
// Request method
request -> {
return "GET";
},
// Request path
request -> {
final int _name = 1 << 0;
int propsSet = 0;
if (request.name() != null)
propsSet |= _name;
if (propsSet == 0) {
StringBuilder buf = new StringBuilder();
buf.append("/_data_stream");
buf.append("/_stats");
return buf.toString();
}
if (propsSet == (_name)) {
StringBuilder buf = new StringBuilder();
buf.append("/_data_stream");
buf.append("/");
SimpleEndpoint.pathEncode(request.name, buf);
buf.append("/_stats");
return buf.toString();
}
throw SimpleEndpoint.noPathTemplateFound("path");
},
// Request parameters
request -> {
Map<String, String> params = new HashMap<>();
if (request.expandWildcards != null) {
params.put("expand_wildcards",
request.expandWildcards.stream().map(v -> v.toString()).collect(Collectors.joining(",")));
}
return params;
}, SimpleEndpoint.emptyMap(), false, DataStreamsStatsResponse._DESERIALIZER);
}
|
[
"sylvain@elastic.co"
] |
sylvain@elastic.co
|
d2babcb6afb1fb6a882f7dc0a9a7696bfe50df05
|
9af04cd180ba35af2de4c446809cd6e7e5cdc1f4
|
/app/src/main/java/com/yuan7/tomcat/bean/ResultEntity.java
|
72799557432478a2696738a02acd6c74c2eb90c8
|
[] |
no_license
|
jv-lee/Yuan7Application
|
bb3f25501c7bed7bedd70115bf7c4a89222f33bb
|
f07ff5e06755e306d6f415e98774b21748eae613
|
refs/heads/master
| 2021-01-22T07:51:53.474516
| 2017-10-13T01:40:45
| 2017-10-13T01:40:45
| 92,580,003
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 597
|
java
|
package com.yuan7.tomcat.bean;
/**
* Created by Administrator on 2017/9/7.
*/
public class ResultEntity<T> {
private int code;
private String message;
private ObjEntity<T> obj;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public ObjEntity getObj() {
return obj;
}
public void setObj(ObjEntity obj) {
this.obj = obj;
}
}
|
[
"jv.lee@foxmail.com"
] |
jv.lee@foxmail.com
|
3b2bda5d4965dbdc12fa16a595128eaa26b4d12a
|
5f4afbc92a72bd847b8aa9ae95f9be9d706ad7d8
|
/common-service/common-trade-system/src/test/java/com/westangel/commonservice/trade/service/test/PayServiceTest.java
|
3aa91f3c30e0774dbc1196ba1e9ca3a5944b9c45
|
[] |
no_license
|
331491512/esz
|
dfc13ba9e142ab1cbacc92cd0bf1b55fec2a05a1
|
8edd10a74b75d36d3963d2ae64602d02ba548b43
|
refs/heads/master
| 2021-04-06T20:31:45.968785
| 2018-03-16T02:56:36
| 2018-03-16T02:56:36
| 125,451,748
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,480
|
java
|
///**
// *
// */
//package com.westangel.commonservice.trade.service.test;
//
//import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppContextSetup;
//
//import javax.annotation.Resource;
//
//import org.junit.Before;
//import org.junit.Ignore;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.test.context.ContextConfiguration;
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//import org.springframework.test.context.web.WebAppConfiguration;
//import org.springframework.test.web.servlet.MockMvc;
//import org.springframework.web.context.WebApplicationContext;
//
//import com.westangel.commonservice.trade.service.pay.PayService;
//
///**
// * @author zhiyinglong
// * @date 2016年2月1日 下午5:34:28
// */
//@RunWith(SpringJUnit4ClassRunner.class)
//@WebAppConfiguration(value = "/WebContent")
//@ContextConfiguration({ "classpath:spring/application.xml" })
//public class PayServiceTest {
//
// @Autowired
// private WebApplicationContext wac;
//
// @Resource(name="payServiceImpl")
// PayService payService;
//
//
// private MockMvc mockMvc;
//
// @Before
// public void setup() {
// this.mockMvc = webAppContextSetup(this.wac).build();
// }
//
// /**
// *
// */
// @Test
// public void refund() throws Exception {
// String orderId= "ORDE20160201165240840875";
// payService.refund(orderId);
// }
//
//}
|
[
"zhuguo@qgs-china.com"
] |
zhuguo@qgs-china.com
|
d59dea1da3a977b52b24086806dc5bd08cf923bd
|
8dadce08a76ce387608951673fc0364feaa9a06a
|
/flexodesktop/GUI/flexo/src/main/java/org/openflexo/view/controller/FlexoDocInspectorController.java
|
fe57ddc88379a33819875a77c305acb886f0de20
|
[] |
no_license
|
melbarra/openflexo
|
b8e1a97d73a9edebad198df4e776d396ae8e9a09
|
9b2d8efe1982ec8f64dee8c43a2e7207594853f3
|
refs/heads/master
| 2021-01-24T02:22:47.141424
| 2012-03-12T00:15:57
| 2012-03-12T00:15:57
| 2,756,256
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,362
|
java
|
/*
* (c) Copyright 2010-2011 AgileBirds
*
* This file is part of OpenFlexo.
*
* OpenFlexo 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.
*
* OpenFlexo 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 OpenFlexo. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.openflexo.view.controller;
import java.io.FileNotFoundException;
import java.util.logging.Logger;
import javax.swing.BorderFactory;
import org.openflexo.ch.DefaultInspectorHelpDelegate;
import org.openflexo.drm.DocResourceManager;
import org.openflexo.foundation.Inspectors;
import org.openflexo.inspector.InspectorSinglePanel;
import org.openflexo.inspector.model.InspectorModel;
import org.openflexo.inspector.model.TabModel;
public class FlexoDocInspectorController extends FlexoInspectorController {
private static final Logger logger = Logger.getLogger(FlexoDocInspectorController.class.getPackage().getName());
protected InspectorSinglePanel _docInspectorPanel;
protected FlexoDocInspectorController(FlexoController controller)
{
super(controller.new FlexoControllerInspectorDelegate(),
new DefaultInspectorHelpDelegate(DocResourceManager.instance()));
if (getDocTabModel() != null) {
_docInspectorPanel = createInspectorSinglePanel(getDocTabModel());
_docInspectorPanel.setBorder(BorderFactory.createEmptyBorder());
}
}
public InspectorSinglePanel getDocInspectorPanel()
{
return _docInspectorPanel;
}
private TabModel _docTabModel;
private TabModel getDocTabModel()
{
if (_docTabModel == null) {
try {
InspectorModel docInspectorModel = importInspectorFile(Inspectors.getDocInspectorFile(/*getInspectorDirectory()*/));
_docTabModel = docInspectorModel.getTabs().elements().nextElement();
} catch (FileNotFoundException e) {
logger.warning("DocForModelObject.inspector NOT FOUND");
}
}
return _docTabModel;
}
}
|
[
"guillaume.polet@gmail.com"
] |
guillaume.polet@gmail.com
|
342277bf4a0aa81f87e6456a1eaafdc011758784
|
92f10c41bad09bee05acbcb952095c31ba41c57b
|
/app/src/main/java/io/github/alula/ohmygod/MainActivity3481.java
|
1bc37e6d69998c525cdcf52cd79317d96ff8873e
|
[] |
no_license
|
alula/10000-activities
|
bb25be9aead3d3d2ea9f9ef8d1da4c8dff1a7c62
|
f7e8de658c3684035e566788693726f250170d98
|
refs/heads/master
| 2022-07-30T05:54:54.783531
| 2022-01-29T19:53:04
| 2022-01-29T19:53:04
| 453,501,018
| 16
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 339
|
java
|
package io.github.alula.ohmygod;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity3481 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
|
[
"6276139+alula@users.noreply.github.com"
] |
6276139+alula@users.noreply.github.com
|
1cde8ef6580c808bb4ebcb6bf80bde34bf1ca6fc
|
bacd99275ac7f5c313736355fde8234a83b38bc5
|
/iaudience/src/main/java/com/iclick/symphony/iaudience/model/remote/Interest.java
|
79eeb69361923ba15e0f7b97b31ee24e877b027e
|
[] |
no_license
|
sunwenjie/iaudience_pro
|
5a97c8ba38b26f84b4bcd9cab2c747c8d5e2c1b6
|
3cf86b537c92c6c24e262fb60745f12cc4c5e8d8
|
refs/heads/master
| 2020-12-03T01:52:00.893882
| 2017-06-30T10:39:59
| 2017-06-30T10:39:59
| 95,874,898
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 568
|
java
|
package com.iclick.symphony.iaudience.model.remote;
public class Interest extends AttributeBase {
private String en_name;
private String zh_cn_name;
public Interest() {
}
public Interest(String key) {
super(key);
}
public String getEn_name() {
return en_name;
}
public void setEn_name(String en_name) {
this.en_name = en_name;
}
public String getZh_cn_name() {
return zh_cn_name;
}
public void setZh_cn_name(String zh_cn_name) {
this.zh_cn_name = zh_cn_name;
}
}
|
[
"wenjie.sun@i-click.com"
] |
wenjie.sun@i-click.com
|
4d19c0ffa9af05f7ef504372f57d85e3f9844f9c
|
44e899f92df3ace36d8a626a56646d826886c8aa
|
/src/main/java/com/gok/ticketingbatch/domain/PatientActivity.java
|
d1b6341599d9aafe585f95020c209e76761ed18c
|
[] |
no_license
|
ArkapravoNath/Ticketing-batch
|
4ce0558c78269b63f6aa18483ac1c56905093ccc
|
fe644f18ee971c0975f7daee212ce787516609e9
|
refs/heads/master
| 2022-12-16T18:31:00.067937
| 2020-09-01T10:26:39
| 2020-09-01T10:26:39
| 291,965,723
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,562
|
java
|
package com.gok.ticketingbatch.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
/**
* A PatientActivity.
*/
@Entity
@Table(name = "patient_activity")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class PatientActivity extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@Column(name = "activity_type")
private String activityType;
@Column(name = "activity_remark")
private String activityRemark;
@Column(name = "status")
private String status;
@Column(name = "risk_level")
private String riskLevel;
@Column(name = "person_id_ref")
private Long personIdRef;
@Column(name = "current_address_id_ref")
private Long currentAddressIdRef;
@OneToMany(mappedBy = "patientActivity")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
private Set<AmbulanceActivity> ambulanceActivities = new HashSet<>();
@ManyToOne
@JsonIgnoreProperties(value = "patientActivities", allowSetters = true)
private Patient patient;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getActivityType() {
return activityType;
}
public PatientActivity activityType(String activityType) {
this.activityType = activityType;
return this;
}
public void setActivityType(String activityType) {
this.activityType = activityType;
}
public String getActivityRemark() {
return activityRemark;
}
public PatientActivity activityRemark(String activityRemark) {
this.activityRemark = activityRemark;
return this;
}
public void setActivityRemark(String activityRemark) {
this.activityRemark = activityRemark;
}
public String getStatus() {
return status;
}
public PatientActivity status(String status) {
this.status = status;
return this;
}
public void setStatus(String status) {
this.status = status;
}
public String getRiskLevel() {
return riskLevel;
}
public PatientActivity riskLevel(String riskLevel) {
this.riskLevel = riskLevel;
return this;
}
public void setRiskLevel(String riskLevel) {
this.riskLevel = riskLevel;
}
public Long getPersonIdRef() {
return personIdRef;
}
public PatientActivity personIdRef(Long personIdRef) {
this.personIdRef = personIdRef;
return this;
}
public void setPersonIdRef(Long personIdRef) {
this.personIdRef = personIdRef;
}
public Long getCurrentAddressIdRef() {
return currentAddressIdRef;
}
public PatientActivity currentAddressIdRef(Long currentAddressIdRef) {
this.currentAddressIdRef = currentAddressIdRef;
return this;
}
public void setCurrentAddressIdRef(Long currentAddressIdRef) {
this.currentAddressIdRef = currentAddressIdRef;
}
public Set<AmbulanceActivity> getAmbulanceActivities() {
return ambulanceActivities;
}
public PatientActivity ambulanceActivities(Set<AmbulanceActivity> ambulanceActivities) {
this.ambulanceActivities = ambulanceActivities;
return this;
}
public PatientActivity addAmbulanceActivity(AmbulanceActivity ambulanceActivity) {
this.ambulanceActivities.add(ambulanceActivity);
ambulanceActivity.setPatientActivity(this);
return this;
}
public PatientActivity removeAmbulanceActivity(AmbulanceActivity ambulanceActivity) {
this.ambulanceActivities.remove(ambulanceActivity);
ambulanceActivity.setPatientActivity(null);
return this;
}
public void setAmbulanceActivities(Set<AmbulanceActivity> ambulanceActivities) {
this.ambulanceActivities = ambulanceActivities;
}
public Patient getPatient() {
return patient;
}
public PatientActivity patient(Patient patient) {
this.patient = patient;
return this;
}
public void setPatient(Patient patient) {
this.patient = patient;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof PatientActivity)) {
return false;
}
return id != null && id.equals(((PatientActivity) o).id);
}
@Override
public int hashCode() {
return 31;
}
// prettier-ignore
@Override
public String toString() {
return "PatientActivity{" +
"id=" + getId() +
", activityType='" + getActivityType() + "'" +
", activityRemark='" + getActivityRemark() + "'" +
", status='" + getStatus() + "'" +
", riskLevel='" + getRiskLevel() + "'" +
", personIdRef=" + getPersonIdRef() +
", currentAddressIdRef=" + getCurrentAddressIdRef() +
"}";
}
}
|
[
"nrko96@gmail.com"
] |
nrko96@gmail.com
|
4b66a928e17a372f27ae8db2d0df32fe457ba89a
|
d4980cf39c75200fd470e3fa2ddddb82e440bfc0
|
/src/main/java/com/bank/ib/service/CardService.java
|
3ca471cd5d8fba3a342d9e90be893ccd4688d105
|
[] |
no_license
|
chuxuantinh/InternetBanking2-ct
|
886ec8f34f4c6c0e1315e1af20fba3e9534cf950
|
e9e4f61af38e84cb9387923677c527f4cf1ad24f
|
refs/heads/master
| 2022-11-28T22:19:28.670527
| 2020-08-20T02:26:30
| 2020-08-20T02:26:30
| 288,885,645
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 165
|
java
|
package com.bank.ib.service;
import com.bank.ib.model.Card;
public interface CardService extends GenericService<Card, Integer> {
void prepareCard(Card c);
}
|
[
"50776038+chuxuantinh@users.noreply.github.com"
] |
50776038+chuxuantinh@users.noreply.github.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.