repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | this(new Fluent(new BasicParameterList(RESPONSE_TYPE.parameter(responseType), STATE.parameter(state)))); |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | this(new Fluent(new BasicParameterList(RESPONSE_TYPE.parameter(responseType), STATE.parameter(state)))); |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | this(new Fluent(new BasicParameterList(RESPONSE_TYPE.parameter(responseType), SCOPE.parameter(scope), STATE.parameter(state)))); |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | return new BasicOAuth2AuthorizationRequest(mParameters.ratherWith(CLIENT_ID.parameter(clientId))); |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... |
public BasicOAuth2AuthorizationRequest(String responseType, OAuth2Scope scope, CharSequence state)
{
this(new Fluent(new BasicParameterList(RESPONSE_TYPE.parameter(responseType), SCOPE.parameter(scope), STATE.parameter(state))));
}
public BasicOAuth2AuthorizationRequest(String responseType, ... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | return new BasicOAuth2AuthorizationRequest(mParameters.ratherWith(REDIRECT_URI.parameter(redirectUri))); |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... | }
public BasicOAuth2AuthorizationRequest(String responseType, OAuth2Scope scope, CharSequence state, ParameterList customParameters)
{
this(new Fluent(new Replacing(customParameters, RESPONSE_TYPE.parameter(responseType), SCOPE.parameter(scope), STATE.parameter(state))));
}
private Basic... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | public OAuth2AuthorizationRequest withCodeChallenge(PkceCodeChallenge codeChallenge) |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... | public BasicOAuth2AuthorizationRequest(String responseType, OAuth2Scope scope, CharSequence state, ParameterList customParameters)
{
this(new Fluent(new Replacing(customParameters, RESPONSE_TYPE.parameter(responseType), SCOPE.parameter(scope), STATE.parameter(state))));
}
private BasicOAuth2Au... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | CODE_CHALLENGE_METHOD.parameter(codeChallenge.method()), |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/BasicOAuth2AuthorizationRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | import static org.dmfs.oauth2.client.utils.Parameters.CODE_CHALLENGE_METHOD;
import static org.dmfs.oauth2.client.utils.Parameters.REDIRECT_URI;
import static org.dmfs.oauth2.client.utils.Parameters.RESPONSE_TYPE;
import static org.dmfs.oauth2.client.utils.Parameters.SCOPE;
import static org.dmfs.oauth2.client.utils.Pa... | {
this(new Fluent(new Replacing(customParameters, RESPONSE_TYPE.parameter(responseType), SCOPE.parameter(scope), STATE.parameter(state))));
}
private BasicOAuth2AuthorizationRequest(FluentParameterList parameters)
{
mParameters = parameters;
}
@Override
public OAuth2Autho... | // Path: src/main/java/org/dmfs/oauth2/client/pkce/PkceCodeChallenge.java
// public interface PkceCodeChallenge
// {
// /**
// * Returns a {@link Token} that identifies the method this code challenge uses.
// *
// * @return A {@link Token} containing the method name.
// */
// Token method();... | CODE_CHALLENGE.parameter(codeChallenge.challenge()))); |
dmfs/oauth2-essentials | src/test/java/org/dmfs/oauth2/client/http/responsehandlers/TokenResponseHandlerTest.java | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AccessToken.java
// public interface OAuth2AccessToken
// {
// /**
// * Returns the actual access token String.
// *
// * @return
// *
// * @throws ProtocolException
// */
// public CharSequence accessToken() throws ProtocolExcept... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.dmfs.httpessentials.HttpStatus;
import org.dmfs.httpessentials.exceptions.ProtocolError;
import org.dmfs.httpessentials.exceptions.ProtocolException;
import org.dmfs.httpessentials.headers.EmptyHeaders;
import org.dmfs.ht... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AccessToken.java
// public interface OAuth2AccessToken
// {
// /**
// * Returns the actual access token String.
// *
// * @return
// *
// * @throws ProtocolException
// */
// public CharSequence accessToken() throws ProtocolExcept... | OAuth2AccessToken token = new TokenResponseHandler(EmptyScope.INSTANCE).handleResponse( |
dmfs/oauth2-essentials | src/test/java/org/dmfs/oauth2/client/http/responsehandlers/TokenResponseHandlerTest.java | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AccessToken.java
// public interface OAuth2AccessToken
// {
// /**
// * Returns the actual access token String.
// *
// * @return
// *
// * @throws ProtocolException
// */
// public CharSequence accessToken() throws ProtocolExcept... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.dmfs.httpessentials.HttpStatus;
import org.dmfs.httpessentials.exceptions.ProtocolError;
import org.dmfs.httpessentials.exceptions.ProtocolException;
import org.dmfs.httpessentials.headers.EmptyHeaders;
import org.dmfs.ht... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AccessToken.java
// public interface OAuth2AccessToken
// {
// /**
// * Returns the actual access token String.
// *
// * @return
// *
// * @throws ProtocolException
// */
// public CharSequence accessToken() throws ProtocolExcept... | OAuth2AccessToken token = new TokenResponseHandler(EmptyScope.INSTANCE).handleResponse( |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/http/requests/AuthorizationCodeTokenRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | import org.dmfs.httpessentials.entities.XWwwFormUrlEncodedEntity;
import org.dmfs.jems.iterable.elementary.Seq;
import org.dmfs.oauth2.client.OAuth2AuthCodeAuthorization;
import org.dmfs.oauth2.client.http.requests.parameters.AuthCodeParam;
import org.dmfs.oauth2.client.http.requests.parameters.CodeVerifierParam;
impor... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | public AuthorizationCodeTokenRequest(OAuth2AuthCodeAuthorization authorization, Uri redirectUri, CharSequence codeVerifier) |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/http/requests/AuthorizationCodeTokenRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | import org.dmfs.httpessentials.entities.XWwwFormUrlEncodedEntity;
import org.dmfs.jems.iterable.elementary.Seq;
import org.dmfs.oauth2.client.OAuth2AuthCodeAuthorization;
import org.dmfs.oauth2.client.http.requests.parameters.AuthCodeParam;
import org.dmfs.oauth2.client.http.requests.parameters.CodeVerifierParam;
impor... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | new GrantTypeParam("authorization_code"), |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/http/requests/AuthorizationCodeTokenRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | import org.dmfs.httpessentials.entities.XWwwFormUrlEncodedEntity;
import org.dmfs.jems.iterable.elementary.Seq;
import org.dmfs.oauth2.client.OAuth2AuthCodeAuthorization;
import org.dmfs.oauth2.client.http.requests.parameters.AuthCodeParam;
import org.dmfs.oauth2.client.http.requests.parameters.CodeVerifierParam;
impor... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | new AuthCodeParam(authorization), |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/http/requests/AuthorizationCodeTokenRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | import org.dmfs.httpessentials.entities.XWwwFormUrlEncodedEntity;
import org.dmfs.jems.iterable.elementary.Seq;
import org.dmfs.oauth2.client.OAuth2AuthCodeAuthorization;
import org.dmfs.oauth2.client.http.requests.parameters.AuthCodeParam;
import org.dmfs.oauth2.client.http.requests.parameters.CodeVerifierParam;
impor... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | new RedirectUriParam(redirectUri), |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/http/requests/AuthorizationCodeTokenRequest.java | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | import org.dmfs.httpessentials.entities.XWwwFormUrlEncodedEntity;
import org.dmfs.jems.iterable.elementary.Seq;
import org.dmfs.oauth2.client.OAuth2AuthCodeAuthorization;
import org.dmfs.oauth2.client.http.requests.parameters.AuthCodeParam;
import org.dmfs.oauth2.client.http.requests.parameters.CodeVerifierParam;
impor... | /*
* Copyright 2016 dmfs GmbH
*
* 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... | // Path: src/main/java/org/dmfs/oauth2/client/OAuth2AuthCodeAuthorization.java
// public interface OAuth2AuthCodeAuthorization
// {
// /**
// * Returns the actual authorization code.
// *
// * @return
// */
// public CharSequence code();
//
// /**
// * Returns the scope that this a... | new CodeVerifierParam(codeVerifier)))); |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/Version.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.io.Serializable;
import java.util.Comparator;
import java.util.List; | package io.arivera.oss.embedded.rabbitmq;
/**
* A class that provides information about a specific distribution artifact version of RabbitMQ.
*/
public interface Version {
VersionComparator VERSION_COMPARATOR = new VersionComparator();
/**
* @return a String formatted like {@code "3.6.5"}
*
* @see #... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | ArchiveType getArchiveType(OperatingSystem operatingSystem); |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/Version.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.io.Serializable;
import java.util.Comparator;
import java.util.List; | package io.arivera.oss.embedded.rabbitmq;
/**
* A class that provides information about a specific distribution artifact version of RabbitMQ.
*/
public interface Version {
VersionComparator VERSION_COMPARATOR = new VersionComparator();
/**
* @return a String formatted like {@code "3.6.5"}
*
* @see #... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | ArchiveType getArchiveType(OperatingSystem operatingSystem); |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/PredefinedVersion.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.util.List; | V3_8_0(new BaseVersion("3.8.0", ErlangVersion.V21_3)),
V3_7_18(new BaseVersion("3.7.18", ErlangVersion.V20_3)),
V3_7_7(new BaseVersion("3.7.7", ErlangVersion.V19_3_6_4)),
V3_7_6(new BaseVersion("3.7.6", ErlangVersion.V19_3)),
V3_7_5(new BaseVersion("3.7.5", ErlangVersion.V19_3)),
V3_7_4(new BaseVersion("3.... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | V3_5_7(new BaseVersion("3.5.7", ErlangVersion.R13B03, ArchiveType.TAR_GZ)), |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/PredefinedVersion.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.util.List; | V3_4_4(new BaseVersion("3.4.4", ErlangVersion.UNKNOWN, ArchiveType.TAR_GZ)),
V3_4_3(new BaseVersion("3.4.3", ErlangVersion.UNKNOWN, ArchiveType.TAR_GZ)),
V3_4_2(new BaseVersion("3.4.2", ErlangVersion.UNKNOWN, ArchiveType.TAR_GZ)),
V3_4_1(new BaseVersion("3.4.1", ErlangVersion.UNKNOWN, ArchiveType.TAR_GZ)),
V3... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | public ArchiveType getArchiveType(OperatingSystem operatingSystem) { |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/SingleArtifactRepository.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/OperatingSystem.java
// public enum OperatingSystem {
//
// WINDOWS, MAC_OS, UNIX;
//
// /**
// * Returns the right instance of the Operation System.
// *
// * @see SystemUtils#IS_OS_MAC
// * @see SystemUtils#IS_OS_WINDOWS
// */
// publ... | import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.net.URL; | package io.arivera.oss.embedded.rabbitmq;
/**
* Class used to allow for the user to specify a custom URL to download the RabbitMQ binary from.
* <p>
* Since this is basically a hardcoded URL, there's no ability to change the artifact to be downloaded based on
* the OS the system is currently running. Use a {@lin... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/OperatingSystem.java
// public enum OperatingSystem {
//
// WINDOWS, MAC_OS, UNIX;
//
// /**
// * Returns the right instance of the Operation System.
// *
// * @see SystemUtils#IS_OS_MAC
// * @see SystemUtils#IS_OS_WINDOWS
// */
// publ... | public URL getUrl(Version version, OperatingSystem operatingSystem) { |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/bin/LoggingProcessListener.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/StringUtils.java
// public class StringUtils {
//
// /**
// * Joins the elements of the provided collection into a single String containing the provided list of elements.
// * <p>
// * No delimiter is added before or after the list.
// * <p>
//... | import io.arivera.oss.embedded.rabbitmq.util.StringUtils;
import org.slf4j.Logger;
import org.zeroturnaround.exec.InvalidExitValueException;
import org.zeroturnaround.exec.ProcessExecutor;
import org.zeroturnaround.exec.ProcessResult;
import org.zeroturnaround.exec.listener.ProcessListener; | package io.arivera.oss.embedded.rabbitmq.bin;
class LoggingProcessListener extends ProcessListener {
private final Logger logger;
private ProcessExecutor executor;
LoggingProcessListener(Logger logger) {
this.logger = logger;
}
@Override
public void beforeStart(ProcessExecutor executor) {
this... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/StringUtils.java
// public class StringUtils {
//
// /**
// * Joins the elements of the provided collection into a single String containing the provided list of elements.
// * <p>
// * No delimiter is added before or after the list.
// * <p>
//... | StringUtils.join(executor.getCommand(), " "), executor.getEnvironment()); |
AlejandroRivera/embedded-rabbitmq | src/test/java/io/arivera/oss/embedded/rabbitmq/helpers/ErlangVersionCheckerTest.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/ErlangVersion.java
// public final class ErlangVersion {
// public static final String V22_3 = "22.3";
// public static final String V21_3 = "21.3";
// public static final String V20_3 = "20.3";
// public static final String V19_3_6_4 = "19.3.6.4";
// pu... | import io.arivera.oss.embedded.rabbitmq.ErlangVersion;
import io.arivera.oss.embedded.rabbitmq.bin.ErlangShell;
import io.arivera.oss.embedded.rabbitmq.bin.ErlangShellException;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
imp... | package io.arivera.oss.embedded.rabbitmq.helpers;
@RunWith(MockitoJUnitRunner.class)
public class ErlangVersionCheckerTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Mock | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/ErlangVersion.java
// public final class ErlangVersion {
// public static final String V22_3 = "22.3";
// public static final String V21_3 = "21.3";
// public static final String V20_3 = "20.3";
// public static final String V19_3_6_4 = "19.3.6.4";
// pu... | private ErlangShell shell; |
AlejandroRivera/embedded-rabbitmq | src/test/java/io/arivera/oss/embedded/rabbitmq/helpers/ErlangVersionCheckerTest.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/ErlangVersion.java
// public final class ErlangVersion {
// public static final String V22_3 = "22.3";
// public static final String V21_3 = "21.3";
// public static final String V20_3 = "20.3";
// public static final String V19_3_6_4 = "19.3.6.4";
// pu... | import io.arivera.oss.embedded.rabbitmq.ErlangVersion;
import io.arivera.oss.embedded.rabbitmq.bin.ErlangShell;
import io.arivera.oss.embedded.rabbitmq.bin.ErlangShellException;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
imp... | package io.arivera.oss.embedded.rabbitmq.helpers;
@RunWith(MockitoJUnitRunner.class)
public class ErlangVersionCheckerTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Mock
private ErlangShell shell;
@Test
public void parseR() {
assertThat(ErlangVersionChecker.pa... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/ErlangVersion.java
// public final class ErlangVersion {
// public static final String V22_3 = "22.3";
// public static final String V21_3 = "21.3";
// public static final String V20_3 = "20.3";
// public static final String V19_3_6_4 = "19.3.6.4";
// pu... | assertThat(ErlangVersionChecker.parse(ErlangVersion.R16B03), equalTo(new int[] {16, 66, 3, 0, 0})); |
AlejandroRivera/embedded-rabbitmq | src/test/java/io/arivera/oss/embedded/rabbitmq/helpers/ErlangVersionCheckerTest.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/ErlangVersion.java
// public final class ErlangVersion {
// public static final String V22_3 = "22.3";
// public static final String V21_3 = "21.3";
// public static final String V20_3 = "20.3";
// public static final String V19_3_6_4 = "19.3.6.4";
// pu... | import io.arivera.oss.embedded.rabbitmq.ErlangVersion;
import io.arivera.oss.embedded.rabbitmq.bin.ErlangShell;
import io.arivera.oss.embedded.rabbitmq.bin.ErlangShellException;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
imp... | package io.arivera.oss.embedded.rabbitmq.helpers;
@RunWith(MockitoJUnitRunner.class)
public class ErlangVersionCheckerTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
@Mock
private ErlangShell shell;
@Test
public void parseR() {
assertThat(ErlangVersionChecker.pa... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/ErlangVersion.java
// public final class ErlangVersion {
// public static final String V22_3 = "22.3";
// public static final String V21_3 = "21.3";
// public static final String V20_3 = "20.3";
// public static final String V19_3_6_4 = "19.3.6.4";
// pu... | public void minVersionNotMet() throws ErlangShellException { |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/BaseVersion.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import io.arivera.oss.embedded.rabbitmq.util.StringUtils;
import java.util.ArrayList;
import java.util.List; | package io.arivera.oss.embedded.rabbitmq;
/**
* Class used when user wants to use a RabbitMQ version that's not defined in {@link PredefinedVersion} but that
* still follows the binary artifact conventions.
*
* @see EmbeddedRabbitMqConfig.Builder#version(Version)
*/
public class BaseVersion implements Version {... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | final ArchiveType unixArchiveType; |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/BaseVersion.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import io.arivera.oss.embedded.rabbitmq.util.StringUtils;
import java.util.ArrayList;
import java.util.List; | * or @{code null} if no version check should be performed.
* @param unixArchiveType The type of packaging used for the Unix/Mac binaries, typically {@link ArchiveType#TAR_XZ}
* @param windowsArchiveType The type of packaging used for Windows binaries, typically {@link ArchiveType#ZIP}
... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | return StringUtils.join(versionComponents, separator); |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/BaseVersion.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import io.arivera.oss.embedded.rabbitmq.util.StringUtils;
import java.util.ArrayList;
import java.util.List; | * @see <a href="https://www.rabbitmq.com/which-erlang.html">RabbitMQ Erlang Version Requirements</a>
*/
public BaseVersion(String semanticVersion, String minErlangVersion,
ArchiveType unixArchiveType, ArchiveType windowsArchiveType) {
String[] versionComponents = semanticVersion.split("... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | public ArchiveType getArchiveType(OperatingSystem operatingSystem) { |
AlejandroRivera/embedded-rabbitmq | src/test/java/io/arivera/oss/embedded/rabbitmq/OfficialArtifactRepositoryTest.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/OperatingSystem.java
// public enum OperatingSystem {
//
// WINDOWS, MAC_OS, UNIX;
//
// /**
// * Returns the right instance of the Operation System.
// *
// * @see SystemUtils#IS_OS_MAC
// * @see SystemUtils#IS_OS_WINDOWS
// */
// publ... | import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import org.junit.Test;
import java.net.URL;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat; | package io.arivera.oss.embedded.rabbitmq;
public class OfficialArtifactRepositoryTest {
@Test
public void downloadForWindows() throws Exception {
URL url = OfficialArtifactRepository.RABBITMQ | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/OperatingSystem.java
// public enum OperatingSystem {
//
// WINDOWS, MAC_OS, UNIX;
//
// /**
// * Returns the right instance of the Operation System.
// *
// * @see SystemUtils#IS_OS_MAC
// * @see SystemUtils#IS_OS_WINDOWS
// */
// publ... | .getUrl(PredefinedVersion.V3_6_5, OperatingSystem.WINDOWS); |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/OfficialArtifactRepository.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map; | package io.arivera.oss.embedded.rabbitmq;
/**
* A list of the official repositories where RabbitMQ publishes their artifacts.
*
* @see EmbeddedRabbitMqConfig.Builder#downloadFrom(ArtifactRepository)
*/
public enum OfficialArtifactRepository implements ArtifactRepository {
/**
* @deprecated in favor of {@li... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | public URL getUrl(Version version, OperatingSystem operatingSystem) { |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/OfficialArtifactRepository.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map; | }
@Override
protected String getFolderVersion(Version version) {
if (Version.VERSION_COMPARATOR.compare(version, PredefinedVersion.V3_7_0) < 0) {
return version.getVersionAsString("_");
}
return super.getFolderVersion(version);
}
},
BINTRAY("https://dl.bintray.com/rabbitm... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | ArchiveType archiveType = version.getArchiveType(operatingSystem); |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/UnknownVersion.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.util.List; | package io.arivera.oss.embedded.rabbitmq;
/**
* A class that represents the RabbitMQ Version that is downloaded from the {@link SingleArtifactRepository}.
* <p>
* The only thing we care about from the custom download artifact is the folder name where the RabbitMQ installation
* can be found. We don't care about ... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | public ArchiveType getArchiveType(OperatingSystem operatingSystem) { |
AlejandroRivera/embedded-rabbitmq | src/main/java/io/arivera/oss/embedded/rabbitmq/UnknownVersion.java | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | import io.arivera.oss.embedded.rabbitmq.util.ArchiveType;
import io.arivera.oss.embedded.rabbitmq.util.OperatingSystem;
import java.util.List; | package io.arivera.oss.embedded.rabbitmq;
/**
* A class that represents the RabbitMQ Version that is downloaded from the {@link SingleArtifactRepository}.
* <p>
* The only thing we care about from the custom download artifact is the folder name where the RabbitMQ installation
* can be found. We don't care about ... | // Path: src/main/java/io/arivera/oss/embedded/rabbitmq/util/ArchiveType.java
// public enum ArchiveType {
//
// TAR_GZ, TAR_XZ, ZIP;
//
// public String getExtension() {
// return name().toLowerCase(Locale.US).replace("_", ".");
// }
//
// public boolean matches(String filesname) {
// return filesna... | public ArchiveType getArchiveType(OperatingSystem operatingSystem) { |
2Checkout/2checkout-java | src/main/java/com/twocheckout/TwocheckoutResponse.java | // Path: src/main/java/com/twocheckout/model/Authorization.java
// public class Authorization {
// private String type;
// private String responseCode;
// private String currencyCode;
// private String orderNumber;
// private String transactionId;
// private String recurrentInstallmentId;
// ... | import com.twocheckout.model.Authorization; | package com.twocheckout;
public class TwocheckoutResponse {
private String response_code;
private String response_message;
private String product_id;
private String assigned_product_id;
private String option_id; | // Path: src/main/java/com/twocheckout/model/Authorization.java
// public class Authorization {
// private String type;
// private String responseCode;
// private String currencyCode;
// private String orderNumber;
// private String transactionId;
// private String recurrentInstallmentId;
// ... | private Authorization response; |
2Checkout/2checkout-java | src/main/java/com/twocheckout/TwocheckoutSale.java | // Path: src/main/java/com/twocheckout/model/Sale.java
// public class Sale {
// private long sale_id;
// private String ip_address;
// private String ip_country;
// private RecurringDecline recurring_decline;
// private Invoice[] invoices;
// private Comments[] comments;
//
// public long ... | import com.google.gson.Gson;
import com.twocheckout.model.Sale;
import com.twocheckout.model.SaleList;
import java.util.HashMap;
| package com.twocheckout;
public class TwocheckoutSale extends TwocheckoutApi {
public Sale sale;
public static Sale retrieve(String sale_id) throws TwocheckoutException {
String urlSuffix = "/api/sales/detail_sale";
HashMap<String, String> args = new HashMap<String, String>();
... | // Path: src/main/java/com/twocheckout/model/Sale.java
// public class Sale {
// private long sale_id;
// private String ip_address;
// private String ip_country;
// private RecurringDecline recurring_decline;
// private Invoice[] invoices;
// private Comments[] comments;
//
// public long ... | public static SaleList list(HashMap<String, String> args) throws TwocheckoutException {
|
2Checkout/2checkout-java | src/main/java/com/twocheckout/TwocheckoutCharge.java | // Path: src/main/java/com/twocheckout/model/Authorization.java
// public class Authorization {
// private String type;
// private String responseCode;
// private String currencyCode;
// private String orderNumber;
// private String transactionId;
// private String recurrentInstallmentId;
// ... | import com.google.gson.Gson;
import com.twocheckout.model.Authorization;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair; | for (Map.Entry<String, String> entry : args.entrySet())
{
html.append( "<input type=\"hidden\" name=\"" + entry.getKey() + "\" value=\"" + entry.getValue() + "\"/>\n" );
}
html.append( "<input type=\"submit\" value=\"Checkout\" />\n</form>\n" );
return html.toString()... | // Path: src/main/java/com/twocheckout/model/Authorization.java
// public class Authorization {
// private String type;
// private String responseCode;
// private String currencyCode;
// private String orderNumber;
// private String transactionId;
// private String recurrentInstallmentId;
// ... | public static Authorization authorize(HashMap<String, Object> args) throws TwocheckoutException { |
2Checkout/2checkout-java | src/main/java/com/twocheckout/TwocheckoutApi.java | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | import com.google.gson.Gson;
import com.twocheckout.model.AuthException;
import com.twocheckout.model.AuthExceptions;
import com.twocheckout.model.Error;
import com.twocheckout.model.Errors;
import org.apache.http.*;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
... | HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
String responseBody = EntityUtils.toString(entity);
httpclient.getConnectionManager().shutdown();
checkStatusCodeAuth(response, responseBody);
if... | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | Errors errors = new Gson().fromJson(responseBody, Errors.class);
|
2Checkout/2checkout-java | src/main/java/com/twocheckout/TwocheckoutApi.java | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | import com.google.gson.Gson;
import com.twocheckout.model.AuthException;
import com.twocheckout.model.AuthExceptions;
import com.twocheckout.model.Error;
import com.twocheckout.model.Errors;
import org.apache.http.*;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
... | HttpEntity entity = response.getEntity();
String responseBody = EntityUtils.toString(entity);
httpclient.getConnectionManager().shutdown();
checkStatusCodeAuth(response, responseBody);
if (responseBody != null) {
return responseBody;
... | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | Error[] error = errors.getErrors();
|
2Checkout/2checkout-java | src/main/java/com/twocheckout/TwocheckoutApi.java | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | import com.google.gson.Gson;
import com.twocheckout.model.AuthException;
import com.twocheckout.model.AuthExceptions;
import com.twocheckout.model.Error;
import com.twocheckout.model.Errors;
import org.apache.http.*;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
... | } catch (TwocheckoutException e) {
throw new TwocheckoutException(e.getMessage(), e.getCode());
} catch (Exception e) {
throw new TwocheckoutException(e.getMessage());
}
return mainObject;
}
public static String addLocationToUrl(String url, List... | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | AuthExceptions exceptions = new Gson().fromJson(responseBody, AuthExceptions.class);
|
2Checkout/2checkout-java | src/main/java/com/twocheckout/TwocheckoutApi.java | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | import com.google.gson.Gson;
import com.twocheckout.model.AuthException;
import com.twocheckout.model.AuthExceptions;
import com.twocheckout.model.Error;
import com.twocheckout.model.Errors;
import org.apache.http.*;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
... | throw new TwocheckoutException(e.getMessage(), e.getCode());
} catch (Exception e) {
throw new TwocheckoutException(e.getMessage());
}
return mainObject;
}
public static String addLocationToUrl(String url, List<NameValuePair> params){
if(!url.en... | // Path: src/main/java/com/twocheckout/model/AuthException.java
// public class AuthException {
// private String errorMsg;
// private String errorCode;
// private String httpStatus;
//
// public String getMessage() {
// return errorMsg;
// }
// public String getCode() {
// retu... | AuthException exception = exceptions.getAuthExceptions();
|
hdweiss/codemap | src/com/hdweiss/codemap/view/workspace/FindDeclarationTask.java | // Path: src/com/hdweiss/codemap/data/CscopeEntry.java
// public class CscopeEntry {
// private static int CSCOPE_FILE = 1;
// private static int CSCOPE_ACTUALNAME = 2;
// private static int CSCOPE_NAME = 4;
// private static int CSCOPE_LINENUMBER = 3;
//
// public String actualName = "";
// public String name ... | import java.util.ArrayList;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import com.hdweiss.codemap.data.CscopeEntry; | package com.hdweiss.codemap.view.workspace;
public class FindDeclarationTask extends AsyncTask<Object, Object, Object>
{
private ProgressDialog dialog;
private Context context;
private FindDeclarationCallback callback;
private String url;
private WorkspaceController controller;
| // Path: src/com/hdweiss/codemap/data/CscopeEntry.java
// public class CscopeEntry {
// private static int CSCOPE_FILE = 1;
// private static int CSCOPE_ACTUALNAME = 2;
// private static int CSCOPE_NAME = 4;
// private static int CSCOPE_LINENUMBER = 3;
//
// public String actualName = "";
// public String name ... | private ArrayList<CscopeEntry> entries; |
hdweiss/codemap | src/com/hdweiss/codemap/view/workspace/fragments/CodeMapAnnotation.java | // Path: src/com/hdweiss/codemap/util/CodeMapPoint.java
// public class CodeMapPoint extends PointF implements Serializable {
// private static final long serialVersionUID = 1L;
//
// public CodeMapPoint() {
// super();
// }
//
// public CodeMapPoint(float x, float y) {
// super(x, y);
// }
//
// public ... | import android.content.Context;
import android.util.AttributeSet;
import android.widget.EditText;
import com.hdweiss.codemap.util.CodeMapPoint; | package com.hdweiss.codemap.view.workspace.fragments;
public class CodeMapAnnotation extends CodeMapItem {
private EditText editText;
public CodeMapAnnotation(Context context, AttributeSet attrs) {
this(context, null, "");
}
| // Path: src/com/hdweiss/codemap/util/CodeMapPoint.java
// public class CodeMapPoint extends PointF implements Serializable {
// private static final long serialVersionUID = 1L;
//
// public CodeMapPoint() {
// super();
// }
//
// public CodeMapPoint(float x, float y) {
// super(x, y);
// }
//
// public ... | public CodeMapAnnotation(Context context, CodeMapPoint point, String contents) { |
hdweiss/codemap | src/com/hdweiss/codemap/data/ProjectController.java | // Path: src/com/hdweiss/codemap/util/SyntaxHighlighter.java
// public class SyntaxHighlighter {
//
// private final String[] C_KEYWORDS = {
// "auto",
// "break",
// "case",
// "char",
// "const",
// "continue",
// "default",
// "do",
// "double",
// "else",
// "enum",
// "exter... | import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import android.content.Context;
import android.text.SpannableString;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.hdweiss.codemap.util.SyntaxHighlighter; | final String fileName = getFileFromUrl(url);
final String functionName = getFunctionFromUrl(url);
ArrayList<CscopeEntry> allEntries = cscopeWrapper.getAllEntries(
functionName, fileName);
return allEntries;
}
/**
* Call in case of full url.
*/
// TODO Refactor, only createCodeMapItem() calls ... | // Path: src/com/hdweiss/codemap/util/SyntaxHighlighter.java
// public class SyntaxHighlighter {
//
// private final String[] C_KEYWORDS = {
// "auto",
// "break",
// "case",
// "char",
// "const",
// "continue",
// "default",
// "do",
// "double",
// "else",
// "enum",
// "exter... | SyntaxHighlighter highlighter = new SyntaxHighlighter(content); |
hdweiss/codemap | src/com/hdweiss/codemap/data/SerializableLink.java | // Path: src/com/hdweiss/codemap/view/workspace/fragments/CodeMapLink.java
// public class CodeMapLink {
//
// public CodeMapItem parent;
// public CodeMapItem child;
//
// public float yOffset = 0;
//
// public CodeMapLink(CodeMapItem parent, CodeMapItem child, float yOffset) {
// this.parent = parent;
// ... | import java.io.Serializable;
import java.util.UUID;
import com.hdweiss.codemap.view.workspace.fragments.CodeMapLink; | package com.hdweiss.codemap.data;
public class SerializableLink implements Serializable {
private static final long serialVersionUID = 1L;
public UUID parent;
public UUID child;
public float offset;
public SerializableLink(UUID parent, UUID child, float offset) {
this.parent = parent;
this.child = child... | // Path: src/com/hdweiss/codemap/view/workspace/fragments/CodeMapLink.java
// public class CodeMapLink {
//
// public CodeMapItem parent;
// public CodeMapItem child;
//
// public float yOffset = 0;
//
// public CodeMapLink(CodeMapItem parent, CodeMapItem child, float yOffset) {
// this.parent = parent;
// ... | public SerializableLink(CodeMapLink link) { |
hdweiss/codemap | src/com/hdweiss/codemap/util/ZoomableLinearLayout.java | // Path: src/com/hdweiss/codemap/view/workspace/WorkspaceView.java
// public class WorkspaceView extends ZoomableAbsoluteLayout {
//
// private GestureDetector gestureDetector;
// private ScaleGestureDetector scaleDetector;
// private Scroller scroller;
//
// public ArrayList<CodeMapItem> items = new ArrayList<C... | import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
import android.widget.LinearLayout;
import com.hdweiss.codemap.view.workspace.WorkspaceView; | package com.hdweiss.codemap.util;
public class ZoomableLinearLayout extends LinearLayout {
public ZoomableLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public float getScaleFactor() { | // Path: src/com/hdweiss/codemap/view/workspace/WorkspaceView.java
// public class WorkspaceView extends ZoomableAbsoluteLayout {
//
// private GestureDetector gestureDetector;
// private ScaleGestureDetector scaleDetector;
// private Scroller scroller;
//
// public ArrayList<CodeMapItem> items = new ArrayList<C... | return ((WorkspaceView) getParent()).getScaleFactor(); |
hdweiss/codemap | src/com/hdweiss/codemap/util/Utils.java | // Path: src/com/hdweiss/codemap/view/project/ProjectBrowser.java
// public class SynchServiceReceiver extends BroadcastReceiver {
// public static final String SYNC_UPDATE = "com.hdweiss.codemap.action.SYNC_UPDATE";
//
// public static final String SYNC_NAME = "sync_name";
// public static final String SYNC_STAT... | import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import... |
return null;
}
}
public static void deleteRecursive(File fileOrDirectory) {
if (fileOrDirectory.isDirectory())
for (File child : fileOrDirectory.listFiles())
deleteRecursive(child);
fileOrDirectory.delete();
}
public static void setupSpinner(Spinner spinner, ArrayList<Stri... | // Path: src/com/hdweiss/codemap/view/project/ProjectBrowser.java
// public class SynchServiceReceiver extends BroadcastReceiver {
// public static final String SYNC_UPDATE = "com.hdweiss.codemap.action.SYNC_UPDATE";
//
// public static final String SYNC_NAME = "sync_name";
// public static final String SYNC_STAT... | Intent intent = new Intent(SynchServiceReceiver.SYNC_UPDATE); |
hdweiss/codemap | tests/src/com/hdweiss/codemap/test/CollisionManagerTest.java | // Path: src/com/hdweiss/codemap/view/workspace/CollisionManager.java
// public class CollisionManager {
//
// private static final int padding = 5;
//
// public static boolean pushItems(CodeMapItem pushingItem,
// ArrayList<CodeMapItem> items) {
// Log.d("Collision", "-> pushItems(): " + pushingItem.getUrl()... | import android.graphics.Point;
import android.graphics.Rect;
import android.test.AndroidTestCase;
import com.hdweiss.codemap.view.workspace.CollisionManager; | package com.hdweiss.codemap.test;
public class CollisionManagerTest extends AndroidTestCase {
public void test_getPushOffset_nonOverlap() {
Rect rect1 = new Rect(100, 100, 200, 200);
Rect rect2 = new Rect(300, 300, 400, 400);
| // Path: src/com/hdweiss/codemap/view/workspace/CollisionManager.java
// public class CollisionManager {
//
// private static final int padding = 5;
//
// public static boolean pushItems(CodeMapItem pushingItem,
// ArrayList<CodeMapItem> items) {
// Log.d("Collision", "-> pushItems(): " + pushingItem.getUrl()... | Point pushOffset = CollisionManager.getPushOffset(rect1, rect2); |
hdweiss/codemap | src/com/hdweiss/codemap/view/workspace/outline/OutlineItemView.java | // Path: src/com/hdweiss/codemap/view/workspace/outline/OutlineItem.java
// public enum TYPE {DIRECTORY, FILE, SYMBOL};
| import android.content.Context;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.hdweiss.codemap.R;
import com.hdweiss.codemap.R.color;
import com.hdweiss.codemap.view.workspace.outline.OutlineItem.TYPE; | package com.hdweiss.codemap.view.workspace.outline;
public class OutlineItemView extends LinearLayout {
private TextView textView;
private TextView declarationView;
public OutlineItemView(Context context) {
super(context);
LayoutInflater.from(context).inflate(R.layout.outline_item, this);
this.textView =... | // Path: src/com/hdweiss/codemap/view/workspace/outline/OutlineItem.java
// public enum TYPE {DIRECTORY, FILE, SYMBOL};
// Path: src/com/hdweiss/codemap/view/workspace/outline/OutlineItemView.java
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.wi... | if(item.type == TYPE.FILE) { |
hdweiss/codemap | src/com/hdweiss/codemap/view/workspace/fragments/FunctionLinkSpan.java | // Path: src/com/hdweiss/codemap/util/SpanUtils.java
// public interface SpanConverter<A extends CharacterStyle, B extends CharacterStyle> {
// B convert(A span);
// }
| import android.text.style.ClickableSpan;
import android.text.style.URLSpan;
import android.view.View;
import com.hdweiss.codemap.util.SpanUtils.SpanConverter; | package com.hdweiss.codemap.view.workspace.fragments;
public class FunctionLinkSpan extends ClickableSpan {
private CodeMapFunction codeMapFunction;
private String url;
public FunctionLinkSpan(CodeMapFunction codeMapFunction, String url) {
this.codeMapFunction = codeMapFunction;
this.url = url;
}
@Overr... | // Path: src/com/hdweiss/codemap/util/SpanUtils.java
// public interface SpanConverter<A extends CharacterStyle, B extends CharacterStyle> {
// B convert(A span);
// }
// Path: src/com/hdweiss/codemap/view/workspace/fragments/FunctionLinkSpan.java
import android.text.style.ClickableSpan;
import android.text.style.UR... | SpanConverter<URLSpan, FunctionLinkSpan> { |
hdweiss/codemap | src/com/hdweiss/codemap/util/CodeMapCursorPoint.java | // Path: src/com/hdweiss/codemap/view/workspace/WorkspaceView.java
// public class WorkspaceView extends ZoomableAbsoluteLayout {
//
// private GestureDetector gestureDetector;
// private ScaleGestureDetector scaleDetector;
// private Scroller scroller;
//
// public ArrayList<CodeMapItem> items = new ArrayList<C... | import com.hdweiss.codemap.view.workspace.WorkspaceView;
import android.graphics.PointF; | package com.hdweiss.codemap.util;
/**
* Wrapper for points that are clicked on canvas.
*/
public class CodeMapCursorPoint extends PointF {
public CodeMapCursorPoint() {
super();
}
public CodeMapCursorPoint(float x, float y) {
super(x, y);
}
| // Path: src/com/hdweiss/codemap/view/workspace/WorkspaceView.java
// public class WorkspaceView extends ZoomableAbsoluteLayout {
//
// private GestureDetector gestureDetector;
// private ScaleGestureDetector scaleDetector;
// private Scroller scroller;
//
// public ArrayList<CodeMapItem> items = new ArrayList<C... | public CodeMapPoint getCodeMapPoint(WorkspaceView codeMapView) { |
hdweiss/codemap | src/com/hdweiss/codemap/util/SyntaxHighlighter.java | // Path: src/com/hdweiss/codemap/data/CscopeEntry.java
// public class CscopeEntry {
// private static int CSCOPE_FILE = 1;
// private static int CSCOPE_ACTUALNAME = 2;
// private static int CSCOPE_NAME = 4;
// private static int CSCOPE_LINENUMBER = 3;
//
// public String actualName = "";
// public String name ... | import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.text.Html;
import android.text.SpannableString;
import com.hdweiss.codemap.data.CscopeEntry; | this.content = contents;
}
public SpannableString formatToHtml() {
formatNewline();
highlightKeywords();
highlightComments();
SpannableString spannableString = new SpannableString(
Html.fromHtml(content));
return spannableString;
}
private void formatNewline() {
content = content.replaceAll... | // Path: src/com/hdweiss/codemap/data/CscopeEntry.java
// public class CscopeEntry {
// private static int CSCOPE_FILE = 1;
// private static int CSCOPE_ACTUALNAME = 2;
// private static int CSCOPE_NAME = 4;
// private static int CSCOPE_LINENUMBER = 3;
//
// public String actualName = "";
// public String name ... | public void markupReferences(ArrayList<CscopeEntry> references) { |
hdweiss/codemap | src/com/hdweiss/codemap/view/workspace/CollisionManager.java | // Path: src/com/hdweiss/codemap/view/workspace/fragments/CodeMapItem.java
// public abstract class CodeMapItem extends LinearLayout implements ICodeMapItem {
// public UUID id = UUID.randomUUID();
//
// public TextView titleView;
// private ImageButton removeButton;
// private LinearLayout containerView;
//
// ... | import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import android.graphics.Point;
import android.graphics.Rect;
import android.util.Log;
import com.hdweiss.codemap.view.workspace.fragments.CodeMapItem; | package com.hdweiss.codemap.view.workspace;
public class CollisionManager {
private static final int padding = 5;
| // Path: src/com/hdweiss/codemap/view/workspace/fragments/CodeMapItem.java
// public abstract class CodeMapItem extends LinearLayout implements ICodeMapItem {
// public UUID id = UUID.randomUUID();
//
// public TextView titleView;
// private ImageButton removeButton;
// private LinearLayout containerView;
//
// ... | public static boolean pushItems(CodeMapItem pushingItem, |
ntmcminn/CounterSign | countersign-repo/src/main/java/org/alfresco/extension/countersign/signature/RepositoryManagedSignatureProviderFactory.java | // Path: countersign-repo/src/main/java/org/alfresco/extension/countersign/service/CounterSignService.java
// public interface CounterSignService {
// public NodeRef getSignatureArtifact(String person, QName assoc);
// public NodeRef getSignatureArtifact(NodeRef person, QName assoc);
// }
| import org.alfresco.extension.countersign.service.CounterSignService;
import org.alfresco.service.ServiceRegistry;
import java.util.Properties; | /*
* Copyright 2012-2013 Alfresco Software Limited.
*
* Licensed under the GNU Affero General Public License, Version 3.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.gnu.org/licenses/agpl-3.0.html
*
* If you... | // Path: countersign-repo/src/main/java/org/alfresco/extension/countersign/service/CounterSignService.java
// public interface CounterSignService {
// public NodeRef getSignatureArtifact(String person, QName assoc);
// public NodeRef getSignatureArtifact(NodeRef person, QName assoc);
// }
// Path: countersign-repo/... | private CounterSignService counterSignService; |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/game/Board.java | // Path: core/src/dev/lonami/klooni/interfaces/IEffect.java
// public interface IEffect {
// void setInfo(Cell deadCell, Vector2 culprit);
//
// void draw(Batch batch);
//
// boolean isDone();
// }
//
// Path: core/src/dev/lonami/klooni/interfaces/IEffectFactory.java
// public interface IEffectFactory {
... | import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import dev.lonami.klooni.int... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/interfaces/IEffect.java
// public interface IEffect {
// void setInfo(Cell deadCell, Vector2 culprit);
//
// void draw(Batch batch);
//
// boolean isDone();
// }
//
// Path: core/src/dev/lonami/klooni/interfaces/IEffectFactory.java
// public interface IEffectFactory {
... | private final Array<IEffect> effects = new Array<IEffect>(); // Particle effects once they vanish |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/game/Board.java | // Path: core/src/dev/lonami/klooni/interfaces/IEffect.java
// public interface IEffect {
// void setInfo(Cell deadCell, Vector2 culprit);
//
// void draw(Batch batch);
//
// boolean isDone();
// }
//
// Path: core/src/dev/lonami/klooni/interfaces/IEffectFactory.java
// public interface IEffectFactory {
... | import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import dev.lonami.klooni.int... | return putPiece(piece, x, y);
}
Vector2 snapToGrid(final Piece piece, final Vector2 position) {
// Snaps the given position (e.g. mouse) to the grid,
// assuming piece wants to be put at the specified position.
// If the piece was not on the grid, the original position is return... | // Path: core/src/dev/lonami/klooni/interfaces/IEffect.java
// public interface IEffect {
// void setInfo(Cell deadCell, Vector2 culprit);
//
// void draw(Batch batch);
//
// boolean isDone();
// }
//
// Path: core/src/dev/lonami/klooni/interfaces/IEffectFactory.java
// public interface IEffectFactory {
... | public int clearComplete(final IEffectFactory effect) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/EvaporateEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
impo... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/EvaporateEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
impo... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/SpinEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector2;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
import... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/SpinEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector2;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
import... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/VanishEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
impo... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/VanishEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
impo... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/interfaces/IEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.math.Vector2;
import dev.lonami.klooni.game.Cell; | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | IEffect create(final Cell deadCell, final Vector2 culprit); |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/game/GameLayout.java | // Path: core/src/dev/lonami/klooni/actors/Band.java
// public class Band extends Actor {
//
// //region Members
//
// private final BaseScorer scorer;
// private final Texture bandTexture;
//
// public final Rectangle scoreBounds;
// public final Rectangle infoBounds;
//
// private final La... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import dev.lonami.klooni.actors.Band;
import dev.lonami.klooni.actors.ShopCard; | area.x, area.y,
area.width * 0.5f - cupSize * 0.5f, area.height);
scorer.highScoreLabel.setBounds(
area.x + area.width * 0.5f + cupSize * 0.5f, area.y,
area.width * 0.5f - cupSize * 0.5f, area.height);
}
// Special case, we want to positi... | // Path: core/src/dev/lonami/klooni/actors/Band.java
// public class Band extends Actor {
//
// //region Members
//
// private final BaseScorer scorer;
// private final Texture bandTexture;
//
// public final Rectangle scoreBounds;
// public final Rectangle infoBounds;
//
// private final La... | public void update(Band band) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/game/GameLayout.java | // Path: core/src/dev/lonami/klooni/actors/Band.java
// public class Band extends Actor {
//
// //region Members
//
// private final BaseScorer scorer;
// private final Texture bandTexture;
//
// public final Rectangle scoreBounds;
// public final Rectangle infoBounds;
//
// private final La... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import dev.lonami.klooni.actors.Band;
import dev.lonami.klooni.actors.ShopCard; | board.cellSize = boardSize / board.cellCount;
// Now that we know the board size, we can center the board on the screen
board.pos.set(
screenWidth * 0.5f - boardSize * 0.5f, pieceHolderHeight);
}
void update(PieceHolder holder) {
holder.area.set(
... | // Path: core/src/dev/lonami/klooni/actors/Band.java
// public class Band extends Actor {
//
// //region Members
//
// private final BaseScorer scorer;
// private final Texture bandTexture;
//
// public final Rectangle scoreBounds;
// public final Rectangle infoBounds;
//
// private final La... | public void update(ShopCard card) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/ExplodeEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
import dev... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
LonamiWebs/Klooni1010 | core/src/dev/lonami/klooni/effects/ExplodeEffectFactory.java | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import dev.lonami.klooni.game.Cell;
import dev.lonami.klooni.interfaces.IEffect;
import dev... | /*
1010! Klooni, a free customizable puzzle game for Android and Desktop
Copyright (C) 2017-2019 Lonami Exo @ lonami.dev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ve... | // Path: core/src/dev/lonami/klooni/game/Cell.java
// public class Cell implements BinSerializable {
//
// //region Members
//
// // Negative index indicates that the cell is empty
// private int colorIndex;
//
// public final Vector2 pos;
// public final float size;
//
// //endregion
//
//... | public IEffect create(Cell deadCell, Vector2 culprit) { |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/Utils.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import java.io.IOException;
import org.apache.commons.lang.Validate;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hba... | /**
* 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... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | Bytes.toBytes(HBaseGraphConstants.HBASE_GRAPH_TABLE_COLFAM_PROPERTY_NAME), |
trendmicro/HGraph | src/test/java/org/trend/hgraph/mapreduce/pagerank/LocalPrTest.java | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculatePageRankReducer.java
// static boolean pageRankEquals(double src, double dest, int scale) {
// BigDecimal a = new BigDecimal(src);
// BigDecimal b = new BigDecimal(dest);
// a = a.setScale(scale, RoundingMode.DOWN);
// b = b.setScale(scale, Rou... | import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.trend.hgraph.HBaseGraphConstants;
import static org.trend.hgraph.mapreduce.pagerank.CalculatePageRankReducer.pageRankEquals;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Ar... | int prChanged = 0;
int round = 0;
do {
round++;
prChanged = 0;
// housekeeping
for (V v : vs)
v.tprs.clear();
// as mapper
double cpr = 0.0D;
double tpr = 0.0D;
for (V v : vs) {
cpr = v.pr;
tpr = cpr / (double) v.al.size();
for... | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculatePageRankReducer.java
// static boolean pageRankEquals(double src, double dest, int scale) {
// BigDecimal a = new BigDecimal(src);
// BigDecimal b = new BigDecimal(dest);
// a = a.setScale(scale, RoundingMode.DOWN);
// b = b.setScale(scale, Rou... | if (!pageRankEquals(opr, npr, 3)) prChanged++; |
trendmicro/HGraph | src/test/java/org/trend/hgraph/mapreduce/pagerank/LocalPrTest.java | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculatePageRankReducer.java
// static boolean pageRankEquals(double src, double dest, int scale) {
// BigDecimal a = new BigDecimal(src);
// BigDecimal b = new BigDecimal(dest);
// a = a.setScale(scale, RoundingMode.DOWN);
// b = b.setScale(scale, Rou... | import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.trend.hgraph.HBaseGraphConstants;
import static org.trend.hgraph.mapreduce.pagerank.CalculatePageRankReducer.pageRankEquals;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Ar... | DriverTest.class.getClassLoader().getResourceAsStream(vertexData);
LineIterator it = IOUtils.lineIterator(new InputStreamReader(data));
// load all Vs
List<V> vs = new ArrayList<V>();
String record = null;
String[] values = null;
V v = null;
while (it.hasNext()) {
record = it.next();... | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculatePageRankReducer.java
// static boolean pageRankEquals(double src, double dest, int scale) {
// BigDecimal a = new BigDecimal(src);
// BigDecimal b = new BigDecimal(dest);
// a = a.setScale(scale, RoundingMode.DOWN);
// b = b.setScale(scale, Rou... | values = values[0].split(HBaseGraphConstants.HBASE_GRAPH_TABLE_EDGE_DELIMITER_1); |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculatePageRankReducer.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import org.apache.commons.lang.time.StopWatch;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.io.DoubleWritable;
import ... |
sw.reset(); sw.start();
double oldPageRank = Utils.getPageRank(vertexTable, rowkey, Constants.PAGE_RANK_CQ_TMP_NAME);
if (!pageRankEquals(oldPageRank, newPageRank, pageRankCompareScale)) {
// collect pageRank changing count with counter
context.getCounter(Counters.CHANGED_PAGE_RANK_COUNT).i... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | Utils.initTable(conf, HBaseGraphConstants.HBASE_GRAPH_TABLE_VERTEX_NAME_KEY, |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/lib/input/CalculateInputSplitMapper.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import java.io.IOException;
import java.util.Arrays;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionInfo;
import o... | }
}
private static String getKeyString(byte[] bkey) {
String key = null;
key = Bytes.toString(bkey).trim();
key = key + EMPTY_STRING;
return key;
}
@Override
protected void cleanup(Context context) throws IOException, InterruptedException {
vertexTable.close();
... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | String tableName = conf.get(HBaseGraphConstants.HBASE_GRAPH_TABLE_VERTEX_NAME_KEY); |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateInitPageRankMapper.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Counter;
import org.trend.hgraph.HBaseGraphConstants;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang... | InterruptedException {
int outgoingEdgeCount = outgoingRowKeys.size();
outgoingEdgeCounter.increment(outgoingEdgeCount);
double pageRankForEachOutgoing = pageRank / (double) outgoingEdgeCount;
StopWatch sw = null;
String outgoingRowKey = null;
try {
sw = new StopWatch();
sw.st... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | + HBaseGraphConstants.HBASE_GRAPH_TABLE_EDGE_DELIMITER_1)); |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/ResetPageRankUpdateFlag.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.had... | /**
*
*/
package org.trend.hgraph.mapreduce.pagerank;
/**
* A MR to set {@link Constants#PAGE_RANK_CQ_UPDATED_NAME} flag to 0
* @author scott_miao
*/
public class ResetPageRankUpdateFlag extends Configured implements Tool {
protected ResetPageRankUpdateFlag(Configuration conf) {
super(conf);
}
priv... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | put.add(Bytes.toBytes(HBaseGraphConstants.HBASE_GRAPH_TABLE_COLFAM_PROPERTY_NAME), |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateIntermediatePageRankMapper.java | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateInitPageRankMapper.java
// static void dispatchPageRank(List<String> outgoingRowKeys, double pageRank, Configuration conf,
// HTable edgeTable, Counter dispatchPrTimeConsumeCounter, Counter outgoingEdgeCounter,
// ContextWriterStrategy strategy... | import org.trend.hgraph.mapreduce.pagerank.CalculateInitPageRankMapper.ContextWriterStrategy;
import static org.trend.hgraph.mapreduce.pagerank.CalculateInitPageRankMapper.dispatchPageRank;
import static org.trend.hgraph.mapreduce.pagerank.CalculateInitPageRankMapper.getOutgoingRowKeys;
import java.io.IOException;
impo... | /**
* 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... | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateInitPageRankMapper.java
// static void dispatchPageRank(List<String> outgoingRowKeys, double pageRank, Configuration conf,
// HTable edgeTable, Counter dispatchPrTimeConsumeCounter, Counter outgoingEdgeCounter,
// ContextWriterStrategy strategy... | getOutgoingRowKeys(conf, vertexTable, edgeTable, rowKey, |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateIntermediatePageRankMapper.java | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateInitPageRankMapper.java
// static void dispatchPageRank(List<String> outgoingRowKeys, double pageRank, Configuration conf,
// HTable edgeTable, Counter dispatchPrTimeConsumeCounter, Counter outgoingEdgeCounter,
// ContextWriterStrategy strategy... | import org.trend.hgraph.mapreduce.pagerank.CalculateInitPageRankMapper.ContextWriterStrategy;
import static org.trend.hgraph.mapreduce.pagerank.CalculateInitPageRankMapper.dispatchPageRank;
import static org.trend.hgraph.mapreduce.pagerank.CalculateInitPageRankMapper.getOutgoingRowKeys;
import java.io.IOException;
impo... | double pageRank = value.get();
// write current pageRank to tmp
Utils.writePageRank(vertexTable, rowKey, tmpPageRankCq, pageRank);
Configuration conf = context.getConfiguration();
List<String> outgoingRowKeys = null;
context.getCounter(Counters.VERTEX_COUNT).increment(1);
outgoingRowKe... | // Path: src/main/java/org/trend/hgraph/mapreduce/pagerank/CalculateInitPageRankMapper.java
// static void dispatchPageRank(List<String> outgoingRowKeys, double pageRank, Configuration conf,
// HTable edgeTable, Counter dispatchPrTimeConsumeCounter, Counter outgoingEdgeCounter,
// ContextWriterStrategy strategy... | Utils.initTable(conf, HBaseGraphConstants.HBASE_GRAPH_TABLE_VERTEX_NAME_KEY, |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/Driver.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import java.io.IOException;
import java.util.Arrays;
import org.apache.commons.lang.Validate;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Scan;
import org... | }
} else if ("-p".equals(arg) || "--input-splits-path".equals(arg)) {
a++;
inputSplitsPath = args[a];
} else {
System.err.println("Not a defined option:" + arg);
printUsage();
return 1;
}
} else {
// must
if (start... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | LOGGER.info(HBaseGraphConstants.HBASE_GRAPH_TABLE_VERTEX_NAME_KEY + "=" + vertexTableName); |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/pagerank/ImportPageRanks.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import java.io.IOException;
import org.apache.commons.lang.Validate;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.cl... | /**
* 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... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | Bytes.toBytes(HBaseGraphConstants.HBASE_GRAPH_TABLE_COLFAM_PROPERTY_NAME), |
trendmicro/HGraph | src/main/java/org/trend/hgraph/util/MoveEntities.java | // Path: src/main/java/org/trend/hgraph/util/FindCandidateEntities.java
// static boolean isFileExists(String fileName) {
// File file = new File(fileName);
// if (file.exists()) {
// System.err.println("file:" + fileName
// + " already exists, pls change to another filepath");
// return true;
// ... | import static org.trend.hgraph.util.FindCandidateEntities.isFileExists;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.NavigableMap;
import org.apache.commons.io.IOUtils;
import o... | /**
* 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... | // Path: src/main/java/org/trend/hgraph/util/FindCandidateEntities.java
// static boolean isFileExists(String fileName) {
// File file = new File(fileName);
// if (file.exists()) {
// System.err.println("file:" + fileName
// + " already exists, pls change to another filepath");
// return true;
// ... | if (!isFileExists(vFile)) { |
trendmicro/HGraph | src/main/java/org/trend/hgraph/mapreduce/lib/input/Driver.java | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.trend.hgraph.HBaseGraphConstants;
import java.io.IOException;
import java.util.Arrays;
import org.apache.hadoo... | System.err.println("-b shall be a numeric value, b:" + cmd);
printUsage();
return -1;
}
} else {
System.err.println("Not a defined option:" + cmd);
printUsage();
return 1;
}
} else {
if (mustStartIdx < 0) {
... | // Path: src/main/java/org/trend/hgraph/HBaseGraphConstants.java
// public class HBaseGraphConstants {
//
// public static final String HBASE_GRAPH_TABLE_VERTEX_NAME_KEY = "hbase.graph.table.vertex.name";
//
// public static final String HBASE_GRAPH_TABLE_EDGE_NAME_KEY = "hbase.graph.table.edge.name";
//
/... | LOGGER.info(HBaseGraphConstants.HBASE_GRAPH_TABLE_VERTEX_NAME_KEY + "=" + tableName); |
vorburger/SwissKnightMinecraft | SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/logo/LogoPlugin.java | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/command/AbstractPluginWithCommands.java
// public abstract class AbstractPluginWithCommands extends AbstractHotPlugin {
//
// protected @Inject PluginContainer plugin;
//
// private @Inject AnnotatedCommandManager commandManager;
//
//... | import java.util.Map;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongepowered.api.command.source.LocatedSource;
import org.spongepowered.api.entity.living.Human;
import com.google.common.collect.MapMaker;
import ch.vorburger.minecraft.command.AbstractPluginW... | package ch.vorburger.minecraft.logo;
// @Plugin(id = "ch.vorburger.minecraft.logo", name = "LOGO", description="Logo-like commands (thank you, Seymour Papert)", version = "1.0")
public class LogoPlugin extends AbstractPluginWithCommands {
private final static Logger logger = LoggerFactory.getLogger(LogoPlugin.cla... | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/command/AbstractPluginWithCommands.java
// public abstract class AbstractPluginWithCommands extends AbstractHotPlugin {
//
// protected @Inject PluginContainer plugin;
//
// private @Inject AnnotatedCommandManager commandManager;
//
//... | SpawnHelper spawnHelper = new SpawnHelper(); |
vorburger/SwissKnightMinecraft | SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/logo/LogoPlugin.java | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/command/AbstractPluginWithCommands.java
// public abstract class AbstractPluginWithCommands extends AbstractHotPlugin {
//
// protected @Inject PluginContainer plugin;
//
// private @Inject AnnotatedCommandManager commandManager;
//
//... | import java.util.Map;
import java.util.function.Function;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spongepowered.api.command.source.LocatedSource;
import org.spongepowered.api.entity.living.Human;
import com.google.common.collect.MapMaker;
import ch.vorburger.minecraft.command.AbstractPluginW... | }
@Command("Make Turtle remove block")
public void rm(LocatedSource player) {
getTurtle(player).remove();
}
// @Command("Make Turtle interact")
// public void inter(Player player) {
// getTurtle(player).interact();
// }
// @Command("Make Turtle dig")
// public void dig(LocatedSource player) {
// getTu... | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/command/AbstractPluginWithCommands.java
// public abstract class AbstractPluginWithCommands extends AbstractHotPlugin {
//
// protected @Inject PluginContainer plugin;
//
// private @Inject AnnotatedCommandManager commandManager;
//
//... | } catch (MinecraftHelperException e) { |
vorburger/SwissKnightMinecraft | CurseDownloader/src/main/java/ch/vorburger/minecraft/cursedl/Downloader.java | // Path: CurseDownloader/src/main/java/ch/vorburger/minecraft/cursedl/CurseManifest.java
// public static class CurseManifestFile {
// public int projectID;
// public int fileID;
// public boolean required;
//
// @Override
// public String toString() {
// return "CurseManifestFile [projectID=" + projectID + "... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpR... | package ch.vorburger.minecraft.cursedl;
/**
* Download files from Curse.com.
*
* @author Michael Vorburger.ch
*/
public class Downloader {
protected HttpTransport http = new ApacheHttpTransport();
protected HttpRequestFactory requestFactory = http.createRequestFactory();
protected File dir;
public Dow... | // Path: CurseDownloader/src/main/java/ch/vorburger/minecraft/cursedl/CurseManifest.java
// public static class CurseManifestFile {
// public int projectID;
// public int fileID;
// public boolean required;
//
// @Override
// public String toString() {
// return "CurseManifestFile [projectID=" + projectID + "... | for (CurseManifestFile file : mf.files) { |
vorburger/SwissKnightMinecraft | SpongePowered/SpongeTests/src/test/java/ch/vorburger/minecraft/testsinfra/CommandTestHelperTest.java | // Path: SpongePowered/SpongeTests/src/main/java/ch/vorburger/minecraft/testsinfra/CommandTestHelper.java
// public static interface Chat {
// List<Text> getMessages();
// }
| import static org.junit.Assert.assertEquals;
import java.util.Collections;
import org.junit.Test;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.Texts;
import org.spongepowered.api.text.translation.FixedTranslation;
import org.spongepowered.api.util.command.CommandResult;
import org.spongepow... | package ch.vorburger.minecraft.testsinfra;
public class CommandTestHelperTest {
@Test public void textToString() {
Text text = Texts.of("something");
assertEquals("something", new CommandTestHelper(null).toString(text));
}
@Test public void translatedTextToString() {
Text text = Texts.builder(new FixedT... | // Path: SpongePowered/SpongeTests/src/main/java/ch/vorburger/minecraft/testsinfra/CommandTestHelper.java
// public static interface Chat {
// List<Text> getMessages();
// }
// Path: SpongePowered/SpongeTests/src/test/java/ch/vorburger/minecraft/testsinfra/CommandTestHelperTest.java
import static org.junit.Assert.as... | Chat chat = () -> Collections.singletonList(Texts.of("something")); |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learnlet/examples/AdditionLearnlet.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learnlet/Evaluation.java
// public class Evaluation {
//
// private final boolean correct;
//
// public Evaluation(boolean correct) {
// this.correct = correct;
// }
//
// public boolean isCorrect() {
// return correct;
// }
/... | import java.util.Locale;
import org.eclipse.jdt.annotation.NonNull;
import ch.vorburger.learnlet.Evaluation;
import ch.vorburger.learnlet.Learnlet;
import ch.vorburger.learnlet.Question; | package ch.vorburger.learnlet.examples;
public class AdditionLearnlet implements Learnlet {
@Override | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learnlet/Evaluation.java
// public class Evaluation {
//
// private final boolean correct;
//
// public Evaluation(boolean correct) {
// this.correct = correct;
// }
//
// public boolean isCorrect() {
// return correct;
// }
/... | public Question newQuestion(int level) { |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learnlet/examples/AdditionLearnlet.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learnlet/Evaluation.java
// public class Evaluation {
//
// private final boolean correct;
//
// public Evaluation(boolean correct) {
// this.correct = correct;
// }
//
// public boolean isCorrect() {
// return correct;
// }
/... | import java.util.Locale;
import org.eclipse.jdt.annotation.NonNull;
import ch.vorburger.learnlet.Evaluation;
import ch.vorburger.learnlet.Learnlet;
import ch.vorburger.learnlet.Question; | package ch.vorburger.learnlet.examples;
public class AdditionLearnlet implements Learnlet {
@Override
public Question newQuestion(int level) {
// TODO helper to partition difficulties
if (level < 3) {
level = 3;
} else { // max.
level = 10;
}
// TODO random helper; http://stackoverflow.com/que... | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learnlet/Evaluation.java
// public class Evaluation {
//
// private final boolean correct;
//
// public Evaluation(boolean correct) {
// this.correct = correct;
// }
//
// public boolean isCorrect() {
// return correct;
// }
/... | public Evaluation answerFreeTextQuestion(Question question, String answer) { |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/server/LearningServiceImpl.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | import ch.vorburger.learning.ServiceEvaluation;
import ch.vorburger.learning.LearningService;
import ch.vorburger.learning.LearningServiceException;
import ch.vorburger.learning.ServiceQuestion;
import ch.vorburger.learning.UserID; | package ch.vorburger.learning.server;
public class LearningServiceImpl implements LearningService {
@Override | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | public ServiceQuestion newQuestion(UserID uid) { |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/server/LearningServiceImpl.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | import ch.vorburger.learning.ServiceEvaluation;
import ch.vorburger.learning.LearningService;
import ch.vorburger.learning.LearningServiceException;
import ch.vorburger.learning.ServiceQuestion;
import ch.vorburger.learning.UserID; | package ch.vorburger.learning.server;
public class LearningServiceImpl implements LearningService {
@Override | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | public ServiceQuestion newQuestion(UserID uid) { |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/server/LearningServiceImpl.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | import ch.vorburger.learning.ServiceEvaluation;
import ch.vorburger.learning.LearningService;
import ch.vorburger.learning.LearningServiceException;
import ch.vorburger.learning.ServiceQuestion;
import ch.vorburger.learning.UserID; | package ch.vorburger.learning.server;
public class LearningServiceImpl implements LearningService {
@Override
public ServiceQuestion newQuestion(UserID uid) {
// TODO this needs to go into the AdditionLearnlet
return new ServiceQuestion("1", "What is 1 + 1?");
}
@Override | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | public ServiceEvaluation answerFreeTextQuestion(String questionID, String answer) throws LearningServiceException { |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/server/LearningServiceImpl.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | import ch.vorburger.learning.ServiceEvaluation;
import ch.vorburger.learning.LearningService;
import ch.vorburger.learning.LearningServiceException;
import ch.vorburger.learning.ServiceQuestion;
import ch.vorburger.learning.UserID; | package ch.vorburger.learning.server;
public class LearningServiceImpl implements LearningService {
@Override
public ServiceQuestion newQuestion(UserID uid) {
// TODO this needs to go into the AdditionLearnlet
return new ServiceQuestion("1", "What is 1 + 1?");
}
@Override | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceEvaluation.java
// public class ServiceEvaluation {
// // TODO https://immutables.github.io
//
// private final boolean correct;
// private final int totalScore;
// private final Optional<String> comment;
// private ... | public ServiceEvaluation answerFreeTextQuestion(String questionID, String answer) throws LearningServiceException { |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/ServiceQuestion.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/utils/EvenMoreObjects.java
// public final class EvenMoreObjects {
//
// @SuppressWarnings("unchecked")
// public static <T> boolean equalsHelper(T self, @Nullable Object other, BooleanEqualsFunction<T> equals) {
// if (o... | import java.util.Collections;
import java.util.List;
import java.util.Objects;
import org.eclipse.jdt.annotation.Nullable;
import ch.vorburger.utils.EvenMoreObjects; | */
public ServiceQuestion(String id, String text, List<String> choices) {
super();
this.id = id;
this.text = text;
this.choices = Collections.unmodifiableList(choices);
if (choices.isEmpty())
throw new IllegalArgumentException("choices.isEmpty(), so it's a free-text not multiple choice question");
}... | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/utils/EvenMoreObjects.java
// public final class EvenMoreObjects {
//
// @SuppressWarnings("unchecked")
// public static <T> boolean equalsHelper(T self, @Nullable Object other, BooleanEqualsFunction<T> equals) {
// if (o... | return EvenMoreObjects.equalsHelper(this, other, |
vorburger/SwissKnightMinecraft | SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/MyFirstSpongePlugIn.java | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/utils/SpawnHelper.java
// public class SpawnHelper {
// private final static Logger logger = LoggerFactory.getLogger(SpawnHelper.class);
//
// private Map<Class<? extends Entity>, EntityType> entityClassToTypeMap;
//
// protected void ... | import java.util.Optional;
import org.slf4j.Logger;
import org.spongepowered.api.Game;
import org.spongepowered.api.command.CommandCallable;
import org.spongepowered.api.command.CommandMapping;
import org.spongepowered.api.config.DefaultConfig;
import org.spongepowered.api.entity.living.player.Player;
import org.sponge... | package ch.vorburger.minecraft;
// @Plugin(id = "MyFirstSponge", name = "My first Sponge Plug-In", version = "1.0")
public class MyFirstSpongePlugIn {
@Inject Game game;
@Inject Logger logger;
@Inject PluginContainer plugin;
@DefaultConfig(sharedRoot = true)
@Inject ConfigurationLoader<CommentedConfiguratio... | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/utils/SpawnHelper.java
// public class SpawnHelper {
// private final static Logger logger = LoggerFactory.getLogger(SpawnHelper.class);
//
// private Map<Class<? extends Entity>, EntityType> entityClassToTypeMap;
//
// protected void ... | SpawnHelper spawnHelper = new SpawnHelper(); |
vorburger/SwissKnightMinecraft | SpongePowered/MyFirstSpongePlugIn/src/test/java/ch/vorburger/minecraft/command/CommandManagerTest.java | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/command/AnnotatedCommandManager.java
// protected static class MethodArg {
// String name;
// Type type;
// boolean optional = false;
// boolean vararg = false;
// }
| import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Optional;
import org.junit.Ignore;
import org.junit.Test;
import org.spongepowered.api.command.CommandSource;
impor... | package ch.vorburger.minecraft.command;
@Ignore
public class CommandManagerTest {
@Command void test(CommandSource commandSource, Optional<String> name, int n, String commandToRepeat) { };
@Test public void getCommandElements() throws Exception {
Method method = this.getClass().getDeclaredMethod("test", Comm... | // Path: SpongePowered/MyFirstSpongePlugIn/src/main/java/ch/vorburger/minecraft/command/AnnotatedCommandManager.java
// protected static class MethodArg {
// String name;
// Type type;
// boolean optional = false;
// boolean vararg = false;
// }
// Path: SpongePowered/MyFirstSpongePlugIn/src/test/java/ch/vorburge... | List<MethodArg> methodArgs = new AnnotatedCommandManager().getMethodArgs(method); |
vorburger/SwissKnightMinecraft | SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/learning/UserID.java | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/utils/EvenMoreObjects.java
// public final class EvenMoreObjects {
//
// @SuppressWarnings("unchecked")
// public static <T> boolean equalsHelper(T self, @Nullable Object other, BooleanEqualsFunction<T> equals) {
// if (o... | import java.util.Objects;
import org.eclipse.jdt.annotation.Nullable;
import ch.vorburger.utils.EvenMoreObjects; | package ch.vorburger.learning;
public class UserID {
// TODO https://immutables.github.io
private final String scheme;
private final String uuid;
// TODO private final Locale locale;
public UserID(String scheme, String uuid) {
super();
this.scheme = scheme;
this.uuid = uuid;
}
public String getSch... | // Path: SpongePowered/ch.vorburger.minecraft.learning/src/main/java/ch/vorburger/utils/EvenMoreObjects.java
// public final class EvenMoreObjects {
//
// @SuppressWarnings("unchecked")
// public static <T> boolean equalsHelper(T self, @Nullable Object other, BooleanEqualsFunction<T> equals) {
// if (o... | return EvenMoreObjects.equalsHelper(this, other, |
vorburger/SwissKnightMinecraft | CurseDownloader/src/test/java/ch/vorburger/minecraft/cursedl/tests/CurseDownloaderTest.java | // Path: CurseDownloader/src/main/java/ch/vorburger/minecraft/cursedl/CurseManifest.java
// public class CurseManifest {
//
// protected static final Gson gson = new Gson();
//
// public int projectID;
// public List<CurseManifestFile> files = new ArrayList<CurseManifestFile>();
//
// public static CurseManifest... | import java.net.URL;
import org.junit.Ignore;
import org.junit.Test;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import com.google.common.io.Resources;
import ch.vorburger.minecraft.cursedl.CurseManifest;
import ch.vorburger.minecraft.cursedl.Downloader; | package ch.vorburger.minecraft.cursedl.tests;
public class CurseDownloaderTest {
@Test
public void testDownloadOneFile() throws Exception { | // Path: CurseDownloader/src/main/java/ch/vorburger/minecraft/cursedl/CurseManifest.java
// public class CurseManifest {
//
// protected static final Gson gson = new Gson();
//
// public int projectID;
// public List<CurseManifestFile> files = new ArrayList<CurseManifestFile>();
//
// public static CurseManifest... | new Downloader(Files.createTempDir()).download(223248, 2237600); |
vorburger/SwissKnightMinecraft | CurseDownloader/src/test/java/ch/vorburger/minecraft/cursedl/tests/CurseDownloaderTest.java | // Path: CurseDownloader/src/main/java/ch/vorburger/minecraft/cursedl/CurseManifest.java
// public class CurseManifest {
//
// protected static final Gson gson = new Gson();
//
// public int projectID;
// public List<CurseManifestFile> files = new ArrayList<CurseManifestFile>();
//
// public static CurseManifest... | import java.net.URL;
import org.junit.Ignore;
import org.junit.Test;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import com.google.common.io.Resources;
import ch.vorburger.minecraft.cursedl.CurseManifest;
import ch.vorburger.minecraft.cursedl.Downloader; | package ch.vorburger.minecraft.cursedl.tests;
public class CurseDownloaderTest {
@Test
public void testDownloadOneFile() throws Exception {
new Downloader(Files.createTempDir()).download(223248, 2237600);
}
@Test @Ignore
public void testCurseDownloader() throws Exception {
URL url = Resources.getResour... | // Path: CurseDownloader/src/main/java/ch/vorburger/minecraft/cursedl/CurseManifest.java
// public class CurseManifest {
//
// protected static final Gson gson = new Gson();
//
// public int projectID;
// public List<CurseManifestFile> files = new ArrayList<CurseManifestFile>();
//
// public static CurseManifest... | CurseManifest mf = CurseManifest.fromString(manifest); |
RatioLabs/BLEService | DeviceService/src/com/ratio/deviceService/BTServiceProfile.java | // Path: DeviceService/src/com/ratio/util/UUIDUtils.java
// public class UUIDUtils {
//
// // if the UUID is null, then we write 0L,0L
// public static void writeToParcel(UUID uuid, Parcel parcel) {
// if (uuid == null) {
// parcel.writeLong(0L);
// parcel.writeLong(0L);
// } else {
// parcel.writeLong... | import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.ratio.util.UUIDUtils;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import android.os.Parcel;
impo... | package com.ratio.deviceService;
/**
* external description of a device profile, so once we query the device services and characteristics
* we can send it back from the service to the activity in a bundle, which can be received by the BroadcastReceiver
* @author mreynolds
*
*/
public class BTServiceProfile i... | // Path: DeviceService/src/com/ratio/util/UUIDUtils.java
// public class UUIDUtils {
//
// // if the UUID is null, then we write 0L,0L
// public static void writeToParcel(UUID uuid, Parcel parcel) {
// if (uuid == null) {
// parcel.writeLong(0L);
// parcel.writeLong(0L);
// } else {
// parcel.writeLong... | UUID serviceUUID = UUIDUtils.readFromParcel(in); |
RatioLabs/BLEService | DeviceService/src/com/ratio/deviceService/BTCharacteristicProfile.java | // Path: DeviceService/src/com/ratio/util/UUIDUtils.java
// public class UUIDUtils {
//
// // if the UUID is null, then we write 0L,0L
// public static void writeToParcel(UUID uuid, Parcel parcel) {
// if (uuid == null) {
// parcel.writeLong(0L);
// parcel.writeLong(0L);
// } else {
// parcel.writeLong... | import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.ratio.util.UUIDUtils;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import android.os.Parcel;
impo... | package com.ratio.deviceService;
/**
* external description of a device profile, so once we query the device services and characteristics
* we can send it back from the service to the activity in a bundle, which can be received by the BroadcastReceiver
* @author mreynolds
*
*/
public class BTCharacteristicPro... | // Path: DeviceService/src/com/ratio/util/UUIDUtils.java
// public class UUIDUtils {
//
// // if the UUID is null, then we write 0L,0L
// public static void writeToParcel(UUID uuid, Parcel parcel) {
// if (uuid == null) {
// parcel.writeLong(0L);
// parcel.writeLong(0L);
// } else {
// parcel.writeLong... | UUIDUtils.writeToParcel(mCharacteristic.getUuid(), dest); |
RatioLabs/BLEService | DeviceService/src/com/ratio/deviceService/DeviceService.java | // Path: DeviceService/src/com/ratio/exceptions/DeviceManagerException.java
// public class DeviceManagerException extends Exception {
// static final long serialVersionUID = 0;
//
// public DeviceManagerException(String s) {
// super(s);
// }
// public DeviceManagerException(String error, String errorValue) {... | import java.util.ArrayList;
import java.util.UUID;
import com.ratio.exceptions.DeviceManagerException;
import com.ratio.exceptions.DeviceNameNotFoundException;
import com.ratio.deviceService.IDeviceCommand;
import android.app.Service;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
imp... | public final static String EXTRA_VALUE = DeviceService.class.getName() + ".EXTRA_VALUE";
public final static String EXTRA_RSSI = DeviceService.class.getName() + ".EXTRA_RSSI";
public final static String EXTRA_STATUS = DeviceService.class.getName() + ".EXTRA_STATUS";
public final static String EXTRA_RETR... | // Path: DeviceService/src/com/ratio/exceptions/DeviceManagerException.java
// public class DeviceManagerException extends Exception {
// static final long serialVersionUID = 0;
//
// public DeviceManagerException(String s) {
// super(s);
// }
// public DeviceManagerException(String error, String errorValue) {... | } catch (DeviceManagerException dmex) { |
RatioLabs/BLEService | DeviceService/src/com/ratio/deviceService/DeviceService.java | // Path: DeviceService/src/com/ratio/exceptions/DeviceManagerException.java
// public class DeviceManagerException extends Exception {
// static final long serialVersionUID = 0;
//
// public DeviceManagerException(String s) {
// super(s);
// }
// public DeviceManagerException(String error, String errorValue) {... | import java.util.ArrayList;
import java.util.UUID;
import com.ratio.exceptions.DeviceManagerException;
import com.ratio.exceptions.DeviceNameNotFoundException;
import com.ratio.deviceService.IDeviceCommand;
import android.app.Service;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
imp... | Intent broadcastIntent = new Intent(ACTION_CONNECTION_STATE);
broadcastIntent.putExtra(EXTRA_DEVICE_ADDRESS, device.getAddress());
broadcastIntent.putExtra(EXTRA_STATE, connState);
sendBroadcast(broadcastIntent);
}
// report that we are attempting to reconnect to a device
public void onRetryReconnect(Bluet... | // Path: DeviceService/src/com/ratio/exceptions/DeviceManagerException.java
// public class DeviceManagerException extends Exception {
// static final long serialVersionUID = 0;
//
// public DeviceManagerException(String s) {
// super(s);
// }
// public DeviceManagerException(String error, String errorValue) {... | } catch (DeviceNameNotFoundException dnnfex) { |
RatioLabs/BLEService | DeviceService/src/com/ratio/deviceService/BTDescriptorProfile.java | // Path: DeviceService/src/com/ratio/util/UUIDUtils.java
// public class UUIDUtils {
//
// // if the UUID is null, then we write 0L,0L
// public static void writeToParcel(UUID uuid, Parcel parcel) {
// if (uuid == null) {
// parcel.writeLong(0L);
// parcel.writeLong(0L);
// } else {
// parcel.writeLong... | import java.util.UUID;
import com.ratio.util.UUIDUtils;
import android.bluetooth.BluetoothGattDescriptor;
import android.os.Parcel;
import android.os.Parcelable; | package com.ratio.deviceService;
/**
* external description of a device profile, so once we query the device services and descriptors
* we can send it back from the service to the activity in a bundle, which can be received by the BroadcastReceiver
* @author mreynolds
*
*/
public class BTDescriptorProfile imp... | // Path: DeviceService/src/com/ratio/util/UUIDUtils.java
// public class UUIDUtils {
//
// // if the UUID is null, then we write 0L,0L
// public static void writeToParcel(UUID uuid, Parcel parcel) {
// if (uuid == null) {
// parcel.writeLong(0L);
// parcel.writeLong(0L);
// } else {
// parcel.writeLong... | UUIDUtils.writeToParcel(mDescriptor.getUuid(), dest); |
cornelcreanga/bitbucket-rest-client | src/main/java/com/ccreanga/bitbucket/rest/client/http/responseparsers/ErrorsParser.java | // Path: src/main/java/com/ccreanga/bitbucket/rest/client/http/dto/BitBucketError.java
// public class BitBucketError {
// private String message;
// private String context;
// private String exceptionName;
//
// public BitBucketError(String message, String context, String exceptionName) {
// t... | import com.ccreanga.bitbucket.rest.client.http.dto.BitBucketError;
import java.util.function.Function;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.List;
import static com.ccreanga.bitbucket.rest.client.http.responseparsers.Parsers.errorParser;
import static com.ccreanga.bitbu... | /*
*
* *
* * 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 writ... | // Path: src/main/java/com/ccreanga/bitbucket/rest/client/http/dto/BitBucketError.java
// public class BitBucketError {
// private String message;
// private String context;
// private String exceptionName;
//
// public BitBucketError(String message, String context, String exceptionName) {
// t... | return listParser(errorParser()).apply(jsonObject.get("error")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.