blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
390
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
35
| license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 539
values | visit_date
timestamp[us]date 2016-08-02 21:09:20
2023-09-06 10:10:07
| revision_date
timestamp[us]date 1990-01-30 01:55:47
2023-09-05 21:45:37
| committer_date
timestamp[us]date 2003-07-12 18:48:29
2023-09-05 21:45:37
| github_id
int64 7.28k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 13
values | gha_event_created_at
timestamp[us]date 2012-06-11 04:05:37
2023-09-14 21:59:18
⌀ | gha_created_at
timestamp[us]date 2008-05-22 07:58:19
2023-08-28 02:39:21
⌀ | gha_language
stringclasses 62
values | src_encoding
stringclasses 26
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 128
12.8k
| extension
stringclasses 11
values | content
stringlengths 128
8.19k
| authors
listlengths 1
1
| author_id
stringlengths 1
79
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2f620927688463685d4536c5379f9f4d040799c8
|
8e3466e06df53054e2400e0e4fb1a7bbfe25b98a
|
/src/test/java/guru/nidi/ramltester/JaxrsTest.java
|
3840934800a1291bbd8d1ab924a36bdb3bdc11fb
|
[
"Apache-2.0"
] |
permissive
|
nidi3/raml-tester
|
2e35951b11a55cf50f06af85392aac3658d09c89
|
6241a5f46a05cc0988be2ce3825495fa2cf95006
|
refs/heads/master
| 2021-01-23T21:01:37.979885
| 2018-02-23T12:30:02
| 2018-02-23T12:30:02
| 19,320,564
| 81
| 27
|
Apache-2.0
| 2023-01-03T16:17:07
| 2014-04-30T16:49:44
|
Java
|
UTF-8
|
Java
| false
| false
| 5,091
|
java
|
/*
* Copyright © 2014 Stefan Niederhauser (nidin@gmx.ch)
*
* 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 guru.nidi.ramltester;
import guru.nidi.ramltester.jaxrs.*;
import guru.nidi.ramltester.junit.ExpectedUsage;
import guru.nidi.ramltester.model.RamlRequest;
import guru.nidi.ramltester.model.RamlResponse;
import guru.nidi.ramltester.util.ServerTest;
import org.apache.catalina.Context;
import org.apache.catalina.startup.Tomcat;
import org.glassfish.jersey.client.JerseyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.ws.rs.client.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.List;
import static guru.nidi.ramltester.util.TestUtils.valuesOf;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.*;
/**
*
*/
@RunWith(Parameterized.class)
public class JaxrsTest extends ServerTest {
private static final RamlDefinition raml = RamlLoaders.fromClasspath(JaxrsTest.class).load("jaxrs.raml");
private final Client client;
private static final MultiReportAggregator aggregator = new MultiReportAggregator();
@ClassRule
public static final ExpectedUsage expectedUsage = new ExpectedUsage(aggregator.usageProvider(raml));
public JaxrsTest(Client client) {
this.client = client;
}
@Parameterized.Parameters(name = "{0}")
public static List<Client> clients() {
return Arrays.asList(
JerseyClientBuilder.createClient(),
new ResteasyClientBuilder().build());
}
@Test
public void model() {
final RamlRequest[] request = new RamlRequest[1];
final RamlResponse[] response = new RamlResponse[1];
final CheckingWebTarget checking = raml.createWebTarget(client.target(baseUrlWithPort())).aggregating(aggregator);
checking.register(new ClientResponseFilter() {
@Override
public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException {
request[0] = new JaxrsContextRamlRequest(requestContext);
response[0] = new JaxrsContextRamlResponse(responseContext);
}
});
final Invocation invocation = checking.path("/app/path").queryParam("qp", "true")
.request().header("h", "h2")
.buildPost(Entity.entity("data", "text/plain"));
final String s = invocation.invoke(String.class);
assertEquals("\"json string\"", s);
assertEquals("POST", request[0].getMethod());
assertEquals(valuesOf("qp", "true"), request[0].getQueryValues());
assertEquals(Arrays.asList("h2"), request[0].getHeaderValues().get("h"));
assertEquals(url("app/path"), request[0].getRequestUrl(null, false));
assertEquals("text/plain", request[0].getContentType());
assertArrayEquals("data".getBytes(), request[0].getContent());
assertEquals(200, response[0].getStatus());
assertEquals(Arrays.asList("true"), response[0].getHeaderValues().get("res"));
assertThat(response[0].getContentType(), startsWith("application/json"));
assertArrayEquals("\"json string\"".getBytes(), response[0].getContent());
}
@Test
public void client() {
final CheckingWebTarget checking = raml.createWebTarget(client.target(baseUrlWithPort()));
checking.path("/app/path").queryParam("qp", "true")
.request().header("h", "h2")
.post(Entity.entity("data", "text/plain"));
assertTrue(checking.getLastReport().isEmpty());
}
@Override
protected void init(Context ctx) {
Tomcat.addServlet(ctx, "app", new TestServlet());
ctx.addServletMapping("/app/path/*", "app");
}
private static class TestServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
assertEquals("d".getBytes()[0], req.getInputStream().read());
resp.setContentType("application/json");
resp.setHeader("res", "true");
final PrintWriter out = resp.getWriter();
out.write(req.getParameter("param") == null ? "\"json string\"" : "illegal json");
out.flush();
}
}
}
|
[
"ghuder5@gmx.ch"
] |
ghuder5@gmx.ch
|
3e9a87c1c5fbec2b3e1d545e8c3c747623acb648
|
e41891da9c6aa30c8699d8f582372f590c8be862
|
/hapi-fhir-docs/src/main/java/ChangelogMigrator.java
|
7c6b23bdf4ea71290a35f83923dfd597b1f1cf22
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] |
permissive
|
mo3dev/hapi-fhir
|
c542a57379d1d1dc99532912ac30ea0a84f48ac9
|
d9d47bb419df5d2f012c4b0a1e3fc1db7a354bee
|
refs/heads/master
| 2020-11-23T23:58:43.971255
| 2019-12-12T19:47:12
| 2019-12-12T19:47:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,219
|
java
|
/*-
* #%L
* HAPI FHIR - Docs
* %%
* Copyright (C) 2014 - 2019 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import org.jdom2.Content;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.jdom2.Text;
import org.jdom2.input.DOMBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
* This is just here to force a javadoc to be built in order to keep
* Maven Central happy
*/
public class ChangelogMigrator {
private static final Logger ourLog = LoggerFactory.getLogger(ChangelogMigrator.class);
private static final Namespace NS = Namespace.getNamespace( "http://maven.apache.org/changes/1.0.0");
public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException {
org.jdom2.Document document = null;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
//If want to make namespace aware.
//factory.setNamespaceAware(true);
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
org.w3c.dom.Document w3cDocument = documentBuilder.parse(new File("src/changes/changes.xml"));
document = new DOMBuilder().build(w3cDocument);
int actionCount = 0;
int releaseCount = 0;
Element docElement = document.getRootElement();
Element bodyElement = docElement.getChild("body", NS);
List<Element> releases = bodyElement.getChildren("release", NS);
for (Element nextRelease : releases) {
String version = nextRelease.getAttributeValue("version");
String date = nextRelease.getAttributeValue("date");
String description = nextRelease.getAttributeValue("description");
ourLog.info("Found release {} - {} - {}", version, date, description);
releaseCount++;
for (Element nextAction : nextRelease.getChildren("action", NS)) {
String type = nextAction.getAttribute("type").getValue();
String issue = nextAction.getAttribute("issue") != null ? nextAction.getAttribute("issue").getValue() : null;
StringBuilder contentBuilder = new StringBuilder();
for (Content nextContents : nextAction.getContent()) {
if (nextContents instanceof Text) {
String text = ((Text) nextContents).getTextNormalize();
contentBuilder.append(text);
} else {
throw new IllegalStateException("Unknown type: " + nextContents.getClass());
}
}
actionCount++;
}
}
ourLog.info("Found {} releases and {} actions", releaseCount, actionCount);
}
}
|
[
"jamesagnew@gmail.com"
] |
jamesagnew@gmail.com
|
0eac164f7de8d09afd321abf25f8f48ece139f78
|
eed87ed9685bd67e65159db7f67586aff7a43dbe
|
/2.JavaCore/src/com/javarush/task/task17/task1701/Solution.java
|
c699dddf82b264da6bfcb68ff88df0f9b9ac5a33
|
[] |
no_license
|
Skwoll/Learning_JavaRush
|
bda3d4e90b3ddd6b962b1d62e7ea7d0ab71ebb05
|
dcf266ae67a5dda2dd348c60756bb37151a6a659
|
refs/heads/master
| 2021-06-04T16:04:57.857442
| 2020-11-04T12:44:04
| 2020-11-04T12:44:04
| 115,603,079
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,929
|
java
|
package com.javarush.task.task17.task1701;
import java.util.ArrayList;
import java.util.List;
/*
Заметки
Асинхронность выполнения нитей.
1. Класс Note будет использоваться нитями.
2. Создай public static нить NoteThread (Runnable не является нитью), которая в методе run 1000 раз (index = 0-999) сделает следующие действия:
2.1. Используя метод addNote добавит заметку с именем [getName() + "-Note" + index], например, при index=4
"Thread-0-Note4"
2.2. Заснет на 1 миллисекунду
2.3. Используя метод removeNote удалит заметку
2.4. В качестве параметра в removeNote передай имя нити - метод getName()
Требования:
1. Класс Solution должен содержать public static класс NoteThread.
2. Класс NoteThread должен быть нитью.
3. В методе run класса NoteThread должен быть цикл.
4. Метод run класса NoteThread должен 1000 раз вызывать метод addNote c параметром (getName() + "-Note" + index).
5. Метод run класса NoteThread должен 1000 раз вызывать Thread.sleep() c параметром (1).
6. Метод run класса NoteThread должен 1000 раз вызывать метод removeNote c параметром (getName()).
*/
public class Solution {
public static void main(String[] args) {
new NoteThread().start();
new NoteThread().start();
}
public static class Note {
public static final List<String> notes = new ArrayList<>();
public static void addNote(String note) {
notes.add(0, note);
}
public static void removeNote(String threadName) {
String note = notes.remove(0);
if (note == null) {
System.out.println("Другая нить удалила нашу заметку");
} else if (!note.startsWith(threadName)) {
System.out.println("Нить [" + threadName + "] удалила чужую заметку [" + note + "]");
} else {
System.out.println("Нить [" + threadName + "] удалила свою заметку [" + note + "]");
}
}
}
public static class NoteThread extends Thread{
@Override
public void run() {
super.run();
for (int index = 0; index <= 999; index++) {
Note.addNote(getName() + "-Note" + index);
try {
Thread.sleep(1);
} catch (InterruptedException e) {
}
Note.removeNote(getName());
}
}
}
}
|
[
"air_mib@mail.ru"
] |
air_mib@mail.ru
|
9ddbdd28b5868359ebc0654fc1aa9a404e5ac178
|
48f0fdfd9e3926311be9f7c4f05f8896c292c993
|
/Food Analyzer Server/test/bg/sofia/uni/fmi/mjt/analyzer/command/GetFoodByBarcodeCommandTest.java
|
1777cce8dffafdc12956d9474dac623d3e3d4bf0
|
[] |
no_license
|
vanshianec/Food-Analyzer
|
4c881ada465e7fcde35a5eac866fd1a41b5c316f
|
fe00cfa72bb97111cc6ae4a20662793997527ed9
|
refs/heads/master
| 2023-03-05T09:59:19.463975
| 2021-02-21T12:51:28
| 2021-02-21T12:51:28
| 340,900,309
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,853
|
java
|
package bg.sofia.uni.fmi.mjt.analyzer.command;
import bg.sofia.uni.fmi.mjt.analyzer.dtos.Food;
import bg.sofia.uni.fmi.mjt.analyzer.exceptions.FoodNotFoundException;
import bg.sofia.uni.fmi.mjt.analyzer.exceptions.FoodServiceException;
import bg.sofia.uni.fmi.mjt.analyzer.exceptions.InvalidCommandArgumentException;
import bg.sofia.uni.fmi.mjt.analyzer.storage.HeapStorage;
import bg.sofia.uni.fmi.mjt.analyzer.storage.Storage;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
public class GetFoodByBarcodeCommandTest {
private static final int STORAGE_SIZE = 2;
private static final String STORED_FOOD_UPC_CODE = "025484007109";
private static final String COMMAND_UPC_CODE_PREFIX = "--code=";
private static final String COMMAND_IMAGE_PATH_PREFIX = "--img=";
private static final Food STORED_FOOD = new Food(1, "", "", STORED_FOOD_UPC_CODE);
private Storage<String, Food> foodByBarcodeStorage;
private Command command;
@Before
public void initialize() {
foodByBarcodeStorage = new HeapStorage<>(STORAGE_SIZE);
foodByBarcodeStorage.save(STORED_FOOD_UPC_CODE, STORED_FOOD);
command = new GetFoodByBarcodeCommand(foodByBarcodeStorage);
}
@Test(expected = InvalidCommandArgumentException.class)
public void testExecuteWithNullArguments() throws InvalidCommandArgumentException, IOException, FoodServiceException {
command.execute(null);
}
@Test(expected = InvalidCommandArgumentException.class)
public void testExecuteWithInvalidArguments() throws InvalidCommandArgumentException, IOException, FoodServiceException {
command.execute("invalid argument");
}
@Test(expected = InvalidCommandArgumentException.class)
public void testExecuteWithInvalidArgumentsCount() throws InvalidCommandArgumentException, IOException, FoodServiceException {
command.execute("1", "2", "3");
}
@Test(expected = InvalidCommandArgumentException.class)
public void testExecuteWithNoArgumentsCount() throws InvalidCommandArgumentException, IOException, FoodServiceException {
command.execute();
}
@Test(expected = InvalidCommandArgumentException.class)
public void testExecuteWithInvalidUpcCode() throws InvalidCommandArgumentException, IOException, FoodServiceException {
String invalidCode = "9j39301jfjd";
command.execute(COMMAND_UPC_CODE_PREFIX + invalidCode);
}
@Test(expected = InvalidCommandArgumentException.class)
public void testExecuteWithInvalidImagePath() throws InvalidCommandArgumentException, IOException, FoodServiceException {
String invalidPath = "some invalid path @**$";
command.execute(COMMAND_IMAGE_PATH_PREFIX + invalidPath);
}
@Test(expected = FoodNotFoundException.class)
public void testExecuteWithNonExistingUpcCodeInStorage() throws InvalidCommandArgumentException, IOException, FoodServiceException {
String nonExistingCode = "9999999999";
command.execute(COMMAND_UPC_CODE_PREFIX + nonExistingCode);
}
@Test
public void testExecuteWithExistingUpcCodeInStorage() throws InvalidCommandArgumentException, IOException, FoodServiceException {
String expected = STORED_FOOD.toString().strip();
String actual = command.execute(COMMAND_UPC_CODE_PREFIX + STORED_FOOD_UPC_CODE);
assertEquals("Food with existing upc code in the storage should match those returned by the command",
expected, actual);
}
@Test
public void testExecuteWithExistingImagePath() throws InvalidCommandArgumentException, IOException, FoodServiceException {
String upcCodeImagePath = "test" + File.separator + "resources"
+ File.separator + "barcode-images" + File.separator + "validImage.gif";
String expected = STORED_FOOD.toString().strip();
String actual = command.execute(COMMAND_IMAGE_PATH_PREFIX + upcCodeImagePath);
assertEquals("Food upc code taken from image which exists in the storage should match those returned by the command",
expected, actual);
}
@Test
public void testIfUpcImagePathIsIgnoredWhenAnUpcCodeIsAlreadyProvided() throws InvalidCommandArgumentException, IOException, FoodServiceException {
/* will throw an exception if not ignored by the command */
String invalidImagePath = "some invalid path$#*";
String expected = STORED_FOOD.toString().strip();
String actual = command.execute(COMMAND_IMAGE_PATH_PREFIX + invalidImagePath,
COMMAND_UPC_CODE_PREFIX + STORED_FOOD_UPC_CODE);
assertEquals("Image path to upc code should be ignored when an upc code is already provided as an argument",
expected, actual);
}
}
|
[
"ivaniovov@abv.bg"
] |
ivaniovov@abv.bg
|
d102e5ceef644527f50759375359080ca7f05c01
|
ad18e138687c1a0e790a16e8a98eb6546e045e4d
|
/baremaps-osm/src/main/java/com/baremaps/osm/cache/PostgisReferenceCache.java
|
0861565094f941b12681869eabeb9049387699b7
|
[
"Apache-2.0"
] |
permissive
|
boswellp/baremaps
|
abc3c945683dd58820f57b61863e5123244bd3ce
|
d213d240b91f7e538ea344163396360a32bfece9
|
refs/heads/master
| 2022-12-15T21:09:24.769854
| 2020-08-26T21:26:41
| 2020-08-26T21:26:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,399
|
java
|
/*
* Copyright (C) 2020 The Baremaps 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 com.baremaps.osm.cache;
import java.sql.Array;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.inject.Inject;
import javax.sql.DataSource;
public class PostgisReferenceCache implements Cache<Long, List<Long>> {
private static final String SELECT =
"SELECT nodes FROM osm_ways WHERE id = ?";
private static final String SELECT_IN =
"SELECT id, nodes FROM osm_ways WHERE id WHERE id = ANY (?)";
private final DataSource dataSource;
@Inject
public PostgisReferenceCache(DataSource dataSource) {
this.dataSource = dataSource;
}
public List<Long> get(Long id) throws CacheException {
try (Connection connection = dataSource.getConnection();
PreparedStatement statement = connection.prepareStatement(SELECT)) {
statement.setLong(1, id);
ResultSet result = statement.executeQuery();
if (result.next()) {
List<Long> nodes = new ArrayList<>();
Array array = result.getArray(1);
if (array != null) {
nodes = Arrays.asList((Long[]) array.getArray());
}
return nodes;
} else {
throw new IllegalArgumentException();
}
} catch (SQLException e) {
throw new CacheException(e);
}
}
@Override
public List<List<Long>> getAll(List<Long> keys) throws CacheException {
try (Connection connection = dataSource.getConnection();
PreparedStatement statement = connection.prepareStatement(SELECT_IN)) {
statement.setArray(1, connection.createArrayOf("int8", keys.toArray()));
ResultSet result = statement.executeQuery();
Map<Long, List<Long>> references = new HashMap<>();
while (result.next()) {
List<Long> nodes = new ArrayList<>();
long id = result.getLong(1);
Array array = result.getArray(2);
if (array != null) {
nodes = Arrays.asList((Long[]) array.getArray());
}
references.put(id, nodes);
}
return keys.stream().map(key -> references.get(key)).collect(Collectors.toList());
} catch (SQLException e) {
throw new CacheException(e);
}
}
@Override
public void put(Long key, List<Long> values) {
throw new UnsupportedOperationException();
}
@Override
public void putAll(List<Entry<Long, List<Long>>> storeEntries) {
throw new UnsupportedOperationException();
}
@Override
public void delete(Long key) {
throw new UnsupportedOperationException();
}
@Override
public void deleteAll(List<Long> keys) {
throw new UnsupportedOperationException();
}
}
|
[
"bchapuis@gmail.com"
] |
bchapuis@gmail.com
|
01867978d13fae6d650aa850abf195e3a5f2d5b6
|
b8743f5f3d3c8754eba595d3c9a8a4de8259b68a
|
/bitcamp-java-basic/src/main/java/ch15/Test13_1.java
|
33b13d05463c685a28675f5e301606425efed0e2
|
[] |
no_license
|
ryong890314/bitcamp-java-20190527
|
bb68333bca72e5acc6268ff1ec31f8f22ee3529d
|
a55614799700fd2ee99d8e2070562a2a4680826f
|
refs/heads/master
| 2020-06-13T20:14:36.797757
| 2020-04-20T06:59:10
| 2020-04-20T06:59:10
| 194,775,345
| 0
| 0
| null | 2020-04-30T11:48:02
| 2019-07-02T02:41:02
|
Java
|
UTF-8
|
Java
| false
| false
| 1,916
|
java
|
// Object 클래스 - clone() : shallow copy
package ch15;
// clone()은 인스턴스를 복제할 때 호출하는 메서드이다.
public class Test13_1 {
static class Engine implements Cloneable {
int cc;
int valve;
public Engine(int cc, int valve) {
this.cc = cc;
this.valve = valve;
}
@Override
public Engine clone() throws CloneNotSupportedException {
return (Engine) super.clone();
}
@Override
public String toString() {
return "Engine [cc=" + cc + ", valve=" + valve + "]";
}
}
static class Car implements Cloneable {
String maker;
String name;
Engine engine;
public Car() {}
public Car(String maker, String name, Engine engine) {
this.maker = maker;
this.name = name;
this.engine = engine;
}
@Override
public String toString() {
return "Car [maker=" + maker + ", name=" + name + ", engine=" + engine + "]";
}
@Override
public Car clone() throws CloneNotSupportedException {
return (Car) super.clone();
}
}
public static void main(String[] args) throws Exception {
Engine engine = new Engine(3000, 16);
Car car = new Car("비트자동차", "비트비트", engine);
// 자동차 복제
Car car2 = car.clone();
System.out.println(car == car2);
System.out.println(car);
System.out.println(car2);
System.out.println(car.engine == car2.engine);
// clone()은 해당 객체의 필드 값만 복제한다.
// 그 객체가 포함하고 있는 하위 객체는 복제하지 않는다.
// "shallow copy(얕은 복제)"라 부른다.
//
// 그 객체가 포함하고 있는 하위 객체까지 복제하는 것을
// "deep copy(깊은 복제)"라 부른다.
// deep copy는 개발자가 직접 clone() 메서드 안에
// deep copy를 수행하는 코드를 작성해야 한다.
}
}
|
[
"syamsyalla@naver.com"
] |
syamsyalla@naver.com
|
b6fe71c993c95f2e94d880825c96951d408d264f
|
4e50a70c4513619e60e3ba6d5a50813b082bcaf5
|
/examples/scep-example/src/main/java/org/xipki/scep/example/ScepClientExample.java
|
647958f620d53c0af10392ec6f615935f976da6d
|
[
"Apache-2.0"
] |
permissive
|
hoggmania/xipki
|
e87dee2e86131aa0d062835d4e7090d3d8596861
|
93824ff1034f59c1bdd2ed6200398673581c604d
|
refs/heads/master
| 2023-04-06T07:19:38.792670
| 2020-03-15T16:21:57
| 2020-03-15T16:21:57
| 247,776,526
| 0
| 0
|
Apache-2.0
| 2023-04-04T00:54:59
| 2020-03-16T17:24:47
| null |
UTF-8
|
Java
| false
| false
| 4,545
|
java
|
/*
*
* Copyright (c) 2013 - 2020 Lijun Liao
*
* 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.xipki.scep.example;
import java.io.FileInputStream;
import java.math.BigInteger;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.Date;
import java.util.concurrent.atomic.AtomicLong;
import org.bouncycastle.asn1.pkcs.CertificationRequest;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.cert.X509v3CertificateBuilder;
import org.bouncycastle.operator.ContentSigner;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.xipki.scep.client.CaCertValidator;
import org.xipki.scep.client.CaIdentifier;
import org.xipki.scep.client.EnrolmentResponse;
import org.xipki.scep.client.ScepClient;
import org.xipki.scep.util.ScepUtil;
import org.xipki.util.IoUtil;
/**
* SCEP client example with concrete test data.
*
* @author Lijun Liao
*/
public class ScepClientExample extends CaClientExample {
private static final String CA_URL = "http://localhost:8080/scep/scep1/tls/pkiclient.exe";
private static final String CA_CERT_FILE = "~/source/xipki/dist/xipki-cli/target/"
+ "xipki-cli-3.1.0-SNAPSHOT/xipki/setup/keycerts/myca1.der";
private static final String challengePassword = "user1:password1";
private static final AtomicLong index = new AtomicLong(System.currentTimeMillis());
public static void main(String[] args) {
//System.setProperty("javax.net.debug", "all");
try {
X509Certificate caCert = ScepUtil.parseCert(
IoUtil.read(new FileInputStream(expandPath(CA_CERT_FILE))));
CaIdentifier tmpCaId = new CaIdentifier(CA_URL, null);
CaCertValidator caCertValidator = new CaCertValidator.PreprovisionedCaCertValidator(caCert);
ScepClient client = new ScepClient(tmpCaId, caCertValidator);
client.init();
// Self-Signed Identity Certificate
MyKeypair keypair = generateRsaKeypair();
CertificationRequest csr = genCsr(keypair, getSubject(), challengePassword);
// self-signed cert must use the same subject as in CSR
X500Name subjectDn = csr.getCertificationRequestInfo().getSubject();
X509v3CertificateBuilder certGenerator = new X509v3CertificateBuilder(
subjectDn, BigInteger.valueOf(1), new Date(),
new Date(System.currentTimeMillis() + 24 * 3600 * 1000),
subjectDn, keypair.getPublic());
ContentSigner signer = new JcaContentSignerBuilder("SHA256withRSA")
.build(keypair.getPrivate());
X509Certificate selfSignedCert = ScepUtil.parseCert(certGenerator.build(signer).getEncoded());
// Enroll certificate - RSA
EnrolmentResponse resp = (EnrolmentResponse) client.scepEnrol(csr, keypair.getPrivate(),
selfSignedCert);
if (resp.isFailure()) {
throw new Exception("server returned 'failure'");
}
if (resp.isPending()) {
throw new Exception("server returned 'pending'");
}
X509Certificate cert = resp.getCertificates().get(0);
printCert("SCEP (RSA, Self-Signed Identity Cert)", cert);
// Use the CA signed identity certificate
X509Certificate identityCert = cert;
PrivateKey identityKey = keypair.getPrivate();
keypair = generateRsaKeypair();
csr = genCsr(keypair, getSubject(), challengePassword);
// Enroll certificate - RSA
resp = (EnrolmentResponse) client.scepEnrol(csr, identityKey, identityCert);
if (resp.isFailure()) {
throw new Exception("server returned 'failure'");
}
if (resp.isPending()) {
throw new Exception("server returned 'pending'");
}
cert = resp.getCertificates().get(0);
printCert("SCEP (RSA, CA issued identity Cert)", cert);
client.destroy();
} catch (Exception ex) {
ex.printStackTrace();
System.exit(-1);
}
} // method main
private static String getSubject() {
return "CN=SCEP-" + index.incrementAndGet() + ".xipki.org,O=xipki,C=DE";
}
}
|
[
"lijun.liao@gmail.com"
] |
lijun.liao@gmail.com
|
aba24e4af43e84a63e48e02491cd977359e856dc
|
ba37fff2f1989b14c6765fcfa2afc07d4581771a
|
/src/main/java/com/chuzihang/lesson/concurrency/example/syncContainer/VectorExample1.java
|
76793b878d57d7253ab9b8b424a4980a52541f9b
|
[] |
no_license
|
winter13292/www.chuzihang.com
|
3fb4a0d6eadf24d6ae03947ee934bb983559456e
|
b21ef38488c3b881e5bb03c0fd55f308b39da1c6
|
refs/heads/master
| 2020-06-16T10:04:39.806654
| 2019-04-01T11:08:46
| 2019-04-01T11:08:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,973
|
java
|
package com.chuzihang.lesson.concurrency.example.syncContainer;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import java.util.Collections;
import java.util.List;
import java.util.Vector;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
import java.util.stream.Stream;
/**
* @ClassName VectorExample1
* @Description TODO
* @Author Q_先生
* @Date 2018/11/2 15:06
**/
@Slf4j
public class VectorExample1 {
//请求总数
public static int clientTotal = 10000;
public static int threadTotal = 200;
public static int count = 0;
public static Vector<Integer> vector = new Vector<>();
public static List<Integer> list = Collections.synchronizedList(Lists.newArrayList());
public static void main(String[] args) throws InterruptedException {
ExecutorService executorService = Executors.newCachedThreadPool();
//信号量
final Semaphore semaphore = new Semaphore(threadTotal);
//计数器闭锁
final CountDownLatch countDownLatch = new CountDownLatch(clientTotal);
Stream.iterate(0, n -> n + 1)
.limit(clientTotal)
.forEach(e -> {
executorService.execute(() -> {
try {
semaphore.acquire();
update();
semaphore.release();
} catch (Exception e1) {
log.error("exception", e);
}
countDownLatch.countDown();
});
});
countDownLatch.await();
executorService.shutdown();
log.info("count:{}", list.size());
}
public static void add() {
count++;
}
public static void update() {
list.add(1);
}
}
|
[
"qiuwei@dongsport.com"
] |
qiuwei@dongsport.com
|
f45a8dbef46b71d167177c7f261fd065b0e91367
|
0e47241136f839b0697e8895729c061b9e219cea
|
/src/main/java/com/enotes/note/service/authentication/TokenInfo.java
|
a0a83c32527041834aed5666bf7a5e9b76639e71
|
[] |
no_license
|
nassimbg/ENotes
|
5128d9a1afb84609056ff04d02c04461d1c7a8a5
|
9a6eb7102defed6292523d9a633c4d3a1870015a
|
refs/heads/master
| 2023-02-13T12:16:18.468823
| 2021-01-10T11:39:09
| 2021-01-10T11:56:21
| 328,367,551
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,163
|
java
|
package com.enotes.note.service.authentication;
public class TokenInfo {
private final String id;
private final String userName;
private final boolean isValid;
private final String token;
public TokenInfo(Builder builder) {
this.id = builder.id;
this.userName = builder.userName;
this.isValid = builder.isValid;
this.token = builder.token;
}
public String getId() {
return id;
}
public String getUserName() {
return userName;
}
public boolean isValid() {
return isValid;
}
public String getToken() {
return token;
}
public static final class Builder {
private String id;
private String userName;
private boolean isValid;
private String token;
public Builder(String token) {
this.token = token;
}
public Builder userName(String userName) {
this.userName = userName;
return this;
}
public Builder id(String id) {
this.id = id;
return this;
}
public Builder isValid(boolean isValid) {
this.isValid = isValid;
return this;
}
public TokenInfo build() {
return new TokenInfo(this);
}
}
}
|
[
"nassimboughannam@gmail.com"
] |
nassimboughannam@gmail.com
|
4542508b13e54923a8e31691da0ed6a872f919a6
|
50384d299d30ab1a4769e7e04021af897c169945
|
/guansongtao20200218/src/main/java/com/bawei/guansongtao20200218/activity/fragment/Fragment_one.java
|
f83a7b808fde489d3486f48b63d0c191720ea5f1
|
[] |
no_license
|
gaunsongtao/week2
|
d5438734ac845dcc540baac3c8ea68d38df04333
|
bc43e54eecbb9b9d4dd6dae065231c58b6ccccd1
|
refs/heads/master
| 2021-01-08T15:09:13.676036
| 2020-02-21T05:35:53
| 2020-02-21T05:35:55
| 242,063,046
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,265
|
java
|
package com.bawei.guansongtao20200218.activity.fragment;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import com.bawei.guansongtao20200218.R;
import com.bawei.guansongtao20200218.activity.activity.Main2Activity;
import com.bawei.guansongtao20200218.activity.adapter.BaseAdap;
import com.bawei.guansongtao20200218.activity.bean.JsonBean;
import com.bawei.guansongtao20200218.activity.utils.Utils;
import com.google.gson.Gson;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import java.util.ArrayList;
import java.util.List;
public class Fragment_one extends Fragment {
private PullToRefreshListView pull;
ArrayList<JsonBean.ListdataBean> list = new ArrayList<>();
int i=1;
protected int getLayId() {
return R.layout.item1;
}
protected void getViewId(View view) {
pull = view.findViewById(R.id.pull);
}
protected void initData() {
getDate("");
//设置模式
pull.setMode(PullToRefreshBase.Mode.BOTH);
//监听器
pull.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
@Override
public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
list.clear();
getDate("2");
pull.onRefreshComplete();
i=1;
}
@Override
public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
i++;
getDate(""+i);
Log.i("xxx",""+i);
pull.onRefreshComplete();
}
});
//单击事件
pull.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
JsonBean.ListdataBean listdataBean = list.get(position);
String url = listdataBean.getUrl();
Intent intent = new Intent(getActivity(), Main2Activity.class);
intent.putExtra("url",url);
startActivity(intent);
}
});
}
//获取json
public void getDate(String page){
String path="http://blog.zhaoliang5156.cn/api/news/lawyer"+page+".json";
Log.i("xxx","执行");
Boolean wifi = Utils.getInstance().isWifi(getActivity());
if (wifi){
Utils.getInstance().getJson(path, new Utils.Inter() {
@Override
public void Ok(String json) {
Log.i("xxx","json");
Gson gson = new Gson();
JsonBean jsonBean = gson.fromJson(json, JsonBean.class);
List<JsonBean.ListdataBean> listdata = jsonBean.getListdata();
list.addAll(listdata);
BaseAdap baseAdap = new BaseAdap(getActivity(), list);
pull.setAdapter(baseAdap);
}
});
}else {
Log.i("xxx","无网络");
}
}
}
|
[
"you@example.com"
] |
you@example.com
|
d8e1510b496b701bc61d2ad476195709a6a639bf
|
0c993ac3c8ac60aa0765561530959feb9847c0a3
|
/JavaCoreProf/src/main/java/lesson_5/optional/Person.java
|
32ba5b4e5668999d345af4e364b1a6d1e7b77ac4
|
[] |
no_license
|
D1mkaGit/GeekBrains
|
0b96bb871b70708e6ad3f8f7ca74ad3908d9205e
|
a638f697e3380c2c1461156fa8b8153f825f220e
|
refs/heads/master
| 2023-04-06T06:47:20.423827
| 2022-12-25T19:31:18
| 2022-12-25T19:31:18
| 221,762,240
| 1
| 1
| null | 2023-03-24T01:17:50
| 2019-11-14T18:30:42
|
Java
|
UTF-8
|
Java
| false
| false
| 741
|
java
|
package lesson_5.optional;
import java.util.Optional;
public class Person {
private Optional<String> firstName;
private Optional<String> secondName;
private Optional<Integer> age;
public Optional<String> getFirstName() {
return firstName;
}
public void setFirstName( String firstName ) {
this.firstName = Optional.ofNullable(firstName);
}
public Optional<String> getSecondName() {
return secondName;
}
public void setSecondName( String secondName ) {
this.secondName = Optional.of(secondName);
}
public Optional<Integer> getAge() {
return age;
}
public void setAge( Integer age ) {
this.age = Optional.ofNullable(age);
}
}
|
[
"30922998+D1mkaGit@users.noreply.github.com"
] |
30922998+D1mkaGit@users.noreply.github.com
|
bef0cd5836559a72456ac1463394cff8ab2b048f
|
afade4ecf3cc19053db4e77c1f1919219dd3f17d
|
/src/main/java/com/github/hotire/springbatch/JobUtils.java
|
93281f8decb76e938c56c1328e2a7892d0ef4a7c
|
[] |
no_license
|
hotire/spring-batch
|
5a5f3cae26ff0853d853e3537c352da72a076905
|
47e5857d917bf526494947b5ff35645b8ad25a70
|
refs/heads/master
| 2022-07-16T11:25:24.223189
| 2022-06-21T23:38:03
| 2022-06-21T23:38:03
| 210,638,080
| 0
| 0
| null | 2022-06-21T04:22:47
| 2019-09-24T15:35:00
|
Java
|
UTF-8
|
Java
| false
| false
| 1,414
|
java
|
package com.github.hotire.springbatch;
import static java.util.Collections.emptyMap;
import static java.util.stream.Collectors.toMap;
import java.util.Date;
import java.util.Map;
import java.util.Optional;
import org.springframework.batch.core.JobParameter;
import org.springframework.batch.core.JobParameters;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class JobUtils {
public static JobParameters convertRawToJobParams(Map<String, Object> properties) {
return new JobParameters(convertRawToParamMap(properties));
}
public static Map<String, JobParameter> convertRawToParamMap(Map<String, Object> properties) {
return Optional.ofNullable(properties)
.orElse(emptyMap())
.entrySet()
.stream()
.collect(toMap(Map.Entry::getKey, e -> createJobParameter(e.getValue())));
}
public static JobParameter createJobParameter(Object value) {
if (value instanceof Date) {
return new JobParameter((Date) value);
} else if (value instanceof Long) {
return new JobParameter((Long) value);
} else if (value instanceof Double) {
return new JobParameter((Double) value);
} else {
return new JobParameter("" + value);
}
}
}
|
[
"gngh0101@gmail.com"
] |
gngh0101@gmail.com
|
e3cb351fcf7a30b042355d03e45ba29557cba422
|
86ccb87786458a8807fe9eff9b7200f2626c01a2
|
/src/main/java/p328/Solution.java
|
80e6e9d79b79789634e50dc60a5b8de2d70c1553
|
[] |
no_license
|
fisher310/leetcoderevolver
|
d919e566271730b3df26fe28b85c387a3f48faa3
|
83263b69728f94b51e7188cd79fcdac1f261c339
|
refs/heads/master
| 2023-03-07T19:05:58.119634
| 2022-03-23T12:40:13
| 2022-03-23T12:40:13
| 251,488,466
| 0
| 0
| null | 2021-03-24T01:50:58
| 2020-03-31T03:14:04
|
Java
|
UTF-8
|
Java
| false
| false
| 918
|
java
|
package p328;
import util.ListNode;
import util.ListNodeUtil;
/** 奇偶链表 */
class Solution {
public ListNode oddEvenList(ListNode head) {
ListNode oddDummy = new ListNode(0);
ListNode evenDummy = new ListNode(0);
ListNode curOdd = oddDummy;
ListNode curEven = evenDummy;
int i = 1;
while (head != null) {
if (i++ % 2 == 1) {
curOdd.next = head;
curOdd = curOdd.next;
} else {
curEven.next = head;
curEven = curEven.next;
}
head = head.next;
}
curEven.next = null;
curOdd.next = evenDummy.next;
return oddDummy.next;
}
public static void main(String[] args) {
Solution s = new Solution();
ListNode head = s.oddEvenList(ListNodeUtil.create(new int[] {1, 2, 3, 4, 5}));
ListNodeUtil.print(head);
ListNodeUtil.print(s.oddEvenList(ListNodeUtil.create(new int[] {2, 1, 3, 5, 6, 4, 7})));
}
}
|
[
"316049914@qq.com"
] |
316049914@qq.com
|
a2d2ad327099ca1cd0ecc1ed6c0f083e115b6006
|
40de84efccbb63fdf19c61349e4de03b8f1f68d6
|
/schemacrawler-tools/src/main/java/schemacrawler/tools/text/base/CommonTextOptions.java
|
c3333487d217af73f6422e17bb3d4e0e771e4cb5
|
[] |
no_license
|
jooohhn/SchemaCrawler
|
587426464c78f331e946985e2d574cb65cbb96a8
|
431069e89c304cf66fd16692e765994d26399410
|
refs/heads/master
| 2020-03-11T22:11:13.316687
| 2018-04-20T00:00:20
| 2018-04-20T00:00:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,178
|
java
|
/*
========================================================================
SchemaCrawler
http://www.schemacrawler.com
Copyright (c) 2000-2018, Sualeh Fatehi <sualeh@hotmail.com>.
All rights reserved.
------------------------------------------------------------------------
SchemaCrawler 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.
SchemaCrawler and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0, GNU General Public License
v3 or GNU Lesser General Public License v3.
You may elect to redistribute this code under any of these licenses.
The Eclipse Public License is available at:
http://www.eclipse.org/legal/epl-v10.html
The GNU General Public License v3 and the GNU Lesser General Public
License v3 are available at:
http://www.gnu.org/licenses/
========================================================================
*/
package schemacrawler.tools.text.base;
public class CommonTextOptions
extends BaseTextOptions
{
private static final long serialVersionUID = 2376263945077668483L;
}
|
[
"sualeh@hotmail.com"
] |
sualeh@hotmail.com
|
a34ba452013b15365803b79d0e6f4a37052b62ac
|
38c4451ab626dcdc101a11b18e248d33fd8a52e0
|
/tokens/xalan-j-2.7.1/src/org/apache/xalan/xsltc/compiler/util/MultiHashtable.java
|
19aa28f4272e221e2bbe2e39583cb1321737da8e
|
[] |
no_license
|
habeascorpus/habeascorpus-data
|
47da7c08d0f357938c502bae030d5fb8f44f5e01
|
536d55729f3110aee058ad009bcba3e063b39450
|
refs/heads/master
| 2020-06-04T10:17:20.102451
| 2013-02-19T15:19:21
| 2013-02-19T15:19:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,068
|
java
|
package TokenNamepackage
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
xalan TokenNameIdentifier
. TokenNameDOT
xsltc TokenNameIdentifier
. TokenNameDOT
compiler TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
java TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
Hashtable TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
java TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
Vector TokenNameIdentifier
; TokenNameSEMICOLON
public TokenNamepublic
final TokenNamefinal
class TokenNameclass
MultiHashtable TokenNameIdentifier
extends TokenNameextends
Hashtable TokenNameIdentifier
{ TokenNameLBRACE
static TokenNamestatic
final TokenNamefinal
long TokenNamelong
serialVersionUID TokenNameIdentifier
= TokenNameEQUAL
- TokenNameMINUS
6151608290510033572L TokenNameLongLiteral
; TokenNameSEMICOLON
public TokenNamepublic
Object TokenNameIdentifier
put TokenNameIdentifier
( TokenNameLPAREN
Object TokenNameIdentifier
key TokenNameIdentifier
, TokenNameCOMMA
Object TokenNameIdentifier
value TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
Vector TokenNameIdentifier
vector TokenNameIdentifier
= TokenNameEQUAL
( TokenNameLPAREN
Vector TokenNameIdentifier
) TokenNameRPAREN
get TokenNameIdentifier
( TokenNameLPAREN
key TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
vector TokenNameIdentifier
== TokenNameEQUAL_EQUAL
null TokenNamenull
) TokenNameRPAREN
super TokenNamesuper
. TokenNameDOT
put TokenNameIdentifier
( TokenNameLPAREN
key TokenNameIdentifier
, TokenNameCOMMA
vector TokenNameIdentifier
= TokenNameEQUAL
new TokenNamenew
Vector TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
vector TokenNameIdentifier
. TokenNameDOT
add TokenNameIdentifier
( TokenNameLPAREN
value TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
return TokenNamereturn
vector TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
Object TokenNameIdentifier
maps TokenNameIdentifier
( TokenNameLPAREN
Object TokenNameIdentifier
from TokenNameIdentifier
, TokenNameCOMMA
Object TokenNameIdentifier
to TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
if TokenNameif
( TokenNameLPAREN
from TokenNameIdentifier
== TokenNameEQUAL_EQUAL
null TokenNamenull
) TokenNameRPAREN
return TokenNamereturn
null TokenNamenull
; TokenNameSEMICOLON
final TokenNamefinal
Vector TokenNameIdentifier
vector TokenNameIdentifier
= TokenNameEQUAL
( TokenNameLPAREN
Vector TokenNameIdentifier
) TokenNameRPAREN
get TokenNameIdentifier
( TokenNameLPAREN
from TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
vector TokenNameIdentifier
!= TokenNameNOT_EQUAL
null TokenNamenull
) TokenNameRPAREN
{ TokenNameLBRACE
final TokenNamefinal
int TokenNameint
n TokenNameIdentifier
= TokenNameEQUAL
vector TokenNameIdentifier
. TokenNameDOT
size TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
for TokenNamefor
( TokenNameLPAREN
int TokenNameint
i TokenNameIdentifier
= TokenNameEQUAL
0 TokenNameIntegerLiteral
; TokenNameSEMICOLON
i TokenNameIdentifier
< TokenNameLESS
n TokenNameIdentifier
; TokenNameSEMICOLON
i TokenNameIdentifier
++ TokenNamePLUS_PLUS
) TokenNameRPAREN
{ TokenNameLBRACE
final TokenNamefinal
Object TokenNameIdentifier
item TokenNameIdentifier
= TokenNameEQUAL
vector TokenNameIdentifier
. TokenNameDOT
elementAt TokenNameIdentifier
( TokenNameLPAREN
i TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
if TokenNameif
( TokenNameLPAREN
item TokenNameIdentifier
. TokenNameDOT
equals TokenNameIdentifier
( TokenNameLPAREN
to TokenNameIdentifier
) TokenNameRPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
item TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
} TokenNameRBRACE
return TokenNamereturn
null TokenNamenull
; TokenNameSEMICOLON
} TokenNameRBRACE
} TokenNameRBRACE
|
[
"pschulam@gmail.com"
] |
pschulam@gmail.com
|
ae056fddef3bdd1edf1bb10989592085b5965dd8
|
442f6be098eeb1866fc2e94796a8ad2016f317d2
|
/juikito/atinject-jndi/src/main/java/net/gcolin/di/atinject/jndi/ResourceInjectionPointBuilder.java
|
ec60a4e195ac433dfdba0d5b195e55662f78197f
|
[
"Apache-2.0"
] |
permissive
|
gcolin/smallee
|
355774d6feb2b9f478b297a17297d446c33705a3
|
3f21f2cbea2af708bb7e8f31375dcc4f56a17e16
|
refs/heads/master
| 2023-07-24T03:00:08.848827
| 2022-12-31T17:23:12
| 2022-12-31T17:23:12
| 205,173,969
| 0
| 0
|
Apache-2.0
| 2023-07-22T14:51:15
| 2019-08-29T13:47:29
|
Java
|
UTF-8
|
Java
| false
| false
| 1,822
|
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 net.gcolin.di.atinject.jndi;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import javax.annotation.Resource;
import javax.inject.Provider;
import net.gcolin.di.atinject.Environment;
import net.gcolin.di.atinject.InjectionPoint;
import net.gcolin.di.atinject.InjectionPointBuilder;
/**
* ResourceInjectionPointBuilder.
*
* @author Gaël COLIN
* @since 1.0
*/
public class ResourceInjectionPointBuilder implements InjectionPointBuilder {
@Override
public InjectionPoint create(Field field, Environment env) {
if(field.isAnnotationPresent(Resource.class)) {
String jndiName = JndiExtension.getJndiName(field.getAnnotation(Resource.class), field);
if(field.getType() == Provider.class) {
return new ProvidedResourceFieldInjectionPoint(jndiName, field);
} else {
return new ResourceFieldInjectionPoint(jndiName, field);
}
}
return null;
}
@Override
public InjectionPoint create(Method method, Environment env) {
return null;
}
}
|
[
"gael87@gmail.com"
] |
gael87@gmail.com
|
a239ab431eafe5d1ebe15b978ae222e9235c9bed
|
096e862f59cf0d2acf0ce05578f913a148cc653d
|
/code/apps/Gallery2/src/com/sprd/gallery3d/drm/VideoDrmUtils.java
|
3adba52d8ba9d8dc18c2d069ed7d9a49d8fe531c
|
[] |
no_license
|
Phenix-Collection/Android-6.0-packages
|
e2ba7f7950c5df258c86032f8fbdff42d2dfc26a
|
ac1a67c36f90013ac1de82309f84bd215d5fdca9
|
refs/heads/master
| 2021-10-10T20:52:24.087442
| 2017-05-27T05:52:42
| 2017-05-27T05:52:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,262
|
java
|
package com.sprd.gallery3d.drm;
import android.app.Activity;
import android.app.AddonManager;
import android.content.Context;
import android.net.Uri;
import android.view.MenuItem;
import com.android.gallery3d.app.MoviePlayer;
import com.android.gallery3d.R;
public class VideoDrmUtils {
static VideoDrmUtils sInstance;
protected String mFilePath = null;
// This flag is used to indicate consume or not when suspend is invoked
// If back is pressed or playing finish, just suspend and consume
// If home key is pressed, suspend but not consume(push to background and will be back later)
protected boolean mConsumeForPause = false;
protected boolean mIsStopped = false;
public static VideoDrmUtils getInstance() {
if (sInstance != null) return sInstance;
sInstance = (VideoDrmUtils) AddonManager.getDefault().getAddon(R.string.feature_drm_video, VideoDrmUtils.class);
return sInstance;
}
public VideoDrmUtils() {
}
public void getFilePathByUri(Uri uri, Context context) {
}
/**
* SPRD: This method is used to control the share menu item
* When drm feature is disabled, videos are always able to be shared,
* so just return false here which means share menu item isn't disabled.
*
* Return value represents current state of share menu item.
* trur for enable and false for disable. This return value
* should be changed when it is used in plugin apk. If current file
* can be transfered, enable the item and return false. And if not, disable
* the item and return true.
*/
public boolean disableShareMenu(MenuItem shareItem) {
return false;
}
/**
* Set mConsumeForPause flag
*/
public void needToConsume(boolean consume) {
}
public boolean isDrmFile(String filePath, String mimeType) {
return false;
}
public boolean isDrmFile() {
return false;
}
public void checkRightBeforePlay(final Activity activity, final MoviePlayer mp) {
}
public void checkRightBeforeChange(final Activity activity, final MoviePlayer mp) {
}
public void setStopState(boolean state) {
}
public boolean isConsumed() {
return false;
}
}
|
[
"wangjicong6403660@126.com"
] |
wangjicong6403660@126.com
|
d7ddc1a6383bc7487da0184baf139f80dd4ffc36
|
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
|
/ast_results/k9mail_k-9/mail/common/src/main/java/com/fsck/k9/mail/filter/PeekableInputStream.java
|
38728e20e8c6c8d6c34948ac97373df9ec321780
|
[] |
no_license
|
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
|
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
|
0564143d92f8024ff5fa6b659c2baebf827582b1
|
refs/heads/master
| 2020-07-13T13:53:40.297493
| 2019-01-11T11:51:18
| 2019-01-11T11:51:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,823
|
java
|
// isComment
package com.fsck.k9.mail.filter;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Locale;
/**
* isComment
*/
public class isClassOrIsInterface extends FilterInputStream {
private boolean isVariable;
private int isVariable;
public isConstructor(InputStream isParameter) {
super(isNameExpr);
}
@Override
public int isMethod() throws IOException {
if (!isNameExpr) {
return isNameExpr.isMethod();
} else {
isNameExpr = true;
return isNameExpr;
}
}
public int isMethod() throws IOException {
if (!isNameExpr) {
isNameExpr = isNameExpr.isMethod();
isNameExpr = true;
}
return isNameExpr;
}
@Override
public int isMethod(byte[] isParameter, int isParameter, int isParameter) throws IOException {
if (!isNameExpr) {
return isNameExpr.isMethod(isNameExpr, isNameExpr, isNameExpr);
} else {
isNameExpr[isNameExpr] = (byte) isNameExpr;
isNameExpr = true;
int isVariable = isNameExpr.isMethod(isNameExpr, isNameExpr + isIntegerConstant, isNameExpr - isIntegerConstant);
if (isNameExpr == -isIntegerConstant) {
return isIntegerConstant;
} else {
return isNameExpr + isIntegerConstant;
}
}
}
@Override
public int isMethod(byte[] isParameter) throws IOException {
return isMethod(isNameExpr, isIntegerConstant, isNameExpr.isFieldAccessExpr);
}
@Override
public String isMethod() {
return isNameExpr.isMethod(isNameExpr.isFieldAccessExpr, "isStringConstant", isNameExpr.isMethod(), isNameExpr, isNameExpr);
}
}
|
[
"matheus@melsolucoes.net"
] |
matheus@melsolucoes.net
|
1e0b008c8d6b2121911dd49c6c47f1b790c3bff1
|
1fc2683bc9ec62850a1eaf70dff8fe3624d3867f
|
/wasp/src/ca/mcmaster/magarveylab/wasp/session/SessionListener.java
|
23568b768da521416658479731d2b7fe0d12ba64
|
[] |
no_license
|
magarveylab/wasp
|
4985c69eacb2bdf67e21d158a70998c1ea91a348
|
bc8dfb75f84b568caa9eac45a393f5afe6ee93c7
|
refs/heads/master
| 2021-01-20T07:28:40.790488
| 2017-08-08T02:41:26
| 2017-08-08T02:41:26
| 28,422,098
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,022
|
java
|
package ca.mcmaster.magarveylab.wasp.session;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Reports Clams search progress to user.
*
* @author skinnider
*
*/
public class SessionListener {
private volatile LinkedHashMap<String, String> stages;
private volatile int progress; // progress of the search, out of 100
public FileUploadListener uploadListener;
public String report;
private Logger logger = Logger.getLogger(SessionListener.class.getName());
public SessionListener() {
stages = new LinkedHashMap<String, String>();
}
public synchronized String getStage(int idx) {
String key = (new ArrayList<String>(stages.keySet())).get(idx);
return key;
}
public synchronized String getDetail(int idx) {
String value = (new ArrayList<String>(stages.values())).get(idx);
return value;
}
public synchronized void addStage(String stage, String detail) {
stages.put(stage, detail);
logger.log(Level.INFO, detail);
}
public synchronized void updateLastDetail(String detail) {
int idx = stages.size() - 1;
String key = (new ArrayList<String>(stages.keySet())).get(idx);
stages.put(key, detail);
logger.log(Level.INFO, detail);
}
public synchronized int progress() {
return progress;
}
public synchronized void updateProgress(int i) {
progress = i;
}
public synchronized int size() {
return stages.size();
}
public synchronized void throwException(Exception e) {
// Set the exception message
String exception = e.toString();
// Convert the stack trace to a string
StringWriter trace = new StringWriter();
e.printStackTrace(new PrintWriter(trace));
String details = trace.toString();
// Output the exception message & stack trace
addStage(exception, details);
e.printStackTrace();
}
public void attachReport(String report) {
this.report = report;
}
public String report() {
return report;
}
}
|
[
"michaelskinnider@gmail.com"
] |
michaelskinnider@gmail.com
|
453f9e0e2da654390c6b731a10ecb39124736f8f
|
d715d4ffff654a57e8c9dc668f142fb512b40bb5
|
/workspace/glaf-bpmn/src/main/java/com/glaf/bpmn/parse/BpmnXmlReader.java
|
40b6f4f021433c953d2c85afbd18d8862b97d673
|
[] |
no_license
|
jior/isdp
|
c940d9e1477d74e9e0e24096f32ffb1430b841e7
|
251fe724dcce7464df53479c7a373fa43f6264ca
|
refs/heads/master
| 2016-09-06T07:43:11.220255
| 2014-12-28T09:18:14
| 2014-12-28T09:18:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,538
|
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.glaf.bpmn.parse;
import java.io.ByteArrayInputStream;
import java.util.Iterator;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import com.glaf.bpmn.domain.FlowActivityDefEntity;
import com.glaf.bpmn.domain.FlowForwardDefEntity;
import com.glaf.bpmn.domain.FlowProcessDefEntity;
import com.glaf.core.util.IOUtils;
public class BpmnXmlReader {
public FlowProcessDefEntity read(byte[] bytes) {
java.io.InputStream inputStream = null;
try {
inputStream = new ByteArrayInputStream(bytes);
return this.read(inputStream);
} finally {
IOUtils.closeStream(inputStream);
}
}
public FlowProcessDefEntity read(java.io.InputStream inputStream) {
FlowProcessDefEntity flowProcessDef = new FlowProcessDefEntity();
SAXReader xmlReader = new SAXReader();
try {
Document doc = xmlReader.read(inputStream);
Element root = doc.getRootElement();
Element definitionsElement = root.element("definitions");
if (definitionsElement != null) {
Element processElement = definitionsElement.element("process");
flowProcessDef.setId(processElement.attributeValue("id"));
flowProcessDef.setName(processElement.attributeValue("name"));
Element startEventElement = processElement
.element("startEvent");
FlowActivityDefEntity startActivity = new FlowActivityDefEntity();
startActivity.setId(flowProcessDef.getId() + "_"
+ startEventElement.attributeValue("id"));
startActivity.setProcessId(flowProcessDef.getId());
startActivity.setName(startEventElement.attributeValue("name"));
startActivity.setTypeofact("1");
flowProcessDef.addActivity(startActivity);
List<?> endEventElements = processElement.elements("endEvent");
if (endEventElements != null && !endEventElements.isEmpty()) {
Iterator<?> iterator = endEventElements.iterator();
while (iterator.hasNext()) {
Element endEventElement = (Element) iterator.next();
FlowActivityDefEntity endActivity = new FlowActivityDefEntity();
endActivity.setId(flowProcessDef.getId() + "_"
+ endEventElement.attributeValue("id"));
endActivity.setProcessId(flowProcessDef.getId());
endActivity.setName(endEventElement
.attributeValue("name"));
endActivity.setTypeofact("2");
flowProcessDef.addActivity(endActivity);
}
}
List<?> userTaskElements = processElement.elements("userTask");
if (userTaskElements != null && !userTaskElements.isEmpty()) {
int listno = 1;
Iterator<?> iterator = userTaskElements.iterator();
while (iterator.hasNext()) {
Element userTaskElement = (Element) iterator.next();
FlowActivityDefEntity userTaskActivity = new FlowActivityDefEntity();
userTaskActivity.setId(flowProcessDef.getId() + "_"
+ userTaskElement.attributeValue("id"));
userTaskActivity.setProcessId(flowProcessDef.getId());
userTaskActivity.setName(userTaskElement
.attributeValue("name"));
userTaskActivity.setTypeofact("0");
userTaskActivity.setListno(listno++);
Element potentialOwnerElement = userTaskElement
.element("potentialOwner");
if (potentialOwnerElement != null) {
Element resourceAssignmentExpressionElement = potentialOwnerElement
.element("resourceAssignmentExpression");
if (resourceAssignmentExpressionElement != null) {
String roleCode = resourceAssignmentExpressionElement
.elementTextTrim("formalExpression");
userTaskActivity.setNetrolecode(roleCode);
}
}
flowProcessDef.addActivity(userTaskActivity);
}
}
List<?> sequenceFlowElements = processElement
.elements("sequenceFlow");
if (sequenceFlowElements != null
&& !sequenceFlowElements.isEmpty()) {
Iterator<?> iterator = sequenceFlowElements.iterator();
while (iterator.hasNext()) {
Element userTaskElement = (Element) iterator.next();
FlowForwardDefEntity flowForwardDef = new FlowForwardDefEntity();
flowForwardDef.setId(flowProcessDef.getId() + "_"
+ userTaskElement.attributeValue("id"));
flowForwardDef.setProcessId(flowProcessDef.getId());
flowForwardDef.setActivPre(flowProcessDef.getId() + "_"
+ userTaskElement.attributeValue("sourceRef"));
flowForwardDef.setActivNext(flowProcessDef.getId()
+ "_"
+ userTaskElement.attributeValue("targetRef"));
flowForwardDef.setName(userTaskElement
.attributeValue("name"));
flowProcessDef.addSequenceFlow(flowForwardDef);
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
return flowProcessDef;
}
}
|
[
"jior2008@gmail.com"
] |
jior2008@gmail.com
|
8195b017757dfd88cd3a98d76b915ef9a123a6d4
|
a5d01febfd8d45a61f815b6f5ed447e25fad4959
|
/Source Code/5.27.0/sources/com/iqoption/e/wa.java
|
b163f2eb86e091e20b951557368ab9507e15071e
|
[] |
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
| 3,195
|
java
|
package com.iqoption.e;
import android.util.SparseIntArray;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingComponent;
import androidx.databinding.ViewDataBinding;
import com.iqoption.view.RobotoTextView;
import com.iqoption.x.R;
/* compiled from: PortfolioPendingInfoBindingImpl */
public class wa extends vz {
@Nullable
private static final IncludedLayouts aor = null;
@Nullable
private static final SparseIntArray aos = new SparseIntArray();
@NonNull
private final LinearLayout aAA;
private long aot;
/* Access modifiers changed, original: protected */
public boolean onFieldChange(int i, Object obj, int i2) {
return false;
}
public boolean setVariable(int i, @Nullable Object obj) {
return true;
}
static {
aos.put(R.id.createTimeLayout, 1);
aos.put(R.id.createTime, 2);
aos.put(R.id.investLayout, 3);
aos.put(R.id.investment, 4);
aos.put(R.id.multiplierLayout, 5);
aos.put(R.id.multiplier, 6);
aos.put(R.id.quantityLayout, 7);
aos.put(R.id.quantity, 8);
aos.put(R.id.currentPrice, 9);
aos.put(R.id.takeProfitLayout, 10);
aos.put(R.id.takeProfit, 11);
aos.put(R.id.stopLossLayout, 12);
aos.put(R.id.stopLoss, 13);
aos.put(R.id.btnClose, 14);
aos.put(R.id.btnCloseLabel, 15);
aos.put(R.id.btnCloseProgress, 16);
aos.put(R.id.btnEdit, 17);
}
public wa(@Nullable DataBindingComponent dataBindingComponent, @NonNull View view) {
this(dataBindingComponent, view, ViewDataBinding.mapBindings(dataBindingComponent, view, 18, aor, aos));
}
private wa(DataBindingComponent dataBindingComponent, View view, Object[] objArr) {
super(dataBindingComponent, view, 0, (FrameLayout) objArr[14], (TextView) objArr[15], (ProgressBar) objArr[16], (ImageView) objArr[17], (RobotoTextView) objArr[2], (LinearLayout) objArr[1], (RobotoTextView) objArr[9], (LinearLayout) objArr[3], (RobotoTextView) objArr[4], (RobotoTextView) objArr[6], (LinearLayout) objArr[5], (RobotoTextView) objArr[8], (LinearLayout) objArr[7], (RobotoTextView) objArr[13], (LinearLayout) objArr[12], (RobotoTextView) objArr[11], (LinearLayout) objArr[10]);
this.aot = -1;
this.aAA = (LinearLayout) objArr[0];
this.aAA.setTag(null);
setRootTag(view);
invalidateAll();
}
public void invalidateAll() {
synchronized (this) {
this.aot = 1;
}
requestRebind();
}
public boolean hasPendingBindings() {
synchronized (this) {
if (this.aot != 0) {
return true;
}
return false;
}
}
/* Access modifiers changed, original: protected */
public void executeBindings() {
synchronized (this) {
long j = this.aot;
this.aot = 0;
}
}
}
|
[
"yihsun1992@gmail.com"
] |
yihsun1992@gmail.com
|
caa8cedb16b4b359c9f5bd3a5f2b7edede1290c5
|
eb462bccac683e0d9e2030dbbab0cfa507c6abb8
|
/multithreading/src/com/training/interthread/Application.java
|
88045f5679da9672d20f62fd205ec4117bf71e04
|
[] |
no_license
|
vatsanTraining/lumen_off_campus_2021
|
7df11b84cc0fedd0db21531db27458ecd3ad4613
|
7ce805204ea6106d2ce2f69a19e710f967f51b6e
|
refs/heads/master
| 2023-06-22T07:07:20.490081
| 2021-07-15T04:31:32
| 2021-07-15T04:31:32
| 379,652,001
| 0
| 21
| null | 2021-06-30T17:30:19
| 2021-06-23T15:37:55
|
Java
|
UTF-8
|
Java
| false
| false
| 621
|
java
|
package com.training.interthread;
public class Application {
public static void main(String[] args) {
Runnable task = () -> {
for(int i=0;i<10;i++)
{
System.out.println("Hello World");
}
};
Thread t = new Thread(task);
t.start();
BankAccount account = new BankAccount();
Thread t1=new Thread(){
public void run(){
System.out.println("Current Balance :="+account.withdraw(4000));
}
};
t1.start();
Thread t2=new Thread(){
public void run(){
System.out.println("Current Balance:="+account.deposit(8000));
}
};
t2.start();
}
}
|
[
"vatsank@gmail.com"
] |
vatsank@gmail.com
|
8b61daf8c43e6d817ac53880846e9536c610608e
|
f97613e16f20c3cc4796c739754edb9516e2c250
|
/src/main/java/be/isach/samaritan/log/SmartLogger.java
|
c3d2cfc7860d9df27da6f36c7c02a9ca7b296b48
|
[
"MIT"
] |
permissive
|
iSach/Samaritan
|
6f11a368a9554790a765cc843a2b52e0fc3be719
|
c759551cdffbb0fe1203e47c43b7be8180d8e677
|
refs/heads/master
| 2021-01-24T08:21:44.381854
| 2016-12-25T20:21:11
| 2016-12-25T20:21:11
| 60,129,221
| 9
| 2
| null | 2016-11-16T21:33:27
| 2016-05-31T22:56:47
|
Java
|
UTF-8
|
Java
| false
| false
| 1,388
|
java
|
package be.isach.samaritan.log;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Objects;
/**
* Project: samaritan
* Package: be.isach.samaritan.log
* Created by: Sacha
* Created on: 15th May, 2016
* <p>
* Description: Represents a Smart Logger.
*/
public class SmartLogger {
private enum LogLevel {
INFO,
WARNING,
ERROR
}
private static final DateFormat df = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS");
public String format(String logRecord, LogLevel logLevel) {
StringBuilder builder = new StringBuilder(1000);
builder.append(df.format(new Date(System.currentTimeMillis()))).append(" - ");
builder.append("[").append(logLevel).append("]: ");
builder.append(logRecord);
return builder.toString();
}
public void write(LogLevel logLevel, Object... objects) {
if (objects.length == 0)
System.out.println(format("", logLevel));
for (Object object : objects)
System.out.println(format(object.toString(), logLevel));
}
public void writeFrom(String provider, Object... objects) {
for (Object o : objects) {
write("[" + provider.toUpperCase() + "]: " + o);
}
}
public void write(Object... objects) {
write(LogLevel.INFO, objects);
}
}
|
[
"sacha.lewin@me.com"
] |
sacha.lewin@me.com
|
4fff53553bb54d5d7a9e0cae88a4d65282cb287d
|
05daac799b7ade63a3501abc8582f9af428ebb9a
|
/lujnet/src/main/java/luj/net/internal/client/connect/NetClientConnectorV2.java
|
48a67b353922ce50345d8f4dfaf02265ab64287a
|
[] |
no_license
|
lowZoom/lujnet
|
15db98215cb23d3345908e743e65b3326e81880c
|
11ae408137903dea12388d749746b4cbf9b7e045
|
refs/heads/master
| 2022-12-12T04:36:03.795661
| 2022-12-02T02:54:18
| 2022-12-02T02:54:18
| 219,450,973
| 0
| 0
| null | 2022-11-23T00:46:18
| 2019-11-04T08:21:28
|
Java
|
UTF-8
|
Java
| false
| false
| 2,244
|
java
|
package luj.net.internal.client.connect;
import com.google.common.collect.ImmutableList;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import java.util.function.Consumer;
import luj.net.api.client.NetConnection;
import luj.net.api.server.FrameDataReceiver;
import luj.net.internal.connection.NetConnFactory;
import luj.net.internal.receive.init.FrameReceiveStateFactory;
/**
* @see luj.net.internal.client.connect3.NetClientConnectorV3
*/
@Deprecated
public class NetClientConnectorV2 {
public NetClientConnectorV2(Consumer<NetConnection.Config> configFiller,
NioEventLoopGroup workGroup) {
_configFiller = configFiller;
_workGroup = workGroup;
}
public NetConnection connect() {
ChannelFuture result = connect2();
result.awaitUninterruptibly();
Channel channel = result.isSuccess() ? result.channel() : null;
return new NetConnFactory(channel).create();
}
public ChannelFuture connect2() {
ConfigImpl conf = new ConfigImpl();
_configFiller.accept(conf);
Bootstrap bootstrap = new ClientBootMaker(_workGroup).make();
if (conf._connectTimeout > 0) {
bootstrap.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, conf._connectTimeout);
}
NettyClientHandler nettyHandler = new NettyClientHandler();
nettyHandler._active = false;
nettyHandler._disconnectListener = conf._disconnectListener;
FrameDataReceiver frameReceiver = conf._frameReceiver;
nettyHandler._frameReceiver = frameReceiver;
nettyHandler._receiveState = new FrameReceiveStateFactory(
(frameReceiver == null) ? ImmutableList.of() : ImmutableList.of(frameReceiver)).create();
bootstrap.handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) {
ch.pipeline().addLast(nettyHandler);
}
});
return bootstrap.connect(conf._host, conf._port);
}
private final Consumer<NetConnection.Config> _configFiller;
private final NioEventLoopGroup _workGroup;
}
|
[
"david_lu_st@163.com"
] |
david_lu_st@163.com
|
3484b32cb6be564879551622f25185e3799f05be
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XRENDERING-481-7-2-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/display/internal/DocumentContentDisplayer_ESTest.java
|
8ad3f84c976dd1ed615287efe8cdc23a0135ec1f
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 581
|
java
|
/*
* This file was automatically generated by EvoSuite
* Mon Apr 06 19:57:31 UTC 2020
*/
package org.xwiki.display.internal;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class DocumentContentDisplayer_ESTest extends DocumentContentDisplayer_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
582e892075bb78691f9666d65ad87d4176a601d6
|
ed5159d056e98d6715357d0d14a9b3f20b764f89
|
/src/irvine/oeis/a040/A040024.java
|
cc5315cf728ab3f9afff1ca71067d8f69dd4281c
|
[] |
no_license
|
flywind2/joeis
|
c5753169cf562939b04dd246f8a2958e97f74558
|
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
|
refs/heads/master
| 2020-09-13T18:34:35.080552
| 2019-11-19T05:40:55
| 2019-11-19T05:40:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 523
|
java
|
package irvine.oeis.a040;
// Generated by gen_seq4.pl cfsqrt 30 at 2019-07-04 10:53
// DO NOT EDIT here!
import irvine.math.z.Z;
import irvine.oeis.ContinuedFractionOfSqrtSequence;
/**
* A040024 Continued fraction for <code>sqrt(30)</code>.
* @author Georg Fischer
*/
public class A040024 extends ContinuedFractionOfSqrtSequence {
/** Construct the sequence. */
public A040024() {
super(0, 30);
}
@Override
public Z next() {
final Z result = Z.valueOf(mB0);
iterate();
return result;
}
}
|
[
"sean.irvine@realtimegenomics.com"
] |
sean.irvine@realtimegenomics.com
|
5c3ca30934f545672c2a1ebc54c5bb84c10e49b4
|
56f6ce0eae24fa29ff2e018c68f84f715f3cdbc4
|
/worktest/src/main/java/com/mw/java/test/utils/MWCommonUtils.java
|
5dd211ec2ba8721caadca9a869b08eb1d7e754cc
|
[] |
no_license
|
Git2191866109/MyWorkTest
|
57852f5244342a235b06a67d88bd959ddce61f24
|
2a8281a3f88760b0a6dbe431fa0fd2a5ba96749e
|
refs/heads/master
| 2020-05-21T20:18:24.906806
| 2016-08-04T02:11:26
| 2016-08-04T02:11:26
| 62,592,440
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,148
|
java
|
package com.mw.java.test.utils;
import com.mw.java.test.Constant;
import org.junit.Test;
import java.io.*;
import java.util.Properties;
/**
* Created by mawei on 2016/6/23.
*/
public class MWCommonUtils {
/**
* 从jar包中读取文件
* this是不能在static(静态)方法或者static块中使用的,原因是static类型的方法或者代码块是属于类本身的,不属于某个对象,
* 而this本身就代表当前对象,而静态方法或者块调用的时候是不用初始化对象的。
*
* @param path
* @return
*/
public static String readFileInJar(String path) throws IOException {
// InputStream inputStream = MWCommonUtils.class.getResourceAsStream(path);
InputStream inputStream = Object.class.getResourceAsStream(path);
BufferedReader bufReader = new BufferedReader(new InputStreamReader(inputStream));
String sourceStr = Constant.EMPTY;
while ((sourceStr = bufReader.readLine()) != null) {
System.out.println(sourceStr.toString());
}
return sourceStr;
}
/**
* 读取Properties文件的例子
* File: TestProperties.java
*/
@Test
public void testProperties() throws IOException {
Properties prop = new Properties();
InputStream in = Object.class.getResourceAsStream("/properties/test.properties");
prop.load(in);
String value = prop.getProperty("key1").trim();
System.out.println(value);
}
/**
* 获取项目的相对路径下文件的绝对路径
* 目标文件的父目录,例如说,工程的目录下,有lib与bin和conf目录,那么程序运行于lib or
* bin,那么需要的配置文件却是conf里面,则需要找到该配置文件的绝对路径
* 文件名
*
* @return一个绝对路径
*/
@Test
public void testGetPath() {
String path = null;
String fileName = "CarParts";
String parentDir = "properties";
String userdir = System.getProperty("user.dir");
String userdirName = new File(userdir).getName();
if (userdirName.equalsIgnoreCase("lib") || userdirName.equalsIgnoreCase("bin")) {
File newf = new File(userdir);
File newp = new File(newf.getParent());
if (fileName.trim().equals("")) {
path = newp.getPath() + File.separator + parentDir;
} else {
path = newp.getPath() + File.separator + parentDir + File.separator + fileName;
}
} else {
if (fileName.trim().equals("")) {
path = userdir + File.separator + parentDir;
} else {
path = userdir + File.separator + parentDir + File.separator
+ fileName;
}
}
System.out.println(path);
// return path;
}
public static void main(String[] args) {
String path = "/template/carParts.txt";
try {
System.out.println(readFileInJar(path));
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
[
"2191866109@qq.com"
] |
2191866109@qq.com
|
9e74bec21e6706a17d8ac518dde6bb82908569db
|
5095b037518edb145fbecbe391fd14757f16c9b9
|
/gameserver/src/main/java/l2s/gameserver/network/l2/c2s/AddTradeItem.java
|
3953fbb75825e19cc6247973c3516776b4c398b3
|
[] |
no_license
|
merlin-tribukait/lindvior
|
ce7da0da95c3367b05e0230379411f3544f4d9f3
|
21a3138a43cc03c7d6b8922054b4663db8e63a49
|
refs/heads/master
| 2021-05-28T20:58:13.697507
| 2014-10-09T15:58:04
| 2014-10-09T15:58:04
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,264
|
java
|
package l2s.gameserver.network.l2.c2s;
import java.util.List;
import l2s.commons.math.SafeMath;
import l2s.gameserver.model.Player;
import l2s.gameserver.model.Request;
import l2s.gameserver.model.Request.L2RequestType;
import l2s.gameserver.model.items.ItemInstance;
import l2s.gameserver.model.items.TradeItem;
import l2s.gameserver.network.l2.components.SystemMsg;
import l2s.gameserver.network.l2.s2c.SendTradeDone;
import l2s.gameserver.network.l2.s2c.TradeOtherAdd;
import l2s.gameserver.network.l2.s2c.TradeOwnAdd;
import l2s.gameserver.network.l2.s2c.TradeUpdate;
public class AddTradeItem extends L2GameClientPacket
{
@SuppressWarnings("unused")
private int _tradeId;
private int _objectId;
private long _amount;
@Override
protected void readImpl()
{
_tradeId = readD(); // 1 ?
_objectId = readD();
_amount = readQ();
}
@Override
protected void runImpl()
{
Player parthner1 = getClient().getActiveChar();
if(parthner1 == null || _amount < 1)
return;
Request request = parthner1.getRequest();
if(request == null || !request.isTypeOf(L2RequestType.TRADE))
{
parthner1.sendActionFailed();
return;
}
if(!request.isInProgress())
{
request.cancel();
parthner1.sendPacket(SendTradeDone.FAIL);
parthner1.sendActionFailed();
return;
}
if(parthner1.isOutOfControl())
{
request.cancel();
parthner1.sendPacket(SendTradeDone.FAIL);
parthner1.sendActionFailed();
return;
}
Player parthner2 = request.getOtherPlayer(parthner1);
if(parthner2 == null)
{
request.cancel();
parthner1.sendPacket(SendTradeDone.FAIL);
parthner1.sendPacket(SystemMsg.THAT_PLAYER_IS_NOT_ONLINE);
parthner1.sendActionFailed();
return;
}
if(parthner2.getRequest() != request)
{
request.cancel();
parthner1.sendPacket(SendTradeDone.FAIL);
parthner1.sendActionFailed();
return;
}
if(request.isConfirmed(parthner1) || request.isConfirmed(parthner2))
{
parthner1.sendPacket(SystemMsg.YOU_MAY_NO_LONGER_ADJUST_ITEMS_IN_THE_TRADE_BECAUSE_THE_TRADE_HAS_BEEN_CONFIRMED);
parthner1.sendActionFailed();
return;
}
ItemInstance item = parthner1.getInventory().getItemByObjectId(_objectId);
if(item == null || !item.canBeTraded(parthner1))
{
parthner1.sendPacket(SystemMsg.THIS_ITEM_CANNOT_BE_TRADED_OR_SOLD);
return;
}
long count = Math.min(_amount, item.getCount());
List<TradeItem> tradeList = parthner1.getTradeList();
TradeItem tradeItem = null;
try
{
for(TradeItem ti : parthner1.getTradeList())
if(ti.getObjectId() == _objectId)
{
count = SafeMath.addAndCheck(count, ti.getCount());
count = Math.min(count, item.getCount());
ti.setCount(count);
tradeItem = ti;
break;
}
}
catch(ArithmeticException ae)
{
parthner1.sendPacket(SystemMsg.INCORRECT_ITEM_COUNT);
return;
}
if(tradeItem == null)
{
// добавляем новую вещь в список
tradeItem = new TradeItem(item);
tradeItem.setCount(count);
tradeList.add(tradeItem);
}
parthner1.sendPacket(new TradeOwnAdd(tradeItem, tradeItem.getCount()), new TradeUpdate(tradeItem, item.getCount() - tradeItem.getCount()));
parthner2.sendPacket(new TradeOtherAdd(tradeItem, tradeItem.getCount()));
}
}
|
[
"namlehong@gmail.com"
] |
namlehong@gmail.com
|
9b9c94f5240347e6d5d17af10a6fd0da8e2ae327
|
f5d5b368c1ae220b59cfb26bc26526b494c54d0e
|
/finalPhonecall/src/com/kd/phonecall/PhoneCallReceiver.java
|
75e379c00aa73f6961a9aeb94b6e60ca086a4eaa
|
[] |
no_license
|
kishordgupta/2012_bkup
|
3778c26082697b1cf223e27822d8efe90b35fc76
|
53ef4014fb3e11158c3f9242cb1f829e02e3ef69
|
refs/heads/master
| 2021-01-10T08:25:57.122415
| 2020-10-16T12:06:52
| 2020-10-16T12:06:52
| 47,512,520
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,339
|
java
|
package com.kd.phonecall;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import com.android.internal.telephony.ITelephony;
import com.lilakhelait.kishor.model.CallNumber;
import com.lilakhelait.kishor.resource.Wish;
import com.tmm.android.chuck.db.DBHelper;
import com.tmm.android.chuck.db.MyFile;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.SQLException;
import android.media.AudioManager;
import android.os.Handler;
import android.telephony.PhoneStateListener;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;
public class PhoneCallReceiver extends BroadcastReceiver {
Context context = null;
private static final String TAG = "Phone call";
ITelephony telephonyService;
TelephonyManager telephonyManager;
final static int callterminate=0;
final static int callwait =1;
final static int callok =2;
static int callstate = callwait;
public static int call=0;
public void data(Context cont)
{
CallNumber.values.clear();
DBHelper myDbHelper = new DBHelper(cont);
try {
myDbHelper.createDataBase();
} catch (IOException ioe) {
throw new Error("Unable to create database");
}
try {
myDbHelper.openDataBase();
}catch(SQLException sqle){
throw sqle;
}
CallNumber.values= myDbHelper.getQuestionSet();
myDbHelper.close();
MyFile f = new MyFile(cont);
String s= f.readFromSD();
String[] lines = s.split("\n");
for (String string : lines) {
Wish w = new Wish();
w.setTitle("unknown");
w.setWishtext(string);
CallNumber.values.add(w);
}
}
public static String incomm="";
@Override
public void onReceive(Context context, Intent arg1) {
TelephonyManager telephony = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
PhoneCallStateListener customPhoneListener = new PhoneCallStateListener(context);
telephony.listen(customPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);
/*callstate = callwait;
data(context);
Toast.makeText(context, CallNumber.values.size()+"", 5000).show();
// TODO Auto-generated method stub
telephonyManager = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(new PhoneCallListener(),
PhoneStateListener.LISTEN_CALL_STATE);
// Java Reflections
Class<?> c = null;
try {
c = Class.forName(telephonyManager.getClass().getName());
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Method m = null;
try {
m = c.getDeclaredMethod("getITelephony");
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
m.setAccessible(true);
try {
telephonyService = (ITelephony) m.invoke(telephonyManager);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
for (Wish s : CallNumber.values) {
// Log.i(LOG_TAG, "RINGING, number: " + s+ " " + incomingNumber);
if(s.getWishtext().contains(incomm))
{telephonyService.endCall();
callstate=callterminate;
break;
}
}
if(callstate==callwait)
callstate=callok;*/
/*
while(true)
{
if(callstate==callterminate)
{
callstate=callwait;
telephonyService.endCall();
break;
}
if(callstate==callok)
{callstate=callwait;
break;
}
}*/
}
public class PhoneCallStateListener extends PhoneStateListener {
private Context context;
public PhoneCallStateListener(Context context){
this.context = context;
data(context);
}
@Override
public void onCallStateChanged(int state, String incomingNumber) {
// SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
switch (state) {
case TelephonyManager.CALL_STATE_RINGING:
//String block_number = prefs.getString("block_number", null);
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
//Turn ON the mute
audioManager.setStreamMute(AudioManager.STREAM_RING, true);
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
try {
// Toast.makeText(context, "incoming number "+incomingNumber, Toast.LENGTH_LONG).show();
Class clazz = Class.forName(telephonyManager.getClass().getName());
Method method = clazz.getDeclaredMethod("getITelephony");
method.setAccessible(true);
ITelephony telephonyService = (ITelephony) method.invoke(telephonyManager);
//Checking incoming call number
//System.out.println("Call "+block_number);
for (Wish s : CallNumber.values) {
if (incomingNumber.toLowerCase().contains(s.getWishtext().toLowerCase())) {
//telephonyService.silenceRinger();//Security exception problem
telephonyService = (ITelephony) method.invoke(telephonyManager);
// telephonyService.silenceRinger();
if(call!=1)
telephonyService.endCall();
else
Toast.makeText(context, "This number is in blocked list accept anyway",Toast.LENGTH_LONG).show();
break;
}}
} catch (Exception e) {
Toast.makeText(context, e.toString(), Toast.LENGTH_LONG).show();
}
//Turn OFF the mute
audioManager.setStreamMute(AudioManager.STREAM_RING, false);
break;
case PhoneStateListener.LISTEN_CALL_STATE:
}
super.onCallStateChanged(state, incomingNumber);
}}
}
|
[
"kdgupta87@gmail.com"
] |
kdgupta87@gmail.com
|
ebaaad06b038f3fb237944104b3f7a486fbc1b99
|
645e3f242a587b722b4bc30c630eb70f5b9cc8ba
|
/stereo-mixedconfig/src/main/java/com/pcz/soundsystem/CDPlayerConfig.java
|
8faafeab2bde94ec4385652646b6c0f4db16b65d
|
[] |
no_license
|
picongzhi/spring-in-action
|
a4a595f85f6b5d6b5173e9f5484fa951ef5f9c1f
|
6cacb08dcca047764ec5b493c22398eb607db3fc
|
refs/heads/master
| 2020-08-12T04:14:52.682158
| 2020-01-17T11:58:13
| 2020-01-17T11:58:13
| 214,687,158
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 334
|
java
|
package com.pcz.soundsystem;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author picongzhi
*/
@Configuration
public class CDPlayerConfig {
@Bean
public CDPlayer cdPlayer(CompactDisc compactDisc) {
return new CDPlayer(compactDisc);
}
}
|
[
"picongzhi@gmail.com"
] |
picongzhi@gmail.com
|
86c47d2c474a3724cde0c06da58bc84190d7ebbe
|
2bb93eac032c795d9ab45db4bdbec9c240fa968c
|
/ratpack-core/src/main/java/ratpack/exec/SuccessPromise.java
|
fa8ca6a40cc29e331725fb2279d3499967aea3e1
|
[
"Apache-2.0"
] |
permissive
|
purplefox/ratpack
|
dbf131b27cffdd99c13bf24ef4266b3af25867ea
|
7ec27469b4a0facbd5612001e17a601e669345f7
|
refs/heads/master
| 2020-12-24T18:23:45.661945
| 2015-03-03T13:23:55
| 2015-03-03T13:23:55
| 31,599,379
| 0
| 0
| null | 2015-03-03T13:21:08
| 2015-03-03T13:21:08
| null |
UTF-8
|
Java
| false
| false
| 2,629
|
java
|
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ratpack.exec;
import ratpack.api.NonBlocking;
import ratpack.func.Action;
/**
* A promise of a successful outcome.
* <p>
* See {@link Promise}.
*
* @param <T> the type of the outcome object
* @see Promise
*/
public interface SuccessPromise<T> extends PromiseOperations<T> {
/**
* Specifies what should be done with the promised object when it becomes available.
*
* @param then the receiver of the promised value
*/
@NonBlocking
void then(Action<? super T> then);
/**
* Returns this success promise as a promise.
* <p>
* This method can be used to create a promise, when you have a success promise but need a promise.
* This can happen, for example, when using {@link #apply(ratpack.func.Function)}.
* <pre class="java">{@code
* import ratpack.exec.Promise;
* import ratpack.test.exec.ExecHarness;
*
* import java.util.Arrays;
* import java.util.LinkedList;
* import java.util.List;
*
* import static org.junit.Assert.assertEquals;
*
* public class Example {
* private static final List<String> LOG = new LinkedList<>();
*
* public static void main(String... args) throws Exception {
* ExecHarness.runSingle(e ->
* e.blocking(() -> { throw new Exception("bang!"); })
* .apply(Example::logErrors)
* .onError(t -> LOG.add("in onError: " + t.getMessage()))
* .then(t -> LOG.add("in then: " + t))
* );
*
* assertEquals(Arrays.asList("in logErrors: bang!"), LOG);
* }
*
* public static <T> Promise<T> logErrors(Promise<T> input) throws Exception {
* return input.onError(t -> LOG.add("in logErrors: " + t.getMessage())).toPromise();
* }
* }
* }</pre>
* <p>
* The error handling strategy defined as part of {@code this} success promise, supersedes any defined on the returned promise of this method.
*
* @return a newly created promise, from {@code this} success promise
*/
Promise<T> toPromise();
}
|
[
"ld@ldaley.com"
] |
ld@ldaley.com
|
086e2b9b358ae5c37d2982faef0bcd9448f5a722
|
61602d4b976db2084059453edeafe63865f96ec5
|
/com/xunlei/common/new_ptl/member/task/g/a$2.java
|
5da2b1a561ae91ab6df080d25b20bfd4287a15d0
|
[] |
no_license
|
ZoranLi/thunder
|
9d18fd0a0ec0a5bb3b3f920f9413c1ace2beb4d0
|
0778679ef03ba1103b1d9d9a626c8449b19be14b
|
refs/heads/master
| 2020-03-20T23:29:27.131636
| 2018-06-19T06:43:26
| 2018-06-19T06:43:26
| 137,848,886
| 12
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,712
|
java
|
package com.xunlei.common.new_ptl.member.task.g;
import com.xunlei.common.httpclient.BaseHttpClientListener;
/* compiled from: UserGetAuthQRCodeTask */
final class a$2 implements BaseHttpClientListener {
private /* synthetic */ a a;
a$2(a aVar) {
this.a = aVar;
}
public final void onSuccess(int r4, org.apache.http.Header[] r5, byte[] r6) {
/* JADX: method processing error */
/*
Error: java.lang.NullPointerException
*/
/*
r3 = this;
r5 = 200; // 0xc8 float:2.8E-43 double:9.9E-322;
if (r4 != r5) goto L_0x004b;
L_0x0004:
r4 = 1026; // 0x402 float:1.438E-42 double:5.07E-321;
r5 = new java.lang.String; Catch:{ NumberFormatException -> 0x0034 }
r5.<init>(r6); Catch:{ NumberFormatException -> 0x0034 }
r5 = java.lang.Integer.valueOf(r5); Catch:{ NumberFormatException -> 0x0034 }
r5 = r5.intValue(); Catch:{ NumberFormatException -> 0x0034 }
r0 = "UserGetAuthQRCodeTask"; Catch:{ NumberFormatException -> 0x0034 }
r1 = new java.lang.StringBuilder; Catch:{ NumberFormatException -> 0x0034 }
r2 = "get qr image error = "; Catch:{ NumberFormatException -> 0x0034 }
r1.<init>(r2); Catch:{ NumberFormatException -> 0x0034 }
r1.append(r5); Catch:{ NumberFormatException -> 0x0034 }
r5 = r1.toString(); Catch:{ NumberFormatException -> 0x0034 }
com.xunlei.common.base.XLLog.v(r0, r5); Catch:{ NumberFormatException -> 0x0034 }
r5 = r3.a; Catch:{ NumberFormatException -> 0x0034 }
r0 = 50331650; // 0x3000002 float:3.761583E-37 double:2.4867139E-316; Catch:{ NumberFormatException -> 0x0034 }
com.xunlei.common.new_ptl.member.task.g.a.b(r5, r0); Catch:{ NumberFormatException -> 0x0034 }
r5 = r3.a; Catch:{ NumberFormatException -> 0x0034 }
com.xunlei.common.new_ptl.member.task.g.a.a(r5, r4); Catch:{ NumberFormatException -> 0x0034 }
return;
L_0x0034:
r5 = "UserGetAuthQRCodeTask";
r0 = "get qr image succeed!";
com.xunlei.common.base.XLLog.v(r5, r0);
r5 = r3.a;
com.xunlei.common.new_ptl.member.task.g.a.a(r5, r6);
r5 = r3.a;
r6 = 0;
com.xunlei.common.new_ptl.member.task.g.a.b(r5, r6);
r5 = r3.a;
com.xunlei.common.new_ptl.member.task.g.a.a(r5, r4);
L_0x004b:
return;
*/
throw new UnsupportedOperationException("Method not decompiled: com.xunlei.common.new_ptl.member.task.g.a$2.onSuccess(int, org.apache.http.Header[], byte[]):void");
}
public final void onFailure(Throwable th, byte[] bArr) {
a.b(this.a, 50331650);
a.a(this.a, 1026);
}
}
|
[
"lizhangliao@xiaohongchun.com"
] |
lizhangliao@xiaohongchun.com
|
36c5a1542c39544eef518dd6f85e1e72d9dc8def
|
c84088fed6a7b4f392810bb166e66dbfe3df4286
|
/kycrm/src/main/java/com/yongjun/tdms/service/project/projectInfoPlan/ProjectInfoPlanManager.java
|
6a5b03085073f58dc39dbd26f2649c98df6481d1
|
[] |
no_license
|
1Will/Work1
|
4c419b9013d2989c4bbe6721c155de609e5ce9b5
|
16e707588da13e9dede5f7de97ca53e15a7d5a78
|
refs/heads/master
| 2020-05-22T16:52:56.501596
| 2018-03-20T01:21:01
| 2018-03-20T01:21:01
| 84,697,600
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,569
|
java
|
package com.yongjun.tdms.service.project.projectInfoPlan;
import com.yongjun.pluto.exception.DaoException;
import com.yongjun.tdms.model.project.projectInfoPlan.ProjectInfoPlan;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import org.apache.taglibs.standard.lang.jstl.Literal;
public abstract interface ProjectInfoPlanManager
{
public abstract void storeProjectInfoPlan(ProjectInfoPlan paramProjectInfoPlan);
public abstract void saveOrderNum(String id1,String id2);
public abstract ProjectInfoPlan loadProjectInfoPlan(Long paramLong);
public abstract List<ProjectInfoPlan> loadAllProjectInfoPlan(Long[] paramArrayOfLong);
public abstract List<ProjectInfoPlan> loadAllProjectInfoPlans();
public abstract void deleteProjectInfoPlan(ProjectInfoPlan paramProjectInfoPlan);
public abstract void deleteAllProjectInfoPlan(Collection<ProjectInfoPlan> paramCollection);
public abstract void disabledProjectInfoPlans(List<ProjectInfoPlan> paramList);
public abstract void enableProjectInfoPlans(List<ProjectInfoPlan> paramList);
public abstract List<ProjectInfoPlan> loadByKey(String paramString, Object paramObject)
throws DaoException;
public abstract List<ProjectInfoPlan> loadByKeyArray(String[] paramArrayOfString, Object[] paramArrayOfObject)
throws DaoException;
public abstract List loadForMyTeam(HashMap map);
public Integer loadMaxOrderNumber(HashMap map);//获取最大排序号
public List loadOrderProjectInfoPlan(HashMap map);//获取排序的工作计划列表
}
|
[
"287463504@qq.com"
] |
287463504@qq.com
|
672224723a73c0385b5fdf989a46cde7c82537e4
|
440e5bff3d6aaed4b07eca7f88f41dd496911c6b
|
/myapplication/src/main/java/com/vlocker/settings/cd.java
|
1a0ffb2e34024715ee785b6e8af7d9759c631cd7
|
[] |
no_license
|
freemanZYQ/GoogleRankingHook
|
4d4968cf6b2a6c79335b3ba41c1c9b80e964ddd3
|
bf9affd70913127f4cd0f374620487b7e39b20bc
|
refs/heads/master
| 2021-04-29T06:55:00.833701
| 2018-01-05T06:14:34
| 2018-01-05T06:14:34
| 77,991,340
| 7
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 282
|
java
|
package com.vlocker.settings;
import com.vlocker.ui.widget.bg;
class cd implements bg {
final /* synthetic */ RedPacketActivity a;
cd(RedPacketActivity redPacketActivity) {
this.a = redPacketActivity;
}
public void a() {
this.a.finish();
}
}
|
[
"zhengyuqin@youmi.net"
] |
zhengyuqin@youmi.net
|
df2ffe61d1841101e9fe788c4c42192655383370
|
3bc62f2a6d32df436e99507fa315938bc16652b1
|
/seam/src/test/testData/highlighting/BijectionIllegalScopeDeclaration.java
|
127cf573ec6c8a540d943fde90f13118990f5803
|
[
"Apache-2.0"
] |
permissive
|
JetBrains/intellij-obsolete-plugins
|
7abf3f10603e7fe42b9982b49171de839870e535
|
3e388a1f9ae5195dc538df0d3008841c61f11aef
|
refs/heads/master
| 2023-09-04T05:22:46.470136
| 2023-06-11T16:42:37
| 2023-06-11T16:42:37
| 184,035,533
| 19
| 29
|
Apache-2.0
| 2023-07-30T14:23:05
| 2019-04-29T08:54:54
|
Java
|
UTF-8
|
Java
| false
| false
| 2,615
|
java
|
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.ScopeType;
@Name("illegal_scope_test")
class BijectionIllegalScopeDeclaration {
@In(value="blog", create=true)
private void setBlog1(Blog blog) {}
@In(value="blog",create=true, scope=ScopeType.UNSPECIFIED)
private void setBlog2(Blog blog) {}
<error>@In(value="blog",create=true, scope=ScopeType.APPLICATION)</error>
private void setBlog3(Blog blog) {}
<error>@In(value="blog", create=true, scope=ScopeType.BUSINESS_PROCESS)</error>
private void setBlog4(Blog blog) {}
<error>@In(value="blog", create=true, scope=ScopeType.CONVERSATION)</error>
private void setBlog5(Blog blog) {}
<error>@In(value="blog", create=true, scope=ScopeType.EVENT)</error>
private void setBlog6(Blog blog) {}
<error>@In(value="blog", create=true, scope=ScopeType.PAGE)</error>
private void setBlog7(Blog blog) {}
<error>@In(value="blog", create=true, scope=ScopeType.STATELESS)</error>
private void setBlog8(Blog blog) {}
<error>@In(value="blog", create=true, scope=ScopeType.SESSION)</error>
private void setBlog9(Blog blog) {}
@Out(value="blog", scope = ScopeType.UNSPECIFIED)
private Blog b_1;
<error>@Out(value="blog", scope = ScopeType.APPLICATION)</error>
private Blog b_2;
<error>@Out(value="blog", scope = ScopeType.BUSINESS_PROCESS)</error>
private Blog b_3;
<error>@Out(value="blog", scope = ScopeType.CONVERSATION)</error>
private Blog b_4;
<error>@Out(value="blog", scope = ScopeType.EVENT)</error>
private Blog b_5;
<error>@Out(value="blog", scope = ScopeType.PAGE)</error>
private Blog b_6;
<error>@Out(value="blog", scope = ScopeType.STATELESS)</error>
private Blog b_7;
<error>@Out(value="blog", scope = ScopeType.SESSION)</error>
private Blog b_8;
@Out(value="blog_unknown1", scope = ScopeType.UNSPECIFIED)
private Blog b_11;
@Out(value="blog_unknown2", scope = ScopeType.APPLICATION)
private Blog b_12;
@Out(value="blog_unknown3", scope = ScopeType.BUSINESS_PROCESS)
private Blog b_13;
@Out(value="blog_unknown4", scope = ScopeType.CONVERSATION)
private Blog b_14;
@Out(value="blog_unknown5", scope = ScopeType.EVENT)
private Blog b_15;
@Out(value="blog_unknown6", scope = ScopeType.PAGE)
private Blog b_16;
@Out(value="blog_unknown7", scope = ScopeType.STATELESS)
private Blog b_17;
@Out(value="blog_unknown8", scope = ScopeType.SESSION)
private Blog b_18;
}
|
[
"yuriy.artamonov@jetbrains.com"
] |
yuriy.artamonov@jetbrains.com
|
fb99aa1b7798717e188c55c4d6ba3bc2e360220b
|
a4a2f08face8d49aadc16b713177ba4f793faedc
|
/flink-java/src/main/java/org/apache/flink/api/java/io/TupleCsvInputFormat.java
|
b4d7c5f4f0b86748c0529ceb3b08da577e23757e
|
[
"BSD-3-Clause",
"MIT",
"OFL-1.1",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
wyfsxs/blink
|
046d64afe81a72d4d662872c007251d94eb68161
|
aef25890f815d3fce61acb3d1afeef4276ce64bc
|
refs/heads/master
| 2021-05-16T19:05:23.036540
| 2020-03-27T03:42:35
| 2020-03-27T03:42:35
| 250,431,969
| 0
| 1
|
Apache-2.0
| 2020-03-27T03:48:25
| 2020-03-27T03:34:26
|
Java
|
UTF-8
|
Java
| false
| false
| 3,927
|
java
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.api.java.io;
import org.apache.flink.annotation.Internal;
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.java.typeutils.TupleTypeInfoBase;
import org.apache.flink.api.java.typeutils.runtime.TupleSerializerBase;
import org.apache.flink.core.fs.Path;
/**
* Input format that reads csv into tuples.
*/
@Internal
public class TupleCsvInputFormat<OUT> extends CsvInputFormat<OUT> {
private static final long serialVersionUID = 1L;
private TupleSerializerBase<OUT> tupleSerializer;
private TupleTypeInfoBase<OUT> tupleTypeInfo;
public TupleCsvInputFormat(Path filePath, TupleTypeInfoBase<OUT> tupleTypeInfo) {
this(filePath, DEFAULT_LINE_DELIMITER, DEFAULT_FIELD_DELIMITER, tupleTypeInfo);
}
public TupleCsvInputFormat(Path filePath, String lineDelimiter, String fieldDelimiter, TupleTypeInfoBase<OUT> tupleTypeInfo) {
this(filePath, lineDelimiter, fieldDelimiter, tupleTypeInfo, createDefaultMask(tupleTypeInfo.getArity()));
}
public TupleCsvInputFormat(Path filePath, TupleTypeInfoBase<OUT> tupleTypeInfo, int[] includedFieldsMask) {
this(filePath, DEFAULT_LINE_DELIMITER, DEFAULT_FIELD_DELIMITER, tupleTypeInfo, includedFieldsMask);
}
public TupleCsvInputFormat(Path filePath, String lineDelimiter, String fieldDelimiter, TupleTypeInfoBase<OUT> tupleTypeInfo, int[] includedFieldsMask) {
super(filePath);
boolean[] mask = (includedFieldsMask == null)
? createDefaultMask(tupleTypeInfo.getArity())
: toBooleanMask(includedFieldsMask);
configure(lineDelimiter, fieldDelimiter, tupleTypeInfo, mask);
}
public TupleCsvInputFormat(Path filePath, TupleTypeInfoBase<OUT> tupleTypeInfo, boolean[] includedFieldsMask) {
this(filePath, DEFAULT_LINE_DELIMITER, DEFAULT_FIELD_DELIMITER, tupleTypeInfo, includedFieldsMask);
}
public TupleCsvInputFormat(Path filePath, String lineDelimiter, String fieldDelimiter, TupleTypeInfoBase<OUT> tupleTypeInfo, boolean[] includedFieldsMask) {
super(filePath);
configure(lineDelimiter, fieldDelimiter, tupleTypeInfo, includedFieldsMask);
}
private void configure(String lineDelimiter, String fieldDelimiter,
TupleTypeInfoBase<OUT> tupleTypeInfo, boolean[] includedFieldsMask) {
if (tupleTypeInfo.getArity() == 0) {
throw new IllegalArgumentException("Tuple size must be greater than 0.");
}
if (includedFieldsMask == null) {
includedFieldsMask = createDefaultMask(tupleTypeInfo.getArity());
}
this.tupleTypeInfo = tupleTypeInfo;
tupleSerializer = (TupleSerializerBase<OUT>) tupleTypeInfo.createSerializer(new ExecutionConfig());
setDelimiter(lineDelimiter);
setFieldDelimiter(fieldDelimiter);
Class<?>[] classes = new Class<?>[tupleTypeInfo.getArity()];
for (int i = 0; i < tupleTypeInfo.getArity(); i++) {
classes[i] = tupleTypeInfo.getTypeAt(i).getTypeClass();
}
setFieldsGeneric(includedFieldsMask, classes);
}
@Override
public OUT fillRecord(OUT reuse, Object[] parsedValues) {
return tupleSerializer.createOrReuseInstance(parsedValues, reuse);
}
public TupleTypeInfoBase<OUT> getTupleTypeInfo() {
return tupleTypeInfo;
}
}
|
[
"yafei.wang@transwarp.io"
] |
yafei.wang@transwarp.io
|
6f31bfc74639e54b80dbedb3fe4477f306270a07
|
f27883bf0aeb2c65c1ea00035aea01059d2d5b37
|
/src/main/java/ru/patterns/creational/factory/FootballFaculty.java
|
04605a47ab5ff5e7c1869804ddf23e4266f56688
|
[
"Apache-2.0"
] |
permissive
|
Sir-Hedgehog/design_patterns
|
27e73fa83305d3cab903cabee110662379c7d433
|
c2b3d3355ad6d5e6d487c89a2705f3cbc09a662e
|
refs/heads/main
| 2023-05-29T03:55:02.590804
| 2021-06-02T20:15:10
| 2021-06-02T20:15:10
| 300,958,074
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 298
|
java
|
package ru.patterns.creational.factory;
/**
* @author Sir-Hedgehog (mailto:quaresma_08@mail.ru)
* @version 1.0
* @since 03.10.2020
*/
public class FootballFaculty implements SportsAcademy {
@Override
public Sportsman preparesSportsman() {
return new FootballPlayer();
}
}
|
[
"mailto:quaresma_08@mail.ru"
] |
mailto:quaresma_08@mail.ru
|
95656a476320a6ab88fe7206929071f68d723238
|
8534ea766585cfbd6986fd845e59a68877ecb15b
|
/com/slideme/sam/manager/view/touchme/C1976i.java
|
de4dfbbc63f032597bf4a71c8082c66787210020
|
[] |
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
| 613
|
java
|
package com.slideme.sam.manager.view.touchme;
import android.view.View;
import android.view.View.OnClickListener;
import com.slideme.sam.manager.R;
/* compiled from: ExpandableTextContainer */
class C1976i implements OnClickListener {
final /* synthetic */ ExpandableTextContainer f3830a;
C1976i(ExpandableTextContainer expandableTextContainer) {
this.f3830a = expandableTextContainer;
}
public void onClick(View view) {
this.f3830a.f3670a.m5948c();
this.f3830a.f3671b.setText(this.f3830a.f3670a.m5949d() ? R.string.expandable_less : R.string.expandable_more);
}
}
|
[
"shanzid.shaiham@gmail.com"
] |
shanzid.shaiham@gmail.com
|
ff6dbfd9b02dac1877078e024403fdbfb8fcf06f
|
a03878f6eb3eb89797a265d5ea55be08bf2295d2
|
/image-api/src/main/java/consulo/images/editor/ImageFileEditorState.java
|
43995630644e785fd74fac80a767c6213ccc8f79
|
[
"Apache-2.0"
] |
permissive
|
consulo/consulo-images
|
1bc40d846f9ea963acc5267f7c546bd158b6dab0
|
aa3956c705e17a2833d30aff4332d6a8c0f0a10a
|
refs/heads/master
| 2023-09-04T09:23:01.402712
| 2023-05-12T17:03:40
| 2023-05-12T17:03:40
| 13,677,472
| 0
| 0
|
Apache-2.0
| 2023-01-03T10:26:03
| 2013-10-18T12:29:11
|
Java
|
UTF-8
|
Java
| false
| false
| 3,421
|
java
|
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* 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 consulo.images.editor;
import consulo.fileEditor.FileEditorState;
import consulo.fileEditor.FileEditorStateLevel;
import consulo.fileEditor.TransferableFileEditorState;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* @author Konstantin Bulenkov
*/
public class ImageFileEditorState implements TransferableFileEditorState, Serializable {
private static final long serialVersionUID = -4470317464706072486L;
public static final String IMAGE_EDITOR_ID = "ImageEditor";
public static final String BACKGROUND_VISIBLE_OPTION = "backgroundVisible";
public static final String GRID_VISIBLE_OPTION = "gridVisible";
public static final String ZOOM_FACTOR_OPTION = "zoomFactor";
public static final String ZOOM_FACTOR_CHANGED_OPTION = "zoomFactorChanged";
private boolean backgroundVisible;
private boolean gridVisible;
private double zoomFactor;
private boolean zoomFactorChanged;
ImageFileEditorState(boolean backgroundVisible, boolean gridVisible, double zoomFactor, boolean zoomFactorChanged) {
this.backgroundVisible = backgroundVisible;
this.gridVisible = gridVisible;
this.zoomFactor = zoomFactor;
this.zoomFactorChanged = zoomFactorChanged;
}
@Override
public boolean canBeMergedWith(FileEditorState otherState, FileEditorStateLevel level) {
return otherState instanceof ImageFileEditorState;
}
public boolean isBackgroundVisible() {
return backgroundVisible;
}
public boolean isGridVisible() {
return gridVisible;
}
public double getZoomFactor() {
return zoomFactor;
}
public boolean isZoomFactorChanged() {
return zoomFactorChanged;
}
//@Override
public void setCopiedFromMasterEditor() {
zoomFactorChanged = true;
}
@Override
public String getEditorId() {
return IMAGE_EDITOR_ID;
}
@Override
public Map<String, String> getTransferableOptions() {
final HashMap<String, String> map = new HashMap<>();
map.put(BACKGROUND_VISIBLE_OPTION, String.valueOf(backgroundVisible));
map.put(GRID_VISIBLE_OPTION, String.valueOf(gridVisible));
map.put(ZOOM_FACTOR_OPTION, String.valueOf(zoomFactor));
map.put(ZOOM_FACTOR_CHANGED_OPTION, String.valueOf(zoomFactorChanged));
return map;
}
@Override
public void setTransferableOptions(Map<String, String> options) {
String o = options.get(BACKGROUND_VISIBLE_OPTION);
if (o != null) {
backgroundVisible = Boolean.valueOf(o);
}
o = options.get(GRID_VISIBLE_OPTION);
if (o != null) {
gridVisible = Boolean.valueOf(o);
}
o = options.get(ZOOM_FACTOR_OPTION);
if (o != null) {
zoomFactor = Double.parseDouble(o);
}
o = options.get(ZOOM_FACTOR_CHANGED_OPTION);
if (o != null) {
zoomFactorChanged = Boolean.valueOf(o);
}
}
}
|
[
"vistall.valeriy@gmail.com"
] |
vistall.valeriy@gmail.com
|
72f25fd834ec43b0dbd0a56a620d15b76b5b9a8f
|
8e44a9366800872e6147a027b61b9e07636da2ad
|
/l2j_server/src/main/java/com/l2jserver/gameserver/data/xml/impl/PlayerTemplateData.java
|
ad86ee008d0a605a48bf42f82bf3268f0c098d6a
|
[
"MIT"
] |
permissive
|
RollingSoftware/L2J_HighFive_Hardcore
|
6980a5e0f8111418bdc2739dd9f8b8abbc22aeff
|
c80436c130c795c590ce454835b9323162bec52b
|
refs/heads/master
| 2022-08-18T11:14:45.674987
| 2022-07-24T09:02:38
| 2022-07-24T09:02:38
| 120,417,466
| 0
| 0
|
MIT
| 2018-02-10T17:38:27
| 2018-02-06T07:25:26
|
Java
|
UTF-8
|
Java
| false
| false
| 6,353
|
java
|
/*
* Copyright (C) 2004-2016 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jserver.gameserver.data.xml.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import com.l2jserver.gameserver.model.Location;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.actor.templates.L2PcTemplate;
import com.l2jserver.gameserver.model.base.ClassId;
import com.l2jserver.util.data.xml.IXmlReader;
/**
* Loads player's base stats.
* @author Forsaiken, Zoey76, GKR
*/
public final class PlayerTemplateData implements IXmlReader
{
private final Map<ClassId, L2PcTemplate> _playerTemplates = new HashMap<>();
private int _dataCount = 0;
protected PlayerTemplateData()
{
load();
}
@Override
public void load()
{
_playerTemplates.clear();
parseDatapackDirectory("data/stats/chars/baseStats", false);
LOG.info("{}: Loaded {} character templates.", getClass().getSimpleName(), _playerTemplates.size());
LOG.info("{}: Loaded {} level up gain records.", getClass().getSimpleName(), _dataCount);
}
@Override
public void parseDocument(Document doc)
{
NamedNodeMap attrs;
int classId = 0;
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
if ("list".equalsIgnoreCase(n.getNodeName()))
{
for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
{
if ("classId".equalsIgnoreCase(d.getNodeName()))
{
classId = Integer.parseInt(d.getTextContent());
}
else if ("staticData".equalsIgnoreCase(d.getNodeName()))
{
StatsSet set = new StatsSet();
set.set("classId", classId);
List<Location> creationPoints = new ArrayList<>();
for (Node nd = d.getFirstChild(); nd != null; nd = nd.getNextSibling())
{
// Skip odd nodes
if (nd.getNodeName().equals("#text"))
{
continue;
}
if (nd.getChildNodes().getLength() > 1)
{
for (Node cnd = nd.getFirstChild(); cnd != null; cnd = cnd.getNextSibling())
{
// use L2CharTemplate(superclass) fields for male collision height and collision radius
if (nd.getNodeName().equalsIgnoreCase("collisionMale"))
{
if (cnd.getNodeName().equalsIgnoreCase("radius"))
{
set.set("collisionRadius", cnd.getTextContent());
}
else if (cnd.getNodeName().equalsIgnoreCase("height"))
{
set.set("collisionHeight", cnd.getTextContent());
}
}
if ("node".equalsIgnoreCase(cnd.getNodeName()))
{
attrs = cnd.getAttributes();
creationPoints.add(new Location(parseInteger(attrs, "x"), parseInteger(attrs, "y"), parseInteger(attrs, "z")));
}
else if ("walk".equalsIgnoreCase(cnd.getNodeName()))
{
set.set("baseWalkSpd", cnd.getTextContent());
}
else if ("run".equalsIgnoreCase(cnd.getNodeName()))
{
set.set("baseRunSpd", cnd.getTextContent());
}
else if ("slowSwim".equals(cnd.getNodeName()))
{
set.set("baseSwimWalkSpd", cnd.getTextContent());
}
else if ("fastSwim".equals(cnd.getNodeName()))
{
set.set("baseSwimRunSpd", cnd.getTextContent());
}
else if (!cnd.getNodeName().equals("#text"))
{
set.set((nd.getNodeName() + cnd.getNodeName()), cnd.getTextContent());
}
}
}
else
{
set.set(nd.getNodeName(), nd.getTextContent());
}
}
// calculate total pdef and mdef from parts
set.set("basePDef", (set.getInt("basePDefchest", 0) + set.getInt("basePDeflegs", 0) + set.getInt("basePDefhead", 0) + set.getInt("basePDeffeet", 0) + set.getInt("basePDefgloves", 0) + set.getInt("basePDefunderwear", 0) + set.getInt("basePDefcloak", 0)));
set.set("baseMDef", (set.getInt("baseMDefrear", 0) + set.getInt("baseMDeflear", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefrfinger", 0) + set.getInt("baseMDefneck", 0)));
_playerTemplates.put(ClassId.getClassId(classId), new L2PcTemplate(set, creationPoints));
}
else if ("lvlUpgainData".equalsIgnoreCase(d.getNodeName()))
{
for (Node lvlNode = d.getFirstChild(); lvlNode != null; lvlNode = lvlNode.getNextSibling())
{
if ("level".equalsIgnoreCase(lvlNode.getNodeName()))
{
attrs = lvlNode.getAttributes();
int level = parseInteger(attrs, "val");
for (Node valNode = lvlNode.getFirstChild(); valNode != null; valNode = valNode.getNextSibling())
{
String nodeName = valNode.getNodeName();
if ((nodeName.startsWith("hp") || nodeName.startsWith("mp") || nodeName.startsWith("cp")) && _playerTemplates.containsKey(ClassId.getClassId(classId)))
{
_playerTemplates.get(ClassId.getClassId(classId)).setUpgainValue(nodeName, level, Double.parseDouble(valNode.getTextContent()));
_dataCount++;
}
}
}
}
}
}
}
}
}
public L2PcTemplate getTemplate(ClassId classId)
{
return _playerTemplates.get(classId);
}
public L2PcTemplate getTemplate(int classId)
{
return _playerTemplates.get(ClassId.getClassId(classId));
}
public static final PlayerTemplateData getInstance()
{
return SingletonHolder._instance;
}
private static class SingletonHolder
{
protected static final PlayerTemplateData _instance = new PlayerTemplateData();
}
}
|
[
"zolotaryov.v.g@gmail.com"
] |
zolotaryov.v.g@gmail.com
|
baf50cb714d920f46cebc33aa76905dd5407341e
|
cde2cc5ddf47cef2de2e03c7fd63028ee02ec34f
|
/J2SE/session/j2ee/myjdbc/src/firstjdbc/ServiceImpl.java
|
ebfd7d22b1506e0d8bd23676d7ae4e0c416b177c
|
[] |
no_license
|
pratyushjava/Java_J2SE_J2EE
|
e93dd5ec75643149a79334f89e60ac7c56c1c20a
|
7fadcaa95d5fcba1a616a189dd65707c60572d77
|
refs/heads/master
| 2021-01-22T23:25:42.769072
| 2018-09-10T05:25:26
| 2018-09-10T05:25:26
| 85,630,861
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 903
|
java
|
package firstjdbc;
import java.sql.*;
public class ServiceImpl implements Service {
Createconnection c=new Createconnection();
Connection con;
@Override
public boolean insrt(Account a) {
boolean isCreated=false;
try{
con=c.getCon();
PreparedStatement pst=con.prepareStatement(Query.insert);
pst.setInt(1, a.getAccno());
pst.setString(2, a.getName());
pst.setDouble(3, a.getBalance());
if(pst.executeUpdate()==1)
{
isCreated=true;
}
}
catch (Exception e) {
e.printStackTrace();
}
return isCreated;
}
@Override
public void delete(int accno) {
// TODO Auto-generated method stub
}
@Override
public void update(Account a) {
// TODO Auto-generated method stub
}
@Override
public void retrive(int accno) {
// TODO Auto-generated method stub
}
@Override
public void retrivAll() {
// TODO Auto-generated method stub
}
}
|
[
"pratyus@g.clemson.edu"
] |
pratyus@g.clemson.edu
|
a34f787bb25ab99db963aad7d22587829591d171
|
092c76fcc6c411ee77deef508e725c1b8277a2fe
|
/hybris/bin/ext-commerce/commerceservices/src/de/hybris/platform/commerceservices/search/solrfacetsearch/strategies/exceptions/NoValidSolrConfigException.java
|
1738611d03a4b20508dba0b950d974faf569a4cf
|
[
"MIT"
] |
permissive
|
BaggaShivanshu2/hybris-bookstore-tutorial
|
4de5d667bae82851fe4743025d9cf0a4f03c5e65
|
699ab7fd8514ac56792cb911ee9c1578d58fc0e3
|
refs/heads/master
| 2022-11-28T12:15:32.049256
| 2020-08-05T11:29:14
| 2020-08-05T11:29:14
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 913
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package de.hybris.platform.commerceservices.search.solrfacetsearch.strategies.exceptions;
import de.hybris.platform.commerceservices.search.solrfacetsearch.strategies.SolrFacetSearchConfigSelectionStrategy;
/**
* Throws when {@link SolrFacetSearchConfigSelectionStrategy} cannot resolve suitable solr index config for the current
* context.
*
*
*
*/
public class NoValidSolrConfigException extends Exception
{
/**
* @param message
*/
public NoValidSolrConfigException(final String message)
{
super(message);
}
}
|
[
"xelilim@hotmail.com"
] |
xelilim@hotmail.com
|
105bcf2c1725bbcd0a412e1573b22f571f417cc1
|
ddc6a947c1e56465e89d9275ae16d0bad048cb67
|
/server/SynaptixMyBatis/src/main/java/com/synaptix/mybatis/cache/SynchronizedSynaptixCache.java
|
b2353c198de6f1687075d1d1382485a7274e5531
|
[] |
no_license
|
TalanLabs/SynaptixLibs
|
15ad37af6fd575f6e366deda761ba650d9e18237
|
cbff7279e1f2428754fce3d83fcec5a834898747
|
refs/heads/master
| 2020-03-22T16:08:53.617289
| 2018-03-07T16:07:22
| 2018-03-07T16:07:22
| 140,306,435
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,596
|
java
|
package com.synaptix.mybatis.cache;
import java.util.concurrent.locks.ReadWriteLock;
class SynchronizedSynaptixCache implements ISynaptixCache {
private ISynaptixCache delegate;
public SynchronizedSynaptixCache(ISynaptixCache delegate) {
this.delegate = delegate;
}
public String getId() {
return delegate.getId();
}
public int getSize() {
acquireReadLock();
try {
return delegate.getSize();
} finally {
releaseReadLock();
}
}
public void putObject(Object key, Object object) {
acquireWriteLock();
try {
delegate.putObject(key, object);
} finally {
releaseWriteLock();
}
}
public Object getObject(Object key) {
acquireReadLock();
try {
return delegate.getObject(key);
} finally {
releaseReadLock();
}
}
public Object removeObject(Object key) {
acquireWriteLock();
try {
return delegate.removeObject(key);
} finally {
releaseWriteLock();
}
}
public void clear(boolean fire) {
acquireWriteLock();
try {
delegate.clear(fire);
} finally {
releaseWriteLock();
}
}
public ReadWriteLock getReadWriteLock() {
return delegate.getReadWriteLock();
}
public int hashCode() {
return delegate.hashCode();
}
public boolean equals(Object obj) {
return delegate.equals(obj);
}
private void acquireReadLock() {
getReadWriteLock().readLock().lock();
}
private void releaseReadLock() {
getReadWriteLock().readLock().unlock();
}
private void acquireWriteLock() {
getReadWriteLock().writeLock().lock();
}
private void releaseWriteLock() {
getReadWriteLock().writeLock().unlock();
}
}
|
[
"gabriel.allaigre@synaptix-labs.com"
] |
gabriel.allaigre@synaptix-labs.com
|
86ece977bbfc0966b947dfa77f231431680a813a
|
8063dedc9dfbabbf95a4f29dbedef62bec67439c
|
/gvr-avatar/app/src/main/java/org/gearvrf/avatardemo/AvatarManager.java
|
600645019fcd6953c0b764e3e87ec024e20e0943
|
[] |
no_license
|
NolaDonato/GearVRf-Demos
|
4ce296f6edc6fc7302bb7596e3548630a3794cd3
|
ef28146ff3efd528c931cbd153b6d4bc8fc5b14a
|
refs/heads/master
| 2020-04-05T14:32:48.885692
| 2018-12-05T03:15:01
| 2018-12-05T03:15:01
| 53,160,807
| 1
| 0
| null | 2018-11-05T21:10:38
| 2016-03-04T19:37:40
|
Java
|
UTF-8
|
Java
| false
| false
| 6,892
|
java
|
package org.gearvrf.avatardemo;
import android.util.Log;
import org.gearvrf.GVRAndroidResource;
import org.gearvrf.GVRContext;
import org.gearvrf.GVRMain;
import org.gearvrf.GVRSceneObject;
import org.gearvrf.animation.GVRAnimation;
import org.gearvrf.animation.GVRAnimator;
import org.gearvrf.animation.GVRAvatar;
import org.gearvrf.animation.GVRRepeatMode;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
public class AvatarManager extends GVRMain
{
private static final String TAG = "AVATAR";
private final String[] YBOT = new String[] { "YBot/ybot.fbx", "animation/mixamo/mixamo_map.txt", "YBot/Football_Hike_mixamo.com.bvh", "YBot/Zombie_Stand_Up_mixamo.com.bvh" };
private final String[] EVA = { "Eva/Eva.dae", "Eva/pet_map.txt", "Eva/bvhExport_GRAB_BONE.bvh", "Eva/bvhExport_RUN.bvh", "Eva/bvhExport_WALK.bvh" };
private final String[] CAT = { "Cat/Cat.fbx", "animation/mixamo/pet_map.txt", "Cat/defaultAnim_SitDown.bvh", "Cat/defaultAnim_StandUp.bvh", "Cat/defaultAnim_Walk.bvh" };
private final String[] HLMODEL = new String[] { "/sdcard/hololab.ply" };
private final List<String[]> mAvatarFiles = new ArrayList<String[]>();
private final List<GVRAvatar> mAvatars = new ArrayList<GVRAvatar>();
private int mAvatarIndex = -1;
private int mNumAnimsLoaded = 0;
private String mBoneMap = null;
private GVRContext mContext;
private GVRAvatar.IAvatarEvents mEventHandler;
AvatarManager(GVRContext ctx, GVRAvatar.IAvatarEvents handler)
{
mContext = ctx;
if (handler == null)
{
handler = mAvatarListener;
}
mEventHandler = handler;
mAvatarFiles.add(0, EVA);
mAvatarFiles.add(1, YBOT);
mAvatarFiles.add(2, CAT);
mAvatars.add(0, new GVRAvatar(ctx, "EVA"));
mAvatars.add(1, new GVRAvatar(ctx, "YBOT"));
mAvatars.add(2, new GVRAvatar(ctx, "CAT"));
selectAvatar("EVA");
}
public GVRAvatar selectAvatar(String name)
{
for (int i = 0; i < mAvatars.size(); ++i)
{
GVRAvatar avatar = mAvatars.get(i);
if (name.equals(avatar.getName()))
{
if (mAvatarIndex == i)
{
return avatar;
}
unselectAvatar();
mAvatarIndex = i;
mNumAnimsLoaded = avatar.getAnimationCount();
if ((avatar.getSkeleton() == null) &&
(mEventHandler != null))
{
avatar.getEventReceiver().addListener(mEventHandler);
}
if (mNumAnimsLoaded == 0)
{
String mapFile = getMapFile();
if (mapFile != null)
{
mBoneMap = readFile(mapFile);
}
else
{
mBoneMap = null;
}
}
return avatar;
}
}
return null;
}
private void unselectAvatar()
{
if (mAvatarIndex >= 0)
{
GVRAvatar avatar = getAvatar();
avatar.stop();
mNumAnimsLoaded = 0;
mBoneMap = null;
}
}
public GVRAvatar getAvatar()
{
return mAvatars.get(mAvatarIndex);
}
public String getModelFile()
{
return mAvatarFiles.get(mAvatarIndex)[0];
}
public String getMapFile()
{
String[] files = mAvatarFiles.get(mAvatarIndex);
if (files.length < 2)
{
return null;
}
return files[1];
}
public String getAnimFile(int animIndex)
{
String[] files = mAvatarFiles.get(mAvatarIndex);
if (animIndex + 2 > files.length)
{
return null;
}
return files[2 + animIndex];
}
public int getAvatarIndex(GVRAvatar avatar)
{
return mAvatars.indexOf(avatar);
}
public GVRAvatar getAvatar(String name)
{
for (GVRAvatar a : mAvatars)
{
if (name.equals(a.getName()))
{
return a;
}
}
return null;
}
public boolean loadModel()
{
GVRAndroidResource res = null;
GVRAvatar avatar = getAvatar();
try
{
res = new GVRAndroidResource(mContext, getModelFile());
}
catch (IOException ex)
{
ex.printStackTrace();
return false;
}
avatar.loadModel(res);
return true;
}
public boolean loadNextAnimation()
{
String animFile = getAnimFile(mNumAnimsLoaded);
if ((animFile == null) || (mBoneMap == null))
{
return false;
}
try
{
GVRAndroidResource res = new GVRAndroidResource(mContext, animFile);
++mNumAnimsLoaded;
getAvatar().loadAnimation(res, mBoneMap);
return true;
}
catch (IOException ex)
{
ex.printStackTrace();
Log.e(TAG, "Animation could not be loaded from " + animFile);
return false;
}
}
private String readFile(String filePath)
{
try
{
GVRAndroidResource res = new GVRAndroidResource(mContext, filePath);
InputStream stream = res.getStream();
byte[] bytes = new byte[stream.available()];
stream.read(bytes);
String s = new String(bytes);
return s;
}
catch (IOException ex)
{
return null;
}
}
public GVRAvatar.IAvatarEvents mAvatarListener = new GVRAvatar.IAvatarEvents()
{
@Override
public void onAvatarLoaded(final GVRAvatar avatar, final GVRSceneObject avatarRoot, String filePath, String errors)
{
GVRSceneObject.BoundingVolume bv = avatarRoot.getBoundingVolume();
float scale = 0.3f / bv.radius;
avatarRoot.getTransform().setScale(scale, scale, scale);
loadNextAnimation();
}
@Override
public void onAnimationLoaded(GVRAvatar avatar, GVRAnimator animation, String filePath, String errors)
{
if (animation != null)
{
animation.setRepeatMode(GVRRepeatMode.ONCE);
animation.setSpeed(1f);
}
}
public void onModelLoaded(GVRAvatar avatar, GVRSceneObject avatarRoot, String filePath, String errors) { }
public void onAnimationFinished(GVRAvatar avatar, GVRAnimator animator, GVRAnimation animation) { }
public void onAnimationStarted(GVRAvatar avatar, GVRAnimator animator) { }
};
}
|
[
"m.marinov@samsung.com"
] |
m.marinov@samsung.com
|
51b6b48f01e53ccdcc67c6dc8c19c9f4905d1350
|
4b1c77cf30378b2c5b7e90e4f4dc41211da2a9c1
|
/commons/src/main/java/com/nstepa/wc/commons/utils/MD5Encrypt.java
|
eeaa378c1c0fb38c0775663c6cd2aecb6c2dfe03
|
[] |
no_license
|
henry201605/mashangdao-server
|
d6a42c400c00a6933d05e697317ce56bb87925ad
|
d377ab237e4ddd9686ee717a23c6595480b9fd32
|
refs/heads/master
| 2020-04-08T18:07:01.219352
| 2018-12-11T10:25:05
| 2018-12-11T10:25:05
| 159,593,986
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,230
|
java
|
package com.nstepa.wc.commons.utils;
public class MD5Encrypt {
public static String encrypt(String value) {
return byte2hex(byte2hex(value));
}
private static String byte2hex(String value) {
try {
java.security.MessageDigest alg = java.security.MessageDigest
.getInstance("MD5");
alg.update(value.getBytes());
byte[] b = alg.digest();
String hs = "";
String stmp = "";
for (int n = 0; n < b.length; n++) {
stmp = (Integer.toHexString(b[n] & 0XFF));
if (stmp.length() == 1)
hs = hs + "0" + stmp;
else
hs = hs + stmp;
}
String temp = hs.toUpperCase();
StringBuffer output = new StringBuffer(temp.substring(23, 26))
.append(temp.substring(1, 3))
.append(temp.substring(20, 21))
.append(temp.substring(21, 23))
.append(temp.substring(10, 11))
.append(temp.substring(26, 30))
.append(temp.substring(16, 20))
.append(temp.substring(30, 32))
.append(temp.substring(0, 1))
.append(temp.substring(13, 16))
.append(temp.substring(3, 6))
.append(temp.substring(11, 13))
.append(temp.substring(6, 10));
return output.toString();
} catch (java.security.NoSuchAlgorithmException ex) {
return "";
}
}
}
|
[
"zhangwei2017@unipus.cn"
] |
zhangwei2017@unipus.cn
|
cd3596c43ade22b37852f352fe48152453252293
|
78044296f15994a250a76cccf75b8eaa35b01504
|
/rest-model/src/main/java/com/gentics/mesh/core/rest/schema/impl/MicroschemaReferenceImpl.java
|
a1fe6c97c641240cc8fa10365fbff3ca2339a4ec
|
[
"Apache-2.0"
] |
permissive
|
reltreug/mesh
|
b1e6aa9efd3b92c346d055c54c1a14c0fdbb3d08
|
426d0e7fd76dfb6e277d2db33639caa809e923ff
|
refs/heads/master
| 2020-04-30T03:24:02.409602
| 2019-03-19T20:24:47
| 2019-03-19T20:24:47
| 176,585,438
| 0
| 0
|
Apache-2.0
| 2019-03-19T19:35:10
| 2019-03-19T19:35:09
| null |
UTF-8
|
Java
| false
| false
| 865
|
java
|
package com.gentics.mesh.core.rest.schema.impl;
import com.gentics.mesh.core.rest.common.AbstractNameUuidReference;
import com.gentics.mesh.core.rest.schema.MicroschemaReference;
/**
* POJO that is used to model a microschema reference within a node. Only the name or the uuid of the microschema must be supplied when this reference is being
* used within a node create request / node update request.
*/
public class MicroschemaReferenceImpl extends AbstractNameUuidReference<MicroschemaReference> implements MicroschemaReference {
private String version;
@Override
public String getVersion() {
return version;
}
@Override
public MicroschemaReference setVersion(String version) {
this.version = version;
return this;
}
@Override
public String toString() {
return super.toString() + "-version:" + version;
}
}
|
[
"j.schueth@gentics.com"
] |
j.schueth@gentics.com
|
eb54230ede3d8e7933b40fc13571532170d1b26e
|
dee407e7d56c3591e93400685b75900bc91d97fb
|
/mobileoa2.0/.svn/pristine/0d/0deced1a303595bc298d1f3cbf4eab17763f8142.svn-base
|
5be74c5934275109ce4ebafe26d276cab5b5575a
|
[] |
no_license
|
chengyue5923/android-OaCode
|
20777c4ec319f990e05fd6443f3b5bebde7a57ef
|
c93b2673be33e203413eba05966d9348dd28f0ca
|
refs/heads/master
| 2021-01-14T08:13:49.651060
| 2017-02-15T05:20:26
| 2017-02-15T05:20:26
| 82,023,114
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 465
|
package com.idxk.mobileoa.model.bean;
/**
* Created by lenovo on 2015/3/9.
*/
public class CommandListItemBean {
public String personName; //显示人名字
public String personUrl; //图片地址
public String personContent; //显示的内容
public String personPraise; //赞
public String personReply; //回复
public String personTime; //显示时间
public String bigPhotoUrl; //大图片
public String feedId; //微博Id
}
|
[
"chengyue5923@163.com"
] |
chengyue5923@163.com
|
|
1a7ae6b117bebadb8c0dac306dd742bafcc8afea
|
a7cbdf02527ab9eafdfbfa64184fdfda58f4133a
|
/src/main/java/org/wcardinal/controller/data/internal/SQueueIterator.java
|
b8c11aab07c24cbac6e6adb0f77b3122f41e099e
|
[
"Apache-2.0"
] |
permissive
|
kagechan/winter-cardinal
|
d38631be1acbd5b416dd999ae579e87d2fccb20e
|
8e947c0ae099fc5d00b7bbdd93e786da5b33fe99
|
refs/heads/master
| 2022-11-17T00:12:41.241165
| 2020-03-11T05:30:28
| 2020-03-11T05:30:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 964
|
java
|
/*
* Copyright (C) 2019 Toshiba Corporation
* SPDX-License-Identifier: Apache-2.0
*/
package org.wcardinal.controller.data.internal;
import java.util.Iterator;
import java.util.Queue;
import org.wcardinal.util.thread.AutoCloseableReentrantLock;
class SQueueIterator<V> implements java.util.Iterator<V> {
final Iterator<V> internalIterator;
final AutoCloseableReentrantLock lock;
SQueueIterator( final SContainer<?, ?> container, final Queue<V> queue, final Queue<V> internalQueue ){
this.lock = container.getLock();
this.internalIterator = internalQueue.iterator();
}
@Override
public boolean hasNext() {
try( final AutoCloseableReentrantLock closeable = lock.open() ) {
return internalIterator.hasNext();
}
}
@Override
public V next() {
try( final AutoCloseableReentrantLock closeable = lock.open() ) {
return internalIterator.next();
}
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
}
|
[
"masashi.kojo@toshiba.co.jp"
] |
masashi.kojo@toshiba.co.jp
|
80e931f7799de79c08065933186f0b3b2b5367b1
|
1ec62a7e351ed029b2141ee01432d2fc8c44f43a
|
/java/isemba/Applet/j316/j316.java
|
ccc5ca3a93ad081aaa9f31693813237ba0470e6f
|
[] |
no_license
|
hataka/codingground
|
7a1b555d13b8e42320f5f5e4898664191da16a47
|
53d2b204ae2e0fb13bd6d293e07c68066226e26b
|
refs/heads/master
| 2021-01-20T01:34:16.778320
| 2019-02-02T04:27:14
| 2019-02-02T04:27:14
| 89,292,259
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,392
|
java
|
// -*- mode: java -*- Time-stamp: <2009-06-20 17:10:09 kahata>
/*====================================================================
* name: j316.java
* created : Time-stamp: <09/06/20(土) 15:52:08 hata>
* $Id$
* Programmed by kahata
* To compile:
* To run: JavaAppletApplication
* links: http://jubilo.cis.ibaraki.ac.jp/~isemba/PROGRAM/JAVA/java.shtml
* http://jubilo.cis.ibaraki.ac.jp/~isemba/PROGRAM/JAVA/APPLET/j316.htm
* description:
* ====================================================================*/
////////////////////////////////////////////////////////////////////////////////
// << j316.java >>
//
// アプレット(1):グラフィックス(複写)
//
// 市松模様を描く。
//
// ●Graphicsクラスのメソッド
// public abstract void copyArea(int x,int y,int w,int h,int dx,int dy)
// 機能:領域の複写。
// x :複写元の左上隅のx座標
// y :複写元の左上隅のy座標
// w :複写元の幅。
// h :複写元の高さ。
// dx:x座標の移動量。
// dy:y座標の移動量。
//
////////////////////////////////////////////////////////////////////////////////
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Color;
public class j316 extends Applet {
public void init() {
// アプレットの背景色を灰色に設定。
this.setBackground(Color.lightGray);
}
public void paint(Graphics g) {
// オレンジ領域の複写。
int x=30, y=30, h=30, n=5;
g.setColor(Color.orange); g.fillRect(x,y,h,h);
for( int i=1; i<=n; i++ ) { // 行。
for( int j=1; j<=n; j++ ) { // 列。
if( (i+j)%2 == 0 ) {
// 複写。
g.copyArea(x,y,h,h,(j-1)*h,(i-1)*h);
}
}
}
// グリーン領域の複写。
x=60; y=30;
g.setColor(Color.green); g.fillRect(x,y,h,h);
for( int i=1; i<=n; i++ ) { // 行。
for( int j=1; j<=n; j++ ) { // 列。
if( (i+j)%2 == 1 ) {
// 複写。
g.copyArea(x,y,h,h,(j-2)*h,(i-1)*h);
}
}
}
}
}
/*
<!-- HTMLファイル -->
<html>
<head>
<title>アプレット</title>
</head>
<body bgcolor=white text=black>
<applet code="j316.class" width="300" height="200">
</applet>
</body>
</html>
*/
|
[
"kazuhiko.hata@nifty.com"
] |
kazuhiko.hata@nifty.com
|
26bd63c4c70f7dbc93dd428793308d9c35876093
|
a4d8c26ae319bbf176d5356b26192dc20314550a
|
/src/main/java/com/cn/leedane/model/ChatBgBean.java
|
a5e7900e46cf5276aa540c394560a82ac984de53
|
[] |
no_license
|
sengeiou/leedaneSpringBoot
|
419e51686ec52e504ebc3a0677ecfec40b69ba2a
|
7e85b93969a79e06d6e8ad78fab6f313021833dd
|
refs/heads/master
| 2023-01-23T02:10:21.351012
| 2020-05-28T11:38:22
| 2020-05-28T11:38:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,041
|
java
|
package com.cn.leedane.model;
/**
* 聊天背景的实体bean
* @author LeeDane
* 2016年7月12日 上午10:40:36
* Version 1.0
*/
//@Table(name="T_CHAT_BG")
public class ChatBgBean extends RecordTimeBean{
private static final long serialVersionUID = 1L;
private String path; //背景图像的路径
private String chatBgDesc ; //聊天背景的描述
private int type; //聊天背景的类型,0:免费,1:收费, 2:全部
private int score; //当是收费类型的时候需要扣除的积分(收费的时候这个字段必填)
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
//@Column(name="chat_bg_desc")
public String getChatBgDesc() {
return chatBgDesc;
}
public void setChatBgDesc(String chatBgDesc) {
this.chatBgDesc = chatBgDesc;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getScore() {
return score;
}
public void setScore(int score) {
this.score = score;
}
}
|
[
"825711424@qq.com"
] |
825711424@qq.com
|
a6a169e6fa89d98878fbb5b89a109de3760e0928
|
947fc9eef832e937f09f04f1abd82819cd4f97d3
|
/src/apk/androidx/appcompat/app/C.java
|
8fd0f45dc6f89252b70e32d700543302a1b93eae
|
[] |
no_license
|
thistehneisen/cifra
|
04f4ac1b230289f8262a0b9cf7448a1172d8f979
|
d46c6f4764c9d4f64e45c56fa42fddee9b44ff5a
|
refs/heads/master
| 2020-09-22T09:35:57.739040
| 2019-12-01T19:39:59
| 2019-12-01T19:39:59
| 225,136,583
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,796
|
java
|
package androidx.appcompat.app;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import b.a.d.b;
import b.g.i.C0244e;
import b.g.i.C0244e.a;
/* compiled from: AppCompatDialog */
public class C extends Dialog implements o {
/* renamed from: a reason: collision with root package name */
private p f413a;
/* renamed from: b reason: collision with root package name */
private final a f414b = new B(this);
public C(Context context, int i2) {
super(context, a(context, i2));
a().a((Bundle) null);
a().a();
}
public boolean a(int i2) {
return a().b(i2);
}
public void addContentView(View view, LayoutParams layoutParams) {
a().a(view, layoutParams);
}
public boolean dispatchKeyEvent(KeyEvent keyEvent) {
return C0244e.a(this.f414b, getWindow().getDecorView(), this, keyEvent);
}
public <T extends View> T findViewById(int i2) {
return a().a(i2);
}
public void invalidateOptionsMenu() {
a().g();
}
/* access modifiers changed from: protected */
public void onCreate(Bundle bundle) {
a().f();
super.onCreate(bundle);
a().a(bundle);
}
/* access modifiers changed from: protected */
public void onStop() {
super.onStop();
a().k();
}
public void onSupportActionModeFinished(b bVar) {
}
public void onSupportActionModeStarted(b bVar) {
}
public b onWindowStartingSupportActionMode(b.a aVar) {
return null;
}
public void setContentView(int i2) {
a().c(i2);
}
public void setTitle(CharSequence charSequence) {
super.setTitle(charSequence);
a().a(charSequence);
}
public p a() {
if (this.f413a == null) {
this.f413a = p.a((Dialog) this, (o) this);
}
return this.f413a;
}
public void setContentView(View view) {
a().a(view);
}
public void setContentView(View view, LayoutParams layoutParams) {
a().b(view, layoutParams);
}
public void setTitle(int i2) {
super.setTitle(i2);
a().a((CharSequence) getContext().getString(i2));
}
private static int a(Context context, int i2) {
if (i2 != 0) {
return i2;
}
TypedValue typedValue = new TypedValue();
context.getTheme().resolveAttribute(b.a.a.dialogTheme, typedValue, true);
return typedValue.resourceId;
}
/* access modifiers changed from: 0000 */
public boolean a(KeyEvent keyEvent) {
return super.dispatchKeyEvent(keyEvent);
}
}
|
[
"putnins@nils.digital"
] |
putnins@nils.digital
|
c01fbf0e8d9413c15f63c0f2a35bb5d5d8a56f04
|
5d49e39b3d6473b01b53b1c50397b2ab3e2c47b3
|
/Enterprise Projects/ips-outward-producer/src/main/java/com/combank/ips/outward/producer/model/camt_052_001/TaxAmount2.java
|
a51c5bc9a668b05b2615d8edaabd419e6f2047d0
|
[] |
no_license
|
ThivankaWijesooriya/Developer-Mock
|
54524e4319457fddc1050bfdb0b13c39c54017aa
|
3acbaa98ff4b64fe226bcef0f3e69d6738bdbf65
|
refs/heads/master
| 2023-03-02T04:14:18.253449
| 2023-01-28T05:54:06
| 2023-01-28T05:54:06
| 177,391,319
| 0
| 0
| null | 2020-01-08T17:26:30
| 2019-03-24T08:56:29
|
CSS
|
UTF-8
|
Java
| false
| false
| 4,739
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2022.08.22 at 12:41:17 AM IST
//
package com.combank.ips.outward.producer.model.camt_052_001;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import iso.std.iso._20022.tech.xsd.camt_052_001.ActiveOrHistoricCurrencyAndAmount;
import iso.std.iso._20022.tech.xsd.camt_052_001.TaxRecordDetails2;
/**
* <p>Java class for TaxAmount2 complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="TaxAmount2">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Rate" type="{urn:iso:std:iso:20022:tech:xsd:camt.052.001.08}PercentageRate" minOccurs="0"/>
* <element name="TaxblBaseAmt" type="{urn:iso:std:iso:20022:tech:xsd:camt.052.001.08}ActiveOrHistoricCurrencyAndAmount" minOccurs="0"/>
* <element name="TtlAmt" type="{urn:iso:std:iso:20022:tech:xsd:camt.052.001.08}ActiveOrHistoricCurrencyAndAmount" minOccurs="0"/>
* <element name="Dtls" type="{urn:iso:std:iso:20022:tech:xsd:camt.052.001.08}TaxRecordDetails2" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TaxAmount2", propOrder = {
"rate",
"taxblBaseAmt",
"ttlAmt",
"dtls"
})
public class TaxAmount2 {
@XmlElement(name = "Rate")
protected BigDecimal rate;
@XmlElement(name = "TaxblBaseAmt")
protected ActiveOrHistoricCurrencyAndAmount taxblBaseAmt;
@XmlElement(name = "TtlAmt")
protected ActiveOrHistoricCurrencyAndAmount ttlAmt;
@XmlElement(name = "Dtls")
protected List<TaxRecordDetails2> dtls;
/**
* Gets the value of the rate property.
*
* @return
* possible object is
* {@link BigDecimal }
*
*/
public BigDecimal getRate() {
return rate;
}
/**
* Sets the value of the rate property.
*
* @param value
* allowed object is
* {@link BigDecimal }
*
*/
public void setRate(BigDecimal value) {
this.rate = value;
}
/**
* Gets the value of the taxblBaseAmt property.
*
* @return
* possible object is
* {@link ActiveOrHistoricCurrencyAndAmount }
*
*/
public ActiveOrHistoricCurrencyAndAmount getTaxblBaseAmt() {
return taxblBaseAmt;
}
/**
* Sets the value of the taxblBaseAmt property.
*
* @param value
* allowed object is
* {@link ActiveOrHistoricCurrencyAndAmount }
*
*/
public void setTaxblBaseAmt(ActiveOrHistoricCurrencyAndAmount value) {
this.taxblBaseAmt = value;
}
/**
* Gets the value of the ttlAmt property.
*
* @return
* possible object is
* {@link ActiveOrHistoricCurrencyAndAmount }
*
*/
public ActiveOrHistoricCurrencyAndAmount getTtlAmt() {
return ttlAmt;
}
/**
* Sets the value of the ttlAmt property.
*
* @param value
* allowed object is
* {@link ActiveOrHistoricCurrencyAndAmount }
*
*/
public void setTtlAmt(ActiveOrHistoricCurrencyAndAmount value) {
this.ttlAmt = value;
}
/**
* Gets the value of the dtls property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the dtls property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDtls().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link TaxRecordDetails2 }
*
*
*/
public List<TaxRecordDetails2> getDtls() {
if (dtls == null) {
dtls = new ArrayList<TaxRecordDetails2>();
}
return this.dtls;
}
}
|
[
"thivankawijesooriya@gmail.com"
] |
thivankawijesooriya@gmail.com
|
2890e11a2d936b65b3dcc2fb2526ec59633fcb4a
|
31b7d2067274728a252574b2452e617e45a1c8fb
|
/jpa-connector-beehive-bdk/com/oracle/beehive/PerformedOnSortCriteria.java
|
b16925df1e4d6f92b74a5900216ad26afb7be8b5
|
[] |
no_license
|
ericschan/open-icom
|
c83ae2fa11dafb92c3210a32184deb5e110a5305
|
c4b15a2246d1b672a8225cbb21b75fdec7f66f22
|
refs/heads/master
| 2020-12-30T12:22:48.783144
| 2017-05-28T00:51:44
| 2017-05-28T00:51:44
| 91,422,338
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,143
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.11.08 at 05:31:42 PM PST
//
package com.oracle.beehive;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for performedOnSortCriteria complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="performedOnSortCriteria">
* <complexContent>
* <extension base="{http://www.oracle.com/beehive}sortCriteria">
* <sequence>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "performedOnSortCriteria")
public class PerformedOnSortCriteria
extends SortCriteria
{
}
|
[
"eric.sn.chan@gmail.com"
] |
eric.sn.chan@gmail.com
|
8bd8f84415e04eb7765ea6aa814835360ab44ad4
|
732bd2ab16d6b2fb570c46a3a0c312a5a40bce23
|
/Apache-Fop/src/main/java/org/apache/fop/afp/AbstractAFPPainter.java
|
692a3df1ece2a6cbf8608d86fec1a7a71d376c0d
|
[
"Apache-2.0"
] |
permissive
|
Guronzan/GenPDF
|
ddedaff22350c387fd7cf04db3c76c0b2c7ba636
|
b1e2d36fda01fbccd7edce5165a388470396e1dd
|
refs/heads/master
| 2016-09-06T08:51:50.479904
| 2014-05-25T11:35:10
| 2014-05-25T11:35:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,809
|
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.
*/
/* $Id: AbstractAFPPainter.java 1036179 2010-11-17 19:45:27Z spepping $ */
package org.apache.fop.afp;
import java.io.IOException;
/**
* A base AFP painter
*/
public abstract class AbstractAFPPainter {
/** data stream */
protected final DataStream dataStream;
/** painting state */
protected final AFPPaintingState paintingState;
/**
* Main constructor
*
* @param paintingState
* the AFP painting state
* @param dataStream
* the AFP Datastream
*/
public AbstractAFPPainter(final AFPPaintingState paintingState,
final DataStream dataStream) {
this.paintingState = paintingState;
this.dataStream = dataStream;
}
/**
* Paints the painting item
*
* @param paintInfo
* the painting information
* @throws IOException
* if an I/O error occurs
*/
public abstract void paint(final PaintingInfo paintInfo) throws IOException;
}
|
[
"guillaume.rodrigues@gmail.com"
] |
guillaume.rodrigues@gmail.com
|
c74475e59a0eb83f995f81befecc0fb2ecb6642e
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/CHART-13b-3-14-PESA_II-WeightedSum:TestLen:CallDiversity/org/jfree/chart/block/BorderArrangement_ESTest_scaffolding.java
|
3fb826452e7926da3f3d2d6046cdf7744459439c
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 443
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sun Jan 19 16:14:00 UTC 2020
*/
package org.jfree.chart.block;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class BorderArrangement_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
30cd35cbadff79db3415bf38288867c15d92186a
|
176e6d0562489a13487c55a1153a384487b6c6a6
|
/sources/com/google/android/gms/maps/model/StreetViewPanoramaLink.java
|
fc5f8ed9d728643fe56985bb1c85f41c1dd3d4f5
|
[] |
no_license
|
Robust-Binaries/PlantNetPlantIdentification_v3.0.2-Extracted
|
068be5bc2c8b7c0a7c1e37bf46d7dd5638803cb6
|
bb7b435367232b864aa3b2e96740a4900c91d6ff
|
refs/heads/master
| 2020-12-23T22:55:00.284246
| 2020-01-30T20:34:16
| 2020-01-30T20:34:16
| 237,298,297
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,387
|
java
|
package com.google.android.gms.maps.model;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.Objects;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Class;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Constructor;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Field;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Param;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable.Reserved;
@Class(creator = "StreetViewPanoramaLinkCreator")
@Reserved({1})
public class StreetViewPanoramaLink extends AbstractSafeParcelable {
public static final Creator<StreetViewPanoramaLink> CREATOR = new zzn();
@Field(mo15077id = 3)
public final float bearing;
@Field(mo15077id = 2)
public final String panoId;
@Constructor
public StreetViewPanoramaLink(@Param(mo15080id = 2) String str, @Param(mo15080id = 3) float f) {
this.panoId = str;
if (((double) f) <= 0.0d) {
f = (f % 360.0f) + 360.0f;
}
this.bearing = f % 360.0f;
}
public void writeToParcel(Parcel parcel, int i) {
int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel);
SafeParcelWriter.writeString(parcel, 2, this.panoId, false);
SafeParcelWriter.writeFloat(parcel, 3, this.bearing);
SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader);
}
public int hashCode() {
return Objects.hashCode(this.panoId, Float.valueOf(this.bearing));
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof StreetViewPanoramaLink)) {
return false;
}
StreetViewPanoramaLink streetViewPanoramaLink = (StreetViewPanoramaLink) obj;
return this.panoId.equals(streetViewPanoramaLink.panoId) && Float.floatToIntBits(this.bearing) == Float.floatToIntBits(streetViewPanoramaLink.bearing);
}
public String toString() {
return Objects.toStringHelper(this).add("panoId", this.panoId).add("bearing", Float.valueOf(this.bearing)).toString();
}
}
|
[
"ingale2273@gmail.com"
] |
ingale2273@gmail.com
|
d4625ac234bf8db046ea03eb6a175a1b229190b2
|
9926a6a4ac88171c98b07b848f5861728fd18239
|
/.history/assignment4_1_20211003150316.java
|
0dca414183e3d6856774903b91bcf17423976ae9
|
[] |
no_license
|
magikflowz/JavaAssignments
|
4dadee2f0f23d581f94c998680ab188c1247013c
|
a4f01f60cedd08dd216841ba98fadac9c09bbe76
|
refs/heads/master
| 2023-08-28T13:08:43.877417
| 2021-11-02T10:47:55
| 2021-11-02T10:47:55
| 423,601,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,926
|
java
|
/* Programming Assignment 4. CSET 1200.
* University of Toledo.
* Instructor: Jared Oluoch, Ph.D.
* Due Date: Sunday October 3, 2021 at 11:59 PM.
* Total Points: 20
*/
/* Your program must compile and run to get credit.
* If your program does not compile, you may get 0.
* If you copy from your classmate, both of you get 0.
* If you copy from a website, you get 0.
* Your program must have the following information at the top.
# Name : Your First and Last Name
# Class: CSET 1200
# Instructor: Dr. Jared Oluoch
# Programming Assignment: 4
# Date: MMDDYY
# Summary: A brief description of what the program does
# The TA for this class is Bibek Poudel (bibek.poudel@rockets.utoledo.edu).
Please reach out to him if you have questions about the assignment.
# You must put this line as a comment at the top of your Java source file.
“This code is my own work. I did not get any help from any online source
such as chegg.com; from a classmate, or any other person other than the instructor
or TA for this course. I understand that getting outside help from this course
other than from the instructor or TA will result in a grade of 0 in this
assignment and other disciplinary actions for academic dishonesty.â€
*/
import java.util.*;
public class assignment4_1 {
public static void main(String[] args){
double strawberry = 5.25;
double pineapple = 4.15;
double mango = 6.12;
double banana = 5.00;
double spinach = 3.13;
double kale = 4.33;
String[] smoothies = new String[6];
smoothies[0] = "Strawberry: $5.25";
smoothies[1] = "Pineapple: $4.15";
smoothies[2] = "Mango: $6.12";
smoothies[3] = "Banana $5.00";
smoothies[4] = "Spinach $3.13";
smoothies[5] = "Kale: $4.33";
ArrayList<Double> itemSelected = new ArrayList<>();
ArrayList<String> itemNames = new ArrayList<>();
Scanner keyboardInput = new Scanner(System.in);
String name;
String selected;
for (String x: smoothies){
System.out.println(x);
}
System.out.print("Please enter your name: ");
name = keyboardInput.nextLine();
while(true){
System.out.println(itemSelected);
System.out.print("Please, select a smoother from the list or enter 0 to stop: ");
selected = keyboardInput.nextLine();
selected.toLowerCase();
if (selected.equals("strawberry")){
itemNames.add("strawberry");
itemSelected.add(strawberry);
}
if (selected.equals("pineapple")){
itemNames.add("pineapple");
itemSelected.add(pineapple);
}
if (selected.equals("mango")){
itemNames.add("mango");
itemSelected.add(mango);
}
if (selected.equals("banana")){
itemNames.add("banana");
itemSelected.add(banana);
}
if (selected.equals("spinach")){
itemNames.add("spinach");
itemSelected.add(spinach);
}
if (selected.equals("kale")){
itemNames.add("kale");
itemSelected.add(kale);
}
if (selected.equals("0")){
break;
}
}
System.out.println("Dear " + name + " you have selected: ");
for (int i=0; i < itemNames.size() &&; i++){
for(int x=0; x < itemSelected.size(); x++){
System.out.println("item: " + itemNames.get(i)+" $" +itemSelected.get(x));
}
}
double totalItemselected = itemSelected.stream().mapToDouble(f -> f.doubleValue()).sum();
System.out.println("total: "+ totalItemselected);
}
}
|
[
"75277480+ImNotMagik@users.noreply.github.com"
] |
75277480+ImNotMagik@users.noreply.github.com
|
beb84d9a7b4d077bd51d886434d400b825fc2cd1
|
d280800ca4ec277f7f2cdabc459853a46bf87a7c
|
/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/install/DependencyResolver.java
|
7b67bedf3d72313be40e4ad04b3646f20a08dd79
|
[
"Apache-2.0"
] |
permissive
|
qqqqqcjq/spring-boot-2.1.x
|
e5ca46d93eeb6a5d17ed97a0b565f6f5ed814dbb
|
238ffa349a961d292d859e6cc2360ad53b29dfd0
|
refs/heads/master
| 2023-03-12T12:50:11.619493
| 2021-03-01T05:32:52
| 2021-03-01T05:32:52
| 343,275,523
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,343
|
java
|
/*
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.cli.command.install;
import java.io.File;
import java.util.List;
/**
* Resolve artifact identifiers (typically in the form {@literal group:artifact:version})
* to {@link File}s.
*
* @author Andy Wilkinson
*/
@FunctionalInterface
interface DependencyResolver {
/**
* Resolves the given {@code artifactIdentifiers}, typically in the form
* "group:artifact:version", and their dependencies.
* @param artifactIdentifiers the artifacts to resolve
* @return the {@code File}s for the resolved artifacts
* @throws Exception if dependency resolution fails
*/
List<File> resolve(List<String> artifactIdentifiers) throws Exception;
}
|
[
"caverspark@163.com"
] |
caverspark@163.com
|
8cb7a3dc949e5bc954a4fe82f3694fd32050b5a6
|
502ea93de54a1be3ef42edb0412a2bf4bc9ddbef
|
/sources/com/google/android/gms/location/C4724l.java
|
e0c073cdba22d30db4379d91e49571dd7787988b
|
[] |
no_license
|
dovanduy/MegaBoicotApk
|
c0852af0773be1b272ec907113e8f088addb0f0c
|
56890cb9f7afac196bd1fec2d1326f2cddda37a3
|
refs/heads/master
| 2020-07-02T04:28:02.199907
| 2019-08-08T20:44:49
| 2019-08-08T20:44:49
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,006
|
java
|
package com.google.android.gms.location;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.google.android.gms.common.internal.safeparcel.C3509a;
/* renamed from: com.google.android.gms.location.l */
public final class C4724l implements Creator<LocationRequest> {
public final /* synthetic */ Object createFromParcel(Parcel parcel) {
Parcel parcel2 = parcel;
int b = C3509a.m12567b(parcel);
int i = 102;
long j = 3600000;
long j2 = 600000;
boolean z = false;
long j3 = Long.MAX_VALUE;
int i2 = Integer.MAX_VALUE;
float f = 0.0f;
long j4 = 0;
while (parcel.dataPosition() < b) {
int a = C3509a.m12562a(parcel);
switch (C3509a.m12561a(a)) {
case 1:
i = C3509a.m12573e(parcel2, a);
break;
case 2:
j = C3509a.m12575g(parcel2, a);
break;
case 3:
j2 = C3509a.m12575g(parcel2, a);
break;
case 4:
z = C3509a.m12571c(parcel2, a);
break;
case 5:
j3 = C3509a.m12575g(parcel2, a);
break;
case 6:
i2 = C3509a.m12573e(parcel2, a);
break;
case 7:
f = C3509a.m12578j(parcel2, a);
break;
case 8:
j4 = C3509a.m12575g(parcel2, a);
break;
default:
C3509a.m12568b(parcel2, a);
break;
}
}
C3509a.m12560E(parcel2, b);
LocationRequest locationRequest = new LocationRequest(i, j, j2, z, j3, i2, f, j4);
return locationRequest;
}
public final /* synthetic */ Object[] newArray(int i) {
return new LocationRequest[i];
}
}
|
[
"pablo.valle.b@gmail.com"
] |
pablo.valle.b@gmail.com
|
d1d46ac81d1503df528b6a57a2cef0b7767ed9f1
|
ed53c4d93e851d46e963cafb26cb6a3f468dd47c
|
/extensions/ecs/ecs-weaver/src/arc/ecs/weaver/impl/profile/ProfileVisitor.java
|
2a3a773c9165756419f21f26c654d4230ea61688
|
[] |
no_license
|
zonesgame/Arc
|
0a4ea8cf1c44066e85ffd95cfe52eb1ece1488e7
|
ea8a0be1642befa535fba717e94c4fc03bd6f8a0
|
refs/heads/main
| 2023-06-28T04:21:06.146553
| 2021-07-26T14:02:35
| 2021-07-26T14:02:35
| 384,278,749
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,105
|
java
|
package arc.ecs.weaver.impl.profile;
import arc.ecs.weaver.meta.*;
import org.objectweb.asm.*;
public class ProfileVisitor extends ClassVisitor implements Opcodes{
private ClassMetadata info;
public ProfileVisitor(ClassVisitor cv, ClassMetadata info){
super(ASM4, cv);
this.info = info;
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature,
String[] exceptions){
MethodVisitor method = super.visitMethod(access, name, desc, signature, exceptions);
if("begin".equals(name) && "()V".equals(desc))
method = new ProfileBeginWeaver(method, info, access, name, desc);
else if("end".equals(name) && "()V".equals(desc))
method = new ProfileEndWeaver(method, info, access, name, desc);
else if("initialize".equals(name) && "()V".equals(desc))
method = new ProfileInitializeWeaver(method, info, access, name, desc);
return method;
}
@Override
public void visitEnd(){
super.visitEnd();
}
}
|
[
"32406374+zonesgame@users.noreply.github.com"
] |
32406374+zonesgame@users.noreply.github.com
|
3f7dfc4cdf14bbf940e9d8cf1d3001b335ee4072
|
6504352f86c2e4f7ef16cea3f5b7cc00bba96a33
|
/WmesWeb/src/com/fsll/wmes/community/vo/CommunityCommentVO.java
|
37fe4d0d1fdfc933d0fc1fb195b8f5b4273d177e
|
[] |
no_license
|
jedyang/XFAWealth
|
1a20c7b4d16c72883b27c4d8aa72d67df4291b9a
|
029d45620b3375a86fec8bb1161492325f9f2c6c
|
refs/heads/master
| 2021-05-07T04:53:24.628018
| 2017-08-03T15:25:59
| 2017-08-03T15:25:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,807
|
java
|
package com.fsll.wmes.community.vo;
import java.util.List;
public class CommunityCommentVO {
private String id;
private String topicId;
private String content;
private String memberId;
private String memberName;
private String memberUrl;
private String memberType;
private String replyId;
private String replyMemberName;
private int likeCount;
private int unlikeCount;
private int commentCount;
private int isLike;
private int isUnlike;
private String dateTime;
private List<CommunityCommentVO> childList;
private int status;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTopicId() {
return topicId;
}
public void setTopicId(String topicId) {
this.topicId = topicId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName;
}
public String getMemberUrl() {
return memberUrl;
}
public void setMemberUrl(String memberUrl) {
this.memberUrl = memberUrl;
}
public String getReplyId() {
return replyId;
}
public String getMemberType() {
return memberType;
}
public void setMemberType(String memberType) {
this.memberType = memberType;
}
public void setReplyId(String replyId) {
this.replyId = replyId;
}
public String getReplyMemberName() {
return replyMemberName;
}
public void setReplyMemberName(String replyMemberName) {
this.replyMemberName = replyMemberName;
}
public int getLikeCount() {
return likeCount;
}
public void setLikeCount(int likeCount) {
this.likeCount = likeCount;
}
public int getUnlikeCount() {
return unlikeCount;
}
public void setUnlikeCount(int unlikeCount) {
this.unlikeCount = unlikeCount;
}
public int getCommentCount() {
return commentCount;
}
public void setCommentCount(int commentCount) {
this.commentCount = commentCount;
}
public int getIsLike() {
return isLike;
}
public void setIsLike(int isLike) {
this.isLike = isLike;
}
public int getIsUnlike() {
return isUnlike;
}
public void setIsUnlike(int isUnlike) {
this.isUnlike = isUnlike;
}
public String getDateTime() {
return dateTime;
}
public void setDateTime(String dateTime) {
this.dateTime = dateTime;
}
public List<CommunityCommentVO> getChildList() {
return childList;
}
public void setChildList(List<CommunityCommentVO> childList) {
this.childList = childList;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
|
[
"549592047@qq.com"
] |
549592047@qq.com
|
341c71919deedf0b070ed6c5059d67c19d348f05
|
4c01c1a8acd7bca86b5dc95476c9ff5c700720ea
|
/library-project/src/main/java/com/hybrid/libraryproject/service/impl/BookRentalServiceImpl.java
|
9a7491a4b69473b4d9bd44425ccacf38123f2394
|
[] |
no_license
|
senka97/library
|
793e343d7e81bb371d22e995931cf99da7ad1911
|
a55149534faea049a1f0034d1f2ea2146c7e398e
|
refs/heads/main
| 2023-06-17T05:43:52.906181
| 2021-07-13T19:09:08
| 2021-07-13T19:09:08
| 385,707,229
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,790
|
java
|
package com.hybrid.libraryproject.service.impl;
import com.hybrid.libraryproject.dto.BookRentalCUDTO;
import com.hybrid.libraryproject.exception.BusinessException;
import com.hybrid.libraryproject.mapper.BookRentalMapper;
import com.hybrid.libraryproject.model.Book;
import com.hybrid.libraryproject.model.BookRental;
import com.hybrid.libraryproject.model.User;
import com.hybrid.libraryproject.repository.BookRentalRepository;
import com.hybrid.libraryproject.service.BookRentalService;
import com.hybrid.libraryproject.service.BookService;
import com.hybrid.libraryproject.service.UserService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityNotFoundException;
import java.time.LocalDate;
import java.util.List;
@Service
public class BookRentalServiceImpl implements BookRentalService {
private final BookRentalRepository repository;
private final BookRentalMapper mapper;
private final BookService bookService;
private final UserService userService;
@Value("${rental-period}")
private Long RENTAL_PERIOD;
public BookRentalServiceImpl(BookRentalRepository bookRentalRepository, BookRentalMapper bookRentalMapper,
BookService bookService, UserService userService) {
this.repository = bookRentalRepository;
this.mapper = bookRentalMapper;
this.bookService = bookService;
this.userService = userService;
}
@Override
@Transactional(readOnly = true)
public List<BookRental> getAll() {
return repository.findAll();
}
@Override
@Transactional(readOnly = true)
public BookRental get(Long id) {
return findById(id);
}
@Override
@Transactional
public BookRental create(BookRentalCUDTO bookRentalDTO){
rentBook(bookService.findById(bookRentalDTO.getBookId()));
User user = userService.findById(bookRentalDTO.getUserId());
Book book = bookService.findById(bookRentalDTO.getBookId());
BookRental newBookRental = mapper.toEntity(new BookRental(), bookRentalDTO, user, book);
return repository.save(newBookRental);
}
@Override
@Transactional
public BookRental update(Long id) {
BookRental bookRental = findById(id);
returnBook(bookRental);
bookRental.setReturnedDate(LocalDate.now());
return repository.save(bookRental);
}
@Override
@Transactional
public void delete(Long id) {
repository.deleteById(id);
}
@Override
public BookRental findById(Long id) {
return repository.findById(id).orElseThrow(() ->
new EntityNotFoundException(String.format("Book rental with id %d not found", id)));
}
@Override
public List<BookRental> getAllOverdueBookReturns() {
return repository.getAllOverdueBookReturns(LocalDate.now().minusDays(RENTAL_PERIOD));
}
private void returnBook(BookRental bookRental) throws BusinessException{
if(bookRental.getReturnedDate() != null){
throw new BusinessException(String.format("Book rental with id %d already returned", bookRental.getId()));
}
Book book = bookRental.getBook();
book.setRentedCopies(book.getRentedCopies() - 1);
bookService.save(book);
}
private void rentBook(Book book) throws BusinessException {
if(book.getCopiesTotal() - book.getRentedCopies() == 0){
throw new BusinessException(String.format("Book with id %d doesn't have available copies", book.getId()));
}
book.setRentedCopies(book.getRentedCopies() + 1);
bookService.save(book);
}
}
|
[
"senka.soic@uns.ac.rs"
] |
senka.soic@uns.ac.rs
|
7f2dced7d4ec237fb99aed12087bb9c73597f099
|
1b6c46ada4641c7a6197c8210845447146f42611
|
/src/test/java/com/microservice/uaa/web/rest/TestUtil.java
|
6721d226bf62f905f2031bc640db822085122eb5
|
[] |
no_license
|
qq281541534/uaa
|
9a35df37f14ad390a45a9e42957e296eb5aa4d31
|
b612aa47afcc173e7fd7849d25f2799278be85c7
|
refs/heads/master
| 2020-04-11T11:26:43.957553
| 2018-12-14T07:30:30
| 2018-12-14T07:30:30
| 161,748,197
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,149
|
java
|
package com.microservice.uaa.web.rest;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
import org.springframework.format.support.DefaultFormattingConversionService;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.http.MediaType;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.time.ZonedDateTime;
import java.time.format.DateTimeParseException;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Utility class for testing REST controllers.
*/
public class TestUtil {
/** MediaType for JSON UTF8 */
public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(
MediaType.APPLICATION_JSON.getType(),
MediaType.APPLICATION_JSON.getSubtype(), StandardCharsets.UTF_8);
/**
* Convert an object to JSON byte array.
*
* @param object
* the object to convert
* @return the JSON byte array
* @throws IOException
*/
public static byte[] convertObjectToJsonBytes(Object object)
throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
JavaTimeModule module = new JavaTimeModule();
mapper.registerModule(module);
return mapper.writeValueAsBytes(object);
}
/**
* Create a byte array with a specific size filled with specified data.
*
* @param size the size of the byte array
* @param data the data to put in the byte array
* @return the JSON byte array
*/
public static byte[] createByteArray(int size, String data) {
byte[] byteArray = new byte[size];
for (int i = 0; i < size; i++) {
byteArray[i] = Byte.parseByte(data, 2);
}
return byteArray;
}
/**
* A matcher that tests that the examined string represents the same instant as the reference datetime.
*/
public static class ZonedDateTimeMatcher extends TypeSafeDiagnosingMatcher<String> {
private final ZonedDateTime date;
public ZonedDateTimeMatcher(ZonedDateTime date) {
this.date = date;
}
@Override
protected boolean matchesSafely(String item, Description mismatchDescription) {
try {
if (!date.isEqual(ZonedDateTime.parse(item))) {
mismatchDescription.appendText("was ").appendValue(item);
return false;
}
return true;
} catch (DateTimeParseException e) {
mismatchDescription.appendText("was ").appendValue(item)
.appendText(", which could not be parsed as a ZonedDateTime");
return false;
}
}
@Override
public void describeTo(Description description) {
description.appendText("a String representing the same Instant as ").appendValue(date);
}
}
/**
* Creates a matcher that matches when the examined string reprensents the same instant as the reference datetime
* @param date the reference datetime against which the examined string is checked
*/
public static ZonedDateTimeMatcher sameInstant(ZonedDateTime date) {
return new ZonedDateTimeMatcher(date);
}
/**
* Verifies the equals/hashcode contract on the domain object.
*/
public static <T> void equalsVerifier(Class<T> clazz) throws Exception {
T domainObject1 = clazz.getConstructor().newInstance();
assertThat(domainObject1.toString()).isNotNull();
assertThat(domainObject1).isEqualTo(domainObject1);
assertThat(domainObject1.hashCode()).isEqualTo(domainObject1.hashCode());
// Test with an instance of another class
Object testOtherObject = new Object();
assertThat(domainObject1).isNotEqualTo(testOtherObject);
assertThat(domainObject1).isNotEqualTo(null);
// Test with an instance of the same class
T domainObject2 = clazz.getConstructor().newInstance();
assertThat(domainObject1).isNotEqualTo(domainObject2);
// HashCodes are equals because the objects are not persisted yet
assertThat(domainObject1.hashCode()).isEqualTo(domainObject2.hashCode());
}
/**
* Create a FormattingConversionService which use ISO date format, instead of the localized one.
* @return the FormattingConversionService
*/
public static FormattingConversionService createFormattingConversionService() {
DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService ();
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(dfcs);
return dfcs;
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
0d213f53611a254129d2db5275bdd9e3be31bb22
|
ca957060b411c88be41dfbf5dffa1fea2744f4a5
|
/src/org/sosy_lab/cpachecker/cpa/smg/refiner/SMGInterpolant.java
|
e95058dc06438698b4f9b5dcf99982d051d8e524
|
[
"Apache-2.0"
] |
permissive
|
45258E9F/IntPTI
|
62f705f539038f9457c818d515c81bf4621d7c85
|
e5dda55aafa2da3d977a9a62ad0857746dae3fe1
|
refs/heads/master
| 2020-12-30T14:34:30.174963
| 2018-06-01T07:32:07
| 2018-06-01T07:32:07
| 91,068,091
| 4
| 6
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,457
|
java
|
/*
* IntPTI: integer error fixing by proper-type inference
* Copyright (c) 2017.
*
* Open-source component:
*
* CPAchecker
* Copyright (C) 2007-2014 Dirk Beyer
*
* Guava: Google Core Libraries for Java
* Copyright (C) 2010-2006 Google
*
*
*/
package org.sosy_lab.cpachecker.cpa.smg.refiner;
import com.google.common.collect.ImmutableMap;
import org.sosy_lab.common.log.LogManager;
import org.sosy_lab.cpachecker.cfa.ast.AFunctionDeclaration;
import org.sosy_lab.cpachecker.cfa.ast.c.CFunctionDeclaration;
import org.sosy_lab.cpachecker.cfa.model.FunctionEntryNode;
import org.sosy_lab.cpachecker.cfa.types.MachineModel;
import org.sosy_lab.cpachecker.cpa.smg.SMGInconsistentException;
import org.sosy_lab.cpachecker.cpa.smg.SMGState;
import org.sosy_lab.cpachecker.cpa.smg.SMGTransferRelation.SMGKnownExpValue;
import org.sosy_lab.cpachecker.cpa.smg.SMGTransferRelation.SMGKnownSymValue;
import org.sosy_lab.cpachecker.cpa.smg.graphs.CLangSMG;
import org.sosy_lab.cpachecker.cpa.smg.join.SMGJoin;
import org.sosy_lab.cpachecker.util.refinement.Interpolant;
import org.sosy_lab.cpachecker.util.states.MemoryLocation;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
public class SMGInterpolant implements Interpolant<SMGState> {
private static final SMGInterpolant FALSE = new SMGInterpolant(null, null, null, 0);
private final Map<SMGKnownSymValue, SMGKnownExpValue> explicitValues;
private final CLangSMG heap;
private final LogManager logger;
private final int externalAllocationSize;
public SMGInterpolant(
Map<SMGKnownSymValue, SMGKnownExpValue> pExplicitValues,
CLangSMG pHeap,
LogManager pLogger, int pExternalAllocationSize) {
explicitValues = pExplicitValues;
heap = pHeap;
logger = pLogger;
externalAllocationSize = pExternalAllocationSize;
}
@Override
public SMGState reconstructState() {
if (isFalse()) {
throw new IllegalStateException("Can't reconstruct state from FALSE-interpolant");
} else {
// TODO Copy necessary?
return new SMGState(new HashMap<>(explicitValues), new CLangSMG(heap), logger,
externalAllocationSize);
}
}
@Override
public int getSize() {
return isTrivial() ? 0 : heap.getHVEdges().size();
}
@Override
public Set<MemoryLocation> getMemoryLocations() {
return heap.getTrackedMemoryLocations();
}
@Override
public boolean isTrue() {
return !isFalse() && heap.getHVEdges().isEmpty();
}
@Override
public boolean isFalse() {
return heap == null;
}
@Override
public boolean isTrivial() {
return isTrue() || isFalse();
}
@SuppressWarnings("unchecked")
@Override
public <T extends Interpolant<SMGState>> T join(T pOtherInterpolant) {
assert pOtherInterpolant instanceof SMGInterpolant;
SMGInterpolant other = (SMGInterpolant) pOtherInterpolant;
return (T) join0(other);
}
private SMGInterpolant join0(SMGInterpolant other) {
if (isFalse() || other.isFalse()) {
return SMGInterpolant.FALSE;
}
SMGJoin join;
try {
join = new SMGJoin(heap, other.heap);
} catch (SMGInconsistentException e) {
throw new IllegalStateException("Can't join interpolants due to: " + e.getMessage());
}
Map<SMGKnownSymValue, SMGKnownExpValue> joinedExplicitValues = new HashMap<>();
//FIXME join of explicit values
joinedExplicitValues.putAll(explicitValues);
joinedExplicitValues.putAll(other.explicitValues);
return new SMGInterpolant(joinedExplicitValues, join.getJointSMG(), logger,
externalAllocationSize);
}
public static SMGInterpolant createInitial(
LogManager logger, MachineModel model,
FunctionEntryNode pMainFunctionNode, int pExternalAllocationSize) {
Map<SMGKnownSymValue, SMGKnownExpValue> explicitValues = ImmutableMap.of();
CLangSMG heap = new CLangSMG(model);
AFunctionDeclaration mainFunction = pMainFunctionNode.getFunctionDefinition();
if (mainFunction instanceof CFunctionDeclaration) {
heap.addStackFrame((CFunctionDeclaration) mainFunction);
}
return new SMGInterpolant(explicitValues, heap, logger, pExternalAllocationSize);
}
public static SMGInterpolant getFalseInterpolant() {
return FALSE;
}
@Override
public String toString() {
if (isFalse()) {
return "FALSE";
} else {
return heap.toString() + "\n" + explicitValues.toString();
}
}
}
|
[
"chengxi09@gmail.com"
] |
chengxi09@gmail.com
|
80e37efe4dabdf9244335b480ef85aed13cc05c9
|
3fe8e5db53dc425afdb24303f2f6926cade14f04
|
/user/ezt_hall/src/main/java/com/eztcn/user/eztcn/activity/watch/DeviceListActivity.java
|
963198571ccc5fbcc4bb6f817f516ba43ecc2967
|
[] |
no_license
|
llorch19/ezt_user_code
|
087a9474a301d8d8fef7bd1172d6c836373c2faf
|
ee82f4bfbbd14c81976be1275dcd4fc49f6b1753
|
refs/heads/master
| 2021-06-01T09:40:19.437831
| 2016-08-10T02:33:35
| 2016-08-10T02:33:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,696
|
java
|
///*
// * Copyright (C) 2009 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.eztcn.user.eztcn.activity.watch;
//
//import java.util.Set;
//
//import android.app.Activity;
//import android.bluetooth.BluetoothAdapter;
//import android.bluetooth.BluetoothDevice;
//import android.content.BroadcastReceiver;
//import android.content.Context;
//import android.content.Intent;
//import android.content.IntentFilter;
//import android.os.Bundle;
//import android.util.Log;
//import android.view.View;
//import android.view.View.OnClickListener;
//import android.view.Window;
//import android.widget.AdapterView;
//import android.widget.AdapterView.OnItemClickListener;
//import android.widget.ArrayAdapter;
//import android.widget.Button;
//import android.widget.ListView;
//import android.widget.TextView;
//
//import com.eztcn.user.R;
//
///**
// * This Activity appears as a dialog. It lists any paired devices and devices
// * detected in the area after discovery. When a device is chosen by the user,
// * the MAC address of the device is sent back to the parent Activity in the
// * result Intent.
// */
//public class DeviceListActivity extends Activity {
// // Debugging
// private static final String TAG = "DeviceListActivity";
// private static final boolean D = true;
//
// // Return Intent extra
// public static String EXTRA_DEVICE_ADDRESS = "device_address";
//
// // Member fields
// private BluetoothAdapter mBtAdapter;
// private ArrayAdapter<String> mPairedDevicesArrayAdapter;
// private ArrayAdapter<String> mNewDevicesArrayAdapter;
// //扫描到设备
// private boolean scaleDevice=false;
// @Override
// protected void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
//
// // Setup the window
// requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// setContentView(R.layout.device_list);
//
// // Set result CANCELED in case the user backs out
// setResult(Activity.RESULT_CANCELED);
//
// // Initialize the button to perform device discovery
// Button scanButton = (Button) findViewById(R.id.button_scan);
// scanButton.setOnClickListener(new OnClickListener() {
// public void onClick(View v) {
// doDiscovery();
// v.setVisibility(View.GONE);
// }
// });
//
// // Initialize array adapters. One for already paired devices and
// // one for newly discovered devices
// mPairedDevicesArrayAdapter = new ArrayAdapter<String>(this,
// R.layout.device_name);
// mNewDevicesArrayAdapter = new ArrayAdapter<String>(this,
// R.layout.device_name);
//
// // Find and set up the ListView for paired devices
// ListView pairedListView = (ListView) findViewById(R.id.paired_devices);
// pairedListView.setAdapter(mPairedDevicesArrayAdapter);
// pairedListView.setOnItemClickListener(mDeviceClickListener);
//
// // Find and set up the ListView for newly discovered devices
// ListView newDevicesListView = (ListView) findViewById(R.id.new_devices);
// newDevicesListView.setAdapter(mNewDevicesArrayAdapter);
// newDevicesListView.setOnItemClickListener(mDeviceClickListener);
//
// // Register for broadcasts when a device is discovered
// IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND);
// this.registerReceiver(mReceiver, filter);
//
// // Register for broadcasts when discovery has finished
// filter = new IntentFilter(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
// this.registerReceiver(mReceiver, filter);
//
// // Get the local Bluetooth adapter
// mBtAdapter = BluetoothAdapter.getDefaultAdapter();
//
// // Get a set of currently paired devices
// Set<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();
//
// // If there are paired devices, add each one to the ArrayAdapter
// if (pairedDevices.size() > 0) {
// findViewById(R.id.title_paired_devices).setVisibility(View.VISIBLE);
// for (BluetoothDevice device : pairedDevices) {
// mPairedDevicesArrayAdapter.add(device.getName() + "\n"
// + device.getAddress());
// }
// } else {
// String noDevices = "没有匹配设备";
// mPairedDevicesArrayAdapter.add(noDevices);
// }
// }
//
// @Override
// protected void onDestroy() {
// super.onDestroy();
//
// // Make sure we're not doing discovery anymore
// if (mBtAdapter != null) {
// mBtAdapter.cancelDiscovery();
// }
//
// // Unregister broadcast listeners
// this.unregisterReceiver(mReceiver);
// }
//
// /**
// * Start device discover with the BluetoothAdapter
// */
// private void doDiscovery() {
// if (D)
// Log.d(TAG, "doDiscovery()");
//
// // Indicate scanning in the title
// setProgressBarIndeterminateVisibility(true);
// setTitle("扫描中...");
//
// // Turn on sub-title for new devices
// findViewById(R.id.title_new_devices).setVisibility(View.VISIBLE);
//
// // If we're already discovering, stop it
// if (mBtAdapter.isDiscovering()) {
// mBtAdapter.cancelDiscovery();
// }
//
// // Request discover from BluetoothAdapter
// mBtAdapter.startDiscovery();
// }
//
// // The on-click listener for all devices in the ListViews
// private OnItemClickListener mDeviceClickListener = new OnItemClickListener() {
// public void onItemClick(AdapterView<?> av, View v, int arg2, long arg3) {
// if(scaleDevice){
// // Cancel discovery because it's costly and we're about to connect
// mBtAdapter.cancelDiscovery();
// }
// // Get the device MAC address, which is the last 17 chars in the
// // View
// String info = ((TextView) v).getText().toString();
// String address = info.substring(info.length() - 17);
//
// // Create the result Intent and include the MAC address
// Intent intent = new Intent();
// intent.putExtra(EXTRA_DEVICE_ADDRESS, address);
//
// // Set result and finish this Activity
// setResult(Activity.RESULT_OK, intent);
// finish();
//
// }
// };
//
// // The BroadcastReceiver that listens for discovered devices and
// // changes the title when discovery is finished
// private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
// @Override
// public void onReceive(Context context, Intent intent) {
// String action = intent.getAction();
//
// // When discovery finds a device
// if (BluetoothDevice.ACTION_FOUND.equals(action)) {
// // Get the BluetoothDevice object from the Intent
// BluetoothDevice device = intent
// .getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
// // If it's already paired, skip it, because it's been listed
// // already
// if (device.getBondState() != BluetoothDevice.BOND_BONDED) {
// mNewDevicesArrayAdapter.add(device.getName() + "\n"
// + device.getAddress());
// }
// // When discovery is finished, change the Activity title
// } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED
// .equals(action)) {
// setProgressBarIndeterminateVisibility(false);
// setTitle("选择设备");
// if (mNewDevicesArrayAdapter.getCount() == 0) {
// String noDevices = "没有找到设备";
// scaleDevice=false;
// mNewDevicesArrayAdapter.add(noDevices);
// }else{
// scaleDevice=true;
// }
// }
// }
// };
//
//}
|
[
"liangxing@eztcn.com"
] |
liangxing@eztcn.com
|
7b18086d1718136d35ec6afa5e24d53ab64212a6
|
58df55b0daff8c1892c00369f02bf4bf41804576
|
/src/hsc.java
|
2a299069ccae572e41231ed194c6647e01d91b0f
|
[] |
no_license
|
gafesinremedio/com.google.android.gm
|
0b0689f869a2a1161535b19c77b4b520af295174
|
278118754ea2a262fd3b5960ef9780c658b1ce7b
|
refs/heads/master
| 2020-05-04T15:52:52.660697
| 2016-07-21T03:39:17
| 2016-07-21T03:39:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,544
|
java
|
import java.io.Serializable;
import java.util.Iterator;
public final class hsc
implements Serializable
{
private static final long serialVersionUID = -1654118204678581940L;
public hwm a;
public hsl b;
public hsc()
{
this(new hwm(), new hsl());
}
private hsc(hwm paramhwm, hsl paramhsl)
{
a = paramhwm;
b = paramhsl;
}
public final hsj a(String paramString)
{
Iterator localIterator = b.iterator();
while (localIterator.hasNext())
{
hsj localhsj = (hsj)localIterator.next();
if (a.equals(paramString)) {
return localhsj;
}
}
return null;
}
public final boolean equals(Object paramObject)
{
if ((paramObject instanceof hsc))
{
paramObject = (hsc)paramObject;
return idkaa, a).a(b, b).a;
}
return super.equals(paramObject);
}
public final int hashCode()
{
return idlaa).a(b).a;
}
public final String toString()
{
StringBuffer localStringBuffer = new StringBuffer();
localStringBuffer.append("BEGIN");
localStringBuffer.append(':');
localStringBuffer.append("VCALENDAR");
localStringBuffer.append("\r\n");
localStringBuffer.append(a);
localStringBuffer.append(b);
localStringBuffer.append("END");
localStringBuffer.append(':');
localStringBuffer.append("VCALENDAR");
localStringBuffer.append("\r\n");
return localStringBuffer.toString();
}
}
/* Location:
* Qualified Name: hsc
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"reverseengineeringer@hackeradmin.com"
] |
reverseengineeringer@hackeradmin.com
|
b3337467fa5de62a78e3c779325608e762c6fcfe
|
02cd2722ae6fa330005a8f42c655c0f1c2b1d816
|
/CCG/src/main/java/com/yukthi/ccg/manager/ConfigurationException.java
|
dde30094541263bb6e0d879e642a52c5eb76b67c
|
[] |
no_license
|
pritam285/utils
|
b201020fdf6f2adc4ac31dedb10be70039503141
|
302211e49c24ff54be7f62d37b160ccc50a6521d
|
refs/heads/master
| 2020-04-05T23:11:54.639378
| 2016-11-06T08:58:20
| 2016-11-06T08:58:20
| 61,019,862
| 0
| 0
| null | 2016-11-06T08:58:21
| 2016-06-13T08:21:48
|
Java
|
UTF-8
|
Java
| false
| false
| 666
|
java
|
package com.yukthi.ccg.manager;
/**
* <BR><BR>
* <P>
* This exception will be thrown when there is exception in the input XML configuration
* data.
* </P>
* <BR><BR>
* @author A. Kranthi Kiran
*/
public class ConfigurationException extends ManagerException
{
private static final long serialVersionUID=1L;
public ConfigurationException()
{
super();
}
public ConfigurationException(String mssg,Throwable rootCause)
{
super(mssg,rootCause);
}
public ConfigurationException(String mssg)
{
super(mssg);
}
public ConfigurationException(Throwable rootCause)
{
super(rootCause);
}
}
|
[
"akranthikiran@gmail.com"
] |
akranthikiran@gmail.com
|
92f4ab6d19c585f3919993667d160d3659fd2600
|
c37ef54d151f8e70b6d521575f0b3b300b55525c
|
/support/cas-server-support-u2f-jpa/src/main/java/org/apereo/cas/config/U2FJpaConfiguration.java
|
970a89a979dab099812060df58ad4e626fa7bfdc
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] |
permissive
|
viswatejan/cas
|
f29c02f4b4ccfe73800012439f06dfdf9e2bffcc
|
671ffd44cd8ebee06c3815502b73cbd56fa46b5b
|
refs/heads/master
| 2020-03-22T18:27:33.912304
| 2018-07-10T19:36:28
| 2018-07-10T19:36:28
| 140,461,569
| 0
| 0
|
Apache-2.0
| 2018-07-10T16:42:51
| 2018-07-10T16:42:50
| null |
UTF-8
|
Java
| false
| false
| 4,064
|
java
|
package org.apereo.cas.config;
import lombok.val;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apereo.cas.CipherExecutor;
import org.apereo.cas.adaptors.u2f.storage.U2FDeviceRegistration;
import org.apereo.cas.adaptors.u2f.storage.U2FDeviceRepository;
import org.apereo.cas.adaptors.u2f.storage.U2FJpaDeviceRepository;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.configuration.model.support.jpa.JpaConfigDataHolder;
import org.apereo.cas.configuration.support.JpaBeans;
import org.apereo.cas.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import java.util.List;
/**
* This is {@link U2FJpaConfiguration}.
*
* @author Misagh Moayyed
* @since 5.2.0
*/
@Configuration("u2fJpaConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
@EnableTransactionManagement(proxyTargetClass = true)
@Slf4j
public class U2FJpaConfiguration {
@Autowired
private CasConfigurationProperties casProperties;
@Autowired
@Qualifier("u2fRegistrationRecordCipherExecutor")
private CipherExecutor u2fRegistrationRecordCipherExecutor;
@RefreshScope
@Bean
public HibernateJpaVendorAdapter jpaU2fVendorAdapter() {
return JpaBeans.newHibernateJpaVendorAdapter(casProperties.getJdbc());
}
@Bean
public DataSource dataSourceU2f() {
return JpaBeans.newDataSource(casProperties.getAuthn().getMfa().getU2f().getJpa());
}
public List<String> jpaU2fPackagesToScan() {
return CollectionUtils.wrapList(U2FDeviceRegistration.class.getPackage().getName());
}
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean u2fEntityManagerFactory() {
val bean =
JpaBeans.newHibernateEntityManagerFactoryBean(
new JpaConfigDataHolder(
jpaU2fVendorAdapter(),
"jpaU2fRegistryContext",
jpaU2fPackagesToScan(),
dataSourceU2f()),
casProperties.getAuthn().getMfa().getU2f().getJpa());
return bean;
}
@Autowired
@Bean
public PlatformTransactionManager transactionManagerU2f(@Qualifier("u2fEntityManagerFactory") final EntityManagerFactory emf) {
val mgmr = new JpaTransactionManager();
mgmr.setEntityManagerFactory(emf);
return mgmr;
}
@Bean
public U2FDeviceRepository u2fDeviceRepository() {
val u2f = casProperties.getAuthn().getMfa().getU2f();
final LoadingCache<String, String> requestStorage =
Caffeine.newBuilder()
.expireAfterWrite(u2f.getExpireRegistrations(), u2f.getExpireRegistrationsTimeUnit())
.build(key -> StringUtils.EMPTY);
val repo = new U2FJpaDeviceRepository(requestStorage,
u2f.getExpireRegistrations(),
u2f.getExpireDevicesTimeUnit());
repo.setCipherExecutor(this.u2fRegistrationRecordCipherExecutor);
return repo;
}
}
|
[
"mmoayyed@unicon.net"
] |
mmoayyed@unicon.net
|
d2b6b9839ee5bc89a88ddcf08a7237949930ab40
|
a8c5b7b04eace88b19b5a41a45f1fb030df393e3
|
/projects/time-series/src/main/java/com/opengamma/timeseries/precise/instant/InstantDoubleEntryIterator.java
|
512eb4519675f879f0c98576aebd7868d6a738a0
|
[
"Apache-2.0"
] |
permissive
|
McLeodMoores/starling
|
3f6cfe89cacfd4332bad4861f6c5d4648046519c
|
7ae0689e06704f78fd9497f8ddb57ee82974a9c8
|
refs/heads/master
| 2022-12-04T14:02:00.480211
| 2020-04-28T17:22:44
| 2020-04-28T17:22:44
| 46,577,620
| 4
| 4
|
Apache-2.0
| 2022-11-24T07:26:39
| 2015-11-20T17:48:10
|
Java
|
UTF-8
|
Java
| false
| false
| 889
|
java
|
/**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.timeseries.precise.instant;
import org.threeten.bp.Instant;
import com.opengamma.timeseries.precise.PreciseDoubleEntryIterator;
import com.opengamma.timeseries.precise.PreciseTimeSeries;
/**
* Specialized iterator for time-series of {@code double} values.
* <p>
* This is a map-based iterator that avoids working with {@code Map.Entry}.
* Using this iterator typically involves using a while loop.
* This iterator is dedicated to {@code InstantDoubleTimeSeries}.
* <p>
* The "time" key to the time-series is an {@code Instant}.
* See {@link PreciseTimeSeries} for details about the "time" represented as a {@code long}.
*/
public interface InstantDoubleEntryIterator extends PreciseDoubleEntryIterator<Instant> {
}
|
[
"stephen@opengamma.com"
] |
stephen@opengamma.com
|
0697f4aa72200ff3b2a37d9faf3e892890821d05
|
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
|
/ltl-20190510/src/main/java/com/aliyun/ltl20190510/models/AttachDataWithSignatureResponseBody.java
|
13e91d3edccc62e61d8827bd71a67103397fca26
|
[
"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,707
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.ltl20190510.models;
import com.aliyun.tea.*;
public class AttachDataWithSignatureResponseBody extends TeaModel {
@NameInMap("Code")
public Integer code;
@NameInMap("Data")
public String data;
@NameInMap("Message")
public String message;
@NameInMap("RequestId")
public String requestId;
@NameInMap("Success")
public Boolean success;
public static AttachDataWithSignatureResponseBody build(java.util.Map<String, ?> map) throws Exception {
AttachDataWithSignatureResponseBody self = new AttachDataWithSignatureResponseBody();
return TeaModel.build(map, self);
}
public AttachDataWithSignatureResponseBody setCode(Integer code) {
this.code = code;
return this;
}
public Integer getCode() {
return this.code;
}
public AttachDataWithSignatureResponseBody setData(String data) {
this.data = data;
return this;
}
public String getData() {
return this.data;
}
public AttachDataWithSignatureResponseBody setMessage(String message) {
this.message = message;
return this;
}
public String getMessage() {
return this.message;
}
public AttachDataWithSignatureResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
public AttachDataWithSignatureResponseBody setSuccess(Boolean success) {
this.success = success;
return this;
}
public Boolean getSuccess() {
return this.success;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
3ce512c8b47495787ccae06fd8a66d9b47c50d6e
|
7222c03a7a34add822f51511269c7061780ee5a6
|
/webmail-frontend/gwt/src/fr/aliasource/webmail/client/composer/AttachmentUploadWidget.java
|
66ca442cb6496d944a939634b350ca78a4260669
|
[] |
no_license
|
YYChildren/minig
|
17103eb1170d29930404230f3ce22609cd66c869
|
9a413a70b9aed485bdc42068bf701db8425963c9
|
refs/heads/master
| 2016-09-14T00:28:53.387344
| 2016-04-13T01:28:08
| 2016-04-13T01:28:08
| 56,111,120
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,540
|
java
|
/* ***** BEGIN LICENSE BLOCK *****
* Version: GPL 2.0
*
* The contents of this file are subject to the GNU General Public
* License Version 2 or later (the "GPL").
*
* 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.
*
* The Initial Developer of the Original Code is
* MiniG.org project members
*
* ***** END LICENSE BLOCK ***** */
package fr.aliasource.webmail.client.composer;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import fr.aliasource.webmail.client.I18N;
import fr.aliasource.webmail.client.reader.AttachmentDisplay;
import fr.aliasource.webmail.client.shared.AttachmentMetadata;
/**
* Widget used to display the attachments upload form and a link to the uploaded
* attachment.
*
* @author tom
*
*/
public class AttachmentUploadWidget extends FormPanel {
private String attachementId;
private FileUpload upload;
private Image upSpinner;
private Anchor droppAttachmentLink;
private AttachmentsPanel attachPanel;
private DockPanel dp;
public AttachmentUploadWidget(AttachmentsPanel attPanel, String attId,
boolean alreadyOnServer) {
this.attachPanel = attPanel;
this.attachementId = attId;
dp = new DockPanel();
dp.setSpacing(1);
setWidget(dp);
if (!alreadyOnServer) {
// when we create a forward, the attachment are already on the
// backend
buildUpload(dp);
} else {
// we're creating a forwarded message
buildDisplay(dp);
}
}
private void buildDisplay(final DockPanel dp) {
attachPanel.notifyUploadComplete(attachementId);
HorizontalPanel hp = new HorizontalPanel();
dp.add(hp, DockPanel.CENTER);
updateMetadata(hp);
}
private void buildUpload(final DockPanel dp) {
setEncoding(FormPanel.ENCODING_MULTIPART);
setMethod(FormPanel.METHOD_POST);
setAction(GWT.getModuleBaseURL() + "attachements");
Label l = new Label();
dp.add(l, DockPanel.WEST);
dp.setCellVerticalAlignment(l, VerticalPanel.ALIGN_MIDDLE);
upload = new FileUpload();
upload.setName(attachementId);
dp.add(upload, DockPanel.CENTER);
droppAttachmentLink = new Anchor(I18N.strings.delete());
droppAttachmentLink
.addClickHandler(createDropAttachmentClickListener());
HorizontalPanel eastPanel = new HorizontalPanel();
upSpinner = new Image("minig/images/spinner_moz.gif");
upSpinner.setVisible(false);
eastPanel.add(upSpinner);
eastPanel.add(droppAttachmentLink);
dp.add(eastPanel, DockPanel.EAST);
addSubmitHandler(new SubmitHandler() {
@Override
public void onSubmit(SubmitEvent event) {
GWT.log("on submit " + attachementId, null);
upSpinner.setVisible(true);
droppAttachmentLink.setVisible(false);
attachPanel.notifyUploadStarted(attachementId);
}
});
addSubmitCompleteHandler(new SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
GWT.log("on submit complete " + attachementId, null);
upSpinner.setVisible(false);
droppAttachmentLink.setVisible(true);
attachPanel.notifyUploadComplete(attachementId);
HorizontalPanel hp = new HorizontalPanel();
Label uploadInfo = new Label();
uploadInfo.setText("File '" + attachementId + "' attached.");
hp.add(uploadInfo);
dp.remove(upload);
dp.add(hp, DockPanel.CENTER);
updateMetadata(hp);
}
});
Timer t = new Timer() {
public void run() {
if (upload.getFilename() != null
&& upload.getFilename().length() > 0) {
GWT.log("filename before upload: " + upload.getFilename(),
null);
cancel();
submit();
}
}
};
t.scheduleRepeating(300);
}
private void updateMetadata(final HorizontalPanel hp) {
AsyncCallback<AttachmentMetadata[]> ac = new AsyncCallback<AttachmentMetadata[]>() {
public void onFailure(Throwable caught) {
if (upSpinner != null) {
upSpinner.setVisible(false);
}
GWT.log("Error fetching metadata for " + attachementId, caught);
}
public void onSuccess(AttachmentMetadata[] meta) {
if (meta != null && meta.length == 1 && meta[0] != null) {
hp.clear();
hp.add(new AttachmentDisplay(meta[0], attachementId));
} else {
GWT.log("Empty metadata", null);
}
if (upSpinner != null) {
upSpinner.setVisible(false);
}
}
};
if (upSpinner != null) {
upSpinner.setVisible(true);
}
attachPanel.getManager().getAttachementMetadata(
new String[] { attachementId }, ac);
}
private ClickHandler createDropAttachmentClickListener() {
final AttachmentUploadWidget auw = this;
return new ClickHandler() {
public void onClick(ClickEvent ev) {
if (attachPanel.getAttachList().getWidgetCount() == 1) {
attachPanel.reset();
} else {
attachPanel.getAttachList().remove(auw);
attachPanel.droppAnAttachment(auw.attachementId);
}
}
};
}
}
|
[
"tcataldo@gmail.com"
] |
tcataldo@gmail.com
|
3da05559b81c77f16a9f8b2c0f79636f960261f6
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-14263-89-25-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/web/Utils_ESTest_scaffolding.java
|
1bd5cdf94e3aa9a6b7aea205a45701f090b5b66a
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 427
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Apr 03 00:31:26 UTC 2020
*/
package com.xpn.xwiki.web;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class Utils_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
e212adb2cca192da3b120dd36b62b469a525e242
|
6552244c7ef44150ea74cef7ec801d5a9f7171e9
|
/app/src/main/java/com/google/android/gms/reminders/internal/ref/DateTimeRef.java
|
3f32f4645cb1dca5f5a13386ad70cefc7af6878d
|
[] |
no_license
|
amithbm/cbskeep
|
c9469156efd307fb474d817760a0b426af8f7c5c
|
a800f00ab617cba49d1a1bea1f0282c0cde525e7
|
refs/heads/master
| 2016-09-06T12:42:33.824977
| 2015-08-24T15:33:50
| 2015-08-24T15:33:50
| 41,311,235
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,914
|
java
|
package com.google.android.gms.reminders.internal.ref;
import android.os.Parcel;
import com.google.android.gms.common.data.DataHolder;
import com.google.android.gms.reminders.model.DateTime;
import com.google.android.gms.reminders.model.DateTimeEntity;
import com.google.android.gms.reminders.model.Time;
public class DateTimeRef extends zza
implements DateTime
{
private boolean zzbmA = false;
private TimeRef zzbmB;
public DateTimeRef(DataHolder paramDataHolder, int paramInt, String paramString)
{
super(paramDataHolder, paramInt, paramString);
}
public static boolean zza(DataHolder paramDataHolder, int paramInt1, int paramInt2, String paramString)
{
return (paramDataHolder.zzj(zzT(paramString, "year"), paramInt1, paramInt2)) && (paramDataHolder.zzj(zzT(paramString, "month"), paramInt1, paramInt2)) && (paramDataHolder.zzj(zzT(paramString, "day"), paramInt1, paramInt2)) && (TimeRef.zza(paramDataHolder, paramInt1, paramInt2, paramString)) && (paramDataHolder.zzj(zzT(paramString, "period"), paramInt1, paramInt2)) && (paramDataHolder.zzj(zzT(paramString, "date_range"), paramInt1, paramInt2)) && (paramDataHolder.zzj(zzT(paramString, "absolute_time_ms"), paramInt1, paramInt2)) && (paramDataHolder.zzj(zzT(paramString, "unspecified_future_time"), paramInt1, paramInt2)) && (paramDataHolder.zzj(zzT(paramString, "all_day"), paramInt1, paramInt2));
}
public int describeContents()
{
return 0;
}
public boolean equals(Object paramObject)
{
if (!(paramObject instanceof DateTime))
return false;
if (this == paramObject)
return true;
return DateTimeEntity.zza(this, (DateTime)paramObject);
}
public Long getAbsoluteTimeMs()
{
return getAsLong(zzer("absolute_time_ms"));
}
public Boolean getAllDay()
{
return Boolean.valueOf(getBoolean(zzer("all_day")));
}
public Integer getDateRange()
{
return getAsInteger(zzer("date_range"));
}
public Integer getDay()
{
return getAsInteger(zzer("day"));
}
public Integer getMonth()
{
return getAsInteger(zzer("month"));
}
public Integer getPeriod()
{
return getAsInteger(zzer("period"));
}
public Time getTime()
{
if (!zzbmA)
{
zzbmA = true;
if (!TimeRef.zza(mDataHolder, zzaiZ, zzaja, zzbne))
break label44;
}
label44: for (zzbmB = null; ; zzbmB = new TimeRef(mDataHolder, zzaiZ, zzbne))
return zzbmB;
}
public Boolean getUnspecifiedFutureTime()
{
return Boolean.valueOf(getBoolean(zzer("unspecified_future_time")));
}
public Integer getYear()
{
return getAsInteger(zzer("year"));
}
public int hashCode()
{
return DateTimeEntity.zzb(this);
}
public void writeToParcel(Parcel paramParcel, int paramInt)
{
new DateTimeEntity(this).writeToParcel(paramParcel, paramInt);
}
public DateTime zzCf()
{
return new DateTimeEntity(this);
}
}
|
[
"amithbm@gmail.com"
] |
amithbm@gmail.com
|
a523e61951055751bd18a6079c66d90ac1c52d12
|
095b0f77ffdad9d735710c883d5dafd9b30f8379
|
/src/android/support/v4/b/b.java
|
d4cbc9325b0c7579ddc7febaa55e7211868f9b12
|
[] |
no_license
|
wubainian/smali_to_java
|
d49f9b1b9b5ae3b41e350cc17c84045bdc843cde
|
47cfc88bbe435a5289fb71a26d7b730db8366373
|
refs/heads/master
| 2021-01-10T01:52:44.648391
| 2016-03-10T12:10:09
| 2016-03-10T12:10:09
| 53,547,707
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 596
|
java
|
package android.support.v4.b
import java.util.Map;
class b extends android.support.v4.b.f{
//instance field
final synthetic android.support.v4.b.a a;
//init method
b(android.support.v4.b.a aa0){
}
//ordinary method
protected int a(){
}
protected int a(Object aObject0){
}
protected Object a(int aint0, int aint0){
}
protected Object a(int aint0, Object aObject0){
}
protected void a(int aint0){
}
protected void a(Object aObject0, Object aObject0){
}
protected int b(Object aObject0){
}
protected Map b(){
}
protected void c(){
}
}
|
[
"guoliang@tigerjoys.com"
] |
guoliang@tigerjoys.com
|
3e46f1a77d2379edd05347a1cce5ae53ee81c558
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Chart/22/org/jfree/data/time/ohlc/OHLCItem_getHighValue_107.java
|
b61f01d5fd05719ba886c5fcbc4cd4f8e4b5500a
|
[] |
no_license
|
hvdthong/NetML
|
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
|
9bb103da21327912e5a29cbf9be9ff4d058731a5
|
refs/heads/master
| 2021-06-30T15:03:52.618255
| 2020-10-07T01:58:48
| 2020-10-07T01:58:48
| 150,383,588
| 1
| 1
| null | 2018-09-26T07:08:45
| 2018-09-26T07:08:44
| null |
UTF-8
|
Java
| false
| false
| 369
|
java
|
org jfree data time ohlc
item repres data form period open high low close
ohlc item ohlcitem compar object item comparableobjectitem
return high
high
high gethighvalu
ohlc ohlc ohlc object getobject
ohlc
ohlc high gethigh
doubl nan
|
[
"hvdthong@gmail.com"
] |
hvdthong@gmail.com
|
155d0dc1f4add79bb23533eb698716dc35b9ba2e
|
dfd0c4f472154b65e643b59e13b7f9ddd321860c
|
/src/me/staartvin/plugins/pluginlibrary/util/Util.java
|
53fb3071e21c7b17cf38f0fbf38a67a210b541c1
|
[] |
no_license
|
recon88/PluginLibrary
|
d9994e1b98d5ccb2f9486dc6fc1a74cfeea58df4
|
0ab6e6c22d190e8da64264c6095ffcbccfddeddc
|
refs/heads/master
| 2021-08-14T05:59:14.462830
| 2017-11-14T17:46:09
| 2017-11-14T17:46:09
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,586
|
java
|
package me.staartvin.plugins.pluginlibrary.util;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
/**
* Util class
* <p>
* Date created: 17:38:32 12 aug. 2015
*
* @author Staartvin
*
*/
public class Util {
/**
* Get the name of this food item.
*
* @param item
* ItemStack to get the name of.
* @return Name of food, or null if not a valid food item.
*/
public static String getFoodName(ItemStack item) {
// Returns null if not a valid food item
// Got Materials from
// https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
if (item == null)
return null;
switch (item.getType()) {
case APPLE:
return "APPLE";
case BAKED_POTATO:
return "BAKED_POTATO";
case BREAD:
return "BREAD";
case CAKE_BLOCK: // not working atm
return "CAKE_BLOCK";
case CARROT_ITEM:
return "CARROT_ITEM";
case COOKED_CHICKEN:
return "COOKED_CHICKEN";
case COOKED_FISH: {
if (item.getDurability() == (short) 1) {
return "COOKED_SALMON";
}
return "COOKED_FISH";
}
case COOKED_MUTTON:
return "COOKED_MUTTON";
case GRILLED_PORK:
return "GRILLED_PORK";
case COOKED_RABBIT:
return "COOKED_RABBIT";
case COOKIE:
return "COOKIE";
case GOLDEN_APPLE: {
if (item.getDurability() == (short) 1) {
return "ENCHANTED_GOLDEN_APPLE";
}
return "GOLDEN_APPLE";
}
case GOLDEN_CARROT:
return "GOLDEN_CARROT";
case MELON:
return "MELON";
case MUSHROOM_SOUP:
return "MUSHROOM_SOUP";
case RABBIT_STEW:
return "RABBIT_STEW";
case RAW_BEEF:
return "RAW_BEEF";
case RAW_CHICKEN:
return "RAW_CHICKEN";
case RAW_FISH: {
if (item.getDurability() == (short) 1) {
return "RAW_SALMON";
} else if (item.getDurability() == (short) 2) {
return "CLOWNFISH";
} else if (item.getDurability() == (short) 3) {
return "PUFFERFISH";
}
return "RAW_FISH";
}
case POISONOUS_POTATO:
return "POISONOUS_POTATO";
case POTATO:
return "POTATO";
case PUMPKIN_PIE:
return "PUMPKIN_PIE";
case MUTTON:
return "MUTTON"; // raw
case COOKED_BEEF:
return "COOKED_BEEF";
case RABBIT:
return "RABBIT";
case ROTTEN_FLESH:
return "ROTTEN_FLESH";
case SPIDER_EYE:
return "SPIDER_EYE";
default:
return null;
}
}
@SuppressWarnings("deprecation")
public static ItemStack getFoodItemFromName(String name) {
// Cannot use switch, is only supported in Java 1.7+
if (name == null)
return null;
name = name.toUpperCase();
name = name.replace(" ", "_");
if (name.equals("APPLE")) {
return new ItemStack(Material.APPLE, 1);
} else if (name.equals("BAKED_POTATO")) {
return new ItemStack(Material.BAKED_POTATO, 1);
} else if (name.equals("BREAD")) {
return new ItemStack(Material.BREAD, 1);
} else if (name.equals("CAKE_BLOCK")) {
return new ItemStack(Material.CAKE_BLOCK, 1);
} else if (name.equals("CARROT_ITEM")) {
return new ItemStack(Material.CARROT_ITEM, 1);
} else if (name.equals("COOKED_CHICKEN")) {
return new ItemStack(Material.COOKED_CHICKEN, 1);
} else if (name.equals("COOKED_FISH")) {
return new ItemStack(Material.COOKED_FISH, 1);
} else if (name.equals("COOKED_SALMON")) {
return new ItemStack(Material.COOKED_FISH.getId(), 1, (short) 1);
} else if (name.equals("COOKED_MUTTON")) {
return new ItemStack(Material.COOKED_MUTTON, 1);
} else if (name.equals("GRILLED_PORK")) {
return new ItemStack(Material.GRILLED_PORK, 1);
} else if (name.equals("COOKED_RABBIT")) {
return new ItemStack(Material.COOKED_RABBIT, 1);
} else if (name.equals("COOKIE")) {
return new ItemStack(Material.COOKIE, 1);
} else if (name.equals("GOLDEN_APPLE")) {
return new ItemStack(Material.GOLDEN_APPLE, 1);
} else if (name.equals("ENCHANTED_GOLDEN_APPLE")) {
return new ItemStack(Material.GOLDEN_APPLE.getId(), 1, (short) 1);
} else if (name.equals("GOLDEN_CARROT")) {
return new ItemStack(Material.GOLDEN_CARROT, 1);
} else if (name.equals("MELON")) {
return new ItemStack(Material.MELON, 1);
} else if (name.equals("MUSHROOM_SOUP")) {
return new ItemStack(Material.MUSHROOM_SOUP, 1);
} else if (name.equals("RABBIT_STEW")) {
return new ItemStack(Material.RABBIT_STEW, 1);
} else if (name.equals("RAW_BEEF")) {
return new ItemStack(Material.RAW_BEEF, 1);
} else if (name.equals("RAW_CHICKEN")) {
return new ItemStack(Material.RAW_CHICKEN, 1);
} else if (name.equals("RAW_FISH")) {
return new ItemStack(Material.RAW_FISH, 1);
} else if (name.equals("RAW_SALMON")) {
return new ItemStack(Material.RAW_FISH.getId(), 1, (short) 1);
} else if (name.equals("CLOWNFISH")) {
return new ItemStack(Material.RAW_FISH.getId(), 1, (short) 2);
} else if (name.equals("PUFFERFISH")) {
return new ItemStack(Material.RAW_FISH.getId(), 1, (short) 3);
} else if (name.equals("POISONOUS_POTATO")) {
return new ItemStack(Material.POISONOUS_POTATO, 1);
} else if (name.equals("POTATO")) {
return new ItemStack(Material.POTATO, 1);
} else if (name.equals("PUMPKIN_PIE")) {
return new ItemStack(Material.PUMPKIN_PIE, 1);
} else if (name.equals("MUTTON")) {
return new ItemStack(Material.MUTTON, 1);
} else if (name.equals("COOKED_BEEF")) {
return new ItemStack(Material.COOKED_BEEF, 1);
} else if (name.equals("RABBIT")) {
return new ItemStack(Material.RABBIT, 1);
} else if (name.equals("ROTTEN_FLESH")) {
return new ItemStack(Material.ROTTEN_FLESH, 1);
} else if (name.equals("SPIDER_EYE")) {
return new ItemStack(Material.SPIDER_EYE, 1);
} else
return null;
}
}
|
[
"mijnleraar@msn.com"
] |
mijnleraar@msn.com
|
69966dfb0a7bd5ce038cbef3731c70e7fa1f5331
|
ccf94dcb6b1500fcbbd56964ae8c4832a496b8b3
|
/java/baiduads-sdk-auto/src/main/java/com/baidu/dev2/api/sdk/campaignfeed/model/CampaignFeedFilter.java
|
b4000f13a6c115b4febfa02d8dfc1d1a5fc6e9a3
|
[
"Apache-2.0"
] |
permissive
|
baidu/baiduads-sdk
|
24c36b5cf3da9362ec5c8ecd417ff280421198ff
|
176363de5e8a4e98aaca039e4300703c3964c1c7
|
refs/heads/main
| 2023-06-08T15:40:24.787863
| 2023-05-20T03:40:51
| 2023-05-20T03:40:51
| 446,718,177
| 16
| 11
|
Apache-2.0
| 2023-06-02T05:19:40
| 2022-01-11T07:23:17
|
Python
|
UTF-8
|
Java
| false
| false
| 2,912
|
java
|
/*
* dev2 api schema
* 'dev2.baidu.com' api schema
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.baidu.dev2.api.sdk.campaignfeed.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* CampaignFeedFilter
*/
@JsonPropertyOrder({
CampaignFeedFilter.JSON_PROPERTY_BSTYPE
})
@JsonTypeName("CampaignFeedFilter")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CampaignFeedFilter {
public static final String JSON_PROPERTY_BSTYPE = "bstype";
private List<Integer> bstype = null;
public CampaignFeedFilter() {
}
public CampaignFeedFilter bstype(List<Integer> bstype) {
this.bstype = bstype;
return this;
}
public CampaignFeedFilter addBstypeItem(Integer bstypeItem) {
if (this.bstype == null) {
this.bstype = new ArrayList<>();
}
this.bstype.add(bstypeItem);
return this;
}
/**
* Get bstype
* @return bstype
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_BSTYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<Integer> getBstype() {
return bstype;
}
@JsonProperty(JSON_PROPERTY_BSTYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setBstype(List<Integer> bstype) {
this.bstype = bstype;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CampaignFeedFilter campaignFeedFilter = (CampaignFeedFilter) o;
return Objects.equals(this.bstype, campaignFeedFilter.bstype);
}
@Override
public int hashCode() {
return Objects.hash(bstype);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CampaignFeedFilter {\n");
sb.append(" bstype: ").append(toIndentedString(bstype)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"jiangyuan04@baidu.com"
] |
jiangyuan04@baidu.com
|
796f1788fb536149a2c14fc521560db43418ca01
|
06b668ff0ac043e2847abd70786de675e14c2b17
|
/tsofim-service/src/main/java/com/tsofim/servicers/rabbitService/RabbitService.java
|
57b6588a5a94e5ebb73dd6c20c0eaadb0822c307
|
[] |
no_license
|
smilyk/atsarat-briut-microservices
|
b1c954eedb85abc721728dfaef85dbd5bb0cd9be
|
eafe29b38eed54aba115fe358b945349bece3adc
|
refs/heads/master
| 2023-01-23T21:58:07.985172
| 2020-11-25T17:34:02
| 2020-11-25T17:34:02
| 303,089,552
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 308
|
java
|
package com.tsofim.servicers.rabbitService;
import com.tsofim.dto.EmailDto;
import com.tsofim.dto.RabbitDto;
import org.springframework.stereotype.Component;
@Component
public interface RabbitService {
void receivedMessage(RabbitDto incomingMessage);
void sendToEmailService(EmailDto emailDto);
}
|
[
"smilyk1982@gmail.com"
] |
smilyk1982@gmail.com
|
cdcff3fc4266eef3663e673659d4e724b2723c09
|
a9dc8d7d1ec02cb809e290aafe8d01b57e3ffbb5
|
/microservices/product-service/src/test/java/com/github/microservices/core/product/PersistenceTests.java
|
35f84436943ae13ac835c368fe4171f2b00a6c42
|
[] |
no_license
|
fabriciolfj/microservices_v2
|
487a985b5eafe49030f5d7ba1bc71aedbe480145
|
88a87077e140581f79458e84cc9977934a10dcf6
|
refs/heads/main
| 2023-07-19T13:13:45.190271
| 2021-08-31T22:12:52
| 2021-08-31T22:12:52
| 385,767,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,987
|
java
|
package com.github.microservices.core.product;
import static java.util.stream.IntStream.rangeClosed;
import static org.junit.jupiter.api.Assertions.*;
import static org.springframework.data.domain.Sort.Direction.ASC;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration;
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.dao.OptimisticLockingFailureException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import com.github.microservices.core.product.persistence.ProductEntity;
import com.github.microservices.core.product.persistence.ProductRepository;
@DataMongoTest(excludeAutoConfiguration = EmbeddedMongoAutoConfiguration.class)
class PersistenceTests extends MongoDbTestBase {
@Autowired
private ProductRepository repository;
private ProductEntity savedEntity;
@BeforeEach
void setupDb() {
repository.deleteAll();
ProductEntity entity = new ProductEntity(1, "n", 1);
savedEntity = repository.save(entity);
assertEqualsProduct(entity, savedEntity);
}
@Test
void create() {
ProductEntity newEntity = new ProductEntity(2, "n", 2);
repository.save(newEntity);
ProductEntity foundEntity = repository.findById(newEntity.getId()).get();
assertEqualsProduct(newEntity, foundEntity);
assertEquals(2, repository.count());
}
@Test
void update() {
savedEntity.setName("n2");
repository.save(savedEntity);
ProductEntity foundEntity = repository.findById(savedEntity.getId()).get();
assertEquals(1, (long)foundEntity.getVersion());
assertEquals("n2", foundEntity.getName());
}
@Test
void delete() {
repository.delete(savedEntity);
assertFalse(repository.existsById(savedEntity.getId()));
}
@Test
void getByProductId() {
Optional<ProductEntity> entity = repository.findByProductId(savedEntity.getProductId());
assertTrue(entity.isPresent());
assertEqualsProduct(savedEntity, entity.get());
}
@Test
void duplicateError() {
assertThrows(DuplicateKeyException.class, () -> {
ProductEntity entity = new ProductEntity(savedEntity.getProductId(), "n", 1);
repository.save(entity);
});
}
@Test
void optimisticLockError() {
// Store the saved entity in two separate entity objects
ProductEntity entity1 = repository.findById(savedEntity.getId()).get();
ProductEntity entity2 = repository.findById(savedEntity.getId()).get();
// Update the entity using the first entity object
entity1.setName("n1");
repository.save(entity1);
// Update the entity using the second entity object.
// This should fail since the second entity now holds an old version number, i.e. an Optimistic Lock Error
assertThrows(OptimisticLockingFailureException.class, () -> {
entity2.setName("n2");
repository.save(entity2);
});
// Get the updated entity from the database and verify its new sate
ProductEntity updatedEntity = repository.findById(savedEntity.getId()).get();
assertEquals(1, (int)updatedEntity.getVersion());
assertEquals("n1", updatedEntity.getName());
}
@Test
void paging() {
repository.deleteAll();
List<ProductEntity> newProducts = rangeClosed(1001, 1010)
.mapToObj(i -> new ProductEntity(i, "name " + i, i))
.collect(Collectors.toList());
repository.saveAll(newProducts);
Pageable nextPage = PageRequest.of(0, 4, ASC, "productId");
nextPage = testNextPage(nextPage, "[1001, 1002, 1003, 1004]", true);
nextPage = testNextPage(nextPage, "[1005, 1006, 1007, 1008]", true);
nextPage = testNextPage(nextPage, "[1009, 1010]", false);
}
private Pageable testNextPage(Pageable nextPage, String expectedProductIds, boolean expectsNextPage) {
Page<ProductEntity> productPage = repository.findAll(nextPage);
assertEquals(expectedProductIds, productPage.getContent().stream().map(p -> p.getProductId()).collect(Collectors.toList()).toString());
assertEquals(expectsNextPage, productPage.hasNext());
return productPage.nextPageable();
}
private void assertEqualsProduct(ProductEntity expectedEntity, ProductEntity actualEntity) {
assertEquals(expectedEntity.getId(), actualEntity.getId());
assertEquals(expectedEntity.getVersion(), actualEntity.getVersion());
assertEquals(expectedEntity.getProductId(), actualEntity.getProductId());
assertEquals(expectedEntity.getName(), actualEntity.getName());
assertEquals(expectedEntity.getWeight(), actualEntity.getWeight());
}
}
|
[
"fabricio.jacob@outlook.com"
] |
fabricio.jacob@outlook.com
|
9dfa2c9a965bbe36f8c8006e9918f4c65b3a8b51
|
02219c56cd31319c512f8ad68b1d1742b631a271
|
/org.eclipse.skalli.view.ext/src/main/java/org/eclipse/skalli/view/ext/Navigator.java
|
1f0a2452ef5150dd88d8bd3e62facd0c2886ce73
|
[] |
no_license
|
hannic/skalli
|
4d0afd8e35555430b1e138bd9d72880efa93f469
|
2c0ef354437555635949f9f92158936334915f54
|
refs/heads/master
| 2021-01-20T23:54:09.312768
| 2011-10-26T09:50:55
| 2011-11-04T12:58:59
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,184
|
java
|
/*******************************************************************************
* Copyright (c) 2010, 2011 SAP AG 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:
* SAP AG - initial API and implementation
*******************************************************************************/
package org.eclipse.skalli.view.ext;
import org.eclipse.skalli.common.User;
import org.eclipse.skalli.model.core.Project;
public interface Navigator {
public void navigateProjectView(Project project);
public void navigateProjectEditView(Project project);
public void navigateProjectNewView();
public void navigateBrowseView();
public void navigateWelcomeView();
public void navigateTagView(String tag);
public void navigateSearchResultView(String query);
public void navigateUserView(User user);
public void navigateLoginUserView();
public void navigateAllTagView();
public void showFeedbackWindow();
}
|
[
"michael.ochmann@sap.com"
] |
michael.ochmann@sap.com
|
cd26dd158b7593c445a23dd7d4ba43d32ec6faae
|
b2b8fac233920fdebd06d1601c3c670490c0da59
|
/java/nepxion-swing/src/com/nepxion/swing/splash/JCaptionSplashWindow.java
|
041b7cd1cbdeeb36723af13a956bac4967a31f84
|
[
"Apache-2.0"
] |
permissive
|
DmytroRybka/nepxion
|
5af80829bdcf1d738bccbf14a4707fae5b9ce28e
|
36412c4a59d40bb4a9a7208224e53f2e4e4c55eb
|
refs/heads/master
| 2020-04-16T03:37:57.532332
| 2013-05-29T02:56:01
| 2013-05-29T02:56:01
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,058
|
java
|
package com.nepxion.swing.splash;
/**
* <p>Title: Nepxion Swing</p>
* <p>Description: Nepxion Swing Repository</p>
* <p>Copyright: Copyright (c) 2010</p>
* <p>Company: Nepxion</p>
* @author Neptune
* @email hj_ren@msn.com
* @version 1.0
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.Icon;
import javax.swing.JWindow;
import com.nepxion.swing.window.WindowManager;
public class JCaptionSplashWindow
extends JWindow
{
private JCaptionSplash captionSplash;
public JCaptionSplashWindow(Icon splashIcon, int[] captionStartPosition, int[] captionSize, String[] caption)
{
this(splashIcon, captionStartPosition, captionSize, caption, true);
}
public JCaptionSplashWindow(Icon splashIcon, int[] captionStartPosition, int[] captionSize, String[] caption, boolean isAlwaysOnTop)
{
this(splashIcon, Color.white, captionStartPosition, captionSize, caption, isAlwaysOnTop);
}
public JCaptionSplashWindow(Icon splashIcon, Color splashColor, int[] captionStartPosition, int[] captionSize, String[] caption, boolean isAlwaysOnTop)
{
this(new JCaptionSplash(splashIcon, splashColor, captionStartPosition, captionSize, caption), isAlwaysOnTop);
}
public JCaptionSplashWindow(JCaptionSplash captionSplash)
{
this(captionSplash, true);
}
public JCaptionSplashWindow(final JCaptionSplash captionSplash, boolean isAlwaysOnTop)
{
this.captionSplash = captionSplash;
Container container = getContentPane();
container.setLayout(new BorderLayout());
container.add(captionSplash, BorderLayout.CENTER);
addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent e)
{
setVisible(false);
}
}
);
WindowManager.setCenter(this, container.getPreferredSize());
WindowManager.setAlwaysOnTop(this, isAlwaysOnTop);
}
public JCaptionSplash getCaptionSplash()
{
return captionSplash;
}
}
|
[
"HaoJun.Ren@4900acfa-993c-71f3-3719-b31e1bbe1dc8"
] |
HaoJun.Ren@4900acfa-993c-71f3-3719-b31e1bbe1dc8
|
e70ed43ab7cf3d9872afbee7320a4226cc66f040
|
e41507592722fd1549a9b43d7545b4d6d5d256ed
|
/src/main/java/org/fhir/pojo/ReferralRequestRequesterHelper.java
|
fc6f1e028ecab4afde3c29a63408264ca25d633e
|
[
"MIT"
] |
permissive
|
gmai2006/fhir
|
a91636495409615ab41cc2a01e296cddc64159ee
|
8613874a4a93a108c8520f8752155449464deb48
|
refs/heads/master
| 2021-05-02T07:11:25.129498
| 2021-02-26T00:17:15
| 2021-02-26T00:17:15
| 120,861,248
| 2
| 0
| null | 2020-01-14T22:16:55
| 2018-02-09T05:29:57
|
Java
|
UTF-8
|
Java
| false
| false
| 2,384
|
java
|
/*
* #%L
* FHIR Implementation
* %%
* Copyright (C) 2018 DataScience 9 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.
* #L%
*/
/**
* This code is 100% AUTO generated. Please do not modify it DIRECTLY
* If you need new features or function or changes please update the templates
* then submit the template through our web interface.
*/
package org.fhir.pojo;
import org.fhir.entity.ReferralRequestRequesterModel;
import com.google.gson.GsonBuilder;
/**
* Auto generated from the FHIR specification
* generated on 07/14/2018
*/
public class ReferralRequestRequesterHelper {
public static java.util.List<ReferralRequestRequester> fromArray2Array(java.util.List<ReferralRequestRequesterModel> list) {
return
list.stream()
.map(x -> new ReferralRequestRequester(x))
.collect(java.util.stream.Collectors.toList());
}
public static ReferralRequestRequester fromArray2Object(java.util.List<ReferralRequestRequesterModel> list) {
return new ReferralRequestRequester(list.get(0));
}
public static java.util.List<ReferralRequestRequesterModel> toModel(ReferralRequestRequester reference, String parentId) {
ReferralRequestRequesterModel model = new ReferralRequestRequesterModel(reference, parentId);
return java.util.Arrays.asList(new ReferralRequestRequesterModel[] { model });
}
public static java.util.List<ReferralRequestRequesterModel> toModelFromArray(java.util.List<ReferralRequestRequester> list, String parentId) {
return (java.util.List<ReferralRequestRequesterModel>)list.stream()
.map(x -> new ReferralRequestRequesterModel(x, parentId))
.collect(java.util.stream.Collectors.toList());
}
public static ReferralRequestRequester fromJson(String json) {
if (null == json) return null;
return new GsonBuilder().create().fromJson(json, ReferralRequestRequester.class);
}
}
|
[
"gmai2006@gmail.com"
] |
gmai2006@gmail.com
|
25b51ace78bb8fca63c86d8edf01b79ecc54b41d
|
50345f0295e8d7c6d063f7c0d06c80eccbb29963
|
/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/logger/LoginLogMapper.java
|
1617fe075125fed97e5d78c26f819da9b7102205
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
YunaiV/ruoyi-vue-pro
|
68189842441ce0232ce1cffc10fdc109ade7d7a1
|
ebf4ac1d5a80e2fb31cdd94a10510ad176e910b8
|
refs/heads/master
| 2023-08-17T10:34:07.385153
| 2023-08-11T16:43:12
| 2023-08-11T16:43:12
| 332,357,698
| 21,744
| 4,192
|
MIT
| 2023-09-12T05:06:36
| 2021-01-24T03:18:25
|
Java
|
UTF-8
|
Java
| false
| false
| 2,297
|
java
|
package cn.iocoder.yudao.module.system.dal.mysql.logger;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogExportReqVO;
import cn.iocoder.yudao.module.system.controller.admin.logger.vo.loginlog.LoginLogPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.logger.LoginLogDO;
import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface LoginLogMapper extends BaseMapperX<LoginLogDO> {
default PageResult<LoginLogDO> selectPage(LoginLogPageReqVO reqVO) {
LambdaQueryWrapperX<LoginLogDO> query = new LambdaQueryWrapperX<LoginLogDO>()
.likeIfPresent(LoginLogDO::getUserIp, reqVO.getUserIp())
.likeIfPresent(LoginLogDO::getUsername, reqVO.getUsername())
.betweenIfPresent(LoginLogDO::getCreateTime, reqVO.getCreateTime());
if (Boolean.TRUE.equals(reqVO.getStatus())) {
query.eq(LoginLogDO::getResult, LoginResultEnum.SUCCESS.getResult());
} else if (Boolean.FALSE.equals(reqVO.getStatus())) {
query.gt(LoginLogDO::getResult, LoginResultEnum.SUCCESS.getResult());
}
query.orderByDesc(LoginLogDO::getId); // 降序
return selectPage(reqVO, query);
}
default List<LoginLogDO> selectList(LoginLogExportReqVO reqVO) {
LambdaQueryWrapperX<LoginLogDO> query = new LambdaQueryWrapperX<LoginLogDO>()
.likeIfPresent(LoginLogDO::getUserIp, reqVO.getUserIp())
.likeIfPresent(LoginLogDO::getUsername, reqVO.getUsername())
.betweenIfPresent(LoginLogDO::getCreateTime, reqVO.getCreateTime());
if (Boolean.TRUE.equals(reqVO.getStatus())) {
query.eq(LoginLogDO::getResult, LoginResultEnum.SUCCESS.getResult());
} else if (Boolean.FALSE.equals(reqVO.getStatus())) {
query.gt(LoginLogDO::getResult, LoginResultEnum.SUCCESS.getResult());
}
query.orderByDesc(LoginLogDO::getId); // 降序
return selectList(query);
}
}
|
[
"zhijiantianya@gmail.com"
] |
zhijiantianya@gmail.com
|
7139477a8dd4af5c92728e83ab5014ae3ba7a595
|
3f223c22d2a0c19da2746217268721a98d3333e4
|
/app/src/main/java/com/xdk/develop/df/teacherpart/data/StudentsSendMessage.java
|
bf781678980c527ba5bc214d69b758f36f446414
|
[] |
no_license
|
dajiashifennanshou/teacherPart
|
e9d9155407bbc8af2c217fc6b21496f122e766b9
|
7cfd105dab62d327d3765517db0e99da6ffc8d21
|
refs/heads/master
| 2021-09-03T03:43:47.208362
| 2018-01-05T08:48:46
| 2018-01-05T08:48:46
| 116,363,166
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,025
|
java
|
package com.xdk.develop.df.teacherpart.data;
import java.io.Serializable;
import java.util.ArrayList;
public class StudentsSendMessage implements Serializable{
private ArrayList<CurrentUser> users;
private String issuer, issuedate, motif, content, validdate;
public ArrayList<CurrentUser> getUsers() {
return users;
}
public void setUsers(ArrayList<CurrentUser> users) {
this.users = users;
}
public String getIssuer() {
return issuer;
}
public void setIssuer(String issuer) {
this.issuer = issuer;
}
public String getIssuedate() {
return issuedate;
}
public void setIssuedate(String issuedate) {
this.issuedate = issuedate;
}
public String getMotif() {
return motif;
}
public void setMotif(String motif) {
this.motif = motif;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getValiddate() {
return validdate;
}
public void setValiddate(String validdate) {
this.validdate = validdate;
}
}
|
[
"773983978@qq.com"
] |
773983978@qq.com
|
69d06bad4e9e224e9f4ab4040d19305bf9a512ac
|
4d6f449339b36b8d4c25d8772212bf6cd339f087
|
/netreflected/src/Framework/System.Windows.Forms,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089/system/windows/forms/AccessibleNavigation.java
|
52f38b471260f18992d8e54a69385ac559d12999
|
[
"MIT"
] |
permissive
|
lvyitian/JCOReflector
|
299a64550394db3e663567efc6e1996754f6946e
|
7e420dca504090b817c2fe208e4649804df1c3e1
|
refs/heads/master
| 2022-12-07T21:13:06.208025
| 2020-08-28T09:49:29
| 2020-08-28T09:49:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,243
|
java
|
/*
* MIT License
*
* Copyright (c) 2020 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**************************************************************************************
* <auto-generated>
* This code was generated from a template using JCOReflector
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
* </auto-generated>
*************************************************************************************/
package system.windows.forms;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
// Import section
// PACKAGE_IMPORT_SECTION
/**
* The base .NET class managing System.Windows.Forms.AccessibleNavigation, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. Extends {@link NetObject}.
* <p>
*
* See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Forms.AccessibleNavigation" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Forms.AccessibleNavigation</a>
*/
public class AccessibleNavigation extends NetObject {
/**
* Fully assembly qualified name: System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
*/
public static final String assemblyFullName = "System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
/**
* Assembly name: System.Windows.Forms
*/
public static final String assemblyShortName = "System.Windows.Forms";
/**
* Qualified class name: System.Windows.Forms.AccessibleNavigation
*/
public static final String className = "System.Windows.Forms.AccessibleNavigation";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumReflected = createEnum();
JCEnum classInstance = null;
static JCType createType() {
try {
return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName));
} catch (JCException e) {
return null;
}
}
static JCEnum createEnum() {
try {
return bridge.GetEnum(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName));
} catch (JCException e) {
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public AccessibleNavigation(Object instance) {
super(instance);
if (instance instanceof JCObject) {
try {
String enumName = NetEnum.GetName(classType, (JCObject)instance);
classInstance = enumReflected.fromValue(enumName);
} catch (Throwable t) {
if (JCOBridgeInstance.getDebug())
t.printStackTrace();
classInstance = enumReflected;
}
} else if (instance instanceof JCEnum) {
classInstance = (JCEnum)instance;
}
}
public AccessibleNavigation() {
super();
// add reference to assemblyName.dll file
try {
addReference(JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
} catch (Throwable jcne) {
if (JCOBridgeInstance.getDebug())
jcne.printStackTrace();
}
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public Object getJCOInstance() {
return classInstance;
}
public JCType getJCOType() {
return classType;
}
final static AccessibleNavigation getFrom(JCEnum object, String value) {
try {
return new AccessibleNavigation(object.fromValue(value));
} catch (JCException e) {
return new AccessibleNavigation(object);
}
}
// Enum fields section
public static AccessibleNavigation Up = getFrom(enumReflected, "Up");
public static AccessibleNavigation Down = getFrom(enumReflected, "Down");
public static AccessibleNavigation Left = getFrom(enumReflected, "Left");
public static AccessibleNavigation Right = getFrom(enumReflected, "Right");
public static AccessibleNavigation Next = getFrom(enumReflected, "Next");
public static AccessibleNavigation Previous = getFrom(enumReflected, "Previous");
public static AccessibleNavigation FirstChild = getFrom(enumReflected, "FirstChild");
public static AccessibleNavigation LastChild = getFrom(enumReflected, "LastChild");
// Flags management section
}
|
[
"mario.mastrodicasa@masesgroup.com"
] |
mario.mastrodicasa@masesgroup.com
|
3fbc70651891236f01ba505db2f9a12a4bdc9954
|
0348bc8d7e7454840fccc9c91f621a5a232b71c5
|
/sources/com/google/android/gms/internal/ea.java
|
a768aa6825b62296c53837cc49440a4ae241dfff
|
[] |
no_license
|
nhannguyen95/jump-monster
|
c5927a0f0bd2b4c96a10f9ee5dcc0e8e5717aebe
|
8b7debabfe06cdd4d7cdbcb6253167acd6aea9fd
|
refs/heads/master
| 2020-05-03T07:42:02.128702
| 2019-03-30T03:47:19
| 2019-03-30T03:47:19
| 178,505,506
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,631
|
java
|
package com.google.android.gms.internal;
import android.net.Uri;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import java.util.HashMap;
import java.util.Map;
public class ea extends WebViewClient {
protected final dz lC;
private final Object li = new Object();
private az mF;
private bc mP;
private C0252a oW;
private final HashMap<String, bb> rA = new HashMap();
private C0303u rB;
private cf rC;
private boolean rD = false;
private boolean rE;
private ci rF;
/* renamed from: com.google.android.gms.internal.ea$a */
public interface C0252a {
/* renamed from: a */
void mo1590a(dz dzVar);
}
public ea(dz dzVar, boolean z) {
this.lC = dzVar;
this.rE = z;
}
/* renamed from: c */
private static boolean m838c(Uri uri) {
String scheme = uri.getScheme();
return "http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme);
}
/* renamed from: d */
private void m839d(Uri uri) {
String path = uri.getPath();
bb bbVar = (bb) this.rA.get(path);
if (bbVar != null) {
Map b = dq.m788b(uri);
if (dw.m819n(2)) {
dw.m823y("Received GMSG: " + path);
for (String path2 : b.keySet()) {
dw.m823y(" " + path2 + ": " + ((String) b.get(path2)));
}
}
bbVar.mo1589b(this.lC, b);
return;
}
dw.m823y("No GMSG handler found for GMSG: " + uri);
}
/* renamed from: a */
public final void m840a(cb cbVar) {
cf cfVar = null;
boolean bL = this.lC.bL();
C0303u c0303u = (!bL || this.lC.m829R().lT) ? this.rB : null;
if (!bL) {
cfVar = this.rC;
}
m841a(new ce(cbVar, c0303u, cfVar, this.rF, this.lC.bK()));
}
/* renamed from: a */
protected void m841a(ce ceVar) {
cc.m2968a(this.lC.getContext(), ceVar);
}
/* renamed from: a */
public final void m842a(C0252a c0252a) {
this.oW = c0252a;
}
/* renamed from: a */
public void m843a(C0303u c0303u, cf cfVar, az azVar, ci ciVar, boolean z, bc bcVar) {
m844a("/appEvent", new ay(azVar));
m844a("/canOpenURLs", ba.mH);
m844a("/click", ba.mI);
m844a("/close", ba.mJ);
m844a("/customClose", ba.mK);
m844a("/httpTrack", ba.mL);
m844a("/log", ba.mM);
m844a("/open", new bd(bcVar));
m844a("/touch", ba.mN);
m844a("/video", ba.mO);
this.rB = c0303u;
this.rC = cfVar;
this.mF = azVar;
this.mP = bcVar;
this.rF = ciVar;
m848q(z);
}
/* renamed from: a */
public final void m844a(String str, bb bbVar) {
this.rA.put(str, bbVar);
}
/* renamed from: a */
public final void m845a(boolean z, int i) {
C0303u c0303u = (!this.lC.bL() || this.lC.m829R().lT) ? this.rB : null;
m841a(new ce(c0303u, this.rC, this.rF, this.lC, z, i, this.lC.bK()));
}
/* renamed from: a */
public final void m846a(boolean z, int i, String str) {
cf cfVar = null;
boolean bL = this.lC.bL();
C0303u c0303u = (!bL || this.lC.m829R().lT) ? this.rB : null;
if (!bL) {
cfVar = this.rC;
}
m841a(new ce(c0303u, cfVar, this.mF, this.rF, this.lC, z, i, str, this.lC.bK(), this.mP));
}
/* renamed from: a */
public final void m847a(boolean z, int i, String str, String str2) {
boolean bL = this.lC.bL();
C0303u c0303u = (!bL || this.lC.m829R().lT) ? this.rB : null;
m841a(new ce(c0303u, bL ? null : this.rC, this.mF, this.rF, this.lC, z, i, str, str2, this.lC.bK(), this.mP));
}
public final void aM() {
synchronized (this.li) {
this.rD = false;
this.rE = true;
final cc bH = this.lC.bH();
if (bH != null) {
if (dv.bD()) {
bH.aM();
} else {
dv.rp.post(new Runnable(this) {
final /* synthetic */ ea rH;
public void run() {
bH.aM();
}
});
}
}
}
}
public boolean bP() {
boolean z;
synchronized (this.li) {
z = this.rE;
}
return z;
}
public final void onLoadResource(WebView webView, String url) {
dw.m823y("Loading resource: " + url);
Uri parse = Uri.parse(url);
if ("gmsg".equalsIgnoreCase(parse.getScheme()) && "mobileads.google.com".equalsIgnoreCase(parse.getHost())) {
m839d(parse);
}
}
public final void onPageFinished(WebView webView, String url) {
if (this.oW != null) {
this.oW.mo1590a(this.lC);
this.oW = null;
}
}
/* renamed from: q */
public final void m848q(boolean z) {
this.rD = z;
}
public final void reset() {
synchronized (this.li) {
this.rA.clear();
this.rB = null;
this.rC = null;
this.oW = null;
this.mF = null;
this.rD = false;
this.rE = false;
this.mP = null;
this.rF = null;
}
}
public final boolean shouldOverrideUrlLoading(WebView webView, String url) {
dw.m823y("AdWebView shouldOverrideUrlLoading: " + url);
Uri parse = Uri.parse(url);
if ("gmsg".equalsIgnoreCase(parse.getScheme()) && "mobileads.google.com".equalsIgnoreCase(parse.getHost())) {
m839d(parse);
} else if (this.rD && webView == this.lC && m838c(parse)) {
return super.shouldOverrideUrlLoading(webView, url);
} else {
if (this.lC.willNotDraw()) {
dw.m824z("AdWebView unable to handle URL: " + url);
} else {
Uri uri;
try {
C0294l bJ = this.lC.bJ();
if (bJ != null && bJ.m1183a(parse)) {
parse = bJ.m1181a(parse, this.lC.getContext());
}
uri = parse;
} catch (C0295m e) {
dw.m824z("Unable to append parameter to URL: " + url);
uri = parse;
}
m840a(new cb("android.intent.action.VIEW", uri.toString(), null, null, null, null, null));
}
}
return true;
}
}
|
[
"nhannguyenmath95@gmail.com"
] |
nhannguyenmath95@gmail.com
|
e2c5f94d2f44018579980bb64dccd057ebf84353
|
6b2a8dd202fdce77c971c412717e305e1caaac51
|
/solutions_5751500831719424_0/java/junior94/A.java
|
068ab664bf5782902c7fa17adf25fcec54d144eb
|
[] |
no_license
|
alexandraback/datacollection
|
0bc67a9ace00abbc843f4912562f3a064992e0e9
|
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
|
refs/heads/master
| 2021-01-24T18:27:24.417992
| 2017-05-23T09:23:38
| 2017-05-23T09:23:38
| 84,313,442
| 2
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,455
|
java
|
import java.io.*;
import java.util.StringTokenizer;
public class A {
public static Reader in = new Reader();
public static Writer out = new Writer();
public static void main(String[] args) {
final int T = in.readInt();
for(int t=1; t<=T; t++) {
int N = in.readInt();
String[] strings = new String[N];
for(int i=0; i<N; i++) {
strings[i] = in.readLine();
}
out.printfln("Case #%d: %s", t, getAns(strings, N));
}
out.close();
}
public static String getAns(String[] strings, int N) {
int[] pos = new int[N];
int[] counts = new int[N];
int ans = 0;
while(pos[0] < strings[0].length()) {
char c = strings[0].charAt(pos[0]);
int mid = 0;
for(int i=0; i<N; i++) {
int count = 0;
for(; pos[i]<strings[i].length() && strings[i].charAt(pos[i])==c; pos[i]++) {
count++;
}
if(count==0) {
return "Fegla Won";
}
counts[i] = count;
mid += count;
}
mid /= N;
for(int i=0; i<N; i++) {
ans += Math.abs(counts[i] - mid);
}
}
for(int i=0; i<N; i++) if(pos[i] < strings[i].length()) return "Fegla Won";
return String.valueOf(ans);
}
}
class Reader {
private BufferedReader input;
private StringTokenizer line = new StringTokenizer("");
public Reader() {
input = new BufferedReader(new InputStreamReader(System.in));
}
public Reader(String s) {
try {
input = new BufferedReader(new FileReader(s));
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public void fill() {
try {
if(!line.hasMoreTokens()) line = new StringTokenizer(input.readLine());
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public double nextDouble() {
fill();
return Double.parseDouble(line.nextToken());
}
public String nextWord() {
fill();
return line.nextToken();
}
public int nextInt() {
fill();
return Integer.parseInt(line.nextToken());
}
public long nextLong() {
fill();
return Long.parseLong(line.nextToken());
}
public double readDouble() {
double d = 0;
try {
d = Double.parseDouble(input.readLine());
} catch(IOException io) {io.printStackTrace(); System.exit(0);}
return d;
}
public int readInt() {
int i = 0;
try {
i = Integer.parseInt(input.readLine());
} catch(IOException io) {io.printStackTrace(); System.exit(0);}
return i;
}
public int[] readInts(int n) {
int[] a = new int[n];
for(int i=0; i<n; i++)
a[i] = nextInt();
return a;
}
public void fillInts(int[] a) {
for(int i=0; i<a.length; i++)
a[i] = nextInt();
}
public long readLong() {
long l = 0;
try {
l = Long.parseLong(input.readLine());
} catch(IOException io) {io.printStackTrace(); System.exit(0);}
return l;
}
public String readLine() {
String s = "";
try {
s = input.readLine();
} catch(IOException io) {io.printStackTrace(); System.exit(0);}
return s;
}
}
class Writer {
private BufferedWriter output;
public Writer() {
output = new BufferedWriter(new OutputStreamWriter(System.out));
}
public Writer(String s) {
try {
output = new BufferedWriter(new FileWriter(s));
} catch(Exception ex) { ex.printStackTrace(); System.exit(0);}
}
public void println() {
try {
output.append("\n");
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public void print(Object o) {
try {
output.append(o.toString());
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public void println(Object o) {
try {
output.append(o.toString()+"\n");
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public void printf(String format, Object... args) {
try {
output.append(String.format(format, args));
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public void printfln(String format, Object... args) {
try {
output.append(String.format(format, args)+"\n");
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public void flush() {
try {
output.flush();
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
public void close() {
try {
output.close();
} catch(IOException io) { io.printStackTrace(); System.exit(0);}
}
}
|
[
"eewestman@gmail.com"
] |
eewestman@gmail.com
|
e58cfe8efbac252dceaba60eafda8f98b664afb9
|
c5f0b9a449b0e22ad87a05f2a4d7a010ed167cb3
|
/3_implementation/src/net/hudup/core/alg/MemoryBasedAlgRemote.java
|
2ccc3b62c29b47d2c45d2ea3f7b2c417bdf4b821
|
[
"MIT"
] |
permissive
|
sunflowersoft/hudup-ext
|
91bcd5b48d84ab33d6d8184e381d27d8f42315f7
|
cb62d5d492a82f1ecc7bc28955a52e767837afd3
|
refs/heads/master
| 2023-08-03T12:25:02.578863
| 2023-07-21T08:23:52
| 2023-07-21T08:23:52
| 131,940,602
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 448
|
java
|
/**
* HUDUP: A FRAMEWORK OF E-COMMERCIAL RECOMMENDATION ALGORITHMS
* (C) Copyright by Loc Nguyen's Academic Network
* Project homepage: hudup.locnguyen.net
* Email: ng_phloc@yahoo.com
* Phone: +84-975250362
*/
package net.hudup.core.alg;
/**
* This interface indicates a remote memory-based algorithm.
*
* @author Loc Nguyen
* @version 1.0
*
*/
public interface MemoryBasedAlgRemote extends MemoryBasedAlgRemoteTask, AlgRemote {
}
|
[
"ngphloc@gmail.com"
] |
ngphloc@gmail.com
|
1436a3e588656ff31f979a21b723d02025d6c092
|
ca8ffc48d3b25f50c68b1b9c92ecd012aa1ec5a1
|
/src/main/java/com/cloudera/crunch/impl/mr/collect/PTableBase.java
|
7c27cd97a9e6c9139e817bd3f00212cc68c77052
|
[
"Apache-2.0"
] |
permissive
|
brockn/crunch
|
1bbc1a08e85873110a8c1ae34ee8e4a262cdbb79
|
75fea5602c4b8eb14a3de6b786172b83419ac843
|
refs/heads/master
| 2021-01-18T10:01:11.319070
| 2011-10-17T18:45:49
| 2011-10-17T18:45:49
| 2,595,659
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,876
|
java
|
/**
* Copyright (c) 2011, Cloudera, Inc. All Rights Reserved.
*
* Cloudera, Inc. 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
*
* This software 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.cloudera.crunch.impl.mr.collect;
import java.util.List;
import com.cloudera.crunch.GroupingOptions;
import com.cloudera.crunch.PTable;
import com.cloudera.crunch.Pair;
import com.cloudera.crunch.type.PType;
import com.google.common.collect.Lists;
public abstract class PTableBase<K, V> extends PCollectionImpl<Pair<K, V>>
implements PTable<K, V> {
public PTableBase(String name) {
super(name);
}
public PType<K> getKeyType() {
return getPTableType().getKeyType();
}
public PType<V> getValueType() {
return getPTableType().getValueType();
}
public PGroupedTableImpl<K, V> groupByKey() {
return new PGroupedTableImpl<K, V>(this);
}
public PGroupedTableImpl<K, V> groupByKey(int numReduceTasks) {
return new PGroupedTableImpl<K, V>(this,
GroupingOptions.builder().numReducers(numReduceTasks).build());
}
public PGroupedTableImpl<K, V> groupByKey(GroupingOptions groupingOptions) {
return new PGroupedTableImpl<K, V>(this, groupingOptions);
}
public PTable<K, V> union(PTable<K, V>... others) {
List<PTableBase<K, V>> internal = Lists.newArrayList();
internal.add(this);
for (PTable<K, V> table : others) {
internal.add((PTableBase<K, V>) table);
}
return new UnionTable<K, V>(internal);
}
}
|
[
"jwills@cloudera.com"
] |
jwills@cloudera.com
|
0283736cf29ef2889fd2f3ee821468dd99705fe9
|
5da904713893fec40ca210380cdec6c0b0a00f09
|
/UnicodeBlock/src/java/example/MainPanel.java
|
fe8414a736c4e9afd29d9b008436247bc9b6ad34
|
[
"MIT"
] |
permissive
|
aterai/java-swing-tips
|
27379a0242e5b7d72ccc0af95a12c45b4a1b77f6
|
6941415d3b245aa655522a0ed998a7f50cb2ea95
|
refs/heads/master
| 2023-09-04T02:36:19.294995
| 2023-09-03T16:51:35
| 2023-09-03T16:51:35
| 23,829,681
| 521
| 184
|
MIT
| 2023-09-03T02:05:16
| 2014-09-09T10:51:59
|
Java
|
UTF-8
|
Java
| false
| false
| 2,406
|
java
|
// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@
package example;
import java.awt.*;
import java.util.Objects;
import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
public final class MainPanel extends JPanel {
private MainPanel() {
super(new BorderLayout());
JTextField label = new JTextField();
label.setEditable(false);
label.setFont(label.getFont().deriveFont(32f));
JTextField labelUnicodeBlock = new JTextField();
label.setEditable(false);
JTextArea textArea = new JTextArea("😀😁😂てすとテストTESTtest試験、𠮟┷→");
textArea.addCaretListener(e -> {
try {
int loc = Math.min(e.getDot(), e.getMark());
Document doc = textArea.getDocument();
String txt = doc.getText(loc, 1);
int code = txt.codePointAt(0);
if (Character.isHighSurrogate((char) code)) {
txt = doc.getText(loc, 2);
code = txt.codePointAt(0);
}
Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of(code);
label.setText(String.format("%s: U+%04X", txt, code));
labelUnicodeBlock.setText(Objects.toString(unicodeBlock));
} catch (BadLocationException ex) {
// should never happen
RuntimeException wrap = new StringIndexOutOfBoundsException(ex.offsetRequested());
wrap.initCause(ex);
throw wrap;
}
});
Box box = Box.createVerticalBox();
box.add(label);
box.add(labelUnicodeBlock);
add(new JScrollPane(textArea));
add(box, BorderLayout.SOUTH);
setPreferredSize(new Dimension(320, 240));
}
public static void main(String[] args) {
EventQueue.invokeLater(MainPanel::createAndShowGui);
}
private static void createAndShowGui() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException ignored) {
Toolkit.getDefaultToolkit().beep();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
ex.printStackTrace();
return;
}
JFrame frame = new JFrame("@title@");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.getContentPane().add(new MainPanel());
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
}
|
[
"aterai@outlook.com"
] |
aterai@outlook.com
|
7af75f13940e1cc9215a95a58f3209779d907bc7
|
93afef3b6b074de67578fb70db227bc4c27ae042
|
/camera/src/main/java/com/camera/utils/CheckPermission.java
|
4a1af47208bc1c8957afae3778120eee083c3898
|
[] |
no_license
|
wisn-mirror/WeChatCamera
|
87c425f439d964e8deccc6a642b899f8d5ffdf04
|
7c0bd1e535b91d760b3c99da75fb23559d62f459
|
refs/heads/master
| 2020-04-12T18:16:14.244809
| 2018-12-30T15:32:50
| 2018-12-30T15:32:50
| 162,674,631
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,217
|
java
|
package com.camera.utils;
import android.hardware.Camera;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.util.Log;
/**
* Created by Wisn on 2018/12/21 下午1:40.
*/
public class CheckPermission {
public static final int STATE_RECORDING = -1;
public static final int STATE_NO_PERMISSION = -2;
public static final int STATE_SUCCESS = 1;
/**
* 用于检测是否具有录音权限
*
* @return
*/
public static int getRecordState() {
int minBuffer = AudioRecord.getMinBufferSize(44100, AudioFormat.CHANNEL_IN_MONO, AudioFormat
.ENCODING_PCM_16BIT);
AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, 44100, AudioFormat
.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, (minBuffer * 100));
short[] point = new short[minBuffer];
int readSize = 0;
try {
audioRecord.startRecording();//检测是否可以进入初始化状态
} catch (Exception e) {
if (audioRecord != null) {
audioRecord.release();
audioRecord = null;
}
return STATE_NO_PERMISSION;
}
if (audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) {
//6.0以下机型都会返回此状态,故使用时需要判断bulid版本
//检测是否在录音中
if (audioRecord != null) {
audioRecord.stop();
audioRecord.release();
audioRecord = null;
Log.d("CheckAudioPermission", "录音机被占用");
}
return STATE_RECORDING;
} else {
//检测是否可以获取录音结果
readSize = audioRecord.read(point, 0, point.length);
if (readSize <= 0) {
if (audioRecord != null) {
audioRecord.stop();
audioRecord.release();
audioRecord = null;
}
Log.d("CheckAudioPermission", "录音的结果为空");
return STATE_NO_PERMISSION;
} else {
if (audioRecord != null) {
audioRecord.stop();
audioRecord.release();
audioRecord = null;
}
return STATE_SUCCESS;
}
}
}
public synchronized static boolean isCameraUseable(int cameraID) {
boolean canUse = true;
Camera mCamera = null;
try {
mCamera = Camera.open(cameraID);
// setParameters 是针对魅族MX5。MX5通过Camera.open()拿到的Camera对象不为null
Camera.Parameters mParameters = mCamera.getParameters();
mCamera.setParameters(mParameters);
} catch (Exception e) {
e.printStackTrace();
canUse = false;
} finally {
if (mCamera != null) {
mCamera.release();
} else {
canUse = false;
}
mCamera = null;
}
return canUse;
}
}
|
[
"wuyishun_kmk@outlook.com"
] |
wuyishun_kmk@outlook.com
|
ea6d0870395a2b7ab8518dfd40f5ab9b06f5738c
|
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
|
/genny_JavaWithoutLambdas/applicationModule/src/main/java/applicationModulepackageJava13/Foo43.java
|
155c7b98ed075cc6e792f8c967f3f854c7060924
|
[] |
no_license
|
NikitaKozlov/generated-project-for-desugaring
|
0bc1443ab3ddc84cd289331c726761585766aea7
|
81506b3711004185070ca4bb9a93482b70011d36
|
refs/heads/master
| 2020-03-20T00:35:06.996525
| 2018-06-12T09:30:37
| 2018-06-12T09:30:37
| 137,049,317
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 346
|
java
|
package applicationModulepackageJava13;
public class Foo43 {
public void foo0() {
new applicationModulepackageJava13.Foo42().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
|
[
"nikita.e.kozlov@gmail.com"
] |
nikita.e.kozlov@gmail.com
|
108215fd6c8f1f9eb174ada974c62a595223f443
|
bb45ca5f028b841ca0a08ffef60cedc40090f2c1
|
/app/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java
|
570ddbab0056f4b4d2ff621ce62a436f96360f36
|
[] |
no_license
|
tik5213/myWorldBox
|
0d248bcc13e23de5a58efd5c10abca4596f4e442
|
b0bde3017211cc10584b93e81cf8d3f929bc0a45
|
refs/heads/master
| 2020-04-12T19:52:17.559775
| 2017-08-14T05:49:03
| 2017-08-14T05:49:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,372
|
java
|
package io.netty.handler.codec.http;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
import java.util.ArrayList;
import java.util.List;
public class QueryStringEncoder {
private final Charset charset;
private final List<Param> params;
private final String uri;
private static final class Param {
final String name;
final String value;
Param(String name, String value) {
this.value = value;
this.name = name;
}
}
public QueryStringEncoder(String uri) {
this(uri, HttpConstants.DEFAULT_CHARSET);
}
public QueryStringEncoder(String uri, Charset charset) {
this.params = new ArrayList();
if (uri == null) {
throw new NullPointerException("getUri");
} else if (charset == null) {
throw new NullPointerException("charset");
} else {
this.uri = uri;
this.charset = charset;
}
}
public void addParam(String name, String value) {
if (name == null) {
throw new NullPointerException("name");
}
this.params.add(new Param(name, value));
}
public URI toUri() throws URISyntaxException {
return new URI(toString());
}
public String toString() {
if (this.params.isEmpty()) {
return this.uri;
}
StringBuilder sb = new StringBuilder(this.uri).append('?');
for (int i = 0; i < this.params.size(); i++) {
Param param = (Param) this.params.get(i);
sb.append(encodeComponent(param.name, this.charset));
if (param.value != null) {
sb.append('=');
sb.append(encodeComponent(param.value, this.charset));
}
if (i != this.params.size() - 1) {
sb.append('&');
}
}
return sb.toString();
}
private static String encodeComponent(String s, Charset charset) {
try {
return URLEncoder.encode(s, charset.name()).replace("+", "%20");
} catch (UnsupportedEncodingException e) {
throw new UnsupportedCharsetException(charset.name());
}
}
}
|
[
"18631616220@163.com"
] |
18631616220@163.com
|
343c2e126ef483b59cbb121e80be7a2d5e08ba87
|
5b2c309c903625b14991568c442eb3a889762c71
|
/classes/android/support/v4/a/ap.java
|
7c203b8c45cdaccc76e8ab8ec2bc840b957b16c8
|
[] |
no_license
|
iidioter/xueqiu
|
c71eb4bcc53480770b9abe20c180da693b2d7946
|
a7d8d7dfbaf9e603f72890cf861ed494099f5a80
|
refs/heads/master
| 2020-12-14T23:55:07.246659
| 2016-10-08T08:56:27
| 2016-10-08T08:56:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 259
|
java
|
package android.support.v4.a;
abstract interface ap
{
public abstract void a(bn parambn);
}
/* Location: E:\apk\xueqiu2\classes-dex2jar.jar!\android\support\v4\a\ap.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"1776098770@qq.com"
] |
1776098770@qq.com
|
fd1216f2e88bfe712d02a592accbd20a10860b7f
|
ef8f4e117d4896e0f75b0eb5a9c529bc0e854f2f
|
/game-utils/src/main/java/com/wjybxx/fastjgame/net/rpc/NetMessageType.java
|
00a1bb33c629dc63f40d749fe74c59f78766f479
|
[
"Apache-2.0"
] |
permissive
|
Fighting-Lee/fastjgame
|
0ae8f8224c7853fba3652084e16671ab651b836e
|
3cc9dd87e61a6a5ccf9159d4d6a90262d3abe18d
|
refs/heads/master
| 2023-03-08T23:40:02.046799
| 2021-03-01T05:35:41
| 2021-03-01T05:35:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,672
|
java
|
/*
* Copyright 2019 wjybxx
*
* 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 iBn 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.wjybxx.fastjgame.net.rpc;
/**
* 网络包类型
*
* @author wjybxx
* @version 1.0
* date - 2019/7/24
* github - https://github.com/hl845740757
*/
public enum NetMessageType {
/**
* 客户端请求建立链接
*/
CONNECT_REQUEST(1),
/**
* 服务器通知建立连接结果(验证结果)
*/
CONNECT_RESPONSE(2),
/**
* 心跳包
*/
PING_PONG(3),
/**
* Rpc请求包。
*/
RPC_REQUEST(4),
/**
* Rpc响应包。
*/
RPC_RESPONSE(5),
/**
* 单向消息包。
*/
ONE_WAY_MESSAGE(6);
public final byte pkgType;
NetMessageType(int pkgType) {
this.pkgType = (byte) pkgType;
}
/**
* 通过网络包中的pkgType找到对应的枚举。
*
* @param pkgType 包类型
* @return 包类型对应的枚举
*/
public static NetMessageType forNumber(byte pkgType) {
if (pkgType < 0 || pkgType > values().length) {
return null;
}
return values()[pkgType - 1];
}
}
|
[
"845740757@qq.com"
] |
845740757@qq.com
|
91d9a91f4b644a5467f733a3fd93612f72574cd3
|
0c21777557f347ae4ac1b3197d1f7c28e05aed1b
|
/org/jcodec/ScalingList.java
|
5e3631f9aaef544e51dbdd425e505e497cf4e7c4
|
[] |
no_license
|
dmisuvorov/HappyFresh.Android
|
68421b90399b72523f398aabbfd30b61efaeea1f
|
242c5b0c006e7825ed34da57716d2ba9d1371d65
|
refs/heads/master
| 2020-04-29T06:47:34.143095
| 2016-01-11T06:24:16
| 2016-01-11T06:24:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,758
|
java
|
package org.jcodec;
public class ScalingList
{
public int[] scalingList;
public boolean useDefaultScalingMatrixFlag;
public static ScalingList read(BitReader paramBitReader, int paramInt)
{
ScalingList localScalingList = new ScalingList();
localScalingList.scalingList = new int[paramInt];
int j = 8;
int m = 8;
int k = 0;
if (k < paramInt)
{
int i = m;
boolean bool;
label70:
int[] arrayOfInt;
if (m != 0)
{
i = (j + CAVLCReader.readSE(paramBitReader, "deltaScale") + 256) % 256;
if ((k == 0) && (i == 0))
{
bool = true;
localScalingList.useDefaultScalingMatrixFlag = bool;
}
}
else
{
arrayOfInt = localScalingList.scalingList;
if (i != 0) {
break label121;
}
}
for (;;)
{
arrayOfInt[k] = j;
j = localScalingList.scalingList[k];
k += 1;
m = i;
break;
bool = false;
break label70;
label121:
j = i;
}
}
return localScalingList;
}
public void write(BitWriter paramBitWriter)
{
if (this.useDefaultScalingMatrixFlag) {
CAVLCWriter.writeSE(paramBitWriter, 0, "SPS: ");
}
for (;;)
{
return;
int j = 8;
int i = 0;
while (i < this.scalingList.length)
{
if (8 != 0) {
CAVLCWriter.writeSE(paramBitWriter, this.scalingList[i] - j - 256, "SPS: ");
}
j = this.scalingList[i];
i += 1;
}
}
}
}
/* Location: /Users/michael/Downloads/dex2jar-2.0/HappyFresh.jar!/org/jcodec/ScalingList.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"michael@MJSTONE-MACBOOK.local"
] |
michael@MJSTONE-MACBOOK.local
|
9af6fe88667515c04237a20d3c7347ee21dda77f
|
45d1e88d4275045417b1128b1978bb277de4136c
|
/A03.DesignPattern/B01.TheZenOfDesignPatterns/src/main/java/com/book/study/zen/chapter29/demod/Client.java
|
9ffbdde228dcc35e028d3182f84c4c52d5686f26
|
[
"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
| 357
|
java
|
package com.book.study.zen.chapter29.demod;
public class Client {
public static void main(String[] args) {
// 定义一个实现化角色
Implementor imp = new ConcreteImplementor1();
// 定义一个抽象化角色
Abstraction abs = new RefinedAbstraction(imp);
// 执行行文
abs.request();
}
}
|
[
"837403116@qq.com"
] |
837403116@qq.com
|
4b6e99f373255a4eb9efa58a24d0f172537232f7
|
8f32b0fbacd0e2f58e367225a926755b5cb7473e
|
/type-alias-axon-serializer-integration-test/src/main/java/org/alias/axon/serializer/example/messaging/axon/EventProcessingServiceAdapter.java
|
d6da81ebe7a319b206f1fb436cb1c06ce087959c
|
[
"Apache-2.0"
] |
permissive
|
JohT/alias
|
60038af52852f6ffb592d8904c87e3e7fd33557b
|
ed2072dbbcd2982677ee3e1af5a9d060d21f9dbe
|
refs/heads/master
| 2023-08-21T22:14:38.756410
| 2023-08-16T00:28:59
| 2023-08-16T03:42:13
| 179,568,092
| 8
| 2
|
Apache-2.0
| 2023-09-13T04:49:16
| 2019-04-04T19:58:45
|
Java
|
UTF-8
|
Java
| false
| false
| 2,434
|
java
|
package org.alias.axon.serializer.example.messaging.axon;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Predicate;
import java.util.stream.Stream;
import org.alias.axon.serializer.example.messaging.boundary.query.EventProcessorService;
import org.axonframework.config.EventProcessingConfiguration;
import org.axonframework.eventhandling.TrackedEventMessage;
import org.axonframework.eventhandling.TrackingEventProcessor;
public class EventProcessingServiceAdapter implements EventProcessorService {
private final EventProcessingConfiguration eventProcessing;
private final ThreadFactory threadFactory;
public EventProcessingServiceAdapter(EventProcessingConfiguration eventProcessing, ThreadFactory threadFactory) {
this.eventProcessing = eventProcessing;
this.threadFactory = threadFactory;
}
/**
* {@inheritDoc}
*/
@Override
public boolean waitForMessage(String processingGroup, Class<?> messageType, String messageContent) {
TrackingEventProcessor trackingEventProcessor = getTrackingEventProcessor(processingGroup);
Stream<? extends TrackedEventMessage<?>> stream = trackingEventProcessor.getMessageSource()
.openStream(null)
.asStream();
ExecutorService executor = Executors.newSingleThreadExecutor(threadFactory);
Future<Boolean> result = executor.submit(() -> stream.anyMatch(containsMessageWithContent(messageType, messageContent)));
try {
return result.get(3, TimeUnit.SECONDS).booleanValue();
} catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException(e);
} catch (TimeoutException e) {
return false;
}
}
private Predicate<TrackedEventMessage<?>> containsMessageWithContent(Class<?> messageType, String messageContent) {
return message -> message.getPayload().toString().contains(messageContent)
&& message.getPayloadType().equals(messageType);
}
private TrackingEventProcessor getTrackingEventProcessor(String processingGroup) {
return eventProcessing.eventProcessor(processingGroup, TrackingEventProcessor.class).get();
}
@Override
public String toString() {
return "EventProcessorServiceAdapter [eventProcessing=" + eventProcessing + "]";
}
}
|
[
"johnnyt@gmx.at"
] |
johnnyt@gmx.at
|
0d983bc04454c705273710ad0d1e28506f574457
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/elastic--elasticsearch/b3c71c1e3ad8b3c2516b0898dbaa696b69cb7abb/before/ENull.java
|
f5cdd3fd9055d27b08de5e919d0bfe744d7f343e
|
[] |
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,828
|
java
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch 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.elasticsearch.painless.node;
import org.elasticsearch.painless.CompilerSettings;
import org.elasticsearch.painless.Definition;
import org.elasticsearch.painless.Variables;
import org.objectweb.asm.Opcodes;
import org.elasticsearch.painless.MethodWriter;
/**
* Represents a null constant.
*/
public final class ENull extends AExpression {
public ENull(final int line, final String location) {
super(line, location);
}
@Override
void analyze(final CompilerSettings settings, final Variables variables) {
isNull = true;
if (expected != null) {
if (expected.sort.primitive) {
throw new IllegalArgumentException(error("Cannot cast null to a primitive type [" + expected.name + "]."));
}
actual = expected;
} else {
actual = Definition.objectType;
}
}
@Override
void write(final CompilerSettings settings, final MethodWriter adapter) {
adapter.visitInsn(Opcodes.ACONST_NULL);
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
aab953a64a4d0e1715113822685d54e945ba46a8
|
a433b33a1507957d71184a289aebbd17cef105ba
|
/amituofo-java-sdk-xfs-objectstorage-azure/src/main/java/com/amituofo/xfs/plugin/fs/objectstorage/azure/blobs/item/BlobContainerspace.java
|
8e07094b60acad6f4b7a3de6e58152d95a26e8f1
|
[
"Apache-2.0"
] |
permissive
|
pineconehouse/amituofo-java-sdk-xfs
|
89003a24bcd16e4b12e5167455f3c53d9a8fe34a
|
b3bb7db93dc045ed4ccf1bb41259ddaeb9dc2710
|
refs/heads/main
| 2023-03-26T11:16:08.833073
| 2021-03-24T04:08:14
| 2021-03-24T04:08:14
| 350,547,943
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,006
|
java
|
package com.amituofo.xfs.plugin.fs.objectstorage.azure.blobs.item;
import java.util.Iterator;
import java.util.Locale;
import com.amituofo.common.define.HandleFeedback;
import com.amituofo.common.ex.ServiceException;
import com.amituofo.common.util.StringUtils;
import com.amituofo.common.util.URLUtils;
import com.amituofo.xfs.plugin.fs.objectstorage.OSDBucketspace;
import com.amituofo.xfs.plugin.fs.objectstorage.OSDItemInstanceCreator;
import com.amituofo.xfs.plugin.fs.objectstorage.OSDVersionFileItem;
import com.amituofo.xfs.plugin.fs.objectstorage.azure.blobs.BlobFileSystemEntry;
import com.amituofo.xfs.plugin.fs.objectstorage.azure.blobs.BlobFileSystemPreference;
import com.amituofo.xfs.plugin.fs.objectstorage.azure.common.AzureStorageContainerspace;
import com.amituofo.xfs.service.FileItem;
import com.amituofo.xfs.service.FolderItem;
import com.amituofo.xfs.service.Item;
import com.amituofo.xfs.service.ItemEvent;
import com.amituofo.xfs.service.ItemFilter;
import com.amituofo.xfs.service.ItemHandler;
import com.amituofo.xfs.service.ItemHiddenFunction;
import com.amituofo.xfs.service.ListOption;
import com.azure.core.http.rest.PagedIterable;
import com.azure.storage.blob.BlobContainerClient;
import com.azure.storage.blob.models.BlobItem;
import com.azure.storage.blob.models.BlobItemProperties;
import com.azure.storage.blob.models.ListBlobsOptions;
public class BlobContainerspace extends AzureStorageContainerspace<BlobContainerClient, BlobFileSystemEntry, BlobFileSystemPreference> implements OSDBucketspace, OSDItemInstanceCreator {
public BlobContainerspace(BlobFileSystemEntry entry, BlobContainerClient containerClient) {
super(entry, containerClient);
}
@Override
public String getName() {
return getContainerClient().getBlobContainerName();
}
@Override
protected FolderItem createRootFolder() {
FolderItem root = newFolderItemInstance("");
((ItemHiddenFunction) root).setName(getName());
return root;
}
@Override
public FolderItem newFolderItemInstance(String key) {
BlobFolderItem folder = new BlobFolderItem(this, key);
return folder;
}
@Override
public FileItem newFileItemInstance(String key) {
BlobFileItem folder = new BlobFileItem(this, key);
return folder;
}
@Override
public OSDVersionFileItem newVersionFileItemInstance(String key, String versionId) {
return new BlobVersionFileItem(this, key, versionId);
}
// public HCPMetadataItem newMetadataFileItemInstance(String key, HCPMetadataSummary hcpMetadataSummary) {
// return new HCPMetadataItem(this, key, hcpMetadataSummary);
// }
//
// public HCPMetadataItem newVersionMetadataFileItemInstance(String key, String versionId, HCPMetadataSummary hcpMetadataSummary) {
// return new HCPVersionMetadataItem(this, key, versionId, hcpMetadataSummary);
// }
@Override
public String getEndpoint() {
return String.format(Locale.ROOT, "https://%s.blob.core.windows.net", this.getName());
}
// protected boolean isShowDeletedObjects() {
// return preference.isShowDeletedObjects() && namespaceSetting.isVersioningEnabled();
// }
//
// protected boolean isEnablePurgeDeletion() {
// return preference.isEnablePurgeDeletion() && namespaceSetting.isVersioningEnabled();
// }
@Override
public void list(final ListOption listOption, final ItemHandler handler) throws ServiceException {
try {
ItemFilter filter = listOption.getFilter();
PagedIterable<BlobItem> resultlisting;
if (listOption.isWithSubDirectory()) {
if (StringUtils.isNotEmpty(listOption.getPrefix())) {
resultlisting = getContainerClient().listBlobs(new ListBlobsOptions().setPrefix(listOption.getPrefix()), null);
} else {
resultlisting = getContainerClient().listBlobs();
}
} else {
if (StringUtils.isNotEmpty(listOption.getPrefix())) {
resultlisting = getContainerClient().listBlobsByHierarchy(listOption.getPrefix());
} else {
resultlisting = getContainerClient().listBlobsByHierarchy("/", null, null);
}
}
for (Iterator<BlobItem> it = resultlisting.iterator(); it.hasNext();) {
BlobItem blobItem = (BlobItem) it.next();
// System.out.println("\t" + blobItem.getName() + "\t" + blobItem.getVersionId() + "\t"+blobItem.getProperties().getContentLength());
Item item;
BlobItemProperties prop = blobItem.getProperties();
String key = blobItem.getName();
if (prop != null) {
item = this.newFileItemInstance(key);
BlobFileItem.setItemProperties((BlobFileItem) item, blobItem, prop);
} else {
item = this.newFolderItemInstance(key);
String name = URLUtils.getLastNameFromPath(key);
((ItemHiddenFunction) item).setName(name);
}
if (filter != null && !filter.accept(item)) {
continue;
}
HandleFeedback result = handler.handle(ItemEvent.ITEM_FOUND, item);
if (result == HandleFeedback.interrupted) {
return;
}
}
} catch (Exception e) {
throw new ServiceException(e);
} finally {
handler.handle(ItemEvent.EXEC_END, null);
}
}
}
|
[
"hs_china@126.com"
] |
hs_china@126.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.