blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 1
79
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9d86666ff5e794a78a53b9e4942bc64b0050d7c9 | cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b | /AndroidApplications/com.zeptolab.ctr.ads-912244/src/com/IQzone/postitial/obfuscated/hq.java | 58ac834c19e5d9ad4b957590282efc16708c3260 | [] | no_license | linux86/AndoirdSecurity | 3165de73b37f53070cd6b435e180a2cb58d6f672 | 1e72a3c1f7a72ea9cd12048d9874a8651e0aede7 | refs/heads/master | 2021-01-11T01:20:58.986651 | 2016-04-05T17:14:26 | 2016-04-05T17:14:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 401 | java | package com.IQzone.postitial.obfuscated;
final class hq implements Runnable {
private /* synthetic */ int a;
private /* synthetic */ hf b;
hq(hf hfVar, int i) {
this.b = hfVar;
this.a = i;
}
public final void run() {
try {
this.b.a.a("postitial-ads-day", String.valueOf(this.a));
} catch (om e) {
gv.i();
}
}
} | [
"[email protected]"
] | |
6ef05d7b0b6f69a406cd806cbf6097113d28376c | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /newEvaluatedBugs/Mockito_24_buggy/mutated/45/ArgumentMatcherStorageImpl.java | bc13ed333bcc19ec051990e484c62dfcb7e752ec | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,540 | java | /*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.progress;
import org.hamcrest.Matcher;
import org.mockito.exceptions.Reporter;
import org.mockito.internal.matchers.And;
import org.mockito.internal.matchers.LocalizedMatcher;
import org.mockito.internal.matchers.Not;
import org.mockito.internal.matchers.Or;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;
@SuppressWarnings("unchecked")
public class ArgumentMatcherStorageImpl implements ArgumentMatcherStorage {
public static final int TWO_SUB_MATCHERS = 2;
public static final int ONE_SUB_MATCHER = 1;
private Stack<LocalizedMatcher> matcherStack = new Stack<LocalizedMatcher>();
/* (non-Javadoc)
* @see org.mockito.internal.progress.ArgumentMatcherStorage#reportMatcher(org.hamcrest.Matcher)
*/
public HandyReturnValues reportMatcher(Matcher matcher) {
matcherStack.push(new LocalizedMatcher(matcher));
return new HandyReturnValues();
}
/* (non-Javadoc)
* @see org.mockito.internal.progress.ArgumentMatcherStorage#pullLocalizedMatchers()
*/
public List<LocalizedMatcher> pullLocalizedMatchers() {
assertStateFor("Or(?)", org.mockito.internal.progress.ArgumentMatcherStorageImpl.TWO_SUB_MATCHERS);
if (matcherStack.isEmpty()) {
return Collections.emptyList();
}
List<LocalizedMatcher> matchers = new ArrayList<LocalizedMatcher>(matcherStack);
matcherStack.clear();
return (List) matchers;
}
/* (non-Javadoc)
* @see org.mockito.internal.progress.ArgumentMatcherStorage#reportAnd()
*/
public HandyReturnValues reportAnd() {
assertStateFor("And(?)", TWO_SUB_MATCHERS);
And and = new And(popLastArgumentMatchers(TWO_SUB_MATCHERS));
matcherStack.push(new LocalizedMatcher(and));
return new HandyReturnValues();
}
/* (non-Javadoc)
* @see org.mockito.internal.progress.ArgumentMatcherStorage#reportOr()
*/
public HandyReturnValues reportOr() {
assertStateFor("Or(?)", TWO_SUB_MATCHERS);
Or or = new Or(popLastArgumentMatchers(TWO_SUB_MATCHERS));
matcherStack.push(new LocalizedMatcher(or));
return new HandyReturnValues();
}
/* (non-Javadoc)
* @see org.mockito.internal.progress.ArgumentMatcherStorage#reportNot()
*/
public HandyReturnValues reportNot() {
assertStateFor("Not(?)", ONE_SUB_MATCHER);
Not not = new Not(popLastArgumentMatchers(ONE_SUB_MATCHER).get(0));
matcherStack.push(new LocalizedMatcher(not));
return new HandyReturnValues();
}
private void assertStateFor(String additionalMatcherName, int subMatchersCount) {
assertMatchersFoundFor(additionalMatcherName);
assertIncorrectUseOfAdditionalMatchers(additionalMatcherName, subMatchersCount);
}
private List<Matcher> popLastArgumentMatchers(int count) {
List<Matcher> result = new LinkedList<Matcher>();
result.addAll(matcherStack.subList(matcherStack.size() - count, matcherStack.size()));
for (int i = 0; i < count; i++) {
matcherStack.pop();
}
return result;
}
private void assertMatchersFoundFor(String additionalMatcherName) {
if (matcherStack.isEmpty()) {
matcherStack.clear();
new Reporter().reportNoSubMatchersFound(additionalMatcherName);
}
}
private void assertIncorrectUseOfAdditionalMatchers(String additionalMatcherName, int count) {
if(matcherStack.size() < count) {
ArrayList<LocalizedMatcher> lastMatchers = new ArrayList<LocalizedMatcher>(matcherStack);
matcherStack.clear();
new Reporter().incorrectUseOfAdditionalMatchers(additionalMatcherName, count, lastMatchers);
}
}
/* (non-Javadoc)
* @see org.mockito.internal.progress.ArgumentMatcherStorage#validateState()
*/
public void validateState() {
if (!matcherStack.isEmpty()) {
ArrayList lastMatchers = new ArrayList<LocalizedMatcher>(matcherStack);
matcherStack.clear();
new Reporter().misplacedArgumentMatcher(lastMatchers);
}
}
/* (non-Javadoc)
* @see org.mockito.internal.progress.ArgumentMatcherStorage#reset()
*/
public void reset() {
matcherStack.clear();
}
}
| [
"[email protected]"
] | |
1cc75f155e663d4b9306aaaf470d7f3447c1987c | 6832918e1b21bafdc9c9037cdfbcfe5838abddc4 | /jdk_11_maven/cs/graphql/timbuctoo/timbuctoo-instancev4/src/test/java/nl/knaw/huygens/timbuctoo/bulkupload/loaders/csv/CsvLoaderTest.java | 0d2effb2b84bee063c1c06c713fd997d7f7c1a85 | [
"Apache-2.0",
"GPL-1.0-or-later",
"LGPL-2.0-or-later",
"GPL-3.0-only"
] | permissive | EMResearch/EMB | 200c5693fb169d5f5462d9ebaf5b61c46d6f9ac9 | 092c92f7b44d6265f240bcf6b1c21b8a5cba0c7f | refs/heads/master | 2023-09-04T01:46:13.465229 | 2023-04-12T12:09:44 | 2023-04-12T12:09:44 | 94,008,854 | 25 | 14 | Apache-2.0 | 2023-09-13T11:23:37 | 2017-06-11T14:13:22 | Java | UTF-8 | Java | false | false | 1,291 | java | package nl.knaw.huygens.timbuctoo.bulkupload.loaders.csv;
import nl.knaw.huygens.timbuctoo.bulkupload.InvalidFileException;
import nl.knaw.huygens.timbuctoo.bulkupload.parsingstatemachine.ImporterStubs;
import org.junit.Test;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import static com.google.common.collect.Lists.newArrayList;
import static nl.knaw.huygens.timbuctoo.util.Tuple.tuple;
public class CsvLoaderTest {
@Test
public void importCsv() throws Exception {
File csvFile = new File(CsvLoaderTest.class.getResource("test.csv").toURI());
CsvLoader loader = new CsvLoader(new HashMap<>());
try {
List<String> results = new ArrayList<>();
AtomicBoolean failure = new AtomicBoolean(false);
loader.loadData(newArrayList(tuple("testcollection.csv", csvFile)), ImporterStubs.withCustomReporter(logline -> {
if (logline.matches("failure.*")) {
failure.set(true);
}
results.add(logline);
}));
if (failure.get()) {
throw new RuntimeException("Failure during import: \n" + String.join("\n", results));
}
} catch (InvalidFileException e) {
throw new RuntimeException(e);
}
}
}
| [
"[email protected]"
] | |
817d147d3041ff62649ec162b21c2dc8c2b17286 | 6dbae30c806f661bcdcbc5f5f6a366ad702b1eea | /Corpus/eclipse.pde.ui/3927.java | 363ed7712f3c9a4746bb697149124cd6c712a3a0 | [
"MIT"
] | permissive | SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018 | d3fd21745dfddb2979e8ac262588cfdfe471899f | 0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0 | refs/heads/master | 2020-03-31T15:52:01.005505 | 2018-10-01T23:38:50 | 2018-10-01T23:38:50 | 152,354,327 | 1 | 0 | MIT | 2018-10-10T02:57:02 | 2018-10-10T02:57:02 | null | UTF-8 | Java | false | false | 1,577 | java | /*******************************************************************************
* Copyright (c) 2016 Google Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Stefan Xenos (Google) - initial API and implementation
*
*******************************************************************************/
package org.eclipse.pde.internal.runtime.spy.dialogs;
import org.eclipse.jface.util.Geometry;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
public class GeometryUtil {
public static Rectangle getDisplayBounds(Control boundsControl) {
Control parent = boundsControl.getParent();
if (parent == null || boundsControl instanceof Shell) {
return boundsControl.getBounds();
}
return Geometry.toDisplay(parent, boundsControl.getBounds());
}
public static Rectangle extrudeEdge(Rectangle innerBoundsWrtOverlay, int distanceToTop, int side) {
if (distanceToTop <= 0) {
return new Rectangle(0, 0, 0, 0);
}
return Geometry.getExtrudedEdge(innerBoundsWrtOverlay, distanceToTop, side);
}
public static int getBottom(Rectangle rect) {
return rect.y + rect.height;
}
public static int getRight(Rectangle rect) {
return rect.x + rect.width;
}
}
| [
"[email protected]"
] | |
37390205b4a38e14c9d83f697661d48bc9e489d8 | 82eba08b9a7ee1bd1a5f83c3176bf3c0826a3a32 | /ZmailSoap/src/java/org/zmail/soap/mail/type/ExcludeRecurrenceInfo.java | 702002dc0846e7a7d6ba0654ed5952a335186a46 | [
"MIT"
] | permissive | keramist/zmailserver | d01187fb6086bf3784fe180bea2e1c0854c83f3f | 762642b77c8f559a57e93c9f89b1473d6858c159 | refs/heads/master | 2021-01-21T05:56:25.642425 | 2013-10-21T11:27:05 | 2013-10-22T12:48:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 891 | java | /*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2011, 2012 VMware, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.zimbra.com/license.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* ***** END LICENSE BLOCK *****
*/
package org.zmail.soap.mail.type;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.zmail.soap.base.ExcludeRecurrenceInfoInterface;
@XmlAccessorType(XmlAccessType.NONE)
public class ExcludeRecurrenceInfo
extends RecurrenceInfo
implements RecurRuleBase, ExcludeRecurrenceInfoInterface {
}
| [
"[email protected]"
] | |
2b53d05c4e66330354c2360d9836d686d3429bcd | 3a5a605790acc5105cf7845fa8f89c6962fff184 | /src/test/java/integration/io/github/seleniumquery/by/SelectorsUtilTest.java | 3aa0a9585b06846055d54429af84f6ca161c0222 | [
"Apache-2.0"
] | permissive | hjralyc1/seleniumQuery | 240326eae3e6874e9ffc97185d06054af0c7bac9 | c3559d9d5bef35477712b810a2939402c75be18b | refs/heads/master | 2020-03-28T19:37:01.701292 | 2015-05-02T18:01:42 | 2015-05-22T22:07:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,692 | java | /*
* Copyright (c) 2015 seleniumQuery 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 integration.io.github.seleniumquery.by;
import infrastructure.junitrule.SetUpAndTearDownDriver;
import io.github.seleniumquery.SeleniumQuery;
import io.github.seleniumquery.by.SelectorUtils;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import java.util.List;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
public class SelectorsUtilTest {
@ClassRule public static SetUpAndTearDownDriver setUpAndTearDownDriverRule = new SetUpAndTearDownDriver();
@Rule public SetUpAndTearDownDriver setUpAndTearDownDriverRuleInstance = setUpAndTearDownDriverRule;
WebDriver driver;
@Before
public void before() {
driver = SeleniumQuery.$.driver().get();
}
@Test
public void testParent() {
// fail("Not yet implemented");
}
@Test
public void lang_function() {
WebElement french_p = driver.findElement(By.id("french-p"));
WebElement brazilian_p = driver.findElement(By.id("brazilian-p"));
WebElement hero_combo = driver.findElement(By.id("hero-combo"));
WebElement htmlElement = driver.findElement(By.cssSelector("html"));
WebElement bodyElement = driver.findElement(By.cssSelector("body"));
assertThat(SelectorUtils.lang(french_p), is("fr"));
assertThat(SelectorUtils.lang(brazilian_p), is("pt-BR"));
assertThat(SelectorUtils.lang(hero_combo), is("pt-BR"));
assertThat(SelectorUtils.lang(bodyElement), is("pt-BR"));
assertThat(SelectorUtils.lang(htmlElement), is(nullValue()));
}
@Test
public void testHasAttribute() {
// fail("Not yet implemented");
}
@Test
public void testGetPreviousSibling() {
// fail("Not yet implemented");
}
@Test
public void itselfWithSiblings() {
WebElement onlyChild = driver.findElement(By.id("onlyChild"));
WebElement grandsonWithSiblings = driver.findElement(By.id("grandsonWithSiblings"));
assertThat(SelectorUtils.itselfWithSiblings(onlyChild).size(), is(1));
List<WebElement> grandsons = SelectorUtils.itselfWithSiblings(grandsonWithSiblings);
assertThat(grandsons.size(), is(3));
assertThat(grandsons.get(0).getAttribute("id"), is("grandsonWithSiblings"));
assertThat(grandsons.get(1).getAttribute("id"), is("grandsonB"));
assertThat(grandsons.get(2).getAttribute("id"), is("grandsonC"));
}
@Test
public void escapeSelector_should_escape_starting_integer() {
String escapedSelector = SelectorUtils.escapeSelector("1a2b3c");
assertThat(escapedSelector, is("\\\\31 a2b3c"));
}
@Test
public void escapeSelector_should_escape_colon() {
String escapedSelector = SelectorUtils.escapeSelector("must:escape");
assertThat(escapedSelector, is("must\\:escape"));
}
@Test
public void escapeSelector_should_escape_hyphen_if_next_char_is_hyphen_or_digit() {
assertThat(SelectorUtils.escapeSelector("-abc"), is("-abc"));
assertThat(SelectorUtils.escapeSelector("-"), is("\\-")); // only hyphen
assertThat(SelectorUtils.escapeSelector("-123"), is("\\-123"));
assertThat(SelectorUtils.escapeSelector("---"), is("\\---"));
}
@Test
public void escapeAttributeValue__should_escape_strings_according_to_how_the_CSS_parser_works() {
// abc -> "abc"
assertThat(SelectorUtils.escapeAttributeValue("abc"), is("\"abc\""));
// a\"bc -> "a\"bc"
assertThat(SelectorUtils.escapeAttributeValue("a\\\"bc"), is("\"a\\\"bc\""));
// a'bc -> "a'bc"
assertThat(SelectorUtils.escapeAttributeValue("a'bc"), is("\"a'bc\""));
// a\tc -> "a\\tc"
assertThat(SelectorUtils.escapeAttributeValue("a\\tc"), is("\"a\\\\tc\""));
}
@Test
public void intoEscapedXPathString() {
assertThat(SelectorUtils.intoEscapedXPathString("abc"), is("'abc'"));
assertThat(SelectorUtils.intoEscapedXPathString("a\"bc"), is("'a\"bc'"));
assertThat(SelectorUtils.intoEscapedXPathString("a'bc"), is("concat('a', \"'\", 'bc')"));
assertThat(SelectorUtils.intoEscapedXPathString("'abc'"), is("concat('', \"'\", 'abc', \"'\", '')"));
}
} | [
"[email protected]"
] | |
a17918eb6211fc2144dc2d0107fec183db4364fa | f34805066fd387b143e7b7de5e2df463df3febc9 | /mssc-brewery/src/main/java/app/wordyourself/msscbrewery/web/model/v2/BeerDtoV2.java | 079ec52ed50a1f7db2acd002e1d666976351459c | [] | no_license | alperarabaci/spring-microservices-cloud | 1c17e10ac836fd038e1045808a242db0f2d60239 | 14ff873c0ec42e73d89cd93c66854f6e7206b853 | refs/heads/master | 2023-06-22T19:22:14.158080 | 2020-08-20T14:08:23 | 2020-08-20T14:08:23 | 282,906,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 740 | java | package app.wordyourself.msscbrewery.web.model.v2;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Positive;
import java.time.OffsetDateTime;
import java.util.UUID;
/**
* alper - 05/08/2020
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BeerDtoV2 {
@Null
private UUID id;
@NotBlank
private String beerName;
@NotNull
private BeerStyleEnum beerStyle;
@Positive
private Long upc;
OffsetDateTime createdDate;
OffsetDateTime lastModifiedDate;
}
| [
"[email protected]"
] | |
065ff4eda1cc8a21ab51dc883bc171b0da063605 | 303fc5afce3df984edbc7e477f474fd7aee3b48e | /fuentes/ucumari-commons/src/main/java/com/wildc/ucumari/parameters/model/UomConversionDatedPK.java | 042e72bd96a4733dfbcaf3ae04daac8d8a420a3b | [] | no_license | douit/erpventas | 3624cbd55cb68b6d91677a493d6ef1e410392127 | c53dc6648bd5a2effbff15e03315bab31e6db38b | refs/heads/master | 2022-03-29T22:06:06.060059 | 2014-04-21T12:53:13 | 2014-04-21T12:53:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,002 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.wildc.ucumari.parameters.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
*
* @author Cristian
*/
@Embeddable
public class UomConversionDatedPK implements Serializable {
/**
*
*/
private static final long serialVersionUID = 8022559796846068054L;
@Basic(optional = false)
@Column(name = "UOM_ID")
private String uomId;
@Basic(optional = false)
@Column(name = "UOM_ID_TO")
private String uomIdTo;
@Basic(optional = false)
@Column(name = "FROM_DATE")
@Temporal(TemporalType.TIMESTAMP)
private Date fromDate;
public UomConversionDatedPK() {
}
public UomConversionDatedPK(String uomId, String uomIdTo, Date fromDate) {
this.uomId = uomId;
this.uomIdTo = uomIdTo;
this.fromDate = fromDate;
}
public String getUomId() {
return uomId;
}
public void setUomId(String uomId) {
this.uomId = uomId;
}
public String getUomIdTo() {
return uomIdTo;
}
public void setUomIdTo(String uomIdTo) {
this.uomIdTo = uomIdTo;
}
public Date getFromDate() {
return fromDate;
}
public void setFromDate(Date fromDate) {
this.fromDate = fromDate;
}
@Override
public int hashCode() {
int hash = 0;
hash += (uomId != null ? uomId.hashCode() : 0);
hash += (uomIdTo != null ? uomIdTo.hashCode() : 0);
hash += (fromDate != null ? fromDate.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof UomConversionDatedPK)) {
return false;
}
UomConversionDatedPK other = (UomConversionDatedPK) object;
if ((this.uomId == null && other.uomId != null) || (this.uomId != null && !this.uomId.equals(other.uomId))) {
return false;
}
if ((this.uomIdTo == null && other.uomIdTo != null) || (this.uomIdTo != null && !this.uomIdTo.equals(other.uomIdTo))) {
return false;
}
if ((this.fromDate == null && other.fromDate != null) || (this.fromDate != null && !this.fromDate.equals(other.fromDate))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.wildc.ucumari.client.modelo.UomConversionDatedPK[ uomId=" + uomId + ", uomIdTo=" + uomIdTo + ", fromDate=" + fromDate + " ]";
}
}
| [
"[email protected]"
] | |
f8fc1fec93092839678c9034c109d3aa47244fe4 | cd3ccc969d6e31dce1a0cdc21de71899ab670a46 | /agp-7.1.0-alpha01/tools/base/build-system/builder/src/test/java/com/android/builder/core/DefaultApiVersionTest.java | df4d9c9140f814d5cbd8ac778dabb95c070130ec | [
"Apache-2.0"
] | permissive | jomof/CppBuildCacheWorkInProgress | 75e76e1bd1d8451e3ee31631e74f22e5bb15dd3c | 9e3475f6d94cb3239f27ed8f8ee81b0abde4ef51 | refs/heads/main | 2023-05-28T19:03:16.798422 | 2021-06-10T20:59:25 | 2021-06-10T20:59:25 | 374,736,765 | 0 | 1 | Apache-2.0 | 2021-06-07T21:06:53 | 2021-06-07T16:44:55 | Java | UTF-8 | Java | false | false | 1,274 | java | /*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.builder.core;
import static com.google.common.truth.Truth.assertThat;
import com.android.builder.model.ApiVersion;
import nl.jqno.equalsverifier.EqualsVerifier;
import org.junit.Test;
public class DefaultApiVersionTest {
@Test
public void checkPreviewSdkVersion() {
ApiVersion version = new DefaultApiVersion("P");
assertThat(version.getApiLevel()).isEqualTo(27);
assertThat(version.getApiString()).isEqualTo("P");
assertThat(version.getCodename()).isEqualTo("P");
}
@Test
public void checkEquals() {
EqualsVerifier.forClass(DefaultApiVersion.class).verify();
}
}
| [
"[email protected]"
] | |
13172a183dad97adf2ad5998777ea04ae0a056ca | 5e362b9070d4d08234de1d06288ff6692fb6836b | /android/app/src/main/java/com/quantie_18053/MainActivity.java | 57b39b5882778d80bdafebae25fe8189216f06de | [] | no_license | crowdbotics-apps/quantie-18053 | 0a380b0f5cb9d1c4a5200e552a700f7fa3809d01 | b9fe9938b16a3a479303c7768b3a4e162d67e5a8 | refs/heads/master | 2022-10-11T03:19:42.577082 | 2020-06-12T21:37:45 | 2020-06-12T21:37:45 | 271,879,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package com.quantie_18053;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "quantie_18053";
}
}
| [
"[email protected]"
] | |
8adcf8c78b5769b3f19fe83491ed540c0f625d04 | 1cc621f0cf10473b96f10fcb5b7827c710331689 | /Ex6/Procyon/com/jogamp/common/util/RunnableExecutor.java | 0f56e557f673251378dfe3f9d65971ab4353799e | [] | no_license | nitaiaharoni1/Introduction-to-Computer-Graphics | eaaa16bd2dba5a51f0f7442ee202a04897cbaa1f | 4467d9f092c7e393d9549df9e10769a4b07cdad4 | refs/heads/master | 2020-04-28T22:56:29.061748 | 2019-06-06T18:55:51 | 2019-06-06T18:55:51 | 175,635,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 484 | java | //
// Decompiled by Procyon v0.5.30
//
package com.jogamp.common.util;
public interface RunnableExecutor
{
public static final RunnableExecutor currentThreadExecutor = new CurrentThreadExecutor();
void invoke(final boolean p0, final Runnable p1);
public static class CurrentThreadExecutor implements RunnableExecutor
{
@Override
public void invoke(final boolean b, final Runnable runnable) {
runnable.run();
}
}
}
| [
"[email protected]"
] | |
935ca72ab41701cbf954d8a1a6800ec4cc392bfb | a257713804c4fa85eef46e47cbc5a0e6cdade150 | /app/src/main/java/com/teambition/talk/entity/Quote.java | cc6fb8dc8ff7a96562dc807c664e17388eb4b47d | [
"MIT"
] | permissive | megadotnet/talk-android | 50aa919b3041840953672fbe588caa59252cd06c | 828ba5c2e72284d7790705bc156cc20d84a605bc | refs/heads/master | 2020-03-09T04:13:54.084431 | 2018-04-08T01:50:57 | 2018-04-08T01:50:57 | 128,582,337 | 0 | 0 | MIT | 2018-04-08T01:05:49 | 2018-04-08T01:05:49 | null | UTF-8 | Java | false | false | 1,963 | java | package com.teambition.talk.entity;
import com.teambition.talk.util.StringUtil;
import org.parceler.Parcel;
/**
* Created by zeatual on 14/11/5.
*/
@Parcel(Parcel.Serialization.BEAN)
public class Quote {
String openId;
String text;
String authorName;
String authorAvatarUrl;
String redirectUrl;
String title;
String category;
String thumbnailPicUrl;
String imageUrl;
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getAuthorName() {
return authorName;
}
public void setAuthorName(String authorName) {
this.authorName = authorName;
}
public String getAuthorAvatarUrl() {
return authorAvatarUrl;
}
public void setAuthorAvatarUrl(String authorAvatarUrl) {
this.authorAvatarUrl = authorAvatarUrl;
}
public String getRedirectUrl() {
return redirectUrl;
}
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getThumbnailPicUrl() {
return thumbnailPicUrl;
}
public void setThumbnailPicUrl(String thumbnailPicUrl) {
this.thumbnailPicUrl = thumbnailPicUrl;
}
public String getThumbnailUrl() {
if (StringUtil.isNotBlank(getThumbnailPicUrl())) {
return getThumbnailPicUrl();
} else if (StringUtil.isNotBlank(imageUrl)) {
return imageUrl;
}
return null;
}
}
| [
"[email protected]"
] | |
d0798e0d4a39d4e6cad40bdcd5e110f66c120c17 | a69254f9f84bba6facc3ffa940ba2e540627d77b | /core/src/main/java/org/jdal/text/PeriodFormatAnnotationFactory.java | 40db674d04b65b778042e4a315207c62dc959910 | [
"Apache-2.0"
] | permissive | chelu/jdal | 3250423e5eaaf5571d6f85045c759abe12adff1f | 2c20b4a7e506d97487a075cd4fa5809e088670cd | refs/heads/master | 2023-03-07T14:09:26.124132 | 2018-05-22T18:52:30 | 2018-05-22T18:52:30 | 13,729,407 | 21 | 12 | null | 2017-01-25T12:20:48 | 2013-10-21T00:10:59 | Java | UTF-8 | Java | false | false | 1,923 | java | /*
* Copyright 2009-2012 Jose Luis Martin.
*
* 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.jdal.text;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.springframework.format.AnnotationFormatterFactory;
import org.springframework.format.Formatter;
import org.springframework.format.Parser;
import org.springframework.format.Printer;
/**
* PeriodFormat Annotation Factory.
*
* @author Jose Luis Martin - ([email protected])
*/
public class PeriodFormatAnnotationFactory implements AnnotationFormatterFactory<PeriodFormat> {
/**
* {@inheritDoc}
*/
public Set<Class<?>> getFieldTypes() {
return new HashSet<Class<?>>(Arrays.asList(new Class<?>[] {
Short.class, Integer.class, Long.class, Float.class,
Double.class, BigDecimal.class, BigInteger.class }));
}
/**
* {@inheritDoc}
*/
public Printer<?> getPrinter(PeriodFormat annotation, Class<?> fieldType) {
return getFormatter(annotation, fieldType);
}
/**
* {@inheritDoc}
*/
public Parser<?> getParser(PeriodFormat annotation, Class<?> fieldType) {
return getFormatter(annotation, fieldType);
}
/**
* @param annotation
* @param fieldType
* @return
*/
protected Formatter<?> getFormatter(PeriodFormat annotation, Class<?> fieldType) {
return new PeriodFormatter();
}
}
| [
"[email protected]"
] | |
3083a6d62b3280d47555ea81b9aff1e600e43740 | d8ae0563f237551cdfbe707cb367a5dcbae8854c | /bingo-core/src/main/java/org/bingo/security/service/AuthorityService.java | a32f1e037bc17d7ed95e861bc31f57218889f941 | [] | no_license | ERIC0402/bingo | ebda99e1d4f6d14511effc43912927d33d47fce7 | 4782ee19fd54293a0c5f9e0e2da987730ffcc513 | refs/heads/master | 2021-06-16T14:01:38.393305 | 2017-05-11T05:47:44 | 2017-05-11T05:47:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 417 | java | package org.bingo.security.service;
import java.util.List;
import java.util.Set;
import org.bingo.security.model.Authority;
import org.bingo.security.model.User;
public interface AuthorityService {
/**
* 获取该用户所有权限
* @param user
* @return
*/
public Set<Authority> getAuthorities(User user);
/**
* 获取所有权限
* @return
*/
public List<Authority> findAllAuthority();
}
| [
"[email protected]"
] | |
5856a9790d9e7a4b0c1a00470449234cd86f090e | 741f751c0475eb1a86b46fa449810f7eb3f3d86a | /v2/googlecloud-to-googlecloud/src/main/java/com/google/cloud/teleport/v2/values/PartitionMetadata.java | 34bd28b12910e7cf84a44c212b7e585eabf43801 | [
"Apache-2.0"
] | permissive | mkuthan/DataflowTemplates | 7f844f349cfc589cb899b90de700175975812442 | 0f2353979e797b811727953d3149f50531d87048 | refs/heads/master | 2022-05-21T01:34:52.726207 | 2022-05-05T13:45:52 | 2022-05-05T13:46:26 | 226,102,831 | 0 | 0 | Apache-2.0 | 2019-12-05T12:58:23 | 2019-12-05T12:58:22 | null | UTF-8 | Java | false | false | 2,047 | java | /*
* Copyright (C) 2021 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.cloud.teleport.v2.values;
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState;
import com.google.api.services.dataplex.v1.model.GoogleCloudDataplexV1Partition;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import java.io.Serializable;
/**
* Partition metadata for Dataplex.
*
* <p>All values are necessary.
*/
@AutoValue
public abstract class PartitionMetadata implements Serializable {
public abstract String location();
public abstract ImmutableList<String> values();
public static Builder builder() {
return new AutoValue_PartitionMetadata.Builder();
}
public GoogleCloudDataplexV1Partition toDataplexPartition() {
return new GoogleCloudDataplexV1Partition().setLocation(location()).setValues(values());
}
/** Builder for {@link PartitionMetadata}. */
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setLocation(String value);
public abstract Builder setValues(ImmutableList<String> value);
abstract PartitionMetadata autoBuild();
public PartitionMetadata build() {
PartitionMetadata metadata = autoBuild();
checkState(!metadata.location().isEmpty(), "Location cannot be empty");
ImmutableList<String> values = metadata.values();
checkState(!values.isEmpty(), "Values cannot be empty");
return metadata;
}
}
}
| [
"[email protected]"
] | |
97333c14d3dcc6b1be0f9c71d6cc2f29f53ab603 | c54062a41a990c192c3eadbb9807e9132530de23 | /solutions/attributes/src/main/java/attributes/book/BookMain.java | f4711ebefe1a21ff03f1327e3cd8680abfc60efa | [] | no_license | Training360/strukturavalto-java-public | 0d76a9dedd7f0a0a435961229a64023931ec43c7 | 82d9b3c54437dd7c74284f06f9a6647ec62796e3 | refs/heads/master | 2022-07-27T15:07:57.915484 | 2021-12-01T08:57:06 | 2021-12-01T08:57:06 | 306,286,820 | 13 | 115 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package attributes.book;
public class BookMain {
public static void main(String[] args) {
Book book = new Book("Egri csillagok");
System.out.println(book.getTitle());
book.setTitle("1984");
System.out.println(book.getTitle());
}
}
| [
"[email protected]"
] | |
a1f6c0628f94042c8165124423bac569f9253378 | dafb5c3abd51720da10e26872a5d7e59be1c0bf7 | /src/main/java/com/zqbweather/app/model9/XDWeatherDB.java | 0736ae188edf3ee944b410b187d633ab97dfba7b | [
"Apache-2.0"
] | permissive | YJWWZHANG/XDWeather | 210c807e588df078b5828dda54458fd68c95a613 | 42dd28cc0b4c78eb12b705c89382ea76e8063716 | refs/heads/master | 2021-01-01T04:30:52.824953 | 2016-05-21T13:44:17 | 2016-05-21T13:44:17 | 59,361,649 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,421 | java | package com.zqbweather.app.model9;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import com.zqbweather.app.activity.MyApplication;
import com.zqbweather.app.db.XDWeatherOpenHelper;
import com.zqbweather.app.model9.Province9;
import java.util.ArrayList;
import java.util.List;
/**
* Created by admin on 2016/2/5.
*/
public class XDWeatherDB {
public static final String DB_NAME = "xd_weather";
public static final int VERSION = 1;
public static XDWeatherDB xdWeatherDB;
private SQLiteDatabase db;
private XDWeatherDB(Context context){
XDWeatherOpenHelper dbHelper = new XDWeatherOpenHelper(context, DB_NAME, null, VERSION);
db = dbHelper.getWritableDatabase();
}
public synchronized static XDWeatherDB getIntance(){
if(xdWeatherDB == null){
xdWeatherDB = new XDWeatherDB(MyApplication.getContext());
}
return xdWeatherDB;
}
public void saveProvince(Province9 province){
if(province != null){
ContentValues values = new ContentValues();
values.put("province_name", province.getProvinceName());
values.put("province_pyname", province.getProvincePyName());
db.insert("Province", null, values);
}
}
public void saveCity(City9 city){
if(city != null){
ContentValues values = new ContentValues();
values.put("city_name", city.getCityName());
values.put("city_pyname", city.getCityPyName());
values.put("province_pyname", city.getProvincePyName());
xdWeatherDB.db.insert("City", null, values);
}
}
public void saveCounty(County9 county){
if(county != null){
ContentValues values = new ContentValues();
values.put("county_name", county.getCountyName());
values.put("county_weather_code", county.getCountyWeatherCode());
values.put("city_pyname", county.getCityPyName());
db.insert("County", null, values);
}
}
public List<Province9> loadProvince(){
List<Province9> list = new ArrayList<>();
Cursor cursor = db.query("Province", null, null, null, null, null, null);
if(cursor.moveToFirst()){
do{
Province9 province = new Province9();
province.setId(cursor.getInt(cursor.getColumnIndex("id")));
province.setProvinceName(cursor.getString(cursor.getColumnIndex("province_name")));
province.setProvincePyName(cursor.getString(cursor.getColumnIndex("province_pyname")));
list.add(province);
}while (cursor.moveToNext());
}
return list;
}
public List<City9> loadCity(String provincePyName){
List<City9> list = new ArrayList<>();
Cursor cursor = db.query("City", null, "province_pyname = ?", new String[]{provincePyName}, null, null, null);
if(cursor.moveToFirst()){
do{
City9 city = new City9();
city.setId(cursor.getInt(cursor.getColumnIndex("id")));
city.setCityName(cursor.getString(cursor.getColumnIndex("city_name")));;
city.setCityPyName(cursor.getString(cursor.getColumnIndex("city_pyname")));
city.setProvincePyName(cursor.getString(cursor.getColumnIndex("province_pyname")));
list.add(city);
}while (cursor.moveToNext());
}
return list;
}
public List<County9> loadCounty(String cityPyName){
List<County9> list = new ArrayList<>();
Cursor cursor = db.query("County", null, "city_pyname = ?", new String[]{cityPyName}, null, null, null);
if(cursor.moveToFirst()){
do{
County9 county = new County9();
county.setId(cursor.getInt(cursor.getColumnIndex("id")));
county.setCountyName(cursor.getString(cursor.getColumnIndex("county_name")));
county.setCountyWeatherCode(cursor.getString(cursor.getColumnIndex("county_weather_code")));
county.setCityPyName(cursor.getString(cursor.getColumnIndex("city_pyname")));
list.add(county);
}while (cursor.moveToNext());
}
return list;
}
}
| [
"[email protected]"
] | |
d1a88f3d58d22b3c2c8a9192bb4ba7bd35bccaa1 | c6f0eb41af209775f264da0ae56e21d7b92d8c87 | /src/test/java/misc/migration/v1_1/EHistory3.java | a3756572a2f7e9be0761ef98ab8dd118539f63a2 | [
"Apache-2.0"
] | permissive | JakubPetr/ebean | 464d88fc466ef4e55258645c189923d99ce5d36f | 4fc47fcd19b568d348bd23a35348198092318094 | refs/heads/master | 2021-06-05T01:53:20.477413 | 2021-05-23T15:45:11 | 2021-05-23T15:45:11 | 136,032,319 | 0 | 1 | NOASSERTION | 2023-05-08T07:01:37 | 2018-06-04T13:51:53 | Java | UTF-8 | Java | false | false | 349 | java | package misc.migration.v1_1;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import io.ebean.annotation.History;
import io.ebean.annotation.HistoryExclude;
@Entity
@Table(name = "migtest_e_history3")
@History
public class EHistory3 {
@Id
Integer id;
@HistoryExclude
String testString;
}
| [
"[email protected]"
] | |
0cb1dfe1ad3d8ffda734ba38ec21ab1e206f18d3 | 803a81cbf3b2c615cbff2bb4a724b3672dd13cdf | /src/main/java/com/cda/gateway/config/CacheConfiguration.java | 47264e83767fca2bbb29aa9d8203c398b0f99052 | [] | no_license | mbobadilla/jhipster-wateway-application | 8ec5238fa4bc04bf1d94961286889962d52cf6bf | 02629cb9e0a6a1e93a3f996063c372d427d57124 | refs/heads/master | 2022-12-21T23:39:24.412381 | 2020-02-20T13:53:18 | 2020-02-20T13:53:18 | 241,896,645 | 0 | 0 | null | 2022-12-16T05:13:12 | 2020-02-20T13:53:02 | Java | UTF-8 | Java | false | false | 2,530 | java | package com.cda.gateway.config;
import java.time.Duration;
import org.ehcache.config.builders.*;
import org.ehcache.jsr107.Eh107Configuration;
import org.hibernate.cache.jcache.ConfigSettings;
import io.github.jhipster.config.JHipsterProperties;
import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer;
import org.springframework.boot.autoconfigure.orm.jpa.HibernatePropertiesCustomizer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.context.annotation.*;
@Configuration
@EnableCaching
public class CacheConfiguration {
private final javax.cache.configuration.Configuration<Object, Object> jcacheConfiguration;
public CacheConfiguration(JHipsterProperties jHipsterProperties) {
JHipsterProperties.Cache.Ehcache ehcache = jHipsterProperties.getCache().getEhcache();
jcacheConfiguration = Eh107Configuration.fromEhcacheCacheConfiguration(
CacheConfigurationBuilder.newCacheConfigurationBuilder(Object.class, Object.class,
ResourcePoolsBuilder.heap(ehcache.getMaxEntries()))
.withExpiry(ExpiryPolicyBuilder.timeToLiveExpiration(Duration.ofSeconds(ehcache.getTimeToLiveSeconds())))
.build());
}
@Bean
public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(javax.cache.CacheManager cacheManager) {
return hibernateProperties -> hibernateProperties.put(ConfigSettings.CACHE_MANAGER, cacheManager);
}
@Bean
public JCacheManagerCustomizer cacheManagerCustomizer() {
return cm -> {
createCache(cm, com.cda.gateway.repository.UserRepository.USERS_BY_LOGIN_CACHE);
createCache(cm, com.cda.gateway.repository.UserRepository.USERS_BY_EMAIL_CACHE);
createCache(cm, com.cda.gateway.domain.User.class.getName());
createCache(cm, com.cda.gateway.domain.Authority.class.getName());
createCache(cm, com.cda.gateway.domain.User.class.getName() + ".authorities");
// jhipster-needle-ehcache-add-entry
};
}
private void createCache(javax.cache.CacheManager cm, String cacheName) {
javax.cache.Cache<Object, Object> cache = cm.getCache(cacheName);
if (cache == null) {
cm.createCache(cacheName, jcacheConfiguration);
}
}
}
| [
"[email protected]"
] | |
1ba37a690a15a806165627791a6c4cf247133f20 | f65400893b5d3a80bf1ede506694850a92c05b21 | /JavaStudy/src/ch12/IndexOf.java | 16b56b9cdec2ce2fff5e221d87f3c0e71512e047 | [] | no_license | fire216/JavaStudy | 9795e3d46d72cbdbb3c3be59a87ca26bb05b8b33 | a8f0d73994c6be20ee2b7101b5a12db8e721a614 | refs/heads/master | 2020-04-28T19:41:00.259026 | 2019-04-19T08:12:16 | 2019-04-19T08:12:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package ch12;
public class IndexOf {
public static void main(String[] args) {
// 0123456789
String text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";
System.out.println(text.length());
int index = -1;
while (true) {
index = text.indexOf("ipsum", index + 1);
System.out.println(index);
if (index == -1) {
break;
}
}
}
}
| [
"Student@DESKTOP-EF9PEQ2"
] | Student@DESKTOP-EF9PEQ2 |
fe3398fa997be06c0aa69df8063c663cdfe97b04 | 3f16f0318fc0bac3dfc9832f1e817da87db7a8da | /src/jp/co/yuki2006/busmap/route/NewAdvancedDetailActivity.java | 4df4fd3d836715c2bba911ce9cedfe28e30c07c0 | [
"Apache-2.0"
] | permissive | yuki2006/busviewer | 697f392b23ba9c37ee6d5f18f5f02169c0c6cd96 | 15f23cdb505f05dd04d8443da78d146749241ebc | refs/heads/master | 2020-01-21T04:34:25.304012 | 2014-03-27T04:11:38 | 2014-03-27T04:11:38 | 18,097,197 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,283 | java | /**
*
*/
package jp.co.yuki2006.busmap.route;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;
import jp.co.yuki2006.busmap.R;
import jp.co.yuki2006.busmap.etc.ActionBarUPWrapper;
import jp.co.yuki2006.busmap.route.store.BusTransferSearch;
import jp.co.yuki2006.busmap.route.store.NewBusSearch;
import jp.co.yuki2006.busmap.store.BusStop;
import jp.co.yuki2006.busmap.values.IntentValues;
/**
* @author yuki
*/
public class NewAdvancedDetailActivity extends SherlockFragmentActivity {
/*
* (非 Javadoc)
*
* @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.Theme_Sherlock);
super.onCreate(savedInstanceState);
ActionBar actionBar = this.getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
linearLayout.setOrientation(LinearLayout.VERTICAL);
setContentView(linearLayout);
Intent intent = getIntent();
BusTransferSearch data = (BusTransferSearch) intent
.getSerializableExtra(IntentValues.TRANSITION_ADVANCED_NEW_SEARCH);
for (int i = 0; i < data.size(); i++) {
NewBusSearch newBusSearch = data.get(i);
View view = layoutInflater.inflate(R.layout.advanced_new_detail_element,
(ViewGroup) findViewById(android.R.id.content), false);
linearLayout.addView(view);
for (int layout : new int[] { R.id.advanced_new_detail_departure, R.id.advanced_new_detail_arrival }) {
boolean isDeparture = layout == R.id.advanced_new_detail_departure;
View detailElement = view.findViewById(layout);
((TextView) detailElement.findViewById(R.id.advanced_search_label)).
setText(isDeparture ? R.string.departure : R.string.arrive);
((TextView) detailElement.findViewById(R.id.advanced_new_time)).
setText(newBusSearch.getTime(isDeparture));
BusStop busStop = newBusSearch.getBusStop(isDeparture);
((TextView) detailElement.findViewById(R.id.advanced_busstop_label)).
setText(busStop.toString());
}
((TextView) view.findViewById(R.id.advanced_new_detail_bus_data)).
setText(
newBusSearch.getLineNumber() + " " +
newBusSearch.getLastBusStopName() + "行き");
((TextView) view.findViewById(R.id.advanced_new_detail_bus_remark)).setText(newBusSearch
.getRemarkForString());
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home: {
ActionBarUPWrapper.doActionUpNavigation(this);
break;
}
default:
break;
}
return super.onOptionsItemSelected(item);
}
}
| [
"[email protected]"
] | |
a53acfd98e857dad47abf9fb8e92f34bcce79655 | 280da3630f692c94472f2c42abd1051fb73d1344 | /src/net/minecraft/src/BetterSnow.java | 6bd40b743afe638806128ccaaa6a901716a764cc | [] | no_license | MicrowaveClient/Clarinet | 7c35206c671eb28bc139ee52e503f405a14ccb5b | bd387bc30329e0febb6c1c1b06a836d9013093b5 | refs/heads/master | 2020-04-02T18:47:52.047731 | 2016-07-14T03:21:46 | 2016-07-14T03:21:46 | 63,297,767 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,913 | java | package net.minecraft.src;
import net.minecraft.block.*;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.IBlockAccess;
public class BetterSnow {
private static IBakedModel modelSnowLayer = null;
public static void update() {
modelSnowLayer = Config.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelForState(Blocks.snow_layer.getDefaultState());
}
public static IBakedModel getModelSnowLayer() {
return modelSnowLayer;
}
public static IBlockState getStateSnowLayer() {
return Blocks.snow_layer.getDefaultState();
}
public static boolean shouldRender(IBlockAccess blockAccess, Block block, IBlockState blockState, BlockPos blockPos) {
return !checkBlock(block, blockState) ? false : hasSnowNeighbours(blockAccess, blockPos);
}
private static boolean hasSnowNeighbours(IBlockAccess blockAccess, BlockPos pos) {
Block blockSnow = Blocks.snow_layer;
return blockAccess.getBlockState(pos.north()).getBlock() != blockSnow && blockAccess.getBlockState(pos.south()).getBlock() != blockSnow && blockAccess.getBlockState(pos.west()).getBlock() != blockSnow && blockAccess.getBlockState(pos.east()).getBlock() != blockSnow ? false : blockAccess.getBlockState(pos.down()).getBlock().isOpaqueCube();
}
private static boolean checkBlock(Block block, IBlockState blockState) {
if (block.isFullCube()) {
return false;
} else if (block.isOpaqueCube()) {
return false;
} else if (block instanceof BlockSnow) {
return false;
} else if (block instanceof BlockBush && (block instanceof BlockDoublePlant || block instanceof BlockFlower || block instanceof BlockMushroom || block instanceof BlockSapling || block instanceof BlockTallGrass)) {
return true;
} else if (!(block instanceof BlockFence) && !(block instanceof BlockFenceGate) && !(block instanceof BlockFlowerPot) && !(block instanceof BlockPane) && !(block instanceof BlockReed) && !(block instanceof BlockWall)) {
if (block instanceof BlockRedstoneTorch && blockState.getValue(BlockTorch.FACING) == EnumFacing.UP) {
return true;
} else {
if (block instanceof BlockLever) {
Comparable orient = blockState.getValue(BlockLever.FACING);
if (orient == BlockLever.EnumOrientation.UP_X || orient == BlockLever.EnumOrientation.UP_Z) {
return true;
}
}
return false;
}
} else {
return true;
}
}
}
| [
"justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704"
] | justanormalpcnoghostclientoranyt@justanormalpcnoghostclientoranyt-Aspire-XC-704 |
c82319f987d8a14c6f13d0e0862fe409f91bffa2 | 8469d2f71bc22fa2acf66a4bb05155c1d85282fa | /SapeStore/src/test/java/com/sapestore/controller/test/AccountControllerTest.java | 2f30b0a7ee7c3c141349a4a1ea5e1334eb119259 | [
"BSD-2-Clause"
] | permissive | rishon1313/sapestore | bce9f33ba16d82eb86be0a2567d92707b340a8c5 | 3f44263799e9abe279c6311a31d4df9209c9b59c | refs/heads/master | 2021-08-17T02:02:18.544939 | 2017-11-20T17:28:41 | 2017-11-20T17:28:41 | 104,585,570 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,729 | java | package com.sapestore.controller.test;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
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.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import com.sapestore.controller.AccountController;
import com.sun.glass.ui.View;
/**
* The class <code>UserLoginControllerTest</code> contains tests for the class
* {@link <code>UserLoginController</code>}
*
* @pattern JUnit Test Case
*
* @generatedBy CodePro at 7/12/14 11:26 AM
*
* @author kmedir
*
* @version $Revision$
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:test-application-context.xml" })
@WebAppConfiguration
public class AccountControllerTest {
private MockMvc mockMvc;
@Autowired
private WebApplicationContext wac;
/**
* The object that is being tested.
*
* @see com.sapestore.controller.UserLoginController
*/
private AccountController fixture = new AccountController();
/**
* Construct new test instance
*
* @param name the test name
*/
public AccountControllerTest() {
}
/**
* Launch the test.
*
* @param args String[]
*/
public static void main(String[] args) {
// add code to run tests here
}
/**
* Return the object that is being tested.
*
* @return the test fixture
*
* @see com.sapestore.controller.UserLoginController
*/
public AccountController getFixture() {
return fixture;
}
/**
* Set the object that is being tested.
*
* @param fixture the test fixture
*/
public void setFixture(AccountController fixture) {
this.fixture = fixture;
}
/**
* Run the String beforeLogin(ModelMap) method test
*/
@Test
public void testBeforeLogin() {
try {
System.out.println("entered testBeforeLogin");
mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();
mockMvc.perform(get("/beforelogin"))
.andExpect(status().isOk());
System.out.println("exited testBeforeLogin");
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Run the String login(UserLogin, ModelMap) method test
*/
@Test
public void testLogin() {
try {
System.out.println("entered testLogin");
mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();
mockMvc.perform(post("/login").param("userId", "testLoginId").param("password", "testPassword"))
.andExpect(status().isOk());
System.out.println("exited testLogin");
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Run the String logout(WebRequest, SessionStatus) method test
*/
@Test
public void testLogout() {
try {
System.out.println("entered testBeforeLogin");
mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();
mockMvc.perform(get("/logout"))
.andExpect(status().is(302));
System.out.println("exited testBeforeLogin");
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testShopMore(){
try {
System.out.println("entered testShopMore");
mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();
mockMvc.perform(get("/shopMore")).andExpect(status().isOk())
.andExpect(forwardedUrl("/WEB-INF/home.jsp"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
/*$CPS$ This comment was generated by CodePro. Do not edit it.
* patternId = com.instantiations.assist.eclipse.pattern.testCasePattern
* strategyId = com.instantiations.assist.eclipse.pattern.testCasePattern.junitTestCase
* additionalTestNames =
* assertTrue = false
* callTestMethod = true
* createMain = true
* createSetUp = false
* createTearDown = false
* createTestFixture = true
* createTestStubs = false
* methods = beforeLogin(QModelMap;),login(QUserLogin;!QModelMap;)
* package = com.sapestore.controller
* package.sourceFolder = SapeStore/src/main/java
* superclassType = junit.framework.TestCase
* testCase = UserLoginControllerTest
* testClassType = com.sapestore.controller.UserLoginController
*/ | [
"[email protected]"
] | |
95a9dfefb3d9c68ece698dd4cbf4878a5a7636ca | d71e879b3517cf4fccde29f7bf82cff69856cfcd | /ExtractedJars/iRobot_com.irobot.home/javafiles/android/support/v4/media/MediaBrowserServiceCompat$d$7.java | 9d5e19ba1a8bb8d727889cf5775d26becb1897b3 | [
"MIT"
] | permissive | Andreas237/AndroidPolicyAutomation | b8e949e072d08cf6c6166c3f15c9c63379b8f6ce | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | refs/heads/master | 2020-04-10T02:14:08.789751 | 2019-05-16T19:29:11 | 2019-05-16T19:29:11 | 160,739,088 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,801 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package android.support.v4.media;
import android.support.v4.f.a;
// Referenced classes of package android.support.v4.media:
// MediaBrowserServiceCompat
class MediaBrowserServiceCompat$d$7
implements Runnable
{
public void run()
{
android.os.IBinder ibinder = a.a();
// 0 0:aload_0
// 1 1:getfield #23 <Field MediaBrowserServiceCompat$e a>
// 2 4:invokeinterface #33 <Method android.os.IBinder android.support.v4.media.MediaBrowserServiceCompat$e.a()>
// 3 9:astore_1
b.a.b.remove(((Object) (ibinder)));
// 4 10:aload_0
// 5 11:getfield #21 <Field MediaBrowserServiceCompat$d b>
// 6 14:getfield #36 <Field MediaBrowserServiceCompat android.support.v4.media.MediaBrowserServiceCompat$d.a>
// 7 17:getfield #39 <Field a MediaBrowserServiceCompat.b>
// 8 20:aload_1
// 9 21:invokevirtual #45 <Method Object a.remove(Object)>
// 10 24:pop
// 11 25:return
}
final MediaBrowserServiceCompat.e a;
final MediaBrowserServiceCompat.d b;
MediaBrowserServiceCompat$d$7(MediaBrowserServiceCompat.d d1, MediaBrowserServiceCompat.e e)
{
b = d1;
// 0 0:aload_0
// 1 1:aload_1
// 2 2:putfield #21 <Field MediaBrowserServiceCompat$d b>
a = e;
// 3 5:aload_0
// 4 6:aload_2
// 5 7:putfield #23 <Field MediaBrowserServiceCompat$e a>
super();
// 6 10:aload_0
// 7 11:invokespecial #26 <Method void Object()>
// 8 14:return
}
}
| [
"[email protected]"
] | |
292778f468e22b8cd23811d76082e5e014581b07 | 86647ab1dce23875b27988750c23b8455829f489 | /commonlib/src/main/java/com/dudu/commonlib/xml/JDomXmlDocument.java | 56458c4864084d4583fcf978c1182669003de3fd | [] | no_license | BAT6188/DuDuHome_Home | 1fab41f8fd0456c6fdecb901dc2ee94c269ec516 | 08fa399406a1e19e7738c6767260db4153593f38 | refs/heads/master | 2023-05-28T18:38:36.377138 | 2016-07-25T06:48:06 | 2016-07-25T06:48:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 692 | java | package com.dudu.commonlib.xml;
/**
* Created by Administrator on 2016/2/15.
*/
import org.jdom2.Document;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by Eaway on 2016/2/15.
*/
public class JDomXmlDocument {
public Document parserXml(InputStream inputStream) {
Document document = null;
SAXBuilder builder = new SAXBuilder();
try {
document = builder.build(inputStream);
} catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return document;
}
}
| [
"[email protected]"
] | |
1cf5a4f0954badee59a8c13eeabe8f47fc06aa71 | 8534ea766585cfbd6986fd845e59a68877ecb15b | /p006b/p007a/p008a/p009a/p010a/p012b/C0215n.java | 09ca10f970e1b8f3561e7b26dc0eaad16c2758c6 | [] | no_license | Shanzid01/NanoTouch | d7af94f2de686f76c2934b9777a92b9949b48e10 | 6d51a44ff8f719f36b880dd8d1112b31ba75bfb4 | refs/heads/master | 2020-04-26T17:39:53.196133 | 2019-03-04T10:23:51 | 2019-03-04T10:23:51 | 173,720,526 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package p006b.p007a.p008a.p009a.p010a.p012b;
import java.io.File;
import java.util.Comparator;
/* compiled from: CommonUtils */
final class C0215n implements Comparator<File> {
C0215n() {
}
public /* synthetic */ int compare(Object obj, Object obj2) {
return m1938a((File) obj, (File) obj2);
}
public int m1938a(File file, File file2) {
return (int) (file.lastModified() - file2.lastModified());
}
}
| [
"[email protected]"
] | |
e1c5833fbd74e3ed594768dc21a1e7da11ad1ed2 | 45d1e88d4275045417b1128b1978bb277de4136c | /A04.Netty/B01.Netty_Book/doc/nettybook2-master/src/com/phei/netty/frame/correct/TimeServer.java | 054d21c33f672d04db4956b944325cec23e27826 | [
"Apache-2.0"
] | permissive | huaxueyihao/NoteOfStudy | 2c1f95ef30e264776d0bbf72fb724b0fe9aceee4 | 061e62c97f4fa04fa417fd08ecf1dab361c20b87 | refs/heads/master | 2022-07-12T04:11:02.960324 | 2021-01-24T02:47:54 | 2021-01-24T02:47:54 | 228,293,820 | 0 | 0 | Apache-2.0 | 2022-06-21T03:49:20 | 2019-12-16T03:19:50 | Java | UTF-8 | Java | false | false | 2,617 | java | /*
* Copyright 2013-2018 Lilinfeng.
*
* 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.phei.netty.frame.correct;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.codec.LineBasedFrameDecoder;
import io.netty.handler.codec.string.StringDecoder;
/**
* @author lilinfeng
* @date 2014年2月14日
* @version 1.0
*/
public class TimeServer {
public void bind(int port) throws Exception {
// 配置服务端的NIO线程组
EventLoopGroup bossGroup = new NioEventLoopGroup();
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
.option(ChannelOption.SO_BACKLOG, 1024)
.childHandler(new ChildChannelHandler());
// 绑定端口,同步等待成功
ChannelFuture f = b.bind(port).sync();
// 等待服务端监听端口关闭
f.channel().closeFuture().sync();
} finally {
// 优雅退出,释放线程池资源
bossGroup.shutdownGracefully();
workerGroup.shutdownGracefully();
}
}
private class ChildChannelHandler extends ChannelInitializer<SocketChannel> {
@Override
protected void initChannel(SocketChannel arg0) throws Exception {
arg0.pipeline().addLast(new LineBasedFrameDecoder(1024));
arg0.pipeline().addLast(new StringDecoder());
arg0.pipeline().addLast(new TimeServerHandler());
}
}
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
int port = 8080;
if (args != null && args.length > 0) {
try {
port = Integer.valueOf(args[0]);
} catch (NumberFormatException e) {
// 采用默认值
}
}
new TimeServer().bind(port);
}
}
| [
"[email protected]"
] | |
7cf758ba6d43d2d78856d1ce4583904f6c211c44 | 67789e4c8d45819105bb39efaa00eec6943ab42c | /src/main/java/br/com/prontuariounico/security/SpringSecurityAuditorAware.java | 7725459d7ca93b7ed117d7fbda0632b2920bdf29 | [] | no_license | emaruya/prontuario_unico | 06fa9581f21a26dab8d1fcb85983ad64b7442433 | 815625ed9ba124db4d71ec097ab1bd1ddc9f3f2d | refs/heads/main | 2023-01-28T00:14:48.242192 | 2020-12-07T01:49:08 | 2020-12-07T01:49:08 | 319,147,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package br.com.prontuariounico.security;
import br.com.prontuariounico.config.Constants;
import java.util.Optional;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;
/**
* Implementation of {@link AuditorAware} based on Spring Security.
*/
@Component
public class SpringSecurityAuditorAware implements AuditorAware<String> {
@Override
public Optional<String> getCurrentAuditor() {
return Optional.of(SecurityUtils.getCurrentUserLogin().orElse(Constants.SYSTEM_ACCOUNT));
}
}
| [
"[email protected]"
] | |
cbf4592d37ac7b546eb545a6b4101a05fd9168ef | 56c068ac8118fbc3e15e37e538935a283b9f908d | /src/com/WaveCreator/TarsosWrapper/TarsosRunner.java | fb45adf23298b6988e2fb6ce2bc40d9e1c254a72 | [] | no_license | nietoperz809/wavecreator | 8944cd630288b234388a0a9cf812ab425541178e | 64f3456208fc891f9a2a5250a564c19bec471a1a | refs/heads/master | 2021-01-17T09:11:52.268778 | 2018-08-26T23:52:21 | 2018-08-26T23:52:21 | 28,629,861 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,605 | java | package com.WaveCreator.TarsosWrapper;
import be.tarsos.dsp.AudioDispatcher;
import be.tarsos.dsp.AudioEvent;
import be.tarsos.dsp.AudioProcessor;
import be.tarsos.dsp.io.jvm.JVMAudioInputStream;
import be.tarsos.dsp.io.jvm.WaveformWriter;
import com.WaveCreator.Wave16;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
/**
* Created by Administrator on 3/7/2017.
*/
public class TarsosRunner
{
static class Wave16Creator extends WaveformWriter
{
final ArrayList<Wave16> waves = new ArrayList<>();
Wave16 result;
final float sampleRate;
final AudioFormat format;
public Wave16Creator (AudioFormat format)
{
super(format, "tarsosCreated");
sampleRate = format.getSampleRate();
this.format = format;
}
@Override
public boolean process (AudioEvent audioEvent)
{
int byteOverlap = audioEvent.getOverlap() * format.getFrameSize();
int byteStepSize = audioEvent.getBufferSize() * format.getFrameSize() - byteOverlap;
if(audioEvent.getTimeStamp() == 0)
{
byteOverlap = 0;
byteStepSize = audioEvent.getBufferSize() * format.getFrameSize();
}
byte[] fb = audioEvent.getByteBuffer();
Wave16 wv = new Wave16 (fb, (int) sampleRate, byteOverlap, byteStepSize);
waves.add(wv);
return true;
}
@Override
public void processingFinished ()
{
Wave16[] arr = new Wave16[waves.size()];
waves.toArray(arr);
result = Wave16.combineAppend(arr);
//System.out.println("finished");
}
}
public static Wave16 execute (Wave16 in, AudioProcessor proc, int buffsize)
{
byte[] arr = in.toByteArray();
ByteArrayInputStream bais = new ByteArrayInputStream(arr);
AudioInputStream inputStream = new AudioInputStream(bais, in.getAudioFormat(), arr.length);
int overlap = buffsize-128;
AudioFormat format = inputStream.getFormat(); //new AudioFormat(44100,16,1,true,false); ;
JVMAudioInputStream i2 = new JVMAudioInputStream(inputStream);
AudioDispatcher dispatcher = new AudioDispatcher(i2, buffsize, overlap);
dispatcher.addAudioProcessor(proc);
Wave16Creator wc = new Wave16Creator(format);
dispatcher.addAudioProcessor(wc);
dispatcher.run();
return wc.result;
}
}
| [
"[email protected]"
] | |
013615f9c4ae26accea39704a1715e001ed68ad8 | 7c1430c53b4d66ad0e96dd9fc7465a5826fdfb77 | /uims-support/src/cn/edu/sdu/uims/itms/task/ITaskBase.java | c2c64adf1c97819a10ed90a56f450fa4ca131cbc | [] | no_license | wang3624270/online-learning-server | ef97fb676485f2bfdd4b479235b05a95ad62f841 | 2d81920fef594a2d0ac482efd76669c8d95561f1 | refs/heads/master | 2020-03-20T04:33:38.305236 | 2019-05-22T06:31:05 | 2019-05-22T06:31:05 | 137,187,026 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,037 | java | package cn.edu.sdu.uims.itms.task;
import java.awt.Graphics;
import java.util.EventObject;
import cn.edu.sdu.uims.itms.def.ITaskTemplate;
import cn.edu.sdu.uims.itms.handler.IHandler;
import cn.edu.sdu.uims.trans.UFPoint;
public class ITaskBase {
protected ITaskTemplate taskTemplate;
protected IHandler handler;
protected ISubTask owner;
public ITaskBase() {
}
public void init() {
}
// public void start() {
//
// }
public void start(String enterStatusFlag, UFPoint firstP) {
}
public void setTemplate(ITaskTemplate temp) {
taskTemplate = temp;
}
public ITaskTemplate getTemplate() {
return taskTemplate;
}
public void setHandler(IHandler handler) {
this.handler = handler;
}
public IHandler getHandler() {
return handler;
}
public int processEvent(String eventName, EventObject e) {
return -1;
}
public void setParaData(Object data) {
}
public void setCurrentPoint(UFPoint p) {
//
}
public void setOwner(ISubTask o) {
owner = o;
}
public void drawCursor(Graphics dc) {
}
}
| [
"[email protected]"
] | |
c6bd60ca6d3af197a335ddf913adb93dc73dd29c | 9af7ff6b77b9e1aac67d7cf9f49b695511d94310 | /MultiProcessSysWebService_Thread_Online_1.3/src/ServiceInterface/ServiceImpl.java | 2d697466ac035b78ce725308d15a4315ae6d55dc | [] | no_license | zjmeixinyanzhi/MultipleDatacenterCollaborativeProcessSystem | bc5e30d27d23b0d1455207eddf90b63f1b2c9939 | 36e28e145eff16d9f7c80c5c5af684aac4f5370a | refs/heads/master | 2021-01-09T21:55:31.022679 | 2017-04-05T14:00:26 | 2017-04-05T14:00:26 | 54,820,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,719 | java | /**
* ServiceImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package ServiceInterface;
public interface ServiceImpl extends java.rmi.Remote {
public java.lang.String orderRSDataPlan(java.lang.String strRequesXML) throws java.rmi.RemoteException;
public java.lang.String systemMonitorInfo(java.lang.String strRequesIP) throws java.rmi.RemoteException;
public java.lang.String commonProductRequireSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String rnDataService(java.lang.String strRequestXML, java.lang.String serviceType) throws java.rmi.RemoteException;
public java.lang.String validationOrderSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String dataProductSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String commonProductOrderSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String faProducRequireSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String dataProductQuery(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String faProductRequireSubmit(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String dataProductViewDetail(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String dataPrdouctQuery(java.lang.String strRequestXML) throws java.rmi.RemoteException;
public java.lang.String taskStatus(java.lang.String strRequestXML) throws java.rmi.RemoteException;
}
| [
"[email protected]"
] | |
6f56b68e33a9b6dc9327c3f01232318a3548c78a | 7d8236d87119493601f83d93ae4a36c29be3f8bc | /src/test/java/io/github/jhipster/application/web/rest/AuditResourceIntTest.java | 004ad669c89004ea9a55a0334ca804ea6dfdb268 | [] | no_license | scarabetta/jhipsterSample2 | e4808cdbeda4482aa507814e406d36bdef1ae8e2 | f5155176eb5b6c334dec9ab94728addea3c9c470 | refs/heads/master | 2021-04-28T13:34:14.329505 | 2018-02-19T19:03:34 | 2018-02-19T19:03:34 | 122,107,341 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,053 | java | package io.github.jhipster.application.web.rest;
import io.github.jhipster.application.JhipsterSample2App;
import io.github.jhipster.application.config.audit.AuditEventConverter;
import io.github.jhipster.application.domain.PersistentAuditEvent;
import io.github.jhipster.application.repository.PersistenceAuditEventRepository;
import io.github.jhipster.application.service.AuditEventService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
/**
* Test class for the AuditResource REST controller.
*
* @see AuditResource
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = JhipsterSample2App.class)
@Transactional
public class AuditResourceIntTest {
private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL";
private static final String SAMPLE_TYPE = "SAMPLE_TYPE";
private static final Instant SAMPLE_TIMESTAMP = Instant.parse("2015-08-04T10:11:30Z");
private static final long SECONDS_PER_DAY = 60 * 60 * 24;
@Autowired
private PersistenceAuditEventRepository auditEventRepository;
@Autowired
private AuditEventConverter auditEventConverter;
@Autowired
private MappingJackson2HttpMessageConverter jacksonMessageConverter;
@Autowired
private FormattingConversionService formattingConversionService;
@Autowired
private PageableHandlerMethodArgumentResolver pageableArgumentResolver;
private PersistentAuditEvent auditEvent;
private MockMvc restAuditMockMvc;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
AuditEventService auditEventService =
new AuditEventService(auditEventRepository, auditEventConverter);
AuditResource auditResource = new AuditResource(auditEventService);
this.restAuditMockMvc = MockMvcBuilders.standaloneSetup(auditResource)
.setCustomArgumentResolvers(pageableArgumentResolver)
.setConversionService(formattingConversionService)
.setMessageConverters(jacksonMessageConverter).build();
}
@Before
public void initTest() {
auditEventRepository.deleteAll();
auditEvent = new PersistentAuditEvent();
auditEvent.setAuditEventType(SAMPLE_TYPE);
auditEvent.setPrincipal(SAMPLE_PRINCIPAL);
auditEvent.setAuditEventDate(SAMPLE_TIMESTAMP);
}
@Test
public void getAllAudits() throws Exception {
// Initialize the database
auditEventRepository.save(auditEvent);
// Get all the audits
restAuditMockMvc.perform(get("/management/audits"))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL)));
}
@Test
public void getAudit() throws Exception {
// Initialize the database
auditEventRepository.save(auditEvent);
// Get the audit
restAuditMockMvc.perform(get("/management/audits/{id}", auditEvent.getId()))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.principal").value(SAMPLE_PRINCIPAL));
}
@Test
public void getAuditsByDate() throws Exception {
// Initialize the database
auditEventRepository.save(auditEvent);
// Generate dates for selecting audits by date, making sure the period will contain the audit
String fromDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0,10);
String toDate = SAMPLE_TIMESTAMP.plusSeconds(SECONDS_PER_DAY).toString().substring(0,10);
// Get the audit
restAuditMockMvc.perform(get("/management/audits?fromDate="+fromDate+"&toDate="+toDate))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL)));
}
@Test
public void getNonExistingAuditsByDate() throws Exception {
// Initialize the database
auditEventRepository.save(auditEvent);
// Generate dates for selecting audits by date, making sure the period will not contain the sample audit
String fromDate = SAMPLE_TIMESTAMP.minusSeconds(2*SECONDS_PER_DAY).toString().substring(0,10);
String toDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0,10);
// Query audits but expect no results
restAuditMockMvc.perform(get("/management/audits?fromDate=" + fromDate + "&toDate=" + toDate))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
.andExpect(header().string("X-Total-Count", "0"));
}
@Test
public void getNonExistingAudit() throws Exception {
// Get the audit
restAuditMockMvc.perform(get("/management/audits/{id}", Long.MAX_VALUE))
.andExpect(status().isNotFound());
}
}
| [
"[email protected]"
] | |
0b50677a813c14968fd58751171f88d2e363482c | 4e643854a9e29ff706536170e8c4ac626eab8d95 | /src/main/java/be/Balor/Manager/Commands/Server/ServerCommand.java | ec403d4b1296cc51eccb42b4bc475a4574793f04 | [] | no_license | Belphemur/AdminCmd | 4fddbd3b43ac84486b691be8202c521bb4cea81a | 8e5c0e3af7c226a510e635aea84d1a0136fefd80 | refs/heads/master | 2021-01-13T02:06:48.308382 | 2014-05-30T20:11:17 | 2014-05-30T20:11:17 | 1,555,007 | 5 | 8 | null | 2014-05-30T20:09:14 | 2011-04-01T10:08:40 | Java | UTF-8 | Java | false | false | 1,481 | java | /************************************************************************
* This file is part of AdminCmd.
*
* AdminCmd 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.
*
* AdminCmd 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 AdminCmd. If not, see <http://www.gnu.org/licenses/>.
************************************************************************/
package be.Balor.Manager.Commands.Server;
import be.Balor.Manager.Commands.CoreCommand;
/**
* @author Balor (aka Antoine Aflalo)
*
*/
public abstract class ServerCommand extends CoreCommand {
/**
*
*/
public ServerCommand() {
super();
this.permParent = plugin.getPermissionLinker().getPermParent(
"admincmd.server.*");
}
/**
* @param string
* @param string2
*/
public ServerCommand(final String cmd, final String permNode) {
super(cmd, permNode);
this.permParent = plugin.getPermissionLinker().getPermParent(
"admincmd.server.*");
}
}
| [
"[email protected]"
] | |
837adef0db6affc780c4c63fe24c6af8bc427577 | 358588de52a2ad83dc30418b0b022ba121d060db | /src/main/java/com/victormeng/leetcode/analyze_user_website_visit_pattern/Solution2.java | 55ab85948e1b996ab263a609af26dac86383496c | [
"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 | 638 | java | /**
* Leetcode - analyze_user_website_visit_pattern
*/
package com.victormeng.leetcode.analyze_user_website_visit_pattern;
import java.util.*;
import com.ciaoshen.leetcode.util.*;
/**
* log instance is defined in Solution interface
* this is how slf4j will work in this class:
* =============================================
* if (log.isDebugEnabled()) {
* log.debug("a + b = {}", sum);
* }
* =============================================
*/
class Solution2 implements Solution {
public List<String> mostVisitedPattern(String[] username, int[] timestamp, String[] website) {
return null;
}
}
| [
"[email protected]"
] | |
3c0d21853b3e49168c2af5fe9cfa5c78d5c20f0a | 56d6fa60f900fb52362d4cce950fa81f949b7f9b | /aws-sdk-java/src/main/java/com/amazonaws/services/identitymanagement/model/GetAccountPasswordPolicyRequest.java | 942df4c3f6817408f3a6b979784153f41b7d1eee | [
"JSON",
"Apache-2.0"
] | permissive | TarantulaTechnology/aws | 5f9d3981646e193c89f1c3fa746ec3db30252913 | 8ce079f5628334f83786c152c76abd03f37281fe | refs/heads/master | 2021-01-19T11:14:53.050332 | 2013-09-15T02:37:02 | 2013-09-15T02:37:02 | 12,839,311 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,342 | java | /*
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.identitymanagement.model;
import com.amazonaws.AmazonWebServiceRequest;
import java.io.Serializable;
/**
* Container for the parameters to the {@link com.amazonaws.services.identitymanagement.AmazonIdentityManagement#getAccountPasswordPolicy(GetAccountPasswordPolicyRequest) GetAccountPasswordPolicy operation}.
* <p>
* Retrieves the password policy for the AWS account. For more information about using a password policy, go to <a
* href="http://docs.amazonwebservices.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html"> Managing an IAM Password Policy </a> .
* </p>
*
* @see com.amazonaws.services.identitymanagement.AmazonIdentityManagement#getAccountPasswordPolicy(GetAccountPasswordPolicyRequest)
*/
public class GetAccountPasswordPolicyRequest extends AmazonWebServiceRequest implements Serializable {
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof GetAccountPasswordPolicyRequest == false) return false;
GetAccountPasswordPolicyRequest other = (GetAccountPasswordPolicyRequest)obj;
return true;
}
}
| [
"[email protected]"
] | |
26a1a51ca0191d4216663a31d0a1326e16dc90eb | 3f7149eb1efdbeba1f6ae3665a66cbef06411442 | /vbox-app/src/com/kedzie/vbox/app/AccordianPageTransformer.java | c43e2fb275896c9689dbb0830967bf0d086bd8d1 | [] | no_license | zeroyou/VBoxManager | 7aa96915c85102c94e06a99b065d65475fbce7cf | a291b442f6de9ea1f8b8e14f75fbbee3fe96729f | refs/heads/master | 2020-04-16T10:43:43.398965 | 2013-07-19T16:02:56 | 2013-07-19T16:02:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 638 | java | package com.kedzie.vbox.app;
import com.nineoldandroids.view.ViewHelper;
import android.support.v4.view.ViewPager.PageTransformer;
import android.view.View;
/**
* Performs an accordian animation.
*/
public class AccordianPageTransformer implements PageTransformer {
@Override
public void transformPage(View view, float position) {
ViewHelper.setTranslationX(view, -1*view.getWidth()*position);
if(position < 0)
ViewHelper.setPivotX(view, 0f);
else if(position > 0)
ViewHelper.setPivotX(view, view.getWidth());
ViewHelper.setScaleX(view, 1-Math.abs(position));
}
}
| [
"[email protected]"
] | |
946fdc8ad77b9cdc066d0d07bd713ab33de1f525 | 323c723bdbdc9bdf5053dd27a11b1976603609f5 | /nssicc/nssicc_service/src/main/java/biz/belcorp/ssicc/service/sisicc/impl/InterfazPRYEnviarInformacionVentaProyeccionParcialCentroServiceImpl.java | 528f58e4f3492704fc663770dbd72fa754869f8a | [] | no_license | cbazalar/PROYECTOS_PROPIOS | adb0d579639fb72ec7871334163d3fef00123a1c | 3ba232d1f775afd07b13c8246d0a8ac892e93167 | refs/heads/master | 2021-01-11T03:38:06.084970 | 2016-10-24T01:33:00 | 2016-10-24T01:33:00 | 71,429,267 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,326 | java | package biz.belcorp.ssicc.service.sisicc.impl;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import biz.belcorp.ssicc.dao.Constants;
import biz.belcorp.ssicc.dao.sisicc.InterfazPRYDAO;
import biz.belcorp.ssicc.service.SapConnectorService;
import biz.belcorp.ssicc.service.sisicc.framework.beans.InterfazParams;
import biz.belcorp.ssicc.service.sisicc.framework.exception.InterfazException;
import biz.belcorp.ssicc.service.sisicc.framework.impl.BaseInterfazSalidaStoredProcedureAbstractService;
/**
* Service del envio de datos para la Proyeccion Parcial de la Interfaz PRY.
*
* @author <a href="">Jose Luis Rodriguez</a>
*/
@Service("sisicc.interfazPRYEnviarInformacionVentaProyeccionParcialCentroService")
@Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class)
public class InterfazPRYEnviarInformacionVentaProyeccionParcialCentroServiceImpl extends BaseInterfazSalidaStoredProcedureAbstractService {
@Resource(name="sisicc.sapConnectorService")
private SapConnectorService sapConnectorService;
@Resource(name="sisicc.interfazPRYDAO")
private InterfazPRYDAO interfazPRYDAO;
/* (non-Javadoc)
* @see biz.belcorp.ssicc.sisicc.service.framework.BaseInterfazSalidaStoredProcedureAbstractService#executeStoreProcedure(java.util.Map)
*/
protected void executeStoreProcedure(Map params) {
interfazPRYDAO.executeEnvioInformacionVentaProyeccionParcialCentro(params);
}
/* (non-Javadoc)
* @see biz.belcorp.ssicc.sisicc.service.framework.BaseInterfazAbstractService#afterProcessInterfaz(biz.belcorp.ssicc.sisicc.service.framework.beans.InterfazParams)
*/
protected void afterProcessInterfaz(InterfazParams interfazParams)
throws InterfazException {
Map result = null;
Map inputParams = new HashMap();
Map queryParams = interfazParams.getQueryParams();
String invocarFuncionSAP = MapUtils.getString(queryParams, "invocarFuncionSAP", Constants.NO);
String funcionSAP = MapUtils.getString(queryParams, "funcionSAP");
String nombreParametro = MapUtils.getString(queryParams, "nombreParametro");
String valorParametro = MapUtils.getString(queryParams, "valorParametro");
// Validamos si el parametro que determina si se invoca o no a SAP esta activo
if (StringUtils.equals(invocarFuncionSAP, Constants.SI)) {
if (log.isDebugEnabled()) {
log.debug("Invocando a la funcion SAP: " + funcionSAP);
log.debug(nombreParametro + "=" + valorParametro);
}
if(StringUtils.isNotBlank(nombreParametro)) {
inputParams.put(nombreParametro, valorParametro);
}
try {
result = sapConnectorService.execute(funcionSAP, inputParams, null);
} catch (Exception e) {
log.warn(e.getMessage());
throw new InterfazException(e.getMessage());
}
if (log.isDebugEnabled()) {
log.debug("result SAP=" + result);
}
} else {
log.info("La interfaz esta configurada para NO invocar a la funcion SAP");
}
}
} | [
"[email protected]"
] | |
3985319dc421c0773980fc3bbbec77fc66d970ae | 29f78bfb928fb6f191b08624ac81b54878b80ded | /SPGenerator/lib/ca.uwaterloo.gp_.fmp_0.7.0/src/ca/uwaterloo/gp/fmp/system/NodeIdDictionary.java | 1fc8a8ee5faad131247d0effebf12bcc0ed54347 | [] | no_license | MSPL4SOA/MSPL4SOA-tool | 8a78e73b4ac7123cf1815796a70f26784866f272 | 9f3419e416c600cba13968390ee89110446d80fb | refs/heads/master | 2020-04-17T17:30:27.410359 | 2018-07-27T14:18:55 | 2018-07-27T14:18:55 | 66,304,158 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,934 | java | /**************************************************************************************
* Copyright (c) 2005, 2006 Generative Software Development Lab, University of Waterloo
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* 1. Generative Software Development Lab, University of Waterloo,
* http://gp.uwaterloo.ca - initial API and implementation
**************************************************************************************/
package ca.uwaterloo.gp.fmp.system;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Iterator;
import ca.uwaterloo.gp.fmp.Feature;
import ca.uwaterloo.gp.fmp.Node;
/**
* Michal: NodeIdDictionary is always recreated when FmpEditor loads the model (regardless if the model
* was just created by new model wizard or is an existing model).
*
* Keeping the model and the NodeIdDictionary synchronized:
* 1. create element
* compute new id within the context. For feature, from name; for others use reference* and featureGroup*
* (with suffixes). Update NodeIdDictionary.
* 2. remove element
* remove ids of the element, of all its children and of all its configurations from the NodeIdDictionary
* 3. move element
* a) within the tree of the same root -> do nothing,
* b) to other tree -> remove element and than create it in the new location.
* 4. clone feature
* see. create element
* 5. manually change id of element
* remove element from dictionary, reinsert with new id.
* update id of all 'confs' of element (synchronize change, otherwise rules won't work)
*
* @author Chang Hwan Peter Kim <[email protected]>,
* Michal Antkiewicz <[email protected]>
*/
public class NodeIdDictionary
{
public static NodeIdDictionary INSTANCE = new NodeIdDictionary();
// used to append numbers to generate the next id
public static final String DELIMITER = "_";
protected long currentId = 0;
protected Dictionary dictionary = new Hashtable();
public Dictionary getRootDictionary(Feature rootFeature)
{
Dictionary rootDictionary = (Dictionary)dictionary.get(rootFeature);
if(rootDictionary == null)
{
rootDictionary = new Hashtable();
dictionary.put(rootFeature, rootDictionary);
}
return rootDictionary;
}
public void putRootDictionary(Feature rootFeature, Dictionary rootDictionary)
{
dictionary.put(rootFeature, rootDictionary);
}
public Node getNode(Feature rootFeature, String id)
{
// Get the dictionary associated with the rootFeature (an id belongs to the dictionary of a given root)
Dictionary rootFeatureDictionary = getRootDictionary(rootFeature);
return (Node)rootFeatureDictionary.get(id);
}
public void putNode(Feature rootFeature, String id, Node node)
{
Dictionary rootFeatureDictionary = getRootDictionary(rootFeature);
rootFeatureDictionary.put(id, node);
}
public String getNextAvailableId(String id, Node node)
{
// Below code doesn't work because _ is not recognized by XPath scanner
//StringTokenizer st = new StringTokenizer(id, DELIMITER);
//String newId = st.nextToken() + DELIMITER + String.valueOf(currentId++);
String newId = null;
int indexOfDigit = -1;
for(int i = 0; i < id.length(); i++)
{
if(id.substring(i).matches("\\d{" + String.valueOf(id.length()-i) + "}"))
{
indexOfDigit = i;
break;
}
}
// if integer was found at the end, take it and replace it by adding 1 to it
if(indexOfDigit != -1)
newId = id.substring(0, indexOfDigit) + String.valueOf(Integer.parseInt(id.substring(indexOfDigit))+1);
// otherwise, append a number at the end
else
newId = id + "0";
return newId;
}
public void visit(Node node) {
visit(null, node);
}
public void visit(String prefix, Node node)
{
if (node == null)
throw new IllegalArgumentException("NodeIdDictionary.visit(): node must not be null");
Feature rootFeature = ModelNavigation.INSTANCE.navigateToRootFeature(node);
// TODO: maybe we should put IDs on features above root features
if(rootFeature != null)
{
Dictionary rootFeatureDictionary = getRootDictionary(rootFeature);
// Get an id that can be used in the construction of propositional formula
String newId = ModelManipulation.INSTANCE.getValidId((prefix != null? prefix : "") + node.getId());
// there is a node in the dictionary
while((Node)rootFeatureDictionary.get(newId) != null)
newId = NodeIdDictionary.INSTANCE.getNextAvailableId(newId, node);
node.setId(newId);
rootFeatureDictionary.put(newId, node);
}
for(Iterator nodeChildren = node.getChildren().iterator(); nodeChildren.hasNext();)
visit(prefix, (Node)nodeChildren.next());
if(node instanceof Feature)
{
for(Iterator configurationsIterator = ((Feature)node).getConfigurations().iterator(); configurationsIterator.hasNext();)
visit(prefix, (Feature)configurationsIterator.next());
}
}
// /**
// * Returns an id generated from a name - removes illegal characters
// * @param string
// * @return
// */
// public String getIdForName(String name) {
// String id = "";
//
// for(int i = 0; i < name.length(); i++)
// {
// if(Character.isLetterOrDigit(name.charAt(i)))
// id += name.substring(i, i+1);
// }
//
// if(id.length() > 0)
// {
// // first character cannot be a digit
// if(Character.isDigit(id.charAt(0)))
// id = "a" + id;
// }
// else
// id = "feature";
//
// return id.substring(0,1).toLowerCase() + id.substring(1);
// }
// /**
// * Michal: removes non-alphanumeric characters and
// * ensures name doesn't start with a digit
// */
// public String getJavaNameForName(String name) {
// StringBuffer newName = new StringBuffer();
//
// for(int i = 0; i < name.length(); i++) {
// char c = name.charAt(i);
// if(Character.isLetterOrDigit(c))
// newName.append(c);
// else if (Character.isWhitespace(c))
// newName.append('_');
// }
//
// if(newName.length() > 0) {
// // first character cannot be a digit
// if(Character.isDigit(newName.charAt(0)))
// newName.insert(0, '_');
// }
// else
// newName.append("feature");
// return newName.toString();
// }
/**
* Michal: remove existing dictionaries for the root feature and all of its configurations
* @param rootFeature
*/
public void removeDictionaries(Feature rootFeature) {
putRootDictionary(rootFeature, new Hashtable());
for (Iterator i = rootFeature.getConfigurations().iterator(); i.hasNext(); )
removeDictionaries((Feature) i.next());
}
} | [
"[email protected]"
] | |
d796b007012cf93008f36e643c6379726f807005 | 92d229534cf099a97ecfc780105c66fcc305fcf6 | /src/main/java/org/agilewiki/incdes/PAInteger.java | 959721c34e407ed2854a6931f4436b631a4d7d00 | [] | no_license | x-jv/JAOsgi | 259598cff4626aacb66d37f231311a4824ec0077 | 11499f4ec62b4b21a867207e7d8d0a835e41e629 | refs/heads/master | 2021-01-21T03:02:59.681184 | 2013-04-18T02:35:10 | 2013-04-18T02:35:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 285 | java | package org.agilewiki.incdes;
import org.agilewiki.pactor.Request;
public interface PAInteger extends IncDes {
Request<Integer> getIntegerReq();
Integer getValue();
Request<Void> setIntegerReq(final Integer _v);
void setValue(final Integer _v) throws Exception;
}
| [
"[email protected]"
] | |
6f5b4e349e5ac0f687ce68d3ba39ceacc87e20eb | a4f182c714397b2097f20498497c9539fa5a527f | /app/src/main/java/com/lzyyd/hsq/transform/BannerTransform.java | fd35c282d0d4833765f8ee8bfd222ef9837a99d5 | [] | no_license | lilinkun/lzy | de36d9804603c293ffcb62c64c50afea88679192 | 80a646a16cf605795940449108fd848c0b0ecd17 | refs/heads/master | 2023-02-19T06:15:51.089562 | 2021-01-13T08:52:30 | 2021-01-13T08:52:30 | 288,416,310 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 389 | java | package com.lzyyd.hsq.transform;
import android.view.View;
import com.xw.banner.transformer.ABaseTransformer;
/**
* Create by liguo on 2020/7/15
* Describe:
*/
public class BannerTransform extends ABaseTransformer {
@Override
protected void onTransform(View page, float position) {
}
@Override
protected boolean isPagingEnabled() {
return true;
}
}
| [
"[email protected]"
] | |
e49b7b1998169115884b21fb84568ceb253f33b6 | f8e7cd7d5367bf6fd34985bbb387315783d744b2 | /src/test/java/org/jusecase/poe/gateways/ResourceItemGatewayTest.java | b72f9b2879eb2aa32a35562e1c1c4319d65a127b | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | iCodeIN/poe-stash-buddy | eb6a263e8468ae840d9dea6f319e74824fcd67ec | a2ecc1dc773afbd37f1bbd723857ed2b83ba0910 | refs/heads/master | 2023-03-11T16:10:38.511421 | 2021-02-19T00:28:09 | 2021-02-19T00:28:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,595 | java | package org.jusecase.poe.gateways;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.jusecase.inject.ComponentTest;
import org.jusecase.poe.entities.Item;
import org.jusecase.poe.entities.ItemType;
import org.jusecase.poe.plugins.ImageHashPlugin;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
class ResourceItemGatewayTest implements ComponentTest {
ResourceItemGateway gateway;
private ImageHashPlugin imageHashPlugin;
@BeforeEach
void setUp() {
givenDependency(imageHashPlugin = new ImageHashPlugin());
gateway = new ResourceItemGateway();
}
@Test
void currenciesAreLoadedFromResources() {
List<Item> currencies = gateway.getAll();
assertThat(currencies.size()).isEqualTo(55 + 1 + 104 + 2 * 156 + 15);
assertThat(currencies.get(0).imageHash.features).isNotEmpty();
assertThat(currencies.get(0).imageHash.colors1).isNotEmpty();
assertThat(currencies.get(0).imageHash.colors2).isNotEmpty();
assertThat(currencies.get(0).type).isEqualTo(ItemType.CURRENCY);
assertThat(currencies.get(55).type).isEqualTo(ItemType.CARD);
assertThat(currencies.get(55 + 1).type).isEqualTo(ItemType.ESSENCE);
assertThat(currencies.get(55 + 1 + 104).type).isEqualTo(ItemType.MAP);
assertThat(currencies.get(55 + 1 + 104 + 2 * 156).type).isEqualTo(ItemType.FRAGMENT);
}
@Test
void noItemConflicts() {
SoftAssertions s = new SoftAssertions();
List<Item> allItems = gateway.getAll();
for (int i = 0; i < allItems.size(); ++i) {
Item item = allItems.get(i);
for (int j = i + 1; j < allItems.size(); ++j) {
Item otherItem = allItems.get(j);
if (item.type != otherItem.type) {
String assertDescription = "";
boolean similar = imageHashPlugin.isSimilar(item.imageHash, otherItem.imageHash);
if (similar) {
assertDescription = "expecting " + item + " not to be similar to item " + otherItem + "\n" + imageHashPlugin.describeDistance(item.imageHash, otherItem.imageHash);
}
s.assertThat(similar).describedAs(assertDescription).isFalse();
}
}
}
s.assertAll();
}
@Test
void scrollOfWisdom() {
Item scrollOfWisdom = gateway.getScrollOfWisdom();
assertThat(scrollOfWisdom).isNotNull();
}
} | [
"[email protected]"
] | |
8353d1cbd2da4ea2918347c7a05237f1941c720b | 61775d5ab720aaba9280f8bd3cc327498c10d96e | /src/com.mentor.nucleus.bp.debug.ui/src/com/mentor/nucleus/bp/debug/ui/BPLineBreakpointAdapter.java | 6247df5f81deb69fd92457d9aad320f5066b92e5 | [
"Apache-2.0"
] | permissive | NDGuthrie/bposs | bf1cbec3d0bd5373edecfbe87906417b5e14d9f1 | 2c47abf74a3e6fadb174b08e57aa66a209400606 | refs/heads/master | 2016-09-05T17:26:54.796391 | 2014-11-17T15:24:00 | 2014-11-17T15:24:00 | 28,010,057 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,192 | java | //========================================================================
//
//File: $RCSfile$
//Version: $Revision$
//Modified: $Date$
//
//(c) Copyright 2006-2014 by Mentor Graphics Corp. All rights reserved.
//
//========================================================================
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
//========================================================================
//
package com.mentor.nucleus.bp.debug.ui;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.ILineBreakpoint;
import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;
import com.mentor.nucleus.bp.debug.ui.model.BPLineBreakpoint;
import com.mentor.nucleus.bp.ui.text.activity.ActivityEditor;
/**
* Adapter to create breakpoints.
*/
public class BPLineBreakpointAdapter implements IToggleBreakpointsTarget {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
ActivityEditor textEditor = getEditor(part);
if (textEditor != null) {
IResource resource = (IResource) textEditor.getEditorInput().getAdapter(IFile.class);
ITextSelection textSelection = (ITextSelection) selection;
int lineNumber = textSelection.getStartLine();
IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IBPDebugUIPluginConstants.PLUGIN_ID);
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint breakpoint = breakpoints[i];
if (resource.equals(breakpoint.getMarker().getResource())) {
if (((ILineBreakpoint)breakpoint).getLineNumber() == (lineNumber + 1)) {
// remove
breakpoint.delete();
return;
}
}
}
// create line breakpoint (doc line numbers start at 0)
int validLine = BPLineBreakpoint.getValidLine(resource, lineNumber + 1);
if ( validLine != -1 ) {
BPLineBreakpoint lineBreakpoint = new BPLineBreakpoint(resource, validLine);
DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint);
}
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) {
return getEditor(part) != null;
}
/**
* Returns the editor being used to edit an activity, associated with the
* given part, or <code>null</code> if none.
*
* @param part workbench part
* @return the editor being used to edit an activity, associated with the
* given part, or <code>null</code> if none
*/
private ActivityEditor getEditor(IWorkbenchPart part) {
if (part instanceof ActivityEditor) {
ActivityEditor editorPart = (ActivityEditor) part;
IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IFile.class);
if (resource != null) {
return editorPart;
}
}
return null;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
return false;
}
}
| [
"[email protected]"
] | |
6c8ac5c7261911a616ec755b57047f882f4185e4 | c6d4872031fe7f9d20c6a5c01eb07c92aab3a205 | /tests/src/test/java/de/quantummaid/mapmaid/specs/examples/serializedobjects/conflicting/asymetric/array_to_map/ARequest.java | 654719d287f682df0c8ce3acd72746963f12ff5e | [
"Apache-2.0"
] | permissive | quantummaid/mapmaid | 22cae89fa09c7cab1d1f73e20f2b92718f59bd49 | 348ed54a2dd46ffb66204ae573f242a01acb73c5 | refs/heads/master | 2022-12-24T06:56:45.809221 | 2021-08-03T09:56:58 | 2021-08-03T09:56:58 | 228,895,012 | 5 | 1 | Apache-2.0 | 2022-12-14T20:53:54 | 2019-12-18T18:01:43 | Java | UTF-8 | Java | false | false | 1,661 | java | /*
* Copyright (c) 2020 Richard Hauswald - https://quantummaid.de/.
*
* 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 de.quantummaid.mapmaid.specs.examples.serializedobjects.conflicting.asymetric.array_to_map;
import de.quantummaid.mapmaid.specs.examples.customprimitives.success.normal.example1.Name;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import java.util.Map;
import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toMap;
@ToString
@EqualsAndHashCode
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public final class ARequest {
public final Map<Name, Name> names;
public static ARequest aRequest(final Name[] names) {
final Map<Name, Name> map = stream(names)
.collect(toMap(x -> x, x -> x));
return new ARequest(map);
}
}
| [
"[email protected]"
] | |
24047ed08cd38595099f5c20349349954addbf9c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_88fef4455a2cc5cbd136f4b88ef825ce7b98f1fd/Messages/2_88fef4455a2cc5cbd136f4b88ef825ce7b98f1fd_Messages_s.java | 49b92c9337bac1e2144da4a866230aae8634c21a | [] | 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 | 3,159 | java | package com.ibm.sbt.services.client.connections.profiles.utils;
/**
* Class used to retrieve translatable message values from the associated properties file.
*
* @author Swati Singh
*/
public class Messages {
public static String InvalidArgument_1 = "Required input parameter is missing : id";
public static String InvalidArgument_2 = "Required input parameter is missing : connectionId";
public static String InvalidArgument_3 = "Invalid Input : Profile passed is null";
public static String InvalidArgument_4 = "Required input parameter is missing : source id is missing";
public static String InvalidArgument_5 = "Required input parameter is missing : target id is missing";
public static String InvalidArgument_6 = "Invalid Input : Connection passed is null";
public static String ProfileServiceException_1 = "Exception occurred in method";
public static String ProfileException = "Error getting profile with identifier : {0}";
public static String SearchException = "Problem occurred while searching profiles";
public static String ColleaguesException = "Problem occurred while getting colleagues of user with identifier : {0}";
public static String CheckColleaguesException = "Problem occurred in checking if two users are colleagues";
public static String CommonColleaguesException = "Problem occurred in getting common colleagues of users {0} and {1}";
public static String ReportingChainException = "Problem occurred in getting report chain of user with identifier : {0}";
public static String DirectReportsException = "Problem occurred in getting direct reports of user with identifier : {0}";
public static String ConnectionsByStatusException = "Problem occurred while getting connections by status for user with identifier : {0}";
public static String SendInviteException = "Problem occurred in sending Invite to user with identifier : {0}, please check if there is already a pending invite for this user";
public static String SendInvitePayloadException = "Error creating Send Invite Payload";
public static String SendInviteMsg = "Please accept this invitation to be in my network of Connections colleagues.";
public static String AcceptInviteException = "Problem occurred in accepting Invite with connection Id : {0}";
public static String AcceptInvitePayloadException = "Error creating Accept Invite Payload";
public static String DeleteInviteException = "Problem occurred in deleting Invite with connection Id : {0}";
public static String UpdateProfilePhotoException = "Problem occurred in Updating Profile Photo";
public static String UpdateProfileException = "Problem occurred in Updating Profile ";
public static String DeleteProfileException = "Problem occurred in deleting Profile of user with identifier : {0}";
public static String CreateProfileException = "Problem occurred in creating Profile , please check if profile already and you are logged in as administrator";
public static String CreateProfilePayloadException = "Error in create Profile Payload";
}
| [
"[email protected]"
] | |
06878502ad35e8a58428f138851583276811fa6a | 1374237fa0c18f6896c81fb331bcc96a558c37f4 | /java/com/winnertel/em/standard/snmp/gui/formatter/HundredPercentFormatter.java | 50fdc7d8c9d598bb8a28f53f290b8ae4f78ffe83 | [] | no_license | fangniude/lct | 0ae5bc550820676f05d03f19f7570dc2f442313e | adb490fb8d0c379a8b991c1a22684e910b950796 | refs/heads/master | 2020-12-02T16:37:32.690589 | 2017-12-25T01:56:32 | 2017-12-25T01:56:32 | 96,560,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | java | package com.winnertel.em.standard.snmp.gui.formatter;
import com.winnertel.em.framework.IApplication;
import com.winnertel.em.framework.model.snmp.SnmpMibBean;
import com.winnertel.em.framework.model.util.MibBeanUtil;
public class HundredPercentFormatter extends SnmpFieldFormatter {
public HundredPercentFormatter(IApplication anApplication) {
super(anApplication);
} // BridgeIdFormatter
public Object format(SnmpMibBean aMibBean, String aProperty) throws Exception {
Integer value = (Integer) MibBeanUtil.getSimpleProperty(aMibBean, aProperty);
if (value == null) {
return null;
}
StringBuffer result = new StringBuffer();
result.append((((float) value.intValue()) / 100.0));
result.append("%");
return result.toString();
}
} // BridgeIdFormatter
| [
"[email protected]"
] | |
a777b88ad15b36633dca506421bdc6be5c89e136 | b5c485493f675bcc19dcadfecf9e775b7bb700ed | /jee-utility/src/main/java/org/cyk/utility/scope/AbstractScopeImpl.java | 1958931f7c7449fca7c6326b7bbe51acd76382c5 | [] | no_license | devlopper/org.cyk.utility | 148a1aafccfc4af23a941585cae61229630b96ec | 14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775 | refs/heads/master | 2023-03-05T23:45:40.165701 | 2021-04-03T16:34:06 | 2021-04-03T16:34:06 | 16,252,993 | 1 | 0 | null | 2022-10-12T20:09:48 | 2014-01-26T12:52:24 | Java | UTF-8 | Java | false | false | 275 | java | package org.cyk.utility.scope;
import java.io.Serializable;
import org.cyk.utility.__kernel__.object.dynamic.AbstractObject;
public abstract class AbstractScopeImpl extends AbstractObject implements Scope,Serializable{
private static final long serialVersionUID = 1L;
}
| [
"[email protected]"
] | |
1820e1a14570e3d6f1ddf1ae11b722ac43bf9d9f | e6d8ca0907ff165feb22064ca9e1fc81adb09b95 | /src/main/java/com/vmware/vim25/ProfileDeferredPolicyOptionParameter.java | 30fcffaf256a0de10174b37da96e0906c0aa2965 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | incloudmanager/incloud-vijava | 5821ada4226cb472c4e539643793bddeeb408726 | f82ea6b5db9f87b118743d18c84256949755093c | refs/heads/inspur | 2020-04-23T14:33:53.313358 | 2019-07-02T05:59:34 | 2019-07-02T05:59:34 | 171,236,085 | 0 | 1 | BSD-3-Clause | 2019-02-20T02:08:59 | 2019-02-18T07:32:26 | Java | UTF-8 | Java | false | false | 2,258 | java | /*================================================================================
Copyright (c) 2013 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the names of copyright holders nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
@SuppressWarnings("all")
public class ProfileDeferredPolicyOptionParameter extends DynamicData {
public ProfilePropertyPath inputPath;
public KeyAnyValue[] parameter;
public ProfilePropertyPath getInputPath() {
return this.inputPath;
}
public KeyAnyValue[] getParameter() {
return this.parameter;
}
public void setInputPath(ProfilePropertyPath inputPath) {
this.inputPath=inputPath;
}
public void setParameter(KeyAnyValue[] parameter) {
this.parameter=parameter;
}
} | [
"sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1"
] | sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1 |
9459416f16490ebbdff928b5d4abd9cabae424ae | 55876a3fe02485c1d524054ecb2573804f234626 | /src/main/java/com/altas/erp/eds/entity/AccountBankStatementImportEntityWithBLOBs.java | 7a66932702484915425053572cae6eb9cec286e8 | [] | no_license | enjoy0924/sample-tars | b427ceac64b2ec99369d2dc29e7b474f5008632c | e08ef487ea939c492e136e06f19393b6ebd83382 | refs/heads/master | 2021-09-11T01:22:45.694774 | 2018-04-05T15:19:30 | 2018-04-05T15:19:32 | 119,140,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,213 | java | package com.altas.erp.eds.entity;
public class AccountBankStatementImportEntityWithBLOBs extends AccountBankStatementImportEntity {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column account_bank_statement_import.data_file
*
* @mbg.generated Thu Apr 05 20:29:43 CST 2018
*/
private byte[] dataFile;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column account_bank_statement_import.filename
*
* @mbg.generated Thu Apr 05 20:29:43 CST 2018
*/
private String filename;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column account_bank_statement_import.data_file
*
* @return the value of account_bank_statement_import.data_file
*
* @mbg.generated Thu Apr 05 20:29:43 CST 2018
*/
public byte[] getDataFile() {
return dataFile;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column account_bank_statement_import.data_file
*
* @param dataFile the value for account_bank_statement_import.data_file
*
* @mbg.generated Thu Apr 05 20:29:43 CST 2018
*/
public void setDataFile(byte[] dataFile) {
this.dataFile = dataFile;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column account_bank_statement_import.filename
*
* @return the value of account_bank_statement_import.filename
*
* @mbg.generated Thu Apr 05 20:29:43 CST 2018
*/
public String getFilename() {
return filename;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column account_bank_statement_import.filename
*
* @param filename the value for account_bank_statement_import.filename
*
* @mbg.generated Thu Apr 05 20:29:43 CST 2018
*/
public void setFilename(String filename) {
this.filename = filename == null ? null : filename.trim();
}
} | [
"[email protected]"
] | |
fcea537ba728204cffd810144560bea386787397 | 54c28a1a5f7fa16b4442f55340abcb4b193e4397 | /network-server/src/main/java/com/programyourhome/immerse/network/server/action/PlayScenarioAction.java | 5d0fbda7796b62c0b87a4a6c42c87ab4c59865a4 | [
"Apache-2.0"
] | permissive | OrangeBaoWang/immerse | cb0e7a26b8ad214fcf329db96f90e14267237451 | 3b89232b7f6b9e229d1f127cb1135d305c856893 | refs/heads/master | 2021-10-11T00:27:58.982416 | 2019-01-19T20:55:46 | 2019-01-19T20:55:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 777 | java | package com.programyourhome.immerse.network.server.action;
import java.io.IOException;
import java.io.ObjectInput;
import java.util.UUID;
import com.programyourhome.immerse.domain.Scenario;
import com.programyourhome.immerse.network.server.ImmerseServer;
/**
* Play a scenario on the mixer.
*/
public class PlayScenarioAction extends Action<UUID> {
@Override
public UUID perform(ImmerseServer server, ObjectInput objectInput) throws ClassNotFoundException, IOException {
Scenario scenario = this.read(objectInput, Scenario.class);
if (!server.hasMixer()) {
throw new IllegalStateException("Server does not have a mixer, playing a scenario is not possible");
}
return server.getMixer().playScenario(scenario);
}
}
| [
"[email protected]"
] | |
d41bd071a1ccc1c24e33de30e1e68281cbdf3db6 | 9c27398b8808a59b476ea7f7b82a6faaa50e4027 | /src/main/java/br/alura/patterns/memento/Contrato.java | 142f6eeafc7e23cfa9c1901bd813ff9b17883085 | [] | no_license | gabrielsmartins/design-patterns-II | 09605f18708640c729c377d3ac8b6df0779ae126 | 80b7a22a0c0ca7938dd314f0af772e1123058581 | refs/heads/master | 2022-01-24T18:16:01.702605 | 2019-10-20T18:37:26 | 2019-10-20T18:37:26 | 216,408,972 | 0 | 0 | null | 2022-01-21T23:32:33 | 2019-10-20T18:36:02 | Java | UTF-8 | Java | false | false | 1,125 | java | package br.alura.patterns.memento;
import java.time.LocalDateTime;
public class Contrato {
private LocalDateTime data;
private String cliente;
private TipoContrato tipo;
public Contrato(LocalDateTime data, String cliente, TipoContrato tipo) {
this.data = data;
this.cliente = cliente;
this.tipo = tipo;
}
public LocalDateTime getData() {
return data;
}
public String getCliente() {
return cliente;
}
public TipoContrato getTipo() {
return tipo;
}
public void avanca() {
if(this.tipo == TipoContrato.NOVO)
this.tipo = TipoContrato.EM_ANDAMENTO;
else if(this.tipo == TipoContrato.EM_ANDAMENTO)
this.tipo = TipoContrato.ACERTADO;
else if(this.tipo == TipoContrato.ACERTADO)
this.tipo = TipoContrato.CONCLUIDO;
}
public Estado salvaEstado() {
return new Estado(new Contrato(this.data, this.cliente, this.tipo));
}
public void restaura(Estado estado) {
this.data = estado.getContrato().getData();
this.cliente = estado.getContrato().getCliente();
this.tipo = estado.getContrato().getTipo();
}
}
| [
"[email protected]"
] | |
8e496177009633c6c9e1926f2c8c3eb661a2f358 | 1dfd0e45975f1cf7ff9f9561ff2cc18559e5c7df | /Projects/中证技术CMS/zzjscms/src/main/java/com/zzjs/cms/entity/vo/ComponentTypeVo.java | 58fa367069ab4cfcd577f0b1012237e2515e2975 | [
"Apache-2.0"
] | permissive | fengmoboygithub/main_respository | 20434a7a676707916a035d4f19f40dba56f26186 | c17bc196ae606ce4af503b68af7a926a8e677986 | refs/heads/master | 2023-01-12T23:43:15.501710 | 2020-11-18T15:48:48 | 2020-11-18T15:48:48 | 313,973,726 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,185 | java | package com.zzjs.cms.entity.vo;
import java.util.Date;
import java.util.List;
import com.zzjs.cms.constant.ComponentTypeConstant;
import com.zzjs.cms.entity.Component;
/**
* 组件类型vo类
*
* @author yinlong
*
*/
public class ComponentTypeVo {
/**
* 组件类型ID
*/
private long tpCompTypeId;
/**
* 组件类型名称
*/
private String compTypeName;
/**
* 组件提示
*/
private String compTypeTip;
/**
* 排序
*/
private int tpSort;
/**
* 创建时间
*/
private Date tpCreateTime;
/**
* 更新时间
*/
private Date tpUpdateTime;
/**
* 组件类型描述
*/
private ComponentTypeConstant.compTypeDesc compTypeDesc;
/**
* html页面对应标签id
*/
private String htmlId;
/**
* 组件类型下的所有组件
*/
private List<Component> components;
public List<Component> getComponents() {
return components;
}
public void setComponents(List<Component> components) {
this.components = components;
}
public long getTpCompTypeId() {
return tpCompTypeId;
}
public void setTpCompTypeId(long tpCompTypeId) {
this.tpCompTypeId = tpCompTypeId;
}
public String getCompTypeName() {
return compTypeName;
}
public void setCompTypeName(String compTypeName) {
this.compTypeName = compTypeName;
}
public String getCompTypeTip() {
return compTypeTip;
}
public void setCompTypeTip(String compTypeTip) {
this.compTypeTip = compTypeTip;
}
public int getTpSort() {
return tpSort;
}
public void setTpSort(int tpSort) {
this.tpSort = tpSort;
}
public Date getTpCreateTime() {
return tpCreateTime;
}
public void setTpCreateTime(Date tpCreateTime) {
this.tpCreateTime = tpCreateTime;
}
public Date getTpUpdateTime() {
return tpUpdateTime;
}
public void setTpUpdateTime(Date tpUpdateTime) {
this.tpUpdateTime = tpUpdateTime;
}
public ComponentTypeConstant.compTypeDesc getCompTypeDesc() {
return compTypeDesc;
}
public void setCompTypeDesc(ComponentTypeConstant.compTypeDesc compTypeDesc) {
this.compTypeDesc = compTypeDesc;
}
public String getHtmlId() {
return htmlId;
}
public void setHtmlId(String htmlId) {
this.htmlId = htmlId;
}
}
| [
"[email protected]"
] | |
80c7b29967c46c971cf3632b56fcbd54479734af | 4da9097315831c8639a8491e881ec97fdf74c603 | /src/StockIT-v1-release_source_from_JADX/sources/com/facebook/imagepipeline/producers/EncodedCacheKeyMultiplexProducer.java | 82229735b5279d8783ba48e80d52ad3665eaac8e | [
"Apache-2.0"
] | permissive | atul-vyshnav/2021_IBM_Code_Challenge_StockIT | 5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1 | 25c26a4cc59a3f3e575f617b59acc202ee6ee48a | refs/heads/main | 2023-08-11T06:17:05.659651 | 2021-10-01T08:48:06 | 2021-10-01T08:48:06 | 410,595,708 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,169 | java | package com.facebook.imagepipeline.producers;
import android.util.Pair;
import com.facebook.cache.common.CacheKey;
import com.facebook.imagepipeline.cache.CacheKeyFactory;
import com.facebook.imagepipeline.image.EncodedImage;
import com.facebook.imagepipeline.request.ImageRequest;
public class EncodedCacheKeyMultiplexProducer extends MultiplexProducer<Pair<CacheKey, ImageRequest.RequestLevel>, EncodedImage> {
private final CacheKeyFactory mCacheKeyFactory;
public EncodedCacheKeyMultiplexProducer(CacheKeyFactory cacheKeyFactory, boolean z, Producer producer) {
super(producer, "EncodedCacheKeyMultiplexProducer", z);
this.mCacheKeyFactory = cacheKeyFactory;
}
/* access modifiers changed from: protected */
public Pair<CacheKey, ImageRequest.RequestLevel> getKey(ProducerContext producerContext) {
return Pair.create(this.mCacheKeyFactory.getEncodedCacheKey(producerContext.getImageRequest(), producerContext.getCallerContext()), producerContext.getLowestPermittedRequestLevel());
}
public EncodedImage cloneOrNull(EncodedImage encodedImage) {
return EncodedImage.cloneOrNull(encodedImage);
}
}
| [
"[email protected]"
] | |
eaeeefc1236afae8cf26362504dd568386d6e76b | 900961ee56d18be726ba0a7f468281b8a1be9bc2 | /src/main/java/it/cnr/istc/pst/platinum/ai/framework/microkernel/lang/flaw/FlawCategoryType.java | 37037ff90beb0418344d2614a68cbc31f7f15aad | [
"Apache-2.0"
] | permissive | pstlab/PLATINUm | 767f77ea7405639673f26fd399e2a14dcdb511f8 | 3b949ee8312090f696e83413849e0c90f50a070a | refs/heads/master | 2023-04-29T11:19:55.606724 | 2023-04-17T09:51:06 | 2023-04-17T09:51:06 | 123,152,138 | 14 | 0 | Apache-2.0 | 2020-10-15T14:34:14 | 2018-02-27T15:54:16 | Java | UTF-8 | Java | false | false | 519 | java | package it.cnr.istc.pst.platinum.ai.framework.microkernel.lang.flaw;
/**
*
* @author anacleto
*
*/
public enum FlawCategoryType
{
/**
* Category of flaws that entail only planning decisions to be solved
*/
PLANNING,
/**
* Category of flaws that entail only scheduling decisions to be solved
*/
SCHEDULING,
/**
* Category of flaws that entail both planning and scheduling decisions to be solved
*/
PLANNING_SCHEDULING,
/**
* Category of flaws that cannot be solved
*/
UNSOLVABLE;
}
| [
"[email protected]"
] | |
435a137212d844365f5ae06fc51a22d7d339696f | e76b9c328c32f3bc19148ce1b42fd2a2aea182e2 | /src/main/java/info/smartkit/eip/obtuse_octo_prune/configs/StaticResourceConfiguration.java | 7d3bb4080bf1bb12c5658a8bc01a045669124b60 | [
"MIT"
] | permissive | yangboz/spring-boot-elasticsearch-LIRE-docker | 8e84a2b4743189c6f766c348a9c524b88f795693 | 70414fa7555bb00dd055ccb249067f572b3486e1 | refs/heads/master | 2021-07-22T07:31:23.966678 | 2017-11-01T15:21:31 | 2017-11-01T15:21:31 | 44,301,575 | 7 | 5 | null | null | null | null | UTF-8 | Java | false | false | 1,263 | java | package info.smartkit.eip.obtuse_octo_prune.configs;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
public class StaticResourceConfiguration extends WebMvcConfigurerAdapter {
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
"classpath:/META-INF/resources/", "classpath:/resources/",
"classpath:/static/", "classpath:/public/"};
/**
* Add our static resources folder mapping.
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
//
registry.addResourceHandler("/**").addResourceLocations(
CLASSPATH_RESOURCE_LOCATIONS);
//
registry.addResourceHandler("/uploads/**").addResourceLocations(
"classpath:/uploads/");
// Jasper report
registry.addResourceHandler("/static/**").addResourceLocations(
"classpath:/static/");
// registry.addResourceHandler("/reports/**").addResourceLocations("classpath:/reports/");
//
super.addResourceHandlers(registry);
}
}
| [
"[email protected]"
] | |
ce94a9017be6206d736d746beb840b33ef5bc3bb | 96c161bbc218794a1c7216af301ebcd584265ae6 | /src/dbQuery/MySqlImageTest.java | de78c82d3262b7503acf2327097228c3649eff48 | [] | no_license | dpmihai/test | b23d57812156d174990e819be7fa878c2957b16a | 0eab964edfc13ebd1a7179d806cb2b5e6d2772a4 | refs/heads/master | 2020-04-15T22:50:03.796014 | 2017-07-28T12:33:03 | 2017-07-28T12:33:03 | 6,610,594 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,464 | java | package dbQuery;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MySqlImageTest {
public static Connection openConnection(String username, String password) throws SQLException {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (java.lang.ClassNotFoundException e) {
throw new SQLException("Cannot load database driver");
}
String url = "jdbc:mysql://vs511.intranet.asf.ro/nextdemo";
return DriverManager.getConnection(url, username, password);
}
public static void insertImage(Connection conn, String name, String img) {
int len;
PreparedStatement pstmt;
try {
String query = "INSERT INTO images VALUES (?, ?)";
File file = new File(img);
FileInputStream fis = new FileInputStream(file);
len = (int) file.length();
pstmt = conn.prepareStatement(query);
pstmt.setString(1, name);
pstmt.setBinaryStream(2, fis, len);
pstmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void getImageData(Connection conn, String name) {
byte[] fileBytes;
String query;
try {
query = "select image from images where name like '" + name + "'";
Statement state = conn.createStatement();
ResultSet rs = state.executeQuery(query);
if (rs.next()) {
Blob aBlob = rs.getBlob(1);
fileBytes = aBlob.getBytes(1, (int) aBlob.length());
OutputStream targetFile = new FileOutputStream("d://new.png");
targetFile.write(fileBytes);
targetFile.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
Connection con = null;
try {
con = openConnection("nextuser", "zefcaHet5");
System.out.println("Connected");
insertImage(con, "Mike", "D:\\Public\\nextreports-server-os\\webapp\\images\\alarm.png");
System.out.println("Image inserted");
getImageData(con, "Mike");
System.out.println("Image read");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (con != null) {
try {
con.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
| [
"[email protected]"
] | |
c7b690a11da71000281fe0e8c50b6ef0162c11b6 | 7991248e6bccacd46a5673638a4e089c8ff72a79 | /base/common/src/main/java/org/artifactory/request/ResponseWithStatusHolderMapper.java | 353da81e81c519ce722ea828071213c08f96697f | [] | no_license | theoriginalshaheedra/artifactory-oss | 69b7f6274cb35c79db3a3cd613302de2ae019b31 | 415df9a9467fee9663850b4b8b4ee5bd4c23adeb | refs/heads/master | 2023-04-23T15:48:36.923648 | 2021-05-05T06:15:24 | 2021-05-05T06:15:24 | 364,455,815 | 1 | 0 | null | 2021-05-05T07:11:40 | 2021-05-05T03:57:33 | Java | UTF-8 | Java | false | false | 1,501 | java | /*
*
* Artifactory is a binaries repository manager.
* Copyright (C) 2018 JFrog Ltd.
*
* Artifactory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Artifactory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Artifactory. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.artifactory.request;
import org.apache.http.HttpStatus;
import org.artifactory.common.StatusHolder;
/**
* Only maps exceptions in case there is no status code inside the status holder
*
* @author Shay Yaakov
*/
public class ResponseWithStatusHolderMapper extends ResponseStatusCodesMapper {
private StatusHolder statusHolder;
public ResponseWithStatusHolderMapper(StatusHolder statusHolder) {
this.statusHolder = statusHolder;
}
@Override
public int getStatusCode(Throwable e) {
int statusCode = statusHolder.getStatusCode();
if (statusCode != HttpStatus.SC_INTERNAL_SERVER_ERROR) {
return statusCode;
}
return super.getStatusCode(e);
}
}
| [
"[email protected]"
] | |
965abb5b828b269200370361bf443efbf722c40e | 2eb567cb893850bec197ead1491f3e802cff93e6 | /java-se-samples/base/src/main/java/apibase/common/DoubleTest.java | 6cc93296ff5a66e9b129988e9ecf2042325e45b3 | [] | no_license | doubleview/java-awesome-demo | 4ca9971f01ab7b3be6fbefb76f9a7d8c78de0ed0 | 983491df02bf9c83978cbec83b93d1a68b1b2275 | refs/heads/master | 2022-12-22T10:12:26.250184 | 2021-07-25T05:58:22 | 2021-07-25T05:58:22 | 96,692,018 | 0 | 0 | null | 2022-12-16T09:52:49 | 2017-07-09T15:07:56 | Java | UTF-8 | Java | false | false | 351 | java | package apibase.common;
public class DoubleTest {
public static void main(String args[]) {
System.out.println("0.05 + 0.01 = " + (0.05 + 0.01));
System.out.println("1.0 - 0.42 = " + (1.0 - 0.42));
System.out.println("4.015 * 100 = " + (4.015 * 100));
System.out.println("123.3 / 100 = " + (123.3 / 100));
}
}
| [
"[email protected]"
] | |
4bfc270e3dfc044f017d0ee6d3d0a6b1ca6e9186 | fab79c220c6175ba553c94c4d176959469589219 | /src/main/java/nc/block/tile/generator/BlockFusionCore.java | 01f3c599670dc5073d1903ec5f611e2f6c78d4ed | [
"CC0-1.0"
] | permissive | remclave/NuclearCraft | bf155280583ef4667a7dea60832264bf24909198 | e873333ad22c0918515376c246a6b0b906aa920a | refs/heads/master | 2020-03-25T08:56:26.322487 | 2018-06-15T15:44:01 | 2018-06-15T15:44:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,155 | java | package nc.block.tile.generator;
import nc.block.tile.BlockInventory;
import nc.block.tile.IActivatable;
import nc.config.NCConfig;
import nc.init.NCBlocks;
import nc.proxy.CommonProxy;
import nc.tile.generator.TileFusionCore;
import nc.util.BlockPosHelper;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockFusionCore extends BlockInventory implements IActivatable {
public BlockFusionCore() {
super("fusion_core", Material.IRON);
setCreativeTab(CommonProxy.TAB_FUSION);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileFusionCore();
}
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos) {
return new AxisAlignedBB(-1.0F, 0.0F, -1.0F, 2.0F, 3.0F, 2.0F);
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Override
public boolean isNormalCube(IBlockState state) {
return false;
}
@Override
public boolean isFullCube(IBlockState state) {
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state) {
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
public boolean canPlaceBlockAt(World world, BlockPos pos) {
BlockPosHelper helper = new BlockPosHelper(pos);
for (BlockPos blockPos : helper.cuboid(-1, 0, -1, 1, 2, 1)) if (!(isAir(world, blockPos))) return false;
return true;
}
@Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
super.onBlockAdded(world, pos, state);
BlockPosHelper helper = new BlockPosHelper(pos);
for (BlockPos blockPos : helper.squareRing(1, 0)) setSide(world, blockPos);
for (BlockPos blockPos : helper.cuboid(-1, 1, -1, 1, 1, 1)) setSide(world, blockPos);
for (BlockPos blockPos : helper.cuboid(-1, 2, -1, 1, 2, 1)) setTop(world, blockPos);
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
BlockPosHelper helper = new BlockPosHelper(pos);
for (BlockPos blockPos : helper.squareRing(1, 0)) setAir(world, blockPos);
for (BlockPos blockPos : helper.cuboid(-1, 1, -1, 1, 2, 1)) setAir(world, blockPos);
world.removeTileEntity(pos);
}
private boolean isAir(World world, BlockPos pos) {
Material mat = world.getBlockState(pos).getMaterial();
return mat == Material.AIR || mat == Material.FIRE || mat == Material.WATER || mat == Material.VINE || mat == Material.SNOW;
}
private void setAir(World world, BlockPos pos) {
world.destroyBlock(pos, false);
}
private void setSide(World world, BlockPos pos) {
IBlockState dummy = NCBlocks.fusion_dummy_side.getDefaultState();
world.setBlockState(pos, dummy);
}
private void setTop(World world, BlockPos pos) {
IBlockState dummy = NCBlocks.fusion_dummy_top.getDefaultState();
world.setBlockState(pos, dummy);
}
@Override
public void setState(boolean active, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
keepInventory = true;
world.setBlockState(pos, NCBlocks.fusion_core.getDefaultState(), 3);
keepInventory = false;
if (tile != null) {
tile.validate();
world.setTileEntity(pos, tile);
}
}
@Override
public boolean hasComparatorInputOverride(IBlockState state) {
return true;
}
@Override
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileFusionCore) {
TileFusionCore core = (TileFusionCore) tile;
double strength = core.getAlternateComparator() ? (double)core.heat/core.getMaxHeat() : (double)core.efficiency/(double)NCConfig.fusion_comparator_max_efficiency;
return (int) MathHelper.clamp(15D*strength, 0, 15);
}
return Container.calcRedstone(world.getTileEntity(pos));
}
}
| [
"[email protected]"
] | |
7c7924672b79c9d7d2455149884d92d501669d88 | ca93d74d71f5d992f03ec8b79b5b5fe08aac4f5f | /src/main/java/com/hengyun/service/patient/SNMacRelationService.java | a13d1d228914f6cfde90d7962a8ef560af888019 | [] | no_license | jarvisxiong/dev | 29d2445d89f97b385218d14d74700c5f026f8dac | ceeefde8d2e15f9d246ff700428583e0721d0d52 | refs/heads/master | 2021-01-01T06:55:52.363282 | 2016-07-07T06:22:09 | 2016-07-07T06:22:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 413 | java | package com.hengyun.service.patient;
import com.hengyun.domain.patient.SNMacRelation;
import com.hengyun.service.BaseService;
/**
* @author bob E-mail:[email protected]
* @version 创建时间:2016年5月13日 下午4:53:40
* 类说明
*/
public interface SNMacRelationService extends BaseService<SNMacRelation,Integer>{
public void add(SNMacRelation snMacRelation);
public String getSN(String mac);
}
| [
"[email protected]"
] | |
e5de8ea2608ec86dd1758777a10b55f80aba535a | ba4b3f72c53eb80f7cc52e93348032dd352c686e | /MyLib/src/org/me/mylib/LibClass.java | 0c25edbb2192c4f2c52f2aaad4b8023d1a902c41 | [] | no_license | Jerek426/HomeWork1 | 2e6dff9fe730f0f26541774d993e0f8a6b11bf81 | 8c88df71be7dbadf868e8efba8cb126d58036025 | refs/heads/master | 2021-01-19T03:24:12.162418 | 2013-02-08T02:48:33 | 2013-02-08T02:48:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 541 | java | package org.me.mylib;
/**
*
* @author Devon Dimone
*/
public class LibClass
{
/**
*
* @param args
* @return
*/
public static String acrostic(String[] args)
{
StringBuffer b = new StringBuffer();
for (int i = 0; i < args.length; i++)
{
if (args[i].length() > i)
{
b.append(args[i].charAt(i));
}
else
{
b.append('?');
}
}
return b.toString();
}
}
| [
"[email protected]"
] | |
ff4f9b1dd0286a600ed1bdd6ed827350b42e341d | a09b4d2050f997a972a23225b96cc5b726f70bbe | /rmi/DynamicInvocation.java | 70afdec97d88fc501fd7879d9db2b2de9e9e2c9e | [] | no_license | cczhong11/Remote-Method-Invocation | a9a0636b2c074890d3c83f4ea81e92fb0b3c5a6b | 21d7f4037c9fa2238fdb5be5c264c90a843e5128 | refs/heads/master | 2021-01-25T09:52:33.923415 | 2018-02-28T18:09:34 | 2018-02-28T18:09:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,336 | java | package rmi;
import java.net.*;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class DynamicInvocation<T> implements InvocationHandler{
//the information stored in each handler to handle requests
private Class<T> remote_interface;
private InetSocketAddress remote_addr;
public DynamicInvocation(InetSocketAddress addr, Class<T> c)
{
remote_interface = c;
remote_addr = addr;
}
/**
* my_toString: report the name of remote interface implemented by the stub
* and remote address(hostname + port) of the skeleton
* @param proxy
* the proxy being invoked
*/
private String my_toString(Object proxy)
{
DynamicInvocation<T> DynamicHandler = (DynamicInvocation<T>)Proxy.getInvocationHandler(proxy);
return DynamicHandler.remote_interface.getName() + " " + DynamicHandler.remote_addr.toString();
}
/**
* my_hashCode: when the client is requesting the hashCode function of Stub,
* the proxy object should implement the hashCode function rather
* than sending it to the server
* @param proxy
* the proxy being invoked
*/
private int my_hashCode(Object proxy)
{
return my_toString(proxy).hashCode();
}
/**
* two stubs are considered equal if they implement the same interface & connect to
* the same skeleton
* Note: should deal with null situation
* @param proxy
* the proxy being invoked
* @param args
* the arguments of equals function
*/
private boolean my_equals(Object proxy, Object[] args)
{
try
{
if (my_hashCode(proxy) == my_hashCode(args[0])) return true;
}
catch (Exception e)
{
return false;
}
return false;
}
/**
* when a method is called, invoke and open a new connection
* @param proxy
* the proxy object created for the stub, the method is invoked on
* @param method
* the method transferred to the server
* @param args
* the method arguments
*/
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable
{
//check if it is the stub's self function
String method_name = method.getName();
if (method_name.equals("hashCode"))
{
return my_hashCode(proxy);
}
if (method_name == "equals")
{
return my_equals(proxy, args);
}
if (method_name == "toString")
{
return my_toString(proxy);
}
//otherwise it should forward the request to the server
//open a connection with the remote server
ObjectOutputStream out = null;
ObjectInputStream in = null;
Socket client = null;
try
{
InetAddress server = remote_addr.getAddress();
int port = remote_addr.getPort();
client = new Socket(server, port);
out = new ObjectOutputStream(client.getOutputStream());
out.flush();
}catch(Exception e)
{
client.close();
System.out.println("Fail to create output stream to server.");
throw new RMIException("RMI: Fail to create output stream to server.");
}
//create the input stream
try
{
in = new ObjectInputStream(client.getInputStream());
}catch(Exception e)
{
client.close();
throw new RMIException("RMI: Fail to create input stream to server.");
}
//send
try
{
out.writeObject(method.getName());
out.writeObject(args);
out.writeObject(null);
out.flush();
}catch(Exception e)
{
client.close();
in.close();
out.close();
System.out.println("Error in sending the data!");
throw new RMIException("RMI: Error in sending the data!");
}
//receive
Object returned_obj;
try
{
returned_obj = (Object)in.readObject();
}catch(Exception e)
{
client.close();
in.close();
out.close();
System.out.println("Error in receiving the data!");
throw new RMIException("Error in receiving the data!");
}
//raise the same exception
if (returned_obj instanceof Exception)
{
throw (java.lang.Throwable)returned_obj;
}
//close connection
try
{
out.close();
in.close();
client.close();
}catch(Exception e)
{
System.out.println("Error in closing socket");
throw new RMIException("Error in closing socket.");
}
//return the object to client
return returned_obj;
}
}
| [
"[email protected]"
] | |
49161a195ea4a7044a299256b9fc1c9680410d71 | 95bbe09da876e356c9376fe979ef7a9bf90822df | /src/main/java/org/citygml4j/ade/energy/model/core/FloorAreaProperty.java | 1fb751ceff3a93b6601be110562b99c3a8a058d4 | [
"Apache-2.0"
] | permissive | citygml4j/energy-ade-citygml4j | ef954ab104a690c0169d3ca10b65301e871cdcde | 663f32cdcdc579b95ff6d6427a728c61f9b30e47 | refs/heads/master | 2022-08-29T17:07:51.335493 | 2022-08-25T11:56:24 | 2022-08-25T11:56:24 | 157,459,176 | 9 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,035 | java | /*
* energy-ade-citygml4j - Energy ADE module for citygml4j
* https://github.com/citygml4j/energy-ade-citygml4j
*
* energy-ade-citygml4j is part of the citygml4j project
*
* Copyright 2019-2021 Claus Nagel <[email protected]>
*
* 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.citygml4j.ade.energy.model.core;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.gml.base.AssociationByRep;
public class FloorAreaProperty extends AssociationByRep<FloorArea> implements ADEModelObject {
public FloorAreaProperty() {
}
public FloorAreaProperty(FloorArea floorArea) {
super(floorArea);
}
public FloorArea getFloorArea() {
return super.getObject();
}
public boolean isSetFloorArea() {
return super.isSetObject();
}
public void setFloorArea(FloorArea floorArea) {
super.setObject(floorArea);
}
public void unsetFloorArea() {
super.unsetObject();
}
@Override
public Class<FloorArea> getAssociableClass() {
return FloorArea.class;
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new FloorAreaProperty(), copyBuilder);
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
FloorAreaProperty copy = (target == null) ? new FloorAreaProperty() : (FloorAreaProperty)target;
return super.copyTo(copy, copyBuilder);
}
}
| [
"[email protected]"
] | |
c751490b6edae859d7116c18c1d0490672524417 | caa2efc6c09b2a69943b173dec19952a213fd7ae | /odin-core/src/main/java/com/purplepip/odin/creation/flow/DefaultFlow.java | 6f0c795738e34735e6db7aa40f5d0ea2887853ca | [
"MIT",
"Apache-2.0"
] | permissive | ianhomer/odin | 83963bf214442f696782c96222b432f40cefa15c | ac3e4a5ddbe5c441fc9fb22fa5f06a996ec1454c | refs/heads/main | 2021-10-19T22:27:29.709053 | 2020-11-15T17:37:40 | 2020-11-15T17:37:40 | 79,387,599 | 6 | 0 | NOASSERTION | 2021-10-05T21:04:08 | 2017-01-18T21:44:23 | Java | UTF-8 | Java | false | false | 2,672 | java | /*
* Copyright (c) 2017 the original author or authors. All Rights Reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.purplepip.odin.creation.flow;
import com.purplepip.odin.clock.Clock;
import com.purplepip.odin.clock.Loop;
import com.purplepip.odin.clock.MeasureContext;
import com.purplepip.odin.clock.measure.MeasureProvider;
import com.purplepip.odin.clock.tick.Tock;
import com.purplepip.odin.creation.sequence.Sequence;
import com.purplepip.odin.events.Event;
import com.purplepip.odin.events.ScanForwardEvent;
import lombok.extern.slf4j.Slf4j;
/**
* Default flow implementation.
*/
@Slf4j
public class DefaultFlow<S extends Sequence> implements MutableFlow<S> {
private S sequence;
private final MeasureContext context;
/**
* Create flow.
*
* @param clock clock
* @param measureProvider measure provider
*/
public DefaultFlow(Clock clock, MeasureProvider measureProvider) {
this.context = new MeasureContext(clock, measureProvider);
}
@Override
public void setSequence(S sequence) {
this.sequence = sequence;
}
@Override
public S getSequence() {
return sequence;
}
@Override
public MeasureContext getContext() {
return context;
}
@Override
public Event getNextEvent(Tock tock) {
/*
* Create local and temporary mutable tock for this function execution.
*/
Loop loop = new Loop(sequence.getLoopLength(), tock.getPosition());
int i = 0;
long maxScanForward = context.getClock().getMaxLookForward().floor();
Event event = null;
while (event == null && i < maxScanForward) {
event = sequence.getNextEvent(context, loop);
if (event == null) {
LOG.trace("{} : No event found at tock {}, incrementing loop", sequence.getName(), loop);
loop.increment();
i++;
}
}
if (event == null) {
LOG.trace("No notes found in the next {} ticks after tock {} for sequence {}",
maxScanForward, tock, getSequence());
event = new ScanForwardEvent(loop.getPosition().getLimit());
}
return event;
}
@Override
public void initialise() {
sequence.initialise();
}
}
| [
"[email protected]"
] | |
4180c85ac6098927740cac685368da377943c805 | d60e287543a95a20350c2caeabafbec517cabe75 | /LACCPlus/Hadoop/2668_1.java | b4c4dad1beebb40499e646457f499388e9253463 | [
"MIT"
] | permissive | sgholamian/log-aware-clone-detection | 242067df2db6fd056f8d917cfbc143615c558b2c | 9993cb081c420413c231d1807bfff342c39aa69a | refs/heads/main | 2023-07-20T09:32:19.757643 | 2021-08-27T15:02:50 | 2021-08-27T15:02:50 | 337,837,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 245 | java | //,temp,SwiftUtils.java,113,117,temp,RandomTextDataGenerator.java,124,131
//,3
public class xxx {
public static void debugEx(Logger log, String text, Exception ex) {
if (log.isDebugEnabled()) {
log.debug(text + ex, ex);
}
}
}; | [
"[email protected]"
] | |
128f880660bcd92d21fe8fe427302b1a04ab02f0 | e9376e9d9da01844014a9785808e24e292cdd9e7 | /app/src/main/java/app/com/esenatenigeria/model/BillsModel.java | 177a048e41bff65110dcf21d687c4d054ff1b701 | [] | no_license | sh7verma/nass_ | 6f16264e3fa6e74d4c744d31b791c893b3f26b5b | 56b7a6af0786edcfa682369b04ad919e828c7950 | refs/heads/master | 2020-05-09T20:42:26.389838 | 2018-09-28T11:47:49 | 2018-09-28T11:47:49 | 181,417,480 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,100 | java | package app.com.esenatenigeria.model;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.Index;
import android.arch.persistence.room.PrimaryKey;
import android.support.annotation.NonNull;
import java.util.List;
import app.com.esenatenigeria.utils.Encode;
/**
* Created by dev on 26/4/18.
*/
public class BillsModel {
static private Encode encode = new Encode();
private int statusCode;
private String message;
private DataBeanX data;
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public DataBeanX getDataX() {
return data;
}
public void setDataX(DataBeanX data) {
this.data = data;
}
public static class DataBeanX {
private int count;
private List<DataBean> data;
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
}
@Entity(tableName = "BillsDataBean", indices = {@Index(value = {"doc_id"},
unique = true)})
public static class DataBean {
/**
* doc_id : 5addad53f58204746f80c03b
* category : SbA06tQMWcg8GR7Yh+RiTA==
* chamber : 9ZjqcZ0HS8yvraRMyThHOg==
* date : 2017-11-17T00:00:00.000Z
* session : null
* parliament : null
* docURL : FsGrVtqTOKTEYoXievB4tXOxnCLdz4FUZgiai04uKMw+85uiktr7MBH+qVqRleNW
* name : FIaYb7vVjo7AYDjQ7oQOExH67DmTeWe5VLRj6gG1vQjYTBOiLdrwAlwwjNHudKM+xe9eEYnuJkWKlCAJru5T2Q==
* __v : 0
*/
@PrimaryKey
@ColumnInfo(name = "doc_id")
@NonNull
private String doc_id;
@ColumnInfo(name = "bill_category")
private String category;
@ColumnInfo(name = "bill_chamber")
private String chamber;
@ColumnInfo(name = "bill_date")
private String date;
@ColumnInfo(name = "bill_summary")
private String summary;
@ColumnInfo(name = "bills_source")
private String source;
@ColumnInfo(name = "bill_session")
private String session;
@ColumnInfo(name = "bill_parliament")
private String parliament;
@ColumnInfo(name = "bill_docURL")
private String docURL;
@ColumnInfo(name = "bill_docLocalPath")
private String docLocalPath;
@ColumnInfo(name = "bill_name")
private String name;
@ColumnInfo(name = "bill_codeUpdatedAt")
private String codeUpdatedAt;
public String getCodeUpdatedAt() {
return codeUpdatedAt;
}
public void setCodeUpdatedAt(String codeUpdatedAt) {
this.codeUpdatedAt = codeUpdatedAt;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getDocLocalPath() {
return docLocalPath;
}
public void setDocLocalPath(String docLocalPath) {
this.docLocalPath = docLocalPath;
}
public String getDoc_id() {
return doc_id;
}
public void setDoc_id(String doc_id) {
this.doc_id = doc_id;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getChamber() {
return chamber;
}
public void setChamber(String chamber) {
this.chamber = chamber;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getSession() {
return session;
}
public void setSession(String session) {
this.session = session;
}
public String getParliament() {
return parliament;
}
public void setParliament(String parliament) {
this.parliament = parliament;
}
public String getDocURL() {
return docURL;
}
public void setDocURL(String docURL) {
this.docURL = docURL;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}
| [
"[email protected]"
] | |
184d191b91a65aeb8e2b6c012d62e30eda607c40 | 9af5abe79a9d2d38b2d6d34c4d821a07935e3339 | /src/main/java/com/phonemetra/turbo/binary/BinaryNameMapper.java | 0923caa525bc9db34ac32b4a1ecbc9103c4ee11c | [
"Apache-2.0"
] | permissive | Global-localhost/TurboSQL | a66b70a8fdb4cd67642dda0dad132986f2b9165c | 10dd81a36a0e25b1f786e366eb3ed9af0e5e325b | refs/heads/master | 2022-12-17T05:48:16.652086 | 2019-04-16T23:02:00 | 2019-04-16T23:02:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,631 | 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 com.phonemetra.turbo.binary;
import com.phonemetra.turbo.configuration.BinaryConfiguration;
/**
* Maps type and field names to different names. Prepares class/type names
* and field names before pass them to {@link BinaryIdMapper}.
* <p>
* Binary name mapper can be configured for all binary objects via
* {@link BinaryConfiguration#getNameMapper()} method,
* or for a specific binary type via {@link BinaryTypeConfiguration#getNameMapper()} method.
* @see BinaryIdMapper
*/
public interface BinaryNameMapper {
/**
* Gets type clsName.
*
* @param clsName Class came
* @return Type name.
*/
String typeName(String clsName);
/**
* Gets field name.
*
* @param fieldName Field name.
* @return Field name.
*/
String fieldName(String fieldName);
}
| [
"[email protected]"
] | |
5c446a3a726ae48a25e9bdf54d34bbfdfb102567 | 78f7fd54a94c334ec56f27451688858662e1495e | /VoterData/src/main/java/com/itgrids/voterdata/service/geo/DistanceChecker.java | 154826bcdff4228e6c2f15f5d8e4bb64254eb13b | [] | no_license | hymanath/PA | 2e8f2ef9e1d3ed99df496761a7b72ec50d25e7ef | d166bf434601f0fbe45af02064c94954f6326fd7 | refs/heads/master | 2021-09-12T09:06:37.814523 | 2018-04-13T20:13:59 | 2018-04-13T20:13:59 | 129,496,146 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,266 | java | package com.itgrids.voterdata.service.geo;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DistanceChecker {
public static void main(String[] args)
{
DistanceChecker checker = new DistanceChecker();
List<DataVO> data = checker.getData("D:/OneDrive/ITGRIDS/ITDP/geodata.txt");
Date d1 = new Date();
Map<String,Integer> map = checker.getPointsBetewenInADistance(15.713531,79.8240546,data,200);
Date d2 = new Date();
System.out.println(map.size());
System.out.println("Time Taken - "+(d2.getTime()-d1.getTime()));
}
public Map<String,Integer> getPointsBetewenInADistance(Double latitude,Double longitude,List<DataVO> dataList,int length)
{
Map<String,Integer> result = new HashMap<String, Integer>(0);
try{
for(DataVO data : dataList)
{
String houseHoldId = data.getHouseHoldId();
Double distance = DistanceCalculator.distance(latitude,longitude,Double.valueOf(data.getLatitude()),Double.valueOf(data.getLongitude()),"M");
int length2 = distance.intValue();
if(length2 < length)
{
System.out.println(houseHoldId+"\t"+length2);
result.put(houseHoldId,length2);
}
}
}catch(Exception e)
{
e.printStackTrace();
}
return result;
}
public List<DataVO> getData(String filePath)
{
List<DataVO> dataList = new ArrayList<DataVO>(0);
try{
BufferedReader br = new BufferedReader(new FileReader(new File(filePath)));
String line = null;
DataVO dataVO = null;
while((line = br.readLine()) != null)
{
try{
String[] data = line.trim().split("\t");
String houseHoldId = data[0].trim();
String latitude = data[1].trim();
String longitude = data[2].trim();
dataVO = new DataVO();
dataVO.setHouseHoldId(houseHoldId);
dataVO.setLatitude(latitude);
dataVO.setLongitude(longitude);
dataList.add(dataVO);
}catch(Exception e)
{
e.printStackTrace();
}
}
br.close();
}catch(Exception e)
{
e.printStackTrace();
}
return dataList;
}
}
| [
"itgrids@b17b186f-d863-de11-8533-00e0815b4126"
] | itgrids@b17b186f-d863-de11-8533-00e0815b4126 |
29cf9cd39c7fef0b7791dff1ce4d5e0d6e2f5bb2 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/AsyncHttpClient--async-http-client/eb136417465e13f0ba17c2ae8efdb9a45c22a315/before/NettyTransferListenerTest.java | 7bd7d6856c035859fc992abe722de7eeb9ecfd40 | [] | 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,160 | java | /*
* Copyright (c) 2010-2012 Sonatype, Inc. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
package com.ning.http.client.async.netty;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
import com.ning.http.client.async.ProviderUtil;
import com.ning.http.client.async.TransferListenerTest;
public class NettyTransferListenerTest extends TransferListenerTest {
@Override
public AsyncHttpClient getAsyncHttpClient(AsyncHttpClientConfig config) {
return ProviderUtil.nettyProvider(config);
}
} | [
"[email protected]"
] | |
6de4d7badd5b9f0fb942233a08801ae300512d70 | f142738b9a5de8b7fcd6b4c0ed57ee70b66d9dac | /src/main/java/de/edgelord/saltyengine/core/stereotypes/ComponentParent.java | 976c67109f374dcdc402f8756cc2e00749263512 | [
"MIT"
] | permissive | igorimagine/salty-engine | 94921f119f824384ae252d8e63b624a179bca4b5 | 532c99fb3f1afc98db17c5a3ea54547d457b63d9 | refs/heads/master | 2020-04-02T06:37:16.123268 | 2018-10-17T17:04:57 | 2018-10-17T17:04:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,755 | java | /*
* This software was published under the MIT License.
* The full LICENSE file can be found here: https://github.com/edgelord314/salty-enigne/tree/master/LICENSE
*
* Copyright (c) 2018 Malte Dostal
*
* 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 de.edgelord.saltyengine.core.stereotypes;
import de.edgelord.saltyengine.core.Component;
import de.edgelord.saltyengine.core.Game;
import de.edgelord.saltyengine.core.interfaces.TransformedObject;
import de.edgelord.saltyengine.graphics.SaltyGraphics;
import de.edgelord.saltyengine.transform.Transform;
import java.util.List;
public abstract class ComponentParent implements TransformedObject {
private String tag;
public ComponentParent(String tag) {
this.tag = tag;
}
/**
* Adds the given {@link Component}
*
* @param component the component to add
*/
public abstract void addComponent(Component component);
/**
* Removes a {@link Component} by searching for the one with the given name
* and remove that one
*
* @param identifier the identifier of the component to be removed
*/
public abstract void removeComponent(String identifier);
/**
* Removes the given {@link Component}
* The implementation should be different from {@link #getComponent(String)}
* due to better performance possible when directly removing a Component
*
* @param component the {@link Component} to be removed
*/
public abstract void removeComponent(Component component);
/**
* Returns the {@link List} of {@link Component}s
*
* @return the {@link List} of {@link Component}s
*/
public abstract List<Component> getComponents();
/**
* Returns the {@link Component} with the given identifier
*
* @param identifier the identifier of the {@link Component} to be returned
* @return the requested {@link Component}
*/
public abstract Component getComponent(String identifier);
/**
* Calls the method {@link Component#onFixedTick()} for every {@link Component}.
*/
public void doComponentOnFixedTick() {
getComponents().forEach(component -> {
if (component.isEnabled()) {
component.onFixedTick();
}
});
}
/**
* Calls the method {@link Component#draw(SaltyGraphics)} for every component with the given {@link SaltyGraphics}
*
* @param graphics the graphics context to draw the components
*/
public void doComponentDrawing(SaltyGraphics graphics) {
getComponents().forEach(component -> {
if (component.isEnabled()) {
component.draw(graphics);
}
});
}
/**
* Places this object in the middle of the {@link de.edgelord.saltyengine.core.Host} {@link Game#host}
*/
public void centrePosition() {
setPosition(Game.getHost().getCentrePosition(getDimensions()));
}
/**
* Centres this object horizontally in the {@link de.edgelord.saltyengine.core.Host} {@link Game#host}
*/
public void centreHorizontalPosition() {
setX(Game.getHost().getHorizontalCentrePosition(getWidth()));
}
/**
* Centres this object vertically in the {@link de.edgelord.saltyengine.core.Host} {@link Game#host}
*/
public void centreVerticalPosition() {
setX(Game.getHost().getVerticalCentrePosition(getHeight()));
}
@Override
public abstract Transform getTransform();
@Override
public abstract void setTransform(Transform transform);
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
}
| [
"[email protected]"
] | |
e0327d2cdbf062b4ac103f1bb7b37f9635347c8c | cd4802766531a9ccf0fb54ca4b8ea4ddc15e31b5 | /dist/game/data/scripts/quests/Q10758_TheOathOfTheWind/Q10758_TheOathOfTheWind.java | 006bed445bc4910c263f2232a8189bf4015c4736 | [] | no_license | singto53/underground | 8933179b0d72418f4b9dc483a8f8998ef5268e3e | 94264f5168165f0b17cc040955d4afd0ba436557 | refs/heads/master | 2021-01-13T10:30:20.094599 | 2016-12-11T20:32:47 | 2016-12-11T20:32:47 | 76,455,182 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,673 | java | /*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package quests.Q10758_TheOathOfTheWind;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
import com.l2jmobius.gameserver.network.NpcStringId;
import quests.Q10757_QuietingTheStorm.Q10757_QuietingTheStorm;
/**
* The Oath of the Wind (10758)
* @author malyelfik
*/
public final class Q10758_TheOathOfTheWind extends Quest
{
// NPC
private static final int PIO = 33963;
// Monster
private static final int WINDIMA = 27522;
// Misc
private static final int MIN_LEVEL = 28;
public Q10758_TheOathOfTheWind()
{
super(10758);
addStartNpc(PIO);
addTalkId(PIO);
addSpawnId(WINDIMA);
addKillId(WINDIMA);
addCondRace(Race.ERTHEIA, "33963-00.htm");
addCondMinLevel(MIN_LEVEL, "33963-00.htm");
addCondCompletedQuest(Q10757_QuietingTheStorm.class.getSimpleName(), "33963-00.htm");
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
String htmltext = event;
switch (event)
{
case "33963-01.htm":
case "33963-02.htm":
break;
case "33963-03.htm":
{
qs.startQuest();
break;
}
case "SPAWN":
{
if (qs.isCond(1))
{
final L2Npc mob = addSpawn(WINDIMA, -93427, 89595, -3216, 0, true, 180000);
addAttackPlayerDesire(mob, player);
}
htmltext = null;
break;
}
case "33963-06.html":
{
if (qs.isCond(2))
{
giveStoryQuestReward(player, 3);
addExpAndSp(player, 561645, 134);
qs.exitQuest(false, true);
}
break;
}
default:
htmltext = null;
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
switch (qs.getState())
{
case State.CREATED:
htmltext = "33963-01.htm";
break;
case State.STARTED:
htmltext = (qs.isCond(1)) ? "33963-04.html" : "33963-05.html";
break;
case State.COMPLETED:
htmltext = getAlreadyCompletedMsg(player);
break;
}
return htmltext;
}
@Override
public String onSpawn(L2Npc npc)
{
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.ARGHH);
return super.onSpawn(npc);
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState qs = getQuestState(killer, false);
if ((qs != null) && qs.isCond(1))
{
qs.setCond(2, true);
}
npc.broadcastSay(ChatType.NPC_GENERAL, NpcStringId.I_AM_LOYAL_TO_YOU_MASTER_OF_THE_WINDS_AND_LOYAL_I_SHALL_REMAIN_IF_MY_VERY_SOUL_BETRAYS_ME);
return super.onKill(npc, killer, isSummon);
}
}
| [
"MobiusDev@7325c9f8-25fd-504a-9f63-8876acdc129b"
] | MobiusDev@7325c9f8-25fd-504a-9f63-8876acdc129b |
d0801ec933f3bf8028b39770d921a59cf8e24d6a | 0d4edfbd462ed72da9d1e2ac4bfef63d40db2990 | /app/src/main/java/com/dvc/mybilibili/mvp/presenter/activity/LoginPresenter.java | 12ca248b98f837a87c1821bbf7b900527a431c13 | [] | no_license | dvc890/MyBilibili | 1fc7e0a0d5917fb12a7efed8aebfd9030db7ff9f | 0483e90e6fbf42905b8aff4cbccbaeb95c733712 | refs/heads/master | 2020-05-24T22:49:02.383357 | 2019-11-23T01:14:14 | 2019-11-23T01:14:14 | 187,502,297 | 31 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,238 | java | package com.dvc.mybilibili.mvp.presenter.activity;
import android.arch.lifecycle.Lifecycle;
import android.content.Context;
import com.dvc.base.di.ApplicationContext;
import com.dvc.base.utils.RxSchedulersHelper;
import com.dvc.mybilibili.app.retrofit2.callback.ObserverCallback;
import com.dvc.mybilibili.mvp.model.DataManager;
import com.dvc.mybilibili.mvp.model.api.exception.BiliApiException;
import com.dvc.mybilibili.mvp.model.api.service.account.entity.LoginInfo;
import com.dvc.mybilibili.mvp.presenter.MyMvpBasePresenter;
import com.dvc.mybilibili.mvp.ui.activity.LoginView;
import com.trello.rxlifecycle2.LifecycleProvider;
import javax.inject.Inject;
public class LoginPresenter extends MyMvpBasePresenter<LoginView> {
@Inject
public LoginPresenter(@ApplicationContext Context context, DataManager dataManager, LifecycleProvider<Lifecycle.Event> provider) {
super(context, dataManager, provider);
}
public LifecycleProvider<Lifecycle.Event> getProvider() {
return this.provider;
}
public void login(String name, String password) {
this.dataManager.getApiHelper().getKey(false)
.compose(RxSchedulersHelper.AllioThread())
.subscribe(authKey -> {
this.dataManager.getApiHelper().loginV3(name,authKey.encryptPassword(password))
.compose(RxSchedulersHelper.ioAndMainThread())
.compose(provider.bindUntilEvent(Lifecycle.Event.ON_DESTROY))
.subscribe(new ObserverCallback<LoginInfo>() {
@Override
public void onSuccess(LoginInfo loginInfo) {
dataManager.getUser().loadToLoginInfo(loginInfo);
ifViewAttached(view -> view.loginCompleted(loginInfo));
}
@Override
public void onError(BiliApiException apiException, int code) {
ifViewAttached(view -> view.loginFailed(apiException));
}
});
});
}
}
| [
"[email protected]"
] | |
f2290ca35cdf55ddcd27ff1e25d8d11e9762578f | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_701e99900d9312579f7e835163563db4dacc5f40/BsonJackson/1_701e99900d9312579f7e835163563db4dacc5f40_BsonJackson_s.java | 9645b1f38cb5adecc1ae3a8347087bacae0c7ec5 | [] | 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 | 384 | java | package serializers;
import de.undercouch.bson4jackson.BsonFactory;
import de.undercouch.bson4jackson.BsonGenerator;
public class BsonJackson
{
public static void register(TestGroups groups)
{
BsonFactory factory = new BsonFactory();
groups.media.add(JavaBuiltIn.MediaTransformer,
new JsonJacksonManual.GenericSerializer("bson/jackson-manual", factory));
}
}
| [
"[email protected]"
] | |
52a18f00cf7d671ebdfecc1c3bd75758b9dd46d6 | cb47a69eb202feae227358af2493efe9c35d0cf6 | /spring-cloud/springcloud-sso/sso/auth-center-master/auth-server/auth-server-core/src/main/java/com/lingchaomin/auth/server/core/role/entity/Authorization.java | 3df48ff6007461ec1e386b7a0b8b3d2e4a22c41d | [
"Apache-2.0"
] | permissive | WCry/demo | e4f6ee469e39e9a96e9deec2724eb89d642830b5 | 5801b12371a1beb610328a8b83a056276427817d | refs/heads/master | 2023-05-28T14:42:29.175634 | 2021-06-14T14:06:43 | 2021-06-14T14:06:43 | 266,535,701 | 2 | 1 | Apache-2.0 | 2020-10-21T01:03:55 | 2020-05-24T12:24:51 | Java | UTF-8 | Java | false | false | 727 | java | package com.lingchaomin.auth.server.core.role.entity;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @author minlingchao
* @version 1.0
* @date 2017/2/20 下午9:35
* @description 授权信息
*/
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Authorization implements Serializable {
private Long id;
private Date gmtCreate;
private Date gmtModified;
/**
* 用户id
*/
private Long userId;
/**
* 应用id
*/
private Long appId;
/**
* 权限ids
*/
private String roleIds;
}
| [
"[email protected]"
] | |
908f6c61e5fdb68d2f447cc7b7a48d8096c71569 | dfe5caf190661c003619bfe7a7944c527c917ee4 | /src/main/java/com/vmware/vim25/VirtualMachineSnapshotTree.java | 63aa7cbc9a75f82345e9d3910faad6b58d73c2ef | [
"BSD-3-Clause"
] | permissive | timtasse/vijava | c9787f9f9b3116a01f70a89d6ea29cc4f6dc3cd0 | 5d75bc0bd212534d44f78e5a287abf3f909a2e8e | refs/heads/master | 2023-06-01T08:20:39.601418 | 2022-10-31T12:43:24 | 2022-10-31T12:43:24 | 150,118,529 | 4 | 1 | BSD-3-Clause | 2023-05-01T21:19:53 | 2018-09-24T14:46:15 | Java | UTF-8 | Java | false | false | 3,979 | java | /*================================================================================
Copyright (c) 2013 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of VMware, Inc. nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/
package com.vmware.vim25;
import java.util.Calendar;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
@SuppressWarnings("all")
public class VirtualMachineSnapshotTree extends DynamicData {
public ManagedObjectReference snapshot;
public ManagedObjectReference vm;
public String name;
public String description;
public Integer id;
public Calendar createTime;
public VirtualMachinePowerState state;
public boolean quiesced;
public String backupManifest;
public VirtualMachineSnapshotTree[] childSnapshotList;
public Boolean replaySupported;
public ManagedObjectReference getSnapshot() {
return this.snapshot;
}
public ManagedObjectReference getVm() {
return this.vm;
}
public String getName() {
return this.name;
}
public String getDescription() {
return this.description;
}
public Integer getId() {
return this.id;
}
public Calendar getCreateTime() {
return this.createTime;
}
public VirtualMachinePowerState getState() {
return this.state;
}
public boolean isQuiesced() {
return this.quiesced;
}
public String getBackupManifest() {
return this.backupManifest;
}
public VirtualMachineSnapshotTree[] getChildSnapshotList() {
return this.childSnapshotList;
}
public Boolean getReplaySupported() {
return this.replaySupported;
}
public void setSnapshot(ManagedObjectReference snapshot) {
this.snapshot=snapshot;
}
public void setVm(ManagedObjectReference vm) {
this.vm=vm;
}
public void setName(String name) {
this.name=name;
}
public void setDescription(String description) {
this.description=description;
}
public void setId(Integer id) {
this.id=id;
}
public void setCreateTime(Calendar createTime) {
this.createTime=createTime;
}
public void setState(VirtualMachinePowerState state) {
this.state=state;
}
public void setQuiesced(boolean quiesced) {
this.quiesced=quiesced;
}
public void setBackupManifest(String backupManifest) {
this.backupManifest=backupManifest;
}
public void setChildSnapshotList(VirtualMachineSnapshotTree[] childSnapshotList) {
this.childSnapshotList=childSnapshotList;
}
public void setReplaySupported(Boolean replaySupported) {
this.replaySupported=replaySupported;
}
} | [
"[email protected]"
] | |
9013e722da43c1dac6e53876d48a63dd56c903b1 | 2650d565255cf7f5c0192599cb69650aba91fdb8 | /java/src/main/java/com/ciaoshen/leetcode/MaxAreaOfIsland.java | 67cfb443d89c115dfd19351b6038aac15322a187 | [
"MIT"
] | permissive | helloShen/leetcode | 78ded31b16cfc0ca4d0618d90bb0ef3a8b10377a | 5bba26f0612d785800c990947db8dae3af4bad81 | refs/heads/master | 2021-06-03T14:44:57.256143 | 2019-04-06T19:06:15 | 2019-04-06T19:06:15 | 96,709,063 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,950 | java | /**
* Leetcode - Algorithm - MaxAreaOfIsland
*/
package com.ciaoshen.leetcode;
import java.util.*;
import com.ciaoshen.leetcode.myUtils.*;
/**
* Each problem is initialized with 3 solutions.
* You can expand more solutions.
* Before using your new solutions, don't forget to register them to the solution registry.
*/
class MaxAreaOfIsland implements Problem {
private Map<Integer,Solution> solutions = new HashMap<>(); // solutions registry
// register solutions HERE...
private MaxAreaOfIsland() {
register(new Solution1());
register(new Solution2());
register(new Solution3());
}
private abstract class Solution {
private int id = 0;
abstract public int maxAreaOfIsland(int[][] grid); // 主方法接口
protected void sometest() { return; } // 预留的一些小测试的接口
}
private class Solution1 extends Solution {
{ super.id = 1; }
private int[] count = new int[0];
private int[] board = new int[0];
private void init(int[][] grid) {
int height = grid.length;
int width = grid[0].length;
count = new int[height * width + 1];
board = new int[height * width + 1];
}
public int maxAreaOfIsland(int[][] grid) {
int height = grid.length;
if (height == 0) { return 0; }
int width = grid[0].length;
init(grid);
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if (grid[i][j] == 1) {
int posCurr = j+1 + width * i, posLeft = -1, posUpper = -1;
create(posCurr);
if (j > 0 && grid[i][j-1] == 1) {
posLeft = j + width * i;
merge(posCurr,posLeft); // 当前树嫁接到左树
}
if (i > 0 && grid[i-1][j] == 1) {
posUpper = j+1 + width * (i-1);
merge(posCurr,posUpper); // 当前树嫁接到上树
}
}
}
}
int max = 0;
for (int i = 0; i < count.length; i++) {
max = Math.max(max,count[i]);
}
// System.out.println(Arrays.toString(count));
// System.out.println(Arrays.toString(board));
return max;
}
private void create(int pos) {
board[pos] = pos;
count[pos] = 1;
}
private int find(int pos) {
if (board[pos] == pos) {
return pos;
} else {
int root = find(board[pos]);
board[pos] = root; // path compression
return root;
}
}
// root1嫁接到root2上
private void merge(int pos1, int pos2) {
int root1 = find(pos1);
int root2 = find(pos2);
if (root1 != root2) {
board[root1] = board[root2];
// System.out.println("Merge Group " + root1 + " to Group " + root2);
// System.out.println(count[root1] + " members from Group " + root1 + " merged to Group " + root2 + " with " + count[root2] + " members.");
count[root2] += count[root1];
count[root1] = 0;
}
}
}
private class Solution2 extends Solution {
{ super.id = 2; }
public int maxAreaOfIsland(int[][] grid) {
return 2;
}
}
private class Solution3 extends Solution {
{ super.id = 3; }
public int maxAreaOfIsland(int[][] grid) {
return 3;
}
}
// you can expand more solutions HERE if you want...
/**
* register a solution in the solution registry
* return false if this type of solution already exist in the registry.
*/
private boolean register(Solution s) {
return (solutions.put(s.id,s) == null)? true : false;
}
/**
* chose one of the solution to test
* return null if solution id does not exist
*/
private Solution solution(int id) {
return solutions.get(id);
}
private static class Test {
private MaxAreaOfIsland problem = new MaxAreaOfIsland();
private Solution solution = null;
// call method in solution
private void call(int[][] grid, int ans) {
Matrix.print(grid);
System.out.println("Max Area = " + solution.maxAreaOfIsland(grid) + "\t [Answer: " + ans + "]\n");
}
// public API of Test interface
public void test(int id) {
solution = problem.solution(id);
if (solution == null) { System.out.println("Sorry, [id:" + id + "] doesn't exist!"); return; }
System.out.println("\nCall Solution" + solution.id);
/** initialize your testcases HERE... */
int[][] grid1 = new int[][]{
{0,0,1,0,0,0,0,1,0,0,0,0,0},
{0,0,0,0,0,0,0,1,1,1,0,0,0},
{0,1,1,0,1,0,0,0,0,0,0,0,0},
{0,1,0,0,1,1,0,0,1,0,1,0,0},
{0,1,0,0,1,1,0,0,1,1,1,0,0},
{0,0,0,0,0,0,0,0,0,0,1,0,0},
{0,0,0,0,0,0,0,1,1,1,0,0,0},
{0,0,0,0,0,0,0,1,1,0,0,0,0}
};
int ans1 = 6;
int[][] grid2 = new int[][] {
{1,1,0,0,0},
{1,1,0,0,0},
{0,0,0,1,1},
{0,0,0,1,1}
};
int ans2 = 4;
/** involk call() method HERE */
call(grid1,ans1);
call(grid2,ans2);
}
}
public static void main(String[] args) {
Test test = new Test();
test.test(1);
// test.test(2);
// test.test(3);
}
}
| [
"[email protected]"
] | |
7dacb4c9f86000cdc14a5f5789f011b34663cc5b | 17999f59adae137d2a9366e3db2a8a91b8509fca | /src/main/java/org/killbill/billing/plugin/adyen/client/payment/builder/ModificationRequestBuilder.java | 597c208a8fb293fdb42345a33320c21ce88cd633 | [
"Apache-2.0"
] | permissive | BLangendorf/killbill-adyen-plugin | 731016e8294824cdf5163cbdf0e7910715d38ef3 | fcae848332f1ddfafed6a0586b7f0cd6e0a7dda0 | refs/heads/master | 2021-01-18T13:10:15.438166 | 2016-03-01T22:29:37 | 2016-03-01T22:29:37 | 39,011,192 | 0 | 0 | null | 2015-07-13T12:38:32 | 2015-07-13T12:38:31 | null | UTF-8 | Java | false | false | 2,626 | java | /*
* Copyright 2014 Groupon, Inc
*
* Groupon 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.killbill.billing.plugin.adyen.client.payment.builder;
import java.util.List;
import org.killbill.adyen.common.Amount;
import org.killbill.adyen.payment.AnyType2AnyTypeMap;
import org.killbill.adyen.payment.ModificationRequest;
import org.killbill.billing.plugin.adyen.client.model.SplitSettlementData;
public class ModificationRequestBuilder extends RequestBuilder<ModificationRequest> {
public ModificationRequestBuilder() {
super(new ModificationRequest());
}
public ModificationRequestBuilder withOriginalReference(final String value) {
request.setOriginalReference(value);
return this;
}
public ModificationRequestBuilder withMerchantAccount(final String value) {
request.setMerchantAccount(value);
return this;
}
public ModificationRequestBuilder withAuthorisationCode(final String value) {
request.setAuthorisationCode(value);
return this;
}
public ModificationRequestBuilder withAmount(final String currency, final Long value) {
if (value != null) {
final Amount amount = new Amount();
amount.setCurrency(currency);
amount.setValue(value);
return withAmount(amount);
}
return this;
}
public ModificationRequestBuilder withAmount(final Amount amount) {
request.setModificationAmount(amount);
return this;
}
public ModificationRequestBuilder withSplitSettlementData(final SplitSettlementData splitSettlementData) {
final List<AnyType2AnyTypeMap.Entry> entries = new SplitSettlementParamsBuilder().createEntriesFrom(splitSettlementData);
addAdditionalData(entries);
return this;
}
@Override
protected List<AnyType2AnyTypeMap.Entry> getAdditionalData() {
if (request.getAdditionalData() == null) {
request.setAdditionalData(new AnyType2AnyTypeMap());
}
return request.getAdditionalData().getEntry();
}
}
| [
"[email protected]"
] | |
cc8c4aa8c70d47e3dbbb88bea5cfcfb216aefded | 7dfb1538fd074b79a0f6a62674d4979c7c55fd6d | /src/day35/StringToIntegerparsing.java | 7d3b678f663d9ab25e905c95c9c8682a55524c6a | [] | no_license | kutluduman/Java-Programming | 424a4ad92e14f2d4cc700c8a9352ff7408aa993f | d55b8a61ab3a654f954e33db1cb244e36bbcc7da | refs/heads/master | 2022-04-18T03:54:50.219846 | 2020-04-18T05:45:45 | 2020-04-18T05:45:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,753 | java | package day35;
public class StringToIntegerparsing {
public static void main(String[] args) {
/**
* I have a employee ID : "FB-457"
* give me the employee number and store it into a number
*/
// String strNum = "100";
// int num = Integer.parseInt(strNum);
//
// System.out.println("num = " + num);
//
// String empID = "FB-457";
// int empID = Integer.parseInt(empID);
/**
* Integer class is class coming from java.lang package
* It's primarily used for wrapping up primitive value and treat it object
* what we will focus here i s though
* many useful static methods it provide already
* parseInt is a static method of Integer class
* It will turn a String that has only numbers and return int result
* if we have any non-numerical character ---> It will throw NumberFormatException
*/
// String[] empIDSplit = empID.s("-");
// String idStr = IDSplit[1];
// int id = Integer.parseInt(idStr);
//
// System.out.println("id = " + id);
// I have a String called twoNumbers
String twoNumbers = "100,600";
// I want to add them and give the result
String[] twoNumbersSplit = twoNumbers.split(",");
int num1 = Integer.parseInt(twoNumbersSplit[0]);
int num2 = Integer.parseInt(twoNumbersSplit[1]);
int sum = num1 + num2;
System.out.println("sum = " + sum);
int num1_1 = Integer.valueOf(twoNumbers.substring(0,3)) ;
int num2_1= Integer.valueOf(twoNumbers.substring(4));
int sum_1 = num1_1+num2_1;
System.out.println("sum_1 = " + sum_1);
}
}
| [
"[email protected]"
] | |
51ecc5071568c7183d9ec9ab538d2121f4be5b95 | f4762a908e49f7aaa177378c2ebdf7b985180e2b | /sources/android/support/constraint/solver/Cache.java | 355eee08d6a474708838500be9f5b4cbc8783ae6 | [
"MIT"
] | permissive | PixalTeam/receiver_android | 76f5b0a7a8c54d83e49ad5921f640842547a171f | d4aa75f9021a66262a9a267edd5bc25509677248 | refs/heads/master | 2020-12-03T08:49:57.484377 | 2020-01-01T20:38:04 | 2020-01-01T20:38:04 | 231,260,295 | 0 | 0 | MIT | 2020-11-15T12:46:40 | 2020-01-01T20:25:18 | Java | UTF-8 | Java | false | false | 254 | java | package android.support.constraint.solver;
public class Cache {
Pool<ArrayRow> arrayRowPool = new SimplePool(256);
SolverVariable[] mIndexedVariables = new SolverVariable[32];
Pool<SolverVariable> solverVariablePool = new SimplePool(256);
}
| [
"[email protected]"
] | |
ecdc3d2a215a3fd8b5dcb0dbb55709f61c14b753 | dc79d4747f95827dad5519554a77bc597de05cc5 | /app/src/main/java/com/tao/xiaoyuanyuan/view/colorpicker/builder/PaintBuilder.java | 90b2a86e81a44eb110765dc4ff35a47534c953c3 | [] | no_license | lt594963425/xiaoyuanyuan2 | 46247076caff88ff2fc18367a0a335c6dc727ea6 | 108b8cfc0c6f50262d3c436e5c77730e00f76397 | refs/heads/master | 2021-07-22T00:32:38.875787 | 2020-07-30T10:01:04 | 2020-07-30T10:01:04 | 202,462,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,645 | java | package com.tao.xiaoyuanyuan.view.colorpicker.builder;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Shader;
/**
* @author vondear
* @date 2018/6/11 11:36:40 整合修改
*/
public class PaintBuilder {
public static PaintHolder newPaint() {
return new PaintHolder();
}
public static Shader createAlphaPatternShader(int size) {
size /= 2;
size = Math.max(8, size * 2);
return new BitmapShader(createAlphaBackgroundPattern(size), Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
}
private static Bitmap createAlphaBackgroundPattern(int size) {
Paint alphaPatternPaint = PaintBuilder.newPaint().build();
Bitmap bm = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bm);
int s = Math.round(size / 2f);
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
if ((i + j) % 2 == 0) {
alphaPatternPaint.setColor(0xffffffff);
} else {
alphaPatternPaint.setColor(0xffd0d0d0);
}
c.drawRect(i * s, j * s, (i + 1) * s, (j + 1) * s, alphaPatternPaint);
}
}
return bm;
}
public static class PaintHolder {
private Paint paint;
private PaintHolder() {
this.paint = new Paint(Paint.ANTI_ALIAS_FLAG);
}
public PaintHolder color(int color) {
this.paint.setColor(color);
return this;
}
public PaintHolder antiAlias(boolean flag) {
this.paint.setAntiAlias(flag);
return this;
}
public PaintHolder style(Paint.Style style) {
this.paint.setStyle(style);
return this;
}
public PaintHolder mode(PorterDuff.Mode mode) {
this.paint.setXfermode(new PorterDuffXfermode(mode));
return this;
}
public PaintHolder stroke(float width) {
this.paint.setStrokeWidth(width);
return this;
}
public PaintHolder xPerMode(PorterDuff.Mode mode) {
this.paint.setXfermode(new PorterDuffXfermode(mode));
return this;
}
public PaintHolder shader(Shader shader) {
this.paint.setShader(shader);
return this;
}
public Paint build() {
return this.paint;
}
}
}
| [
"[email protected]"
] | |
ca2745587e0028e3d21062da5f8e2f05ca8568dc | 401c228cf3672c8754330711af7a7e5128f1cf19 | /kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-case-mgmt/kie-wb-common-stunner-case-mgmt-client/src/main/java/org/kie/workbench/common/stunner/cm/client/command/util/CaseManagementCommandUtil.java | 4b40c7cb38f659f7f5af660f9d66f4e30ebdc3ef | [
"Apache-2.0"
] | permissive | gitgabrio/kie-wb-common | f2fb145536a2c5bd60ddbaf1cb41dec5e93912ec | 57ffa0afc6819d784e60bd675bbdee5d0660ad1b | refs/heads/master | 2020-03-21T08:00:52.572728 | 2019-05-13T13:03:14 | 2019-05-13T13:03:14 | 138,314,007 | 0 | 0 | Apache-2.0 | 2019-09-27T12:27:30 | 2018-06-22T14:46:16 | Java | UTF-8 | Java | false | false | 1,441 | java | /*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* 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.kie.workbench.common.stunner.cm.client.command.util;
import java.util.List;
import org.kie.workbench.common.stunner.core.graph.Edge;
import org.kie.workbench.common.stunner.core.graph.Node;
public class CaseManagementCommandUtil {
@SuppressWarnings("unchecked")
public static int getChildIndex(final Node parent,
final Node child) {
if (parent != null && child != null) {
List<Edge> outEdges = parent.getOutEdges();
if (null != outEdges && !outEdges.isEmpty()) {
for (int i = 0, n = outEdges.size(); i < n; i++) {
if (child.equals(outEdges.get(i).getTargetNode())) {
return i;
}
}
}
}
return -1;
}
}
| [
"[email protected]"
] | |
045430535301fb48895423fc93a68ee4d30cf8de | 13db4a1d034aa9dc3b97ba5a4c758eb37ef254df | /opserv-sp-service-impl/src/main/java/com/cognizant/opserv/sp/service/internal/MetricIntService.java | a83cacfe16af5499c0504bb586209bb8c196c067 | [] | no_license | deepthikamaraj/javaCode | 3436c539c0abcaeb3fbec87ccd1b79b543dffbc6 | 7634d01d5553496c7f5549382651ae63f371f8cc | refs/heads/master | 2021-04-06T08:54:22.184740 | 2018-03-13T09:57:40 | 2018-03-13T09:57:40 | 125,029,394 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,341 | java | package com.cognizant.opserv.sp.service.internal;
import java.util.List;
import com.cognizant.opserv.sp.exception.MetricServiceException;
import com.cognizant.opserv.sp.model.auth.UserDetails;
import com.cognizant.opserv.sp.model.metric.RangeDetails;
/**
* ****************************************************************************.
*
* @class MetricIntService contains all the metric internal services
* @author Cognizant Technology Solutions
* @version OpServ 3.0
* @since 30/03/2016
* ***************************************************************************
*/
public interface MetricIntService {
/**
* Gets the range details for salespos metrics.
*
* @param mtrId the mtr id
* @param userDetails the user details
* @return the range details by metric
* @throws MetricServiceException the metric service exception
*/
List<RangeDetails> getRangeDetailsForSalesPosMetrics(long mtrId, UserDetails userDetails) throws MetricServiceException;
/**
* Gets the range details for geo metrics.
*
* @param mtrId the mtr id
* @param userDetails the user details
* @return the range details for geo metrics
* @throws MetricServiceException the metric service exception
*/
public List<RangeDetails> getRangeDetailsForGeoMetrics(Long mtrId,UserDetails userDetails) throws MetricServiceException;
}
| [
"[email protected]"
] | |
a5f0d2bee7dc1687def1f59eeb82595117b98e80 | efca855f83be608cc5fcd5f9976b820f09f11243 | /consensus/qbft/src/integration-test/java/org/enterchain/enter/consensus/qbft/test/SpuriousBehaviourTest.java | df827f98b106cf9d6e7840bbadfaa7bbf5e9464c | [
"Apache-2.0"
] | permissive | enterpact/enterchain | 5438e127c851597cbd7e274526c3328155483e58 | d8b272fa6885e5d263066da01fff3be74a6357a0 | refs/heads/master | 2023-05-28T12:48:02.535365 | 2021-06-09T20:44:01 | 2021-06-09T20:44:01 | 375,483,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,337 | java | /*
* Copyright ConsenSys AG.
*
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.enterchain.enter.consensus.qbft.test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.enterchain.enter.consensus.qbft.support.IntegrationTestHelpers.createSignedCommitPayload;
import org.enterchain.enter.consensus.common.bft.ConsensusRoundIdentifier;
import org.enterchain.enter.consensus.common.bft.inttest.NodeParams;
import org.enterchain.enter.consensus.qbft.messagedata.QbftV1;
import org.enterchain.enter.consensus.qbft.messagewrappers.Commit;
import org.enterchain.enter.consensus.qbft.messagewrappers.Prepare;
import org.enterchain.enter.consensus.qbft.payload.MessageFactory;
import org.enterchain.enter.consensus.qbft.support.RoundSpecificPeers;
import org.enterchain.enter.consensus.qbft.support.TestContext;
import org.enterchain.enter.consensus.qbft.support.TestContextBuilder;
import org.enterchain.enter.consensus.qbft.support.ValidatorPeer;
import org.enterchain.enter.crypto.NodeKey;
import org.enterchain.enter.crypto.NodeKeyUtils;
import org.enterchain.enter.crypto.SECPSignature;
import org.enterchain.enter.ethereum.core.Block;
import org.enterchain.enter.ethereum.core.Hash;
import org.enterchain.enter.ethereum.core.Util;
import org.enterchain.enter.ethereum.p2p.rlpx.wire.MessageData;
import org.enterchain.enter.ethereum.p2p.rlpx.wire.RawMessage;
import java.time.Clock;
import java.time.Instant;
import java.time.ZoneId;
import org.apache.tuweni.bytes.Bytes;
import org.junit.Before;
import org.junit.Test;
public class SpuriousBehaviourTest {
private final long blockTimeStamp = 100;
private final Clock fixedClock =
Clock.fixed(Instant.ofEpochSecond(blockTimeStamp), ZoneId.systemDefault());
// Test is configured such that a remote peer is responsible for proposing a block
private final int NETWORK_SIZE = 5;
// Configuration ensures remote peer will provide proposal for first block
private final TestContext context =
new TestContextBuilder()
.validatorCount(NETWORK_SIZE)
.indexOfFirstLocallyProposedBlock(0)
.clock(fixedClock)
.buildAndStart();
private final ConsensusRoundIdentifier roundId = new ConsensusRoundIdentifier(1, 0);
private final RoundSpecificPeers peers = context.roundSpecificPeers(roundId);
private final Block proposedBlock =
context.createBlockForProposalFromChainHead(30, peers.getProposer().getNodeAddress());
private Prepare expectedPrepare;
private Commit expectedCommit;
@Before
public void setup() {
expectedPrepare =
context.getLocalNodeMessageFactory().createPrepare(roundId, proposedBlock.getHash());
expectedCommit =
new Commit(
createSignedCommitPayload(
roundId, proposedBlock, context.getLocalNodeParams().getNodeKey()));
}
@Test
public void badlyFormedRlpDoesNotPreventOngoingBftOperation() {
final MessageData illegalCommitMsg = new RawMessage(QbftV1.PREPARE, Bytes.EMPTY);
peers.getNonProposing(0).injectMessage(illegalCommitMsg);
peers.getProposer().injectProposal(roundId, proposedBlock);
peers.verifyMessagesReceived(expectedPrepare);
}
@Test
public void messageWithIllegalMessageCodeAreDiscardedAndDoNotPreventOngoingBftOperation() {
final MessageData illegalCommitMsg = new RawMessage(QbftV1.MESSAGE_SPACE, Bytes.EMPTY);
peers.getNonProposing(0).injectMessage(illegalCommitMsg);
peers.getProposer().injectProposal(roundId, proposedBlock);
peers.verifyMessagesReceived(expectedPrepare);
}
@Test
public void nonValidatorsCannotTriggerResponses() {
final NodeKey nonValidatorNodeKey = NodeKeyUtils.generate();
final NodeParams nonValidatorParams =
new NodeParams(
Util.publicKeyToAddress(nonValidatorNodeKey.getPublicKey()), nonValidatorNodeKey);
final ValidatorPeer nonvalidator =
new ValidatorPeer(
nonValidatorParams,
new MessageFactory(nonValidatorParams.getNodeKey()),
context.getEventMultiplexer());
nonvalidator.injectProposal(new ConsensusRoundIdentifier(1, 0), proposedBlock);
peers.verifyNoMessagesReceived();
}
@Test
public void preparesWithMisMatchedDigestAreNotRespondedTo() {
peers.getProposer().injectProposal(roundId, proposedBlock);
peers.verifyMessagesReceived(expectedPrepare);
peers.prepareForNonProposing(roundId, Hash.ZERO);
peers.verifyNoMessagesReceived();
peers.prepareForNonProposing(roundId, proposedBlock.getHash());
peers.verifyMessagesReceived(expectedCommit);
peers.prepareForNonProposing(roundId, Hash.ZERO);
assertThat(context.getCurrentChainHeight()).isEqualTo(0);
peers.commitForNonProposing(roundId, proposedBlock);
assertThat(context.getCurrentChainHeight()).isEqualTo(1);
}
@Test
public void oneCommitSealIsIllegalPreventsImport() {
peers.getProposer().injectProposal(roundId, proposedBlock);
peers.verifyMessagesReceived(expectedPrepare);
peers.prepareForNonProposing(roundId, proposedBlock.getHash());
// for a network of 5, 4 seals are required (local + 3 remote)
peers.getNonProposing(0).injectCommit(roundId, proposedBlock);
peers.getNonProposing(1).injectCommit(roundId, proposedBlock);
// nonProposer-2 will generate an invalid seal
final ValidatorPeer badSealPeer = peers.getNonProposing(2);
final SECPSignature illegalSeal = badSealPeer.getnodeKey().sign(Hash.ZERO);
badSealPeer.injectCommit(roundId, proposedBlock.getHash(), illegalSeal);
assertThat(context.getCurrentChainHeight()).isEqualTo(0);
// Now inject the REAL commit message
badSealPeer.injectCommit(roundId, proposedBlock);
assertThat(context.getCurrentChainHeight()).isEqualTo(1);
}
}
| [
"[email protected]"
] | |
f480c1ed940fb59916589b70b8498357d3697a24 | bf640d825debde2b8b3fd993b80d1f30c69db6af | /server/src/main/java/com/cezarykluczynski/stapi/server/comicStrip/reader/ComicStripRestReader.java | 560540ba046d5164cc382494645e1e14538fb65f | [
"MIT"
] | permissive | mastermind1981/stapi | 6b8395a18a0097312d33780f6cd5e203f20acf99 | 5e9251e0ca800c6b5d607a7977554675231d785c | refs/heads/master | 2021-01-20T12:49:17.620368 | 2017-05-05T17:18:53 | 2017-05-05T17:18:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,901 | java | package com.cezarykluczynski.stapi.server.comicStrip.reader;
import com.cezarykluczynski.stapi.client.v1.rest.model.ComicStripBaseResponse;
import com.cezarykluczynski.stapi.client.v1.rest.model.ComicStripFullResponse;
import com.cezarykluczynski.stapi.model.comicStrip.entity.ComicStrip;
import com.cezarykluczynski.stapi.server.comicStrip.dto.ComicStripRestBeanParams;
import com.cezarykluczynski.stapi.server.comicStrip.mapper.ComicStripBaseRestMapper;
import com.cezarykluczynski.stapi.server.comicStrip.mapper.ComicStripFullRestMapper;
import com.cezarykluczynski.stapi.server.comicStrip.query.ComicStripRestQuery;
import com.cezarykluczynski.stapi.server.common.mapper.PageMapper;
import com.cezarykluczynski.stapi.server.common.reader.BaseReader;
import com.cezarykluczynski.stapi.server.common.reader.FullReader;
import com.cezarykluczynski.stapi.server.common.validator.StaticValidator;
import com.google.common.collect.Iterables;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
@Service
public class ComicStripRestReader implements BaseReader<ComicStripRestBeanParams, ComicStripBaseResponse>,
FullReader<String, ComicStripFullResponse> {
private ComicStripRestQuery comicStripRestQuery;
private ComicStripBaseRestMapper comicStripBaseRestMapper;
private ComicStripFullRestMapper comicStripFullRestMapper;
private PageMapper pageMapper;
@Inject
public ComicStripRestReader(ComicStripRestQuery comicStripRestQuery, ComicStripBaseRestMapper comicStripBaseRestMapper,
ComicStripFullRestMapper comicStripFullRestMapper, PageMapper pageMapper) {
this.comicStripRestQuery = comicStripRestQuery;
this.comicStripBaseRestMapper = comicStripBaseRestMapper;
this.comicStripFullRestMapper = comicStripFullRestMapper;
this.pageMapper = pageMapper;
}
@Override
public ComicStripBaseResponse readBase(ComicStripRestBeanParams comicStripRestBeanParams) {
Page<ComicStrip> comicStripPage = comicStripRestQuery.query(comicStripRestBeanParams);
ComicStripBaseResponse comicStripResponse = new ComicStripBaseResponse();
comicStripResponse.setPage(pageMapper.fromPageToRestResponsePage(comicStripPage));
comicStripResponse.getComicStrips().addAll(comicStripBaseRestMapper.mapBase(comicStripPage.getContent()));
return comicStripResponse;
}
@Override
public ComicStripFullResponse readFull(String uid) {
StaticValidator.requireUid(uid);
ComicStripRestBeanParams comicStripRestBeanParams = new ComicStripRestBeanParams();
comicStripRestBeanParams.setUid(uid);
Page<ComicStrip> comicStripPage = comicStripRestQuery.query(comicStripRestBeanParams);
ComicStripFullResponse comicStripResponse = new ComicStripFullResponse();
comicStripResponse.setComicStrip(comicStripFullRestMapper.mapFull(Iterables.getOnlyElement(comicStripPage.getContent(), null)));
return comicStripResponse;
}
}
| [
"[email protected]"
] | |
ebf786cf80edc3472ac85dc20e98df12b5ce3741 | b90a16dd9209bb1a93f08badd7f1b102676d59ec | /glacier-common/src/main/java/com/geektcp/alpha/common/base/context/SpringContext.java | 7f97364c27b200ccbf2a6b9eedac4e262bb515f7 | [
"Apache-2.0"
] | permissive | jojofans/alpha-glacier | bc00e168724518393e685dce55d895cb5e35db3a | bcf37167ecbf68673bf8283e20592cdbff1c914d | refs/heads/master | 2021-05-23T08:43:42.737533 | 2020-03-31T05:50:56 | 2020-03-31T05:50:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,438 | java | package com.geektcp.alpha.common.base.context;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
/**
* @author tanghaiyang on 2017/11/13.
*/
@Component
public class SpringContext implements ApplicationContextAware {
public static ApplicationContext context;
public static Environment env;
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
SpringContext.context = context;
SpringContext.env = context.getEnvironment();
}
public static <T> T getBean(String beanId, Class<T> clazz) {
return context.getBean(beanId, clazz);
}
public static <T> T getBean(Class<T> clazz) {
return context.getBean(clazz);
}
public static ApplicationContext getContext() {
return context;
}
public static Environment getEnv() {
return env;
}
public static String getProperty(String key) {
return getProperty(key, "");
}
public static String getProperty(String key, String defaultValue) {
return env.getProperty(key, defaultValue);
}
public static <T> T getProperty(String key, Class<T> targetType) {
return env.getProperty(key, targetType);
}
} | [
"[email protected]"
] | |
256400c455f1e28c8219e86054ee37c8c200d752 | 79367d7a51a493c66b9c0dc9bcc9531f46ac151d | /src/test/java/com/IniciandoComSpringMVC/cobranca/CobrancaApplicationTests.java | b93e4185590b95bea52fe233bcb81744af20067f | [] | no_license | vitorfelipep/SpringCobranca | de4a027213dda78f0abf0b9de5b3def040818dfa | ed5724301ecdc04797d00f71df25bd61d0865459 | refs/heads/master | 2021-01-10T01:33:10.757284 | 2016-01-31T22:40:47 | 2016-01-31T22:40:47 | 49,376,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 522 | java | package com.IniciandoComSpringMVC.cobranca;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = CobrancaApplication.class)
@WebAppConfiguration
public class CobrancaApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"[email protected]"
] | |
dc0f2d20e67a019e7f0aa94eda753cc56ad30c43 | 0cd6efa364121ad5cfb0b948f242561848a311cc | /jdk1.8.0_161/src/main/java/com/sun/corba/se/PortableActivationIDL/ServerNotRegistered.java | ca5c07709f72c19ef1a5f0fe8be589b15df2a091 | [] | no_license | izbk/jdk1.8.0_161 | 0050c98a7aa19b42b162db91ec0123f9b33bc849 | 606a851668a0ebfb01f3777fa923ec257059a21e | refs/heads/master | 2021-07-14T00:29:26.104001 | 2020-05-14T02:46:42 | 2020-05-14T02:46:42 | 130,954,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 952 | java | package com.sun.corba.se.PortableActivationIDL;
/**
* com/sun/corba/se/PortableActivationIDL/ServerNotRegistered.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u161/10277/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
* Tuesday, December 19, 2017 5:53:41 PM PST
*/
public final class ServerNotRegistered extends org.omg.CORBA.UserException
{
public String serverId = null;
public ServerNotRegistered ()
{
super(ServerNotRegisteredHelper.id());
} // ctor
public ServerNotRegistered (String _serverId)
{
super(ServerNotRegisteredHelper.id());
serverId = _serverId;
} // ctor
public ServerNotRegistered (String $reason, String _serverId)
{
super(ServerNotRegisteredHelper.id() + " " + $reason);
serverId = _serverId;
} // ctor
} // class ServerNotRegistered
| [
"[email protected]"
] | |
4bb39328a709fc1cfdb65a9109cbe28b35cb2386 | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/no_seeding/8_gfarcegestionfa-fr.unice.gfarce.interGraph.CreerUnEtudiantAction-1.0-7/fr/unice/gfarce/interGraph/CreerUnEtudiantAction_ESTest_scaffolding.java | d3740eea38187357846377692b223f1195c233c2 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 554 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Oct 28 20:32:23 GMT 2019
*/
package fr.unice.gfarce.interGraph;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class CreerUnEtudiantAction_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"[email protected]"
] | |
ace4519e0d79b9f5c0d5170aabbf5224101c4877 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /linkedmall-20220531/src/main/java/com/aliyun/linkedmall20220531/models/QueryOrderDetail4DistributionResponse.java | 03951c17a1633380e8a99015ae84dced93adb097 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 1,514 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.linkedmall20220531.models;
import com.aliyun.tea.*;
public class QueryOrderDetail4DistributionResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("statusCode")
@Validation(required = true)
public Integer statusCode;
@NameInMap("body")
@Validation(required = true)
public QueryOrderDetail4DistributionResponseBody body;
public static QueryOrderDetail4DistributionResponse build(java.util.Map<String, ?> map) throws Exception {
QueryOrderDetail4DistributionResponse self = new QueryOrderDetail4DistributionResponse();
return TeaModel.build(map, self);
}
public QueryOrderDetail4DistributionResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public QueryOrderDetail4DistributionResponse setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
return this;
}
public Integer getStatusCode() {
return this.statusCode;
}
public QueryOrderDetail4DistributionResponse setBody(QueryOrderDetail4DistributionResponseBody body) {
this.body = body;
return this;
}
public QueryOrderDetail4DistributionResponseBody getBody() {
return this.body;
}
}
| [
"[email protected]"
] | |
66a176de5a0bba8b53f4d5df45e655c2de315aee | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/com/tencent/mm/ui/base/MMViewPager$h$1.java | b831ffd13a8ac37bc6f8033ff2ef7377bd980ca7 | [] | no_license | jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null | UTF-8 | Java | false | false | 1,053 | java | package com.tencent.mm.ui.base;
import com.tencent.mm.ui.base.MMViewPager.h;
class MMViewPager$h$1 implements Runnable {
final /* synthetic */ h yeL;
MMViewPager$h$1(h hVar) {
this.yeL = hVar;
}
public final void run() {
MMViewPager.a(this.yeL.yeI).getImageMatrix().getValues(this.yeL.mVx);
float f = this.yeL.mVx[2];
float scale = MMViewPager.a(this.yeL.yeI).getScale() * ((float) MMViewPager.a(this.yeL.yeI).imageWidth);
if (scale < ((float) MMViewPager.b(this.yeL.yeI))) {
scale = (((float) MMViewPager.b(this.yeL.yeI)) / 2.0f) - (scale / 2.0f);
} else {
scale = 0.0f;
}
scale -= f;
if (scale >= 0.0f) {
this.yeL.fdb = true;
} else if (Math.abs(scale) <= 5.0f) {
this.yeL.fdb = true;
} else {
scale = (-((float) (((double) Math.abs(scale)) - Math.pow(Math.sqrt((double) Math.abs(scale)) - 1.0d, 2.0d)))) * 2.0f;
}
MMViewPager.a(this.yeL.yeI).K(scale, 0.0f);
}
}
| [
"[email protected]"
] | |
d17d7812c3f1a04b8d5092143f630e53c6ec72e3 | d2781f4b33d71b57222d9636fa6e4536238ce4f1 | /jbehave-eclipse-plugin/src/org/jbehave/eclipse/step/StepCandidate.java | 1ba0de692be988398b450028064ac1006899969b | [
"BSD-3-Clause"
] | permissive | Arnauld/jbehave-ide | 9b7fb10a5110be1c68a73dd57251f46d9d160584 | c04f87907958dc8ed9b81e5541d3a208250f9020 | refs/heads/master | 2021-01-17T06:57:09.421458 | 2012-06-25T12:21:00 | 2012-06-25T12:21:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,261 | java | package org.jbehave.eclipse.step;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.jbehave.core.parsers.RegexPrefixCapturingPatternParser;
import org.jbehave.core.parsers.StepMatcher;
import org.jbehave.core.parsers.StepPatternParser;
import org.jbehave.core.steps.StepType;
import org.jbehave.eclipse.JBehaveProject;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
/**
* A StepCandidate is associated to a JDT IMethod and IAnnotation that can be
* matched to a textual step. It plays an analogous role to the JBehave Core
* StepCandidate.
*/
public class StepCandidate {
private final LocalizedStepSupport localizedSupport;
private final String parameterPrefix;
public final IMethod method;
public final IAnnotation annotation;
public final StepType stepType;
public final String stepPattern;
private ParametrizedStep parametrizedStep;
public final Integer priority;
public StepCandidate(LocalizedStepSupport localizedSupport,
String parameterPrefix, IMethod method, IAnnotation annotation,
StepType stepType, String stepPattern, Integer priority) {
this.localizedSupport = localizedSupport;
this.parameterPrefix = parameterPrefix;
this.method = method;
this.annotation = annotation;
this.stepType = stepType;
this.stepPattern = stepPattern;
this.priority = (priority == null) ? Integer.valueOf(0) : priority
.intValue();
}
public float weightOf(String input) {
return getParametrizedStep().weightOf(input);
}
public ParametrizedStep getParametrizedStep() {
if (parametrizedStep == null) {
parametrizedStep = new ParametrizedStep(stepPattern,
parameterPrefix);
}
return parametrizedStep;
}
public boolean hasParameters() {
return getParametrizedStep().getParameterCount() > 0;
}
public boolean isTypeEqualTo(String searchedType) {
return StringUtils.equalsIgnoreCase(searchedType, stepType.name());
}
public String fullStep() {
return typeWord() + " " + stepPattern;
}
public String typeWord() {
switch (stepType) {
case WHEN:
return localizedSupport.lWhen(false);
case THEN:
return localizedSupport.lThen(false);
case GIVEN:
default:
return localizedSupport.lGiven(false);
}
}
public boolean matches(String step) {
return getMatcher(stepType, stepPattern).matches(step);
}
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[").append(stepType).append("]").append(stepPattern)
.append(", ");
if (method == null) {
builder.append("n/a");
} else {
IType classFile = method.getDeclaringType();
if (classFile != null)
builder.append(classFile.getElementName());
else
builder.append("<type-unknown>");
builder.append('#').append(method.getElementName());
try {
Integer prio = JBehaveProject.getValue(
annotation.getMemberValuePairs(), "priority");
if (prio != null && prio.intValue() != 0) {
builder.append(", priority ").append(prio);
}
} catch (JavaModelException e) {
}
}
return builder.toString();
}
private static StepPatternParser stepParser = new RegexPrefixCapturingPatternParser();
private static Cache<String, StepMatcher> matcherCache = CacheBuilder
.newBuilder().concurrencyLevel(4).weakKeys().maximumSize(50)
.expireAfterWrite(10 * 60, TimeUnit.SECONDS)
.build(new CacheLoader<String, StepMatcher>() {
public StepMatcher load(String key) throws Exception {
int indexOf = key.indexOf('/');
StepType stepType = StepType.valueOf(key.substring(0,
indexOf));
String stepPattern = key.substring(indexOf + 1);
return stepParser.parseStep(stepType, stepPattern);
}
});
private StepMatcher getMatcher(StepType stepType, String stepPattern) {
try {
String key = stepType.name() + "/" + stepPattern;
return matcherCache.get(key);
} catch (ExecutionException e) {
// rely on parse
return stepParser.parseStep(stepType, stepPattern);
}
}
} | [
"[email protected]"
] | |
8a6c569fdcf41276df1cdbe43c60d99f12a2948e | 86204f02fccd160335a513ddf7e68c8130a57202 | /dynamic-support/src/main/java/com/pranavpandey/android/dynamic/support/recyclerview/adapter/DynamicTypeBinderAdapter.java | daa818cdcbfb35b0b87504dc48d8da76e815cc32 | [
"Apache-2.0"
] | permissive | H4NG-MAN/dynamic-support | a93b108ea30636e6740fae463d35cfc3833c94f7 | 94fb5c2225df1fac801bfdd375d2ce55cedd98d6 | refs/heads/master | 2021-01-04T15:36:04.131812 | 2020-02-14T23:01:02 | 2020-02-14T23:01:02 | 240,613,183 | 1 | 0 | Apache-2.0 | 2020-02-14T23:00:32 | 2020-02-14T23:00:31 | null | UTF-8 | Java | false | false | 4,911 | java | package com.pranavpandey.android.dynamic.support.recyclerview.adapter;
import androidx.annotation.NonNull;
import com.pranavpandey.android.dynamic.support.recyclerview.binder.DynamicRecyclerViewBinder;
import java.util.HashMap;
import java.util.Map;
/**
* A recycler view adapter to display different type of {@link VB}
* inside a recycler view.
*/
public abstract class DynamicTypeBinderAdapter<E extends Enum<E>,
VB extends DynamicRecyclerViewBinder> extends DynamicBinderAdapter<VB> {
/**
* Default item type {@code enums} for this adapter.
*/
public enum ItemViewType {
/**
* Enum for the type empty.
*/
EMPTY,
/**
* Enum for the type section header.
*/
HEADER,
/**
* Enum for the type item.
*/
ITEM,
/**
* Enum for the type divider.
*/
DIVIDER
}
/**
* Map to hold the data binders.
*/
private Map<E, VB> mDataBinderMap = new HashMap<>();
@Override
public int getItemCount() {
int itemCount = 0;
for (VB binder : mDataBinderMap.values()) {
itemCount += binder.getItemCount();
}
return itemCount;
}
@Override
public int getItemViewType(int position) {
return getEnumFromPosition(position).ordinal();
}
@Override
public VB getDataBinder(int viewType) {
return getDataBinderBinder(getEnumFromOrdinal(viewType));
}
@Override
public int getPosition(@NonNull VB binder, int binderPosition) {
E targetViewType = getEnumFromBinder(binder);
for (int i = 0, count = getItemCount(); i < count; i++) {
if (targetViewType == getEnumFromPosition(i)) {
binderPosition--;
if (binderPosition < 0) {
return i;
}
}
}
return getItemCount();
}
@Override
public int getBinderPosition(int position) {
E targetViewType = getEnumFromPosition(position);
int binderPosition = -1;
for (int i = 0; i <= position; i++) {
if (targetViewType == getEnumFromPosition(i)) {
binderPosition++;
}
}
if (binderPosition == -1) {
throw new IllegalArgumentException("Binder does not exists in the adapter.");
}
return binderPosition;
}
@Override
public void notifyBinderItemRangeChanged(@NonNull VB binder,
int positionStart, int itemCount) {
for (int i = positionStart; i <= itemCount; i++) {
notifyItemChanged(getPosition(binder, i));
}
}
@Override
public void notifyBinderItemRangeInserted(@NonNull VB binder,
int positionStart, int itemCount) {
for (int i = positionStart; i <= itemCount; i++) {
notifyItemInserted(getPosition(binder, i));
}
}
@Override
public void notifyBinderItemRangeRemoved(@NonNull VB binder,
int positionStart, int itemCount) {
for (int i = positionStart; i <= itemCount; i++) {
notifyItemRemoved(getPosition(binder, i));
}
}
/**
* Get the item type enum associated with position the position.
*
* @param position The position to get the corresponding {@code enum}.
*
* @return The {@code enum} corresponding to the given position.
*/
public abstract E getEnumFromPosition(int position);
/**
* Get the item type enum according to the ordinal.
*
* @param ordinal The ordinal to get the corresponding {@code enum}.
*
* @return The {@code enum} corresponding to the given ordinal.
*/
public abstract E getEnumFromOrdinal(int ordinal);
public E getEnumFromBinder(VB binder) {
for (Map.Entry<E, VB> entry : mDataBinderMap.entrySet()) {
if (entry.getValue().equals(binder)) {
return entry.getKey();
}
}
throw new IllegalArgumentException("Invalid data binder.");
}
/**
* Returns the dynamic data binder according to the supplied {@code enum}.
*
* @param e The data binder enum.
*
* @return The dynamic data binder according to the supplied {@code enum}.
*/
public VB getDataBinderBinder(E e) {
return mDataBinderMap.get(e);
}
/**
* Get the map to hold the data binders.
*
* @return The map to hold the data binders.
*/
public @NonNull Map<E, VB> getDataBinderMap() {
return mDataBinderMap;
}
/**
* Add data binders to display in this adapter.
*
* @param e The data binder enum.
* @param binder The data binder to be added in this adapter.
*/
public void putDataBinder(E e, VB binder) {
mDataBinderMap.put(e, binder);
}
}
| [
"[email protected]"
] | |
7ac80dc90278352f4fdb6c1a7de7802e38b8fc8c | f18d65356e89a2a5f7e363c72e6dfa842a8fe31b | /demo-mopub/src/main/java/toro/demo/mopub/DemoListAdapter.java | aeb5d1e6f2609adac2bf71040904253de3404593 | [
"Apache-2.0"
] | permissive | shanto462/toro | c339ae3340fa4ba89507005996da3c2c360a9ee2 | 8c4ef5998def82b6ac530d8512fdd54d191da0af | refs/heads/dev-v3 | 2020-05-02T06:51:08.600632 | 2019-01-18T12:32:39 | 2019-01-18T12:32:39 | 177,804,804 | 0 | 0 | NOASSERTION | 2019-04-22T09:18:39 | 2019-03-26T14:26:53 | Java | UTF-8 | Java | false | false | 4,721 | java | /*
* Copyright (c) 2018 Nam Nguyen, [email protected]
*
* 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 toro.demo.mopub;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import im.ene.toro.CacheManager;
import im.ene.toro.PlayerSelector;
import im.ene.toro.ToroPlayer;
import im.ene.toro.ToroUtil;
import im.ene.toro.exoplayer.ui.PlayerView;
import im.ene.toro.exoplayer.ui.ToroControlView;
import im.ene.toro.widget.Container;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* This Adapter introduces 2 practices for Toro:
*
* 1. Acts as a {@link CacheManager}. The implementation is trivial.
* 2. Acts as a {@link PlayerSelector} and minds the 'UI interaction'.
* The background is: the {@link VideoViewHolder} has a {@link PlayerView} by default, in which
* a {@link ToroControlView} is available. User can interact to that widget to play/pause/change
* volume for a playback. If a playback is paused by User, we should not start it automatically.
*
* To be able to do this, we keep track of the player position that User has manually paused,
* and use the ability of {@link PlayerSelector} to disallow it to start automatically, until
* User manually do it again. Right now it caches only one position, but the implementation for
* many should be trivial.
*
* @author eneim (2018/03/13).
*/
public class DemoListAdapter //
extends RecyclerView.Adapter<BaseViewHolder> //
implements PlayerSelector, CacheManager {
private static final int TYPE_TEXT = 10;
private static final int TYPE_VIDEO = 30;
DemoListAdapter(PlayerSelector origin) {
this.origin = ToroUtil.checkNotNull(origin);
}
DemoListAdapter() {
this(PlayerSelector.DEFAULT);
}
private LayoutInflater inflater;
@NonNull @Override
public BaseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
if (inflater == null || inflater.getContext() != parent.getContext()) {
inflater = LayoutInflater.from(parent.getContext());
}
return viewType == TYPE_VIDEO ? //
new UiAwareVideoViewHolder(this, parent, inflater, R.layout.view_holder_video)
: new TextViewHolder(parent, inflater, R.layout.view_holder_text);
}
@Override public void onBindViewHolder(@NonNull BaseViewHolder holder, int position) {
// Boolean.TRUE --> if holder is a TextViewHolder, then show both Text and Photo.
// Boolean.FALSE --> if holder is a TextViewHolder, then show only Text.
holder.bind(position % 5 == 0 ? Boolean.TRUE : Boolean.FALSE);
}
@Override public int getItemCount() {
return Integer.MAX_VALUE;
}
@Override public int getItemViewType(int position) {
return position % 4 == 1 ? TYPE_VIDEO : TYPE_TEXT;
}
/// PlayerSelector implementation
@SuppressWarnings("WeakerAccess") //
final PlayerSelector origin;
// Keep a cache of the Playback order that is manually paused by User.
// So that if User scroll to it again, it will not start play.
// Value will be updated by the ViewHolder.
final AtomicInteger lastUserPause = new AtomicInteger(-1);
@NonNull @Override public Collection<ToroPlayer> select(@NonNull Container container,
@NonNull List<ToroPlayer> items) {
Collection<ToroPlayer> originalResult = origin.select(container, items);
ArrayList<ToroPlayer> result = new ArrayList<>(originalResult);
if (lastUserPause.get() >= 0) {
for (Iterator<ToroPlayer> it = result.iterator(); it.hasNext(); ) {
if (it.next().getPlayerOrder() == lastUserPause.get()) {
it.remove();
break;
}
}
}
return result;
}
@NonNull @Override public PlayerSelector reverse() {
return origin.reverse();
}
/// CacheManager implementation
@Nullable @Override public Object getKeyForOrder(int order) {
return order;
}
@Nullable @Override public Integer getOrderForKey(@NonNull Object key) {
return key instanceof Integer ? (Integer) key : null;
}
}
| [
"[email protected]"
] | |
a2db47988a43afe05242c7c1eed10e4cd71fe204 | d7c5121237c705b5847e374974b39f47fae13e10 | /airspan.netspan/src/main/java/Netspan/NBI_15_2/Statistics/BsIbBaseTermDataRawGetResponse.java | d9d6c672edb01441e2e6ec2e769431283c1c3320 | [] | no_license | AirspanNetworks/SWITModules | 8ae768e0b864fa57dcb17168d015f6585d4455aa | 7089a4b6456621a3abd601cc4592d4b52a948b57 | refs/heads/master | 2022-11-24T11:20:29.041478 | 2020-08-09T07:20:03 | 2020-08-09T07:20:03 | 184,545,627 | 1 | 0 | null | 2022-11-16T12:35:12 | 2019-05-02T08:21:55 | Java | UTF-8 | Java | false | false | 1,957 | java |
package Netspan.NBI_15_2.Statistics;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="BsIbBaseTermDataRawGetResult" type="{http://Airspan.Netspan.WebServices}StatsBsIbBaseTermDataResponse" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"bsIbBaseTermDataRawGetResult"
})
@XmlRootElement(name = "BsIbBaseTermDataRawGetResponse")
public class BsIbBaseTermDataRawGetResponse {
@XmlElement(name = "BsIbBaseTermDataRawGetResult")
protected StatsBsIbBaseTermDataResponse bsIbBaseTermDataRawGetResult;
/**
* Gets the value of the bsIbBaseTermDataRawGetResult property.
*
* @return
* possible object is
* {@link StatsBsIbBaseTermDataResponse }
*
*/
public StatsBsIbBaseTermDataResponse getBsIbBaseTermDataRawGetResult() {
return bsIbBaseTermDataRawGetResult;
}
/**
* Sets the value of the bsIbBaseTermDataRawGetResult property.
*
* @param value
* allowed object is
* {@link StatsBsIbBaseTermDataResponse }
*
*/
public void setBsIbBaseTermDataRawGetResult(StatsBsIbBaseTermDataResponse value) {
this.bsIbBaseTermDataRawGetResult = value;
}
}
| [
"[email protected]"
] | |
bc2dd3edb634945c9bd4ca20f23caafdbbb47a32 | b4493419485490a99785ffb5ded9e0806a533426 | /archive/proto/test/src/com/arsdigita/tools/junit/framework/BaseTestCase.java | b337ae2d961cd2cc4af79cf7af963c63b459464a | [] | no_license | BackupTheBerlios/myrian-svn | 11b6704a34689251c835cc1d6b21295c4312e2e5 | 65c1acb69e37f146bfece618b8812b0760bdcae5 | refs/heads/master | 2021-01-01T06:44:46.948808 | 2004-10-19T20:03:43 | 2004-10-19T20:03:43 | 40,823,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,296 | java | /*
* Copyright (C) 2001, 2002 Red Hat Inc. All Rights Reserved.
*
* The contents of this file are subject to the CCM Public
* License (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.redhat.com/licenses/ccmpl.html
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
*/
package com.arsdigita.tools.junit.framework;
import junit.framework.*;
import com.arsdigita.persistence.Session;
import com.arsdigita.persistence.SessionManager;
import com.arsdigita.kernel.TestHelper;
import org.apache.log4j.Logger;
import java.util.Locale;
public abstract class BaseTestCase extends TestCase {
private static Logger s_log =
Logger.getLogger(BaseTestCase.class.getName());
/**
* Constructs a test case with the given name.
*/
public BaseTestCase(String name) {
super(name);
}
/**
* Runs the bare test sequence.
* @exception Throwable if any exception is thrown
*/
public void runBare() throws Throwable {
baseSetUp();
try {
try {
setUp();
runTest();
} catch(Throwable t) {
try {
tearDown();
} catch (Throwable t2) {
System.err.println ( "Error in teardown: " );
t2.printStackTrace ( System.err );
}
throw t;
}
tearDown();
} finally {
baseTearDown ();
}
}
protected void baseSetUp() {
s_log.warn (this.getClass().getName() + "." + getName() + " started");
Session sess = SessionManager.getSession();
sess.getTransactionContext().beginTxn();
TestHelper.setLocale(Locale.ENGLISH);
}
protected void baseTearDown() {
Session sess = SessionManager.getSession();
if (sess.getTransactionContext().inTxn()) {
sess.getTransactionContext().abortTxn();
}
s_log.info (this.getClass().getName() + " finished");
}
}
| [
"dennis@0c4ed275-74e5-0310-b0c6-b6ea092b5e81"
] | dennis@0c4ed275-74e5-0310-b0c6-b6ea092b5e81 |
13aeccee0d1dcd990ce1d507feeb4ecd0a17280f | 1e4788f838d7a703f6f15f80e230b08d889682e6 | /dist/game/data/scripts/quests/Q087_SagaOfEvasSaint/Q087_SagaOfEvasSaint.java | 724559690ff91f28011e1adef4b2e57343978d11 | [] | no_license | pr1vetdruk/l2jspace-c6-interlude | fbc5f0bea9fcf38c92172df15bde16ebb667fcdd | e0f701d4d87642887a3173a181de2037517f606d | refs/heads/master | 2023-07-14T13:32:16.250915 | 2021-08-30T08:31:55 | 2021-08-30T08:31:55 | 340,645,976 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,265 | java | /*
* This file is part of the L2jSpace project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package quests.Q087_SagaOfEvasSaint;
import quests.SagasSuperClass;
/**
* @author Emperorc
*/
public class Q087_SagaOfEvasSaint extends SagasSuperClass {
public Q087_SagaOfEvasSaint() {
super(87, "Saga of Eva's Saint");
_npc = new int[]
{
30191,
31626,
31588,
31280,
31620,
31646,
31649,
31653,
31654,
31655,
31657,
31280
};
_items = new int[]
{
7080,
7524,
7081,
7502,
7285,
7316,
7347,
7378,
7409,
7440,
7088,
0
};
_mob = new int[]
{
27266,
27236,
27276
};
_classId = new int[]
{
105
};
_prevClass = new int[]
{
0x1e
};
_x = new int[]
{
164650,
46087,
46066
};
_y = new int[]
{
-74121,
-36372,
-36396
};
_z = new int[]
{
-2871,
-1685,
-1685
};
_text = new String[]
{
"PLAYERNAME! Pursued to here! However, I jumped out of the Banshouren boundaries! You look at the giant as the sign of power!",
"... Oh ... good! So it was ... let's begin!",
"I do not have the patience ..! I have been a giant force ...! Cough chatter ah ah ah!",
"Paying homage to those who disrupt the orderly will be PLAYERNAME's death!",
"Now, my soul freed from the shackles of the millennium, Halixia, to the back side I come ...",
"Why do you interfere others' battles?",
"This is a waste of time.. Say goodbye...!",
"...That is the enemy",
"...Goodness! PLAYERNAME you are still looking?",
"PLAYERNAME ... Not just to whom the victory. Only personnel involved in the fighting are eligible to share in the victory.",
"Your sword is not an ornament. Don't you think, PLAYERNAME?",
"Goodness! I no longer sense a battle there now.",
"let...",
"Only engaged in the battle to bar their choice. Perhaps you should regret.",
"The human nation was foolish to try and fight a giant's strength.",
"Must...Retreat... Too...Strong.",
"PLAYERNAME. Defeat...by...retaining...and...Mo...Hacker",
"....! Fight...Defeat...It...Fight...Defeat...It..."
};
registerNPCs();
}
} | [
"[email protected]"
] | |
b19d144b9b4fbf08a3dd5d1b011a7811974eaa30 | a5d01febfd8d45a61f815b6f5ed447e25fad4959 | /Source Code/5.27.0/sources/com/iqoption/app/-$$Lambda$IQApp$2$wb4il6o036zHk_pttwwNAoKalGg.java | c850a6a49da25ad7152bbe694766d3a987f8b96e | [] | no_license | kkagill/Decompiler-IQ-Option | 7fe5911f90ed2490687f5d216cb2940f07b57194 | c2a9dbbe79a959aa1ab8bb7a89c735e8f9dbc5a6 | refs/heads/master | 2020-09-14T20:44:49.115289 | 2019-11-04T06:58:55 | 2019-11-04T06:58:55 | 223,236,327 | 1 | 0 | null | 2019-11-21T18:17:17 | 2019-11-21T18:17:16 | null | UTF-8 | Java | false | false | 509 | java | package com.iqoption.app;
import com.google.common.base.n;
import com.iqoption.app.IQApp.AnonymousClass2;
/* compiled from: lambda */
public final /* synthetic */ class -$$Lambda$IQApp$2$wb4il6o036zHk_pttwwNAoKalGg implements n {
private final /* synthetic */ AnonymousClass2 f$0;
public /* synthetic */ -$$Lambda$IQApp$2$wb4il6o036zHk_pttwwNAoKalGg(AnonymousClass2 anonymousClass2) {
this.f$0 = anonymousClass2;
}
public final Object get() {
return this.f$0.EX();
}
}
| [
"[email protected]"
] | |
45c2b32b6fcb6cc9106e3384269a1ce797679137 | 3fe383525b2dcd3f9a405c5105a4562983c7f7fa | /jenabean/jpa4jena/src/test/java/test/jpa/MusicGenre.java | b8f7ef7699957934e3d61fea31bdc1c1e7bf69e2 | [
"Apache-2.0"
] | permissive | william-vw/mlod | 7e013d999878a1fcd16e4add94e62626a16875a5 | 20d67f8790ef24527d2e0baff4b5dd053b5ab621 | refs/heads/master | 2023-07-25T12:35:00.658936 | 2022-03-02T16:03:55 | 2022-03-02T16:03:55 | 253,907,808 | 0 | 0 | Apache-2.0 | 2023-07-23T11:15:08 | 2020-04-07T20:44:36 | HTML | UTF-8 | Java | false | false | 242 | java | package test.jpa;
import java.net.URI;
import javax.persistence.Entity;
import javax.persistence.Id;
import thewebsemantic.Namespace;
@Entity
@Namespace("http://example.org/")
public class MusicGenre {
@Id URI id;
String description;
}
| [
"[email protected]"
] | |
5dce13c5ecec13568769daf8ba15840c52632f4e | f0568343ecd32379a6a2d598bda93fa419847584 | /modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201402/cm/EntityNotFound.java | 6ef20ef7f917e5dc50607ff868386d76d94ada57 | [
"Apache-2.0"
] | permissive | frankzwang/googleads-java-lib | bd098b7b61622bd50352ccca815c4de15c45a545 | 0cf942d2558754589a12b4d9daa5902d7499e43f | refs/heads/master | 2021-01-20T23:20:53.380875 | 2014-07-02T19:14:30 | 2014-07-02T19:14:30 | 21,526,492 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,658 | java |
package com.google.api.ads.adwords.jaxws.v201402.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
*
* An id did not correspond to an entity, or it referred to an entity which does not belong to the
* customer.
*
*
* <p>Java class for EntityNotFound complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="EntityNotFound">
* <complexContent>
* <extension base="{https://adwords.google.com/api/adwords/cm/v201402}ApiError">
* <sequence>
* <element name="reason" type="{https://adwords.google.com/api/adwords/cm/v201402}EntityNotFound.Reason" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EntityNotFound", propOrder = {
"reason"
})
public class EntityNotFound
extends ApiError
{
protected EntityNotFoundReason reason;
/**
* Gets the value of the reason property.
*
* @return
* possible object is
* {@link EntityNotFoundReason }
*
*/
public EntityNotFoundReason getReason() {
return reason;
}
/**
* Sets the value of the reason property.
*
* @param value
* allowed object is
* {@link EntityNotFoundReason }
*
*/
public void setReason(EntityNotFoundReason value) {
this.reason = value;
}
}
| [
"[email protected]"
] | |
41858a261fb3877ec3d1e7a6362f72c69ddcc356 | 004832e529873885f1559eb8c864384b3e1cda3f | /java/lineage2/gameserver/network/clientpackets/RequestCommissionBuyInfo.java | 78d4e0979d4fa3cc57f5944ad97c3fc7f0a9c43f | [] | no_license | wks1222/mobius-source | 02323e79316eabd4ce7e5b29f8cd5749c930d098 | 325a49fa23035f4d529e5a34b809b83c68d19cad | refs/heads/master | 2021-01-10T02:22:17.746138 | 2015-01-17T20:08:13 | 2015-01-17T20:08:13 | 36,601,733 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,427 | java | /*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package lineage2.gameserver.network.clientpackets;
import lineage2.gameserver.instancemanager.commission.CommissionShopManager;
import lineage2.gameserver.model.Player;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public class RequestCommissionBuyInfo extends L2GameClientPacket
{
private long auctionId;
private int exItemType;
/**
* Method readImpl.
*/
@Override
protected void readImpl()
{
auctionId = readQ();
exItemType = readD();
}
/**
* Method runImpl.
*/
@Override
protected void runImpl()
{
Player player = getClient().getActiveChar();
if (player == null)
{
return;
}
CommissionShopManager.getInstance().showCommissionBuyInfo(player, auctionId, exItemType);
}
}
| [
"[email protected]"
] | |
6401b410cde259e17810805eca0fecbba8932f35 | 5920532e9a0377a779cb7525b394928e8504ce81 | /practica5/Fecha.java | 1438de21c31fbc95013231a97e874b0e7d4738b3 | [] | no_license | kodemakerDor/Java_programming | d1cf2aa161e6c09d7e09eb7a594a8c8edf63cb66 | c80a1a11a962ff9be5cf5cf24c07f90c19b1ec5e | refs/heads/master | 2021-12-22T11:22:30.744139 | 2017-10-12T19:30:31 | 2017-10-12T19:30:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,707 | java | package practica5;
/*
* Clase Fecha
* Autor: Angeles Junco
*/
public class Fecha {
private int mes;
private int dia;
private int anio;
public Fecha(int dia, int mes, int anio) {
if (mes <= 0 || mes >12) {
this.mes = 1;
this.dia = 1;
}
else {
this.mes = mes;
if (dia <= 0 || dia > diasDelMes(mes))
this.dia = 1;
else
this.dia = dia;
}
this.anio = anio;
}
public Fecha(Fecha f){
this.dia = f.dia;
this.mes = f.mes;
this.anio = f.anio;
}
public int getDia () {
return this.dia;
}
public int getMes () {
return this.mes;
}
public int getAnio () {
return this.anio;
}
public void setDia(int dia) {
if (dia >= 1 && dia <= diasDelMes(this.mes))
this.dia = dia;
}
public void setMes(int mes) {
if (mes >= 1 && mes <= 12 && this.dia <= diasDelMes(mes))
this.mes = mes;
}
public void setAnio(int anio) {
this.anio = anio;
}
@Override
public String toString() {
return this.dia + " / " + this.mes + " / " + this.anio;
}
public boolean esMenorQue(Fecha f) {
if (this.anio > f.anio)
return true;
if (this.mes > f.mes && f.anio == this.anio)
return true;
if (this.dia > f.dia && this.mes == f.mes && f.anio == this.anio)
return true;
return false;
}
private int diasDelMes(int mes){
switch (mes) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12: return 31;
case 2: return 28;
case 4:
case 6:
case 9:
case 11: return 30;
}
return 0;
}
} | [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.