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 |
|---|---|---|---|---|---|---|
yammer/tenacity | tenacity-core/src/test/java/com/yammer/tenacity/tests/DependencyKeyFactory.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/properties/TenacityPropertyKey.java
// public interface TenacityPropertyKey extends HystrixCommandKey, HystrixThreadPoolKey {
// default Predicate<TenacityPropertyKey> isEqualPredicate() {
// return (value) -> value.name().equals(name());
// ... | import com.yammer.tenacity.core.properties.TenacityPropertyKey;
import com.yammer.tenacity.core.properties.TenacityPropertyKeyFactory; | package com.yammer.tenacity.tests;
public class DependencyKeyFactory implements TenacityPropertyKeyFactory {
@Override | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/properties/TenacityPropertyKey.java
// public interface TenacityPropertyKey extends HystrixCommandKey, HystrixThreadPoolKey {
// default Predicate<TenacityPropertyKey> isEqualPredicate() {
// return (value) -> value.name().equals(name());
// ... | public TenacityPropertyKey from(String value) { |
yammer/tenacity | tenacity-core/src/main/java/com/yammer/tenacity/core/auth/TenacityAuthenticator.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/TenacityCommand.java
// public abstract class TenacityCommand<R> extends HystrixCommand<R> {
// protected TenacityCommand(TenacityPropertyKey tenacityPropertyKey) {
// this(tenacityPropertyKey, tenacityPropertyKey);
// }
//
// protected ... | import com.yammer.tenacity.core.TenacityCommand;
import com.yammer.tenacity.core.properties.TenacityPropertyKey;
import io.dropwizard.auth.AuthenticationException;
import io.dropwizard.auth.Authenticator;
import java.security.Principal;
import java.util.Optional; | package com.yammer.tenacity.core.auth;
public class TenacityAuthenticator<C, P extends Principal> implements Authenticator<C, P> {
private final Authenticator<C, P> underlying; | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/TenacityCommand.java
// public abstract class TenacityCommand<R> extends HystrixCommand<R> {
// protected TenacityCommand(TenacityPropertyKey tenacityPropertyKey) {
// this(tenacityPropertyKey, tenacityPropertyKey);
// }
//
// protected ... | private final TenacityPropertyKey tenacityPropertyKey; |
yammer/tenacity | tenacity-core/src/main/java/com/yammer/tenacity/core/auth/TenacityAuthenticator.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/TenacityCommand.java
// public abstract class TenacityCommand<R> extends HystrixCommand<R> {
// protected TenacityCommand(TenacityPropertyKey tenacityPropertyKey) {
// this(tenacityPropertyKey, tenacityPropertyKey);
// }
//
// protected ... | import com.yammer.tenacity.core.TenacityCommand;
import com.yammer.tenacity.core.properties.TenacityPropertyKey;
import io.dropwizard.auth.AuthenticationException;
import io.dropwizard.auth.Authenticator;
import java.security.Principal;
import java.util.Optional; | package com.yammer.tenacity.core.auth;
public class TenacityAuthenticator<C, P extends Principal> implements Authenticator<C, P> {
private final Authenticator<C, P> underlying;
private final TenacityPropertyKey tenacityPropertyKey;
private TenacityAuthenticator(Authenticator<C, P> underlying, TenacityPr... | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/TenacityCommand.java
// public abstract class TenacityCommand<R> extends HystrixCommand<R> {
// protected TenacityCommand(TenacityPropertyKey tenacityPropertyKey) {
// this(tenacityPropertyKey, tenacityPropertyKey);
// }
//
// protected ... | private class TenacityAuthenticate extends TenacityCommand<Optional<P>> { |
yammer/tenacity | tenacity-core/src/main/java/com/yammer/tenacity/core/servlets/TenacityConfigurationServlet.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/resources/TenacityConfigurationResource.java
// @Path(TenacityConfigurationResource.PATH)
// public class TenacityConfigurationResource {
// public static final String PATH = "/tenacity/configuration";
// private final TenacityPropertyKeyFactory fact... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.yammer.tenacity.core.resources.TenacityConfigurationResource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException; | package com.yammer.tenacity.core.servlets;
public class TenacityConfigurationServlet extends TenacityServlet {
private static final long serialVersionUID = 0; | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/resources/TenacityConfigurationResource.java
// @Path(TenacityConfigurationResource.PATH)
// public class TenacityConfigurationResource {
// public static final String PATH = "/tenacity/configuration";
// private final TenacityPropertyKeyFactory fact... | private transient final TenacityConfigurationResource configurationResource; |
yammer/tenacity | tenacity-core/src/main/java/com/yammer/tenacity/core/properties/ArchaiusPropertyRegister.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/config/BreakerboxConfiguration.java
// public class BreakerboxConfiguration {
// @NotNull @Valid
// private String urls = "";
//
// @NotNull @Valid
// private Duration initialDelay = Duration.seconds(0);
//
// @NotNull @Valid
// pri... | import com.google.common.primitives.Ints;
import com.netflix.config.ConfigurationManager;
import com.netflix.config.DynamicConfiguration;
import com.netflix.config.FixedDelayPollingScheduler;
import com.netflix.config.PolledConfigurationSource;
import com.netflix.config.sources.URLConfigurationSource;
import com.yammer... | package com.yammer.tenacity.core.properties;
public class ArchaiusPropertyRegister {
private static final Logger LOGGER = LoggerFactory.getLogger(ArchaiusPropertyRegister.class);
private static class TenacityPollingScheduler extends FixedDelayPollingScheduler {
private static final Logger LOGGER = ... | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/config/BreakerboxConfiguration.java
// public class BreakerboxConfiguration {
// @NotNull @Valid
// private String urls = "";
//
// @NotNull @Valid
// private Duration initialDelay = Duration.seconds(0);
//
// @NotNull @Valid
// pri... | public void register(BreakerboxConfiguration breakerboxConfiguration) { |
yammer/tenacity | tenacity-client/src/main/java/com/yammer/tenacity/client/TenacityClientBuilder.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/http/TenacityJerseyClientBuilder.java
// public class TenacityJerseyClientBuilder {
// protected final TenacityPropertyKey tenacityPropertyKey;
// //50ms by default, because with lower values we have seen issues with it racing with Tenacity/Hystrix's... | import com.yammer.tenacity.core.http.TenacityJerseyClientBuilder;
import com.yammer.tenacity.core.properties.TenacityPropertyKey;
import io.dropwizard.client.JerseyClientBuilder;
import io.dropwizard.client.JerseyClientConfiguration;
import io.dropwizard.setup.Environment;
import javax.ws.rs.client.Client; | package com.yammer.tenacity.client;
public class TenacityClientBuilder {
protected JerseyClientConfiguration jerseyConfiguration = new JerseyClientConfiguration();
protected final Environment environment; | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/http/TenacityJerseyClientBuilder.java
// public class TenacityJerseyClientBuilder {
// protected final TenacityPropertyKey tenacityPropertyKey;
// //50ms by default, because with lower values we have seen issues with it racing with Tenacity/Hystrix's... | protected final TenacityPropertyKey tenacityPropertyKey; |
yammer/tenacity | tenacity-client/src/main/java/com/yammer/tenacity/client/TenacityClientBuilder.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/http/TenacityJerseyClientBuilder.java
// public class TenacityJerseyClientBuilder {
// protected final TenacityPropertyKey tenacityPropertyKey;
// //50ms by default, because with lower values we have seen issues with it racing with Tenacity/Hystrix's... | import com.yammer.tenacity.core.http.TenacityJerseyClientBuilder;
import com.yammer.tenacity.core.properties.TenacityPropertyKey;
import io.dropwizard.client.JerseyClientBuilder;
import io.dropwizard.client.JerseyClientConfiguration;
import io.dropwizard.setup.Environment;
import javax.ws.rs.client.Client; | package com.yammer.tenacity.client;
public class TenacityClientBuilder {
protected JerseyClientConfiguration jerseyConfiguration = new JerseyClientConfiguration();
protected final Environment environment;
protected final TenacityPropertyKey tenacityPropertyKey;
public TenacityClientBuilder(Environme... | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/http/TenacityJerseyClientBuilder.java
// public class TenacityJerseyClientBuilder {
// protected final TenacityPropertyKey tenacityPropertyKey;
// //50ms by default, because with lower values we have seen issues with it racing with Tenacity/Hystrix's... | return new TenacityClient(environment.metrics(), TenacityJerseyClientBuilder |
yammer/tenacity | tenacity-core/src/main/java/com/yammer/tenacity/core/properties/TenacityPropertyRegister.java | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/config/BreakerboxConfiguration.java
// public class BreakerboxConfiguration {
// @NotNull @Valid
// private String urls = "";
//
// @NotNull @Valid
// private Duration initialDelay = Duration.seconds(0);
//
// @NotNull @Valid
// pri... | import com.google.common.collect.ImmutableMap;
import com.netflix.config.ConfigurationManager;
import com.yammer.tenacity.core.config.BreakerboxConfiguration;
import com.yammer.tenacity.core.config.TenacityConfiguration;
import io.dropwizard.util.Duration;
import org.apache.commons.configuration.AbstractConfiguration;
... | package com.yammer.tenacity.core.properties;
public class TenacityPropertyRegister {
protected final ImmutableMap<TenacityPropertyKey, TenacityConfiguration> configurations; | // Path: tenacity-core/src/main/java/com/yammer/tenacity/core/config/BreakerboxConfiguration.java
// public class BreakerboxConfiguration {
// @NotNull @Valid
// private String urls = "";
//
// @NotNull @Valid
// private Duration initialDelay = Duration.seconds(0);
//
// @NotNull @Valid
// pri... | protected final BreakerboxConfiguration breakerboxConfiguration; |
yammer/tenacity | tenacity-client/src/test/java/com/yammer/tenacity/client/tests/TenacityResourcesJerseyTest.java | // Path: tenacity-client/src/main/java/com/yammer/tenacity/client/TenacityClientBuilder.java
// public class TenacityClientBuilder {
// protected JerseyClientConfiguration jerseyConfiguration = new JerseyClientConfiguration();
// protected final Environment environment;
// protected final TenacityPropertyKe... | import com.google.common.io.Resources;
import com.yammer.tenacity.client.TenacityClientBuilder;
import io.dropwizard.Configuration;
import io.dropwizard.client.JerseyClientBuilder;
import io.dropwizard.testing.junit.DropwizardAppRule;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import java.net.URI; | package com.yammer.tenacity.client.tests;
public class TenacityResourcesJerseyTest extends TenacityResources {
@ClassRule
public static DropwizardAppRule<Configuration> APP_RULE = new DropwizardAppRule<>(TenacityServletService.class,
Resources.getResource("tenacityPropertyKeyServletService.yml").... | // Path: tenacity-client/src/main/java/com/yammer/tenacity/client/TenacityClientBuilder.java
// public class TenacityClientBuilder {
// protected JerseyClientConfiguration jerseyConfiguration = new JerseyClientConfiguration();
// protected final Environment environment;
// protected final TenacityPropertyKe... | CLIENT = new TenacityClientBuilder(APP_RULE.getEnvironment(), ServletKeys.KEY_ONE).build(); |
AfterLifeLochie/fontbox | src/main/java/net/afterlifelochie/fontbox/layout/ObjectBounds.java | // Path: src/main/java/net/afterlifelochie/fontbox/document/property/FloatMode.java
// public enum FloatMode {
// NONE, LEFT, RIGHT;
// }
| import net.afterlifelochie.fontbox.document.property.FloatMode;
| package net.afterlifelochie.fontbox.layout;
public class ObjectBounds {
public int x, y;
public int width, height;
| // Path: src/main/java/net/afterlifelochie/fontbox/document/property/FloatMode.java
// public enum FloatMode {
// NONE, LEFT, RIGHT;
// }
// Path: src/main/java/net/afterlifelochie/fontbox/layout/ObjectBounds.java
import net.afterlifelochie.fontbox.document.property.FloatMode;
package net.afterlifelochie.fontbo... | public FloatMode floating;
|
AfterLifeLochie/fontbox | src/main/java/net/afterlifelochie/fontbox/data/FormattedString.java | // Path: src/main/java/net/afterlifelochie/fontbox/document/formatting/TextFormat.java
// public class TextFormat implements Cloneable {
//
// public final EnumSet<DecorationStyle> decorations;
// public final GLFont font;
// public final ColorFormat color;
//
// public TextFormat(GLFont font) {
// this(... | import net.afterlifelochie.fontbox.document.formatting.TextFormat;
| package net.afterlifelochie.fontbox.data;
public class FormattedString {
public final String string;
| // Path: src/main/java/net/afterlifelochie/fontbox/document/formatting/TextFormat.java
// public class TextFormat implements Cloneable {
//
// public final EnumSet<DecorationStyle> decorations;
// public final GLFont font;
// public final ColorFormat color;
//
// public TextFormat(GLFont font) {
// this(... | public final TextFormat[] format;
|
MaChristmann/mobile-trial | test/src/com/android/vending/licensing/StrictPolicyTest.java | // Path: library/src/com/google/android/vending/licensing/Policy.java
// public interface Policy {
//
// /**
// * Change these values to make it more difficult for tools to automatically
// * strip LVL protection from your APK.
// */
//
// /**
// * LICENSED means that the server returned b... | import com.google.android.vending.licensing.Policy;
import com.google.android.vending.licensing.StrictPolicy;
import junit.framework.TestCase; | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: library/src/com/google/android/vending/licensing/Policy.java
// public interface Policy {
//
// /**
// * Change these values to make it more difficult for tools to automatically
// * strip LVL protection from your APK.
// */
//
// /**
// * LICENSED means that the server returned b... | p.processServerResponse(Policy.LICENSED, null); |
MaChristmann/mobile-trial | library/src/org/mobiletrial/license/LicenseChecker.java | // Path: library/src/com/google/android/vending/licensing/Policy.java
// public interface Policy {
//
// /**
// * Change these values to make it more difficult for tools to automatically
// * strip LVL protection from your APK.
// */
//
// /**
// * LICENSED means that the server returned b... | import java.net.URL;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.X509EncodedKeySpec;
import java.util.Date;
import java.util.HashSet;
import... | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: library/src/com/google/android/vending/licensing/Policy.java
// public interface Policy {
//
// /**
// * Change these values to make it more difficult for tools to automatically
// * strip LVL protection from your APK.
// */
//
// /**
// * LICENSED means that the server returned b... | private final Policy mPolicy; |
MaChristmann/mobile-trial | library/src/org/mobiletrial/license/LicenseValidator.java | // Path: library/src/com/google/android/vending/licensing/Policy.java
// public interface Policy {
//
// /**
// * Change these values to make it more difficult for tools to automatically
// * strip LVL protection from your APK.
// */
//
// /**
// * LICENSED means that the server returned b... | import com.google.android.vending.licensing.DeviceLimiter;
import com.google.android.vending.licensing.Policy;
import com.google.android.vending.licensing.ResponseData;
import com.google.android.vending.licensing.util.Base64;
import com.google.android.vending.licensing.util.Base64DecoderException;
import android.text.T... | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | // Path: library/src/com/google/android/vending/licensing/Policy.java
// public interface Policy {
//
// /**
// * Change these values to make it more difficult for tools to automatically
// * strip LVL protection from your APK.
// */
//
// /**
// * LICENSED means that the server returned b... | private final Policy mPolicy; |
MaChristmann/mobile-trial | library/src/org/mobiletrial/license/ServerLicensingService.java | // Path: library/src/org/mobiletrial/license/connect/RestClient.java
// public class RestClient {
//
// private static final int ERROR_CONTACTING_SERVER = 0x101;
// private static final int ERROR_SERVER_FAILURE = 0x4;
//
// private String TAG = "RestClient";
//
// private URL mServiceUrl;
// private Context ... | import java.net.URL;
import java.net.URLEncoder;
import java.util.Date;
import org.json.JSONException;
import org.json.JSONObject;
import org.mobiletrial.license.connect.RestClient;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log; | package org.mobiletrial.license;
public class ServerLicensingService implements ILicensingService {
private static final String TAG = "ServerLicensingService";
private static final String PARAM_TIMESTAMP = "ts";
private static final String PARAM_VERSIONCODE = "vc";
private static final String PARAM_NONCE = "... | // Path: library/src/org/mobiletrial/license/connect/RestClient.java
// public class RestClient {
//
// private static final int ERROR_CONTACTING_SERVER = 0x101;
// private static final int ERROR_SERVER_FAILURE = 0x4;
//
// private String TAG = "RestClient";
//
// private URL mServiceUrl;
// private Context ... | RestClient client = new RestClient(mContext, mWebserviceUrl); |
julman99/futuristic | futuristic-core/src/test/java/io/futuristic/FuturesTest.java | // Path: futuristic-core/src/test/java/io/futuristic/util/DummyExceptions.java
// public class DummyExceptions {
//
// private DummyExceptions(){
//
// }
//
// public static class DummyException1 extends RuntimeException {
//
// }
//
// public static class DummyException2 extends RuntimeExcepti... | import io.futuristic.util.DummyExceptions;
import org.junit.Test;
import java.util.concurrent.Executors;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail; | package io.futuristic;
/**
* @autor: julio
*/
public class FuturesTest {
@Test
public void testWithCallback() throws Exception {
Future<Integer> future = Futures.withCallback(c -> c.completed(1));
int result = future.await();
assertEquals(1, result);
}
@Test
public v... | // Path: futuristic-core/src/test/java/io/futuristic/util/DummyExceptions.java
// public class DummyExceptions {
//
// private DummyExceptions(){
//
// }
//
// public static class DummyException1 extends RuntimeException {
//
// }
//
// public static class DummyException2 extends RuntimeExcepti... | Exception exception = new DummyExceptions.DummyException1(); |
julman99/futuristic | futuristic-core/src/test/java/io/futuristic/FutureWithTriggerTest.java | // Path: futuristic-core/src/test/java/io/futuristic/util/DummyExceptions.java
// public class DummyExceptions {
//
// private DummyExceptions(){
//
// }
//
// public static class DummyException1 extends RuntimeException {
//
// }
//
// public static class DummyException2 extends RuntimeExcepti... | import io.futuristic.util.DummyExceptions;
import io.futuristic.util.Triggerer;
import org.junit.Test;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import static org.junit.Assert.*; | package io.futuristic;
/**
* @autor: julio
*/
public class FutureWithTriggerTest {
@Test
public void testGetSync() throws Exception {
FutureWithTrigger futureWithTrigger = new FutureWithTrigger();
Object test = new Object(); | // Path: futuristic-core/src/test/java/io/futuristic/util/DummyExceptions.java
// public class DummyExceptions {
//
// private DummyExceptions(){
//
// }
//
// public static class DummyException1 extends RuntimeException {
//
// }
//
// public static class DummyException2 extends RuntimeExcepti... | Triggerer.triggerValue(test, futureWithTrigger); |
julman99/futuristic | futuristic-core/src/test/java/io/futuristic/FutureWithTriggerTest.java | // Path: futuristic-core/src/test/java/io/futuristic/util/DummyExceptions.java
// public class DummyExceptions {
//
// private DummyExceptions(){
//
// }
//
// public static class DummyException1 extends RuntimeException {
//
// }
//
// public static class DummyException2 extends RuntimeExcepti... | import io.futuristic.util.DummyExceptions;
import io.futuristic.util.Triggerer;
import org.junit.Test;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import static org.junit.Assert.*; | assertEquals(exception, catchedException);
}
}
@Test
public void testErrorCatchingFuture() {
FutureWithTrigger<Object> futureWithTrigger = new FutureWithTrigger<>();
RuntimeException exception = new RuntimeException();
AtomicReference<RuntimeException> exceptionR... | // Path: futuristic-core/src/test/java/io/futuristic/util/DummyExceptions.java
// public class DummyExceptions {
//
// private DummyExceptions(){
//
// }
//
// public static class DummyException1 extends RuntimeException {
//
// }
//
// public static class DummyException2 extends RuntimeExcepti... | DummyExceptions.DummyException1 exception = new DummyExceptions.DummyException1(); |
julman99/futuristic | futuristic-http-gson/src/main/java/io/futuristic/JsonHttpClient.java | // Path: futuristic-http/src/main/java/io/futuristic/http/BaseHttpClient.java
// public abstract class BaseHttpClient<T> {
//
// private HttpAsyncEngine engine;
// private HttpParams defaultHeaders = new HttpParams();
//
// public BaseHttpClient(HttpAsyncEngine engine) {
// this.engine = engine;
/... | import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import io.futuristic.http.BaseHttpClient;
import io.futuristic.http.HttpAsyncEngine;
import io.futuristic.http.HttpResponse;
import java.io.InputStream;
import java.io.InputStreamReader; | package io.futuristic;
/**
* Client to perform http requests that return a json element
* @author julio
*/
public class JsonHttpClient extends BaseHttpClient<JsonElement> {
public JsonHttpClient(HttpAsyncEngine client) {
super(client);
}
@Override | // Path: futuristic-http/src/main/java/io/futuristic/http/BaseHttpClient.java
// public abstract class BaseHttpClient<T> {
//
// private HttpAsyncEngine engine;
// private HttpParams defaultHeaders = new HttpParams();
//
// public BaseHttpClient(HttpAsyncEngine engine) {
// this.engine = engine;
/... | protected JsonElement responseToObject(HttpResponse<InputStream> response) { |
julman99/futuristic | futuristic-core/src/test/java/io/futuristic/CallbackLinkTest.java | // Path: futuristic-core/src/main/java/io/futuristic/Callback.java
// public interface Callback<T> {
//
// void completed(T result);
// void failed(Exception throwable);
//
// }
//
// Path: futuristic-core/src/main/java/io/futuristic/CallbackLink.java
// public final class CallbackLink<T> {
//
// privat... | import io.futuristic.Callback;
import io.futuristic.CallbackLink;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
im... | package io.futuristic;
/**
* @autor: julio
*/
public class CallbackLinkTest {
@Test
public void testLinkSuccessFirstTo(){ | // Path: futuristic-core/src/main/java/io/futuristic/Callback.java
// public interface Callback<T> {
//
// void completed(T result);
// void failed(Exception throwable);
//
// }
//
// Path: futuristic-core/src/main/java/io/futuristic/CallbackLink.java
// public final class CallbackLink<T> {
//
// privat... | CallbackLink<AtomicBoolean> callbackLink = new CallbackLink<>(); |
julman99/futuristic | futuristic-core/src/test/java/io/futuristic/CallbackLinkTest.java | // Path: futuristic-core/src/main/java/io/futuristic/Callback.java
// public interface Callback<T> {
//
// void completed(T result);
// void failed(Exception throwable);
//
// }
//
// Path: futuristic-core/src/main/java/io/futuristic/CallbackLink.java
// public final class CallbackLink<T> {
//
// privat... | import io.futuristic.Callback;
import io.futuristic.CallbackLink;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
im... | package io.futuristic;
/**
* @autor: julio
*/
public class CallbackLinkTest {
@Test
public void testLinkSuccessFirstTo(){
CallbackLink<AtomicBoolean> callbackLink = new CallbackLink<>(); | // Path: futuristic-core/src/main/java/io/futuristic/Callback.java
// public interface Callback<T> {
//
// void completed(T result);
// void failed(Exception throwable);
//
// }
//
// Path: futuristic-core/src/main/java/io/futuristic/CallbackLink.java
// public final class CallbackLink<T> {
//
// privat... | callbackLink.addTo(new Callback<AtomicBoolean>() { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/Future.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
public interface Future<T> {
/**
* Blocks the call until the future value is available.
* @return
* @throws Exception
*/
public T await() throws Exception;
/**
* Called when the future value is available.
* @param consumer
... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public Future<T> consume(ConsumerWithException<T> consumer); |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/Future.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
public interface Future<T> {
/**
* Blocks the call until the future value is available.
* @return
* @throws Exception
*/
public T await() throws Exception;
/**
* Called when the future value is available.
* @param consumer
... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <R> Future<R> map(FunctionWithException<T, R> mapper); |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/Future.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
public interface Future<T> {
/**
* Blocks the call until the future value is available.
* @return
* @throws Exception
*/
public T await() throws Exception;
/**
* Called when the future value is available.
* @param consumer
... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <E extends Exception> Future<T> trap(Class<E> exceptionClass, ExceptionTrapper<E, T> trapper); |
julman99/futuristic | futuristic-http/src/main/java/io/futuristic/http/HttpUrlEncodedBody.java | // Path: futuristic-http/src/main/java/io/futuristic/http/util/GenericBuilder.java
// public interface GenericBuilder<T> {
//
// public T build();
//
// }
| import io.futuristic.http.util.GenericBuilder;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException; | package io.futuristic.http;
/**
* @autor: julio
*/
public final class HttpUrlEncodedBody extends HttpParams implements HttpBody {
private HttpUrlEncodedBody(){
}
private HttpUrlEncodedBody(HttpParams params){
this.putAll(params);
}
@Override
public int getContentLength() {
... | // Path: futuristic-http/src/main/java/io/futuristic/http/util/GenericBuilder.java
// public interface GenericBuilder<T> {
//
// public T build();
//
// }
// Path: futuristic-http/src/main/java/io/futuristic/http/HttpUrlEncodedBody.java
import io.futuristic.http.util.GenericBuilder;
import java.io.ByteArrayInpu... | public final static class Builder implements GenericBuilder<HttpUrlEncodedBody> { |
julman99/futuristic | futuristic-http/src/test/java/io/futuristic/http/HttpParamsTest.java | // Path: futuristic-http/src/main/java/io/futuristic/http/HttpParams.java
// public class HttpParams implements Multimap<String, String> {
//
// private static final Comparator<String> KEY_COMPARATOR = new StringCaseInsensitiveComparator();
// private static final Comparator<String> VALUES_COMPARATOR = Compara... | import io.futuristic.http.HttpParams;
import org.junit.Test;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; | package io.futuristic.http;
/**
* @autor: julio
*/
public class HttpParamsTest {
@Test
public void testInsensitive(){ | // Path: futuristic-http/src/main/java/io/futuristic/http/HttpParams.java
// public class HttpParams implements Multimap<String, String> {
//
// private static final Comparator<String> KEY_COMPARATOR = new StringCaseInsensitiveComparator();
// private static final Comparator<String> VALUES_COMPARATOR = Compara... | HttpParams p = new HttpParams(); |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithValue.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
final class FutureWithValue<T> implements Future<T> {
private final T value;
FutureWithValue(T value) {
this.value = value;
}
@Override
public T await() throws Exception {
return value;
}
@Override | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public Future<T> consume(ConsumerWithException<T> consumer) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithValue.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
final class FutureWithValue<T> implements Future<T> {
private final T value;
FutureWithValue(T value) {
this.value = value;
}
@Override
public T await() throws Exception {
return value;
}
@Override
public Future<T> con... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <R> Future<R> map(FunctionWithException<T, R> mapper) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithValue.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | public Future<T> consume(ConsumerWithException<T> consumer) {
try {
consumer.accept(value);
return this;
} catch (Exception ex) {
return new FutureWithException<>(ex);
}
}
@Override
public <R> Future<R> map(FunctionWithException<T, R> mapper) ... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <E extends Exception> Future<T> trap(Class<E> exceptionClass, ExceptionTrapper<E, T> trapper) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithTrigger.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference; | private Future<T> createFuture(){
return new Future<T>() {
@Override
public T await() throws Exception{
final CountDownLatch latch = new CountDownLatch(1);
final AtomicReference<T> resultReference = new AtomicReference<>();
final Atomic... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public Future<T> consume(ConsumerWithException<T> consumer) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithTrigger.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference; | return resultReference.get();
} else {
throw errorReference.get();
}
}
@Override
public Future<T> consume(ConsumerWithException<T> consumer) {
FutureWithTrigger<T> nextFuture = new FutureWithTrig... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <R> Future<R> map(FunctionWithException<T, R> mapper) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithTrigger.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference; | }
@Override
public <R> Future<R> map(FunctionWithException<T, R> mapper) {
return mapFuture(t -> new FutureWithValue<R>(mapper.apply(t)));
}
@Override
public <R> Future<R> mapFuture(FunctionWithException<T, Future<R>> mapper) {
... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <E extends Exception> Future<T> trap(Class<E> exceptionClass, ExceptionTrapper<E, T> trapper) { |
julman99/futuristic | futuristic-http/src/main/java/io/futuristic/http/HttpRequest.java | // Path: futuristic-http/src/main/java/io/futuristic/http/util/GenericBuilder.java
// public interface GenericBuilder<T> {
//
// public T build();
//
// }
| import io.futuristic.http.util.GenericBuilder; | package io.futuristic.http;
/**
* @autor: julio
*/
public interface HttpRequest {
static final String HEADER_CONTENT_TYPE = "Content-Type";
static final String HEADER_CONTENT_LENGTH = "Content-Length";
String getUrl();
HttpParams getHeaders();
HttpBody getBody();
HttpVerb getVerb();
... | // Path: futuristic-http/src/main/java/io/futuristic/http/util/GenericBuilder.java
// public interface GenericBuilder<T> {
//
// public T build();
//
// }
// Path: futuristic-http/src/main/java/io/futuristic/http/HttpRequest.java
import io.futuristic.http.util.GenericBuilder;
package io.futuristic.http;
/**
... | static final class Builder<T> implements GenericBuilder<HttpRequest> { |
julman99/futuristic | futuristic-http/src/main/java/io/futuristic/http/BaseHttpClient.java | // Path: futuristic-core/src/main/java/io/futuristic/Future.java
// public interface Future<T> {
//
// /**
// * Blocks the call until the future value is available.
// * @return
// * @throws Exception
// */
// public T await() throws Exception;
//
// /**
// * Called when the futur... | import io.futuristic.Future;
import com.google.common.io.ByteStreams;
import java.io.InputStream; | package io.futuristic.http;
/**
* @autor: julio
*/
public abstract class BaseHttpClient<T> {
private HttpAsyncEngine engine;
private HttpParams defaultHeaders = new HttpParams();
public BaseHttpClient(HttpAsyncEngine engine) {
this.engine = engine;
}
public void addDefaultHeader(Stri... | // Path: futuristic-core/src/main/java/io/futuristic/Future.java
// public interface Future<T> {
//
// /**
// * Blocks the call until the future value is available.
// * @return
// * @throws Exception
// */
// public T await() throws Exception;
//
// /**
// * Called when the futur... | public Future<HttpResponse<T>> request(final HttpRequest.Builder request) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithException.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
final class FutureWithException<T> implements Future<T> {
private final Exception exception;
FutureWithException(Exception exception) {
this.exception = exception;
}
@Override
public T await() throws Exception {
throw exception;
... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public Future<T> consume(ConsumerWithException<T> consumer) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithException.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
final class FutureWithException<T> implements Future<T> {
private final Exception exception;
FutureWithException(Exception exception) {
this.exception = exception;
}
@Override
public T await() throws Exception {
throw exception;
... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <R> Future<R> map(FunctionWithException<T, R> mapper) { |
julman99/futuristic | futuristic-core/src/main/java/io/futuristic/FutureWithException.java | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | import io.futuristic.function.ConsumerWithException;
import io.futuristic.function.ExceptionTrapper;
import io.futuristic.function.FunctionWithException; | package io.futuristic;
/**
* @autor: julio
*/
final class FutureWithException<T> implements Future<T> {
private final Exception exception;
FutureWithException(Exception exception) {
this.exception = exception;
}
@Override
public T await() throws Exception {
throw exception;
... | // Path: futuristic-core/src/main/java/io/futuristic/function/ConsumerWithException.java
// public interface ConsumerWithException<T> {
//
// /**
// * Performs this operation on the given argument.
// *
// * @param t the input argument
// */
// void accept(T t) throws Exception;
// }
//
//... | public <E extends Exception> Future<T> trap(Class<E> exceptionClass, ExceptionTrapper<E, T> trapper) { |
yDelouis/selfoss-android | app/src/main/java/fr/ydelouis/selfoss/config/model/ConfigManager.java | // Path: app/src/main/java/fr/ydelouis/selfoss/model/DatabaseHelper.java
// public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
//
// public static final String ACTION_TABLES_CLEARED = "fr.ydelouis.selfoss.ACTION_TABLES_CLEARED";
//
// private static final String DATABASE_NAME = "selfoss.db";
// private ... | import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.androidannotations.annotations.SystemService;... | package fr.ydelouis.selfoss.config.model;
@EBean
public class ConfigManager {
public static final String ACCOUNT_TYPE = BuildConfig.ACCOUNT_TYPE;
private static final String KEY_USERNAME = "username";
private static final String KEY_SYNC_PERIOD = "syncPeriod";
private static final String KEY_TRUST_ALL_CERTIFI... | // Path: app/src/main/java/fr/ydelouis/selfoss/model/DatabaseHelper.java
// public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
//
// public static final String ACTION_TABLES_CLEARED = "fr.ydelouis.selfoss.ACTION_TABLES_CLEARED";
//
// private static final String DATABASE_NAME = "selfoss.db";
// private ... | private DatabaseHelper databaseHelper; |
yDelouis/selfoss-android | app/src/main/java/fr/ydelouis/selfoss/config/model/ConfigManager.java | // Path: app/src/main/java/fr/ydelouis/selfoss/model/DatabaseHelper.java
// public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
//
// public static final String ACTION_TABLES_CLEARED = "fr.ydelouis.selfoss.ACTION_TABLES_CLEARED";
//
// private static final String DATABASE_NAME = "selfoss.db";
// private ... | import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import org.androidannotations.annotations.AfterInject;
import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;
import org.androidannotations.annotations.SystemService;... | private static final String KEY_SYNC_PERIOD = "syncPeriod";
private static final String KEY_TRUST_ALL_CERTIFICATES = "trustAllCertificates";
private static final String KEY_USE_HTTPS = "useHttps";
private static final String KEY_SYNC_OVER_WIFI_ONLY = "syncOverWifiOnly";
@SystemService protected AccountManager acc... | // Path: app/src/main/java/fr/ydelouis/selfoss/model/DatabaseHelper.java
// public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
//
// public static final String ACTION_TABLES_CLEARED = "fr.ydelouis.selfoss.ACTION_TABLES_CLEARED";
//
// private static final String DATABASE_NAME = "selfoss.db";
// private ... | SyncManager.setPeriodicSync(this, config); |
yDelouis/selfoss-android | app/src/main/java/fr/ydelouis/selfoss/sync/SyncManager.java | // Path: app/src/main/java/fr/ydelouis/selfoss/config/model/Config.java
// public class Config {
//
// private String url;
// private boolean trustAllCertificates;
// private boolean useHttps;
// private String username;
// private String password;
// private long syncPeriod;
// private boolean syncOverWifiOnly... | import android.accounts.Account;
import android.content.ContentResolver;
import android.os.Bundle;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EBean;
import fr.ydelouis.selfoss.BuildConfig;
import fr.ydelouis.selfoss.config.model.Config;
import fr.ydelouis.selfoss.config.mo... | package fr.ydelouis.selfoss.sync;
@EBean
public class SyncManager {
private static final String AUTHORITY = BuildConfig.AUTHORITY;
| // Path: app/src/main/java/fr/ydelouis/selfoss/config/model/Config.java
// public class Config {
//
// private String url;
// private boolean trustAllCertificates;
// private boolean useHttps;
// private String username;
// private String password;
// private long syncPeriod;
// private boolean syncOverWifiOnly... | public static void setPeriodicSync(ConfigManager configManager, Config config) { |
yDelouis/selfoss-android | app/src/main/java/fr/ydelouis/selfoss/sync/SyncManager.java | // Path: app/src/main/java/fr/ydelouis/selfoss/config/model/Config.java
// public class Config {
//
// private String url;
// private boolean trustAllCertificates;
// private boolean useHttps;
// private String username;
// private String password;
// private long syncPeriod;
// private boolean syncOverWifiOnly... | import android.accounts.Account;
import android.content.ContentResolver;
import android.os.Bundle;
import org.androidannotations.annotations.Bean;
import org.androidannotations.annotations.EBean;
import fr.ydelouis.selfoss.BuildConfig;
import fr.ydelouis.selfoss.config.model.Config;
import fr.ydelouis.selfoss.config.mo... | package fr.ydelouis.selfoss.sync;
@EBean
public class SyncManager {
private static final String AUTHORITY = BuildConfig.AUTHORITY;
| // Path: app/src/main/java/fr/ydelouis/selfoss/config/model/Config.java
// public class Config {
//
// private String url;
// private boolean trustAllCertificates;
// private boolean useHttps;
// private String username;
// private String password;
// private long syncPeriod;
// private boolean syncOverWifiOnly... | public static void setPeriodicSync(ConfigManager configManager, Config config) { |
yDelouis/selfoss-android | app/src/main/java/fr/ydelouis/selfoss/entity/Tag.java | // Path: app/src/main/java/fr/ydelouis/selfoss/model/TagDao.java
// public class TagDao extends BaseDaoImpl<Tag, String> {
//
// public static final String COLUMN_NAME = "name";
//
// public TagDao(ConnectionSource connectionSource) throws SQLException {
// super(connectionSource, Tag.class);
// }... | import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import java.util.ArrayList... | private int nameId;
@DatabaseField
private int color;
@DatabaseField
private int unread;
public Tag() {
}
private Tag(int nameId) {
this.nameId = nameId;
}
public String getName(Context context) {
if (nameId != 0)
return context.getString(nameId);
return name;
}
public void setName(String name... | // Path: app/src/main/java/fr/ydelouis/selfoss/model/TagDao.java
// public class TagDao extends BaseDaoImpl<Tag, String> {
//
// public static final String COLUMN_NAME = "name";
//
// public TagDao(ConnectionSource connectionSource) throws SQLException {
// super(connectionSource, Tag.class);
// }... | this.color = ColorUtil.parseColor(color); |
yDelouis/selfoss-android | app/src/main/java/fr/ydelouis/selfoss/view/TypeView.java | // Path: app/src/main/java/fr/ydelouis/selfoss/entity/ArticleType.java
// public enum ArticleType {
//
// Newest(R.id.newest, R.string.newest, ""),
// Unread(R.id.unread, R.string.unread, "unread"),
// Starred(R.id.starred, R.string.starred, "starred");
//
// private int id;
// private int nameResId;
// private... | import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EViewGroup;
import org.andro... | package fr.ydelouis.selfoss.view;
@EViewGroup(R.layout.view_type)
public class TypeView extends RelativeLayout {
| // Path: app/src/main/java/fr/ydelouis/selfoss/entity/ArticleType.java
// public enum ArticleType {
//
// Newest(R.id.newest, R.string.newest, ""),
// Unread(R.id.unread, R.string.unread, "unread"),
// Starred(R.id.starred, R.string.starred, "starred");
//
// private int id;
// private int nameResId;
// private... | private ArticleType type; |
yDelouis/selfoss-android | app/src/main/java/fr/ydelouis/selfoss/view/TagView.java | // Path: app/src/main/java/fr/ydelouis/selfoss/entity/Tag.java
// @DatabaseTable(daoClass = TagDao.class)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Tag implements Parcelable {
//
// public static final Tag ALL = new Tag(R.string.allTags);
//
// public static final Comparator<Tag> COMPARATOR_UNR... | import android.content.Context;
import android.graphics.Typeface;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import org.androidannotat... | package fr.ydelouis.selfoss.view;
@EViewGroup(R.layout.view_tag)
public class TagView extends RelativeLayout {
| // Path: app/src/main/java/fr/ydelouis/selfoss/entity/Tag.java
// @DatabaseTable(daoClass = TagDao.class)
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class Tag implements Parcelable {
//
// public static final Tag ALL = new Tag(R.string.allTags);
//
// public static final Comparator<Tag> COMPARATOR_UNR... | private Tag tag; |
MegaApuTurkUltra/Scratch-ApuC | antlr-src/org/antlr/v4/runtime/misc/IntervalSet.java | // Path: antlr-src/org/antlr/v4/runtime/Token.java
// public interface Token {
// public static final int INVALID_TYPE = 0;
//
// /** During lookahead operations, this "token" signifies we hit rule end ATN state
// * and did not follow it despite needing to.
// */
// public static final int EPSILON... | import org.antlr.v4.runtime.Token;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import org.antlr.v4.runtime.Lexer; | return false;
/*
for (ListIterator iter = intervals.listIterator(); iter.hasNext();) {
Interval I = (Interval) iter.next();
if ( el<I.a ) {
break; // list is sorted and el is before this interval; not here
}
if ( el>=I.a && el<=I.b ) {
... | // Path: antlr-src/org/antlr/v4/runtime/Token.java
// public interface Token {
// public static final int INVALID_TYPE = 0;
//
// /** During lookahead operations, this "token" signifies we hit rule end ATN state
// * and did not follow it despite needing to.
// */
// public static final int EPSILON... | return Token.INVALID_TYPE; |
MegaApuTurkUltra/Scratch-ApuC | src/apu/scratch/converter/IdeMain.java | // Path: src/apu/scratch/converter/IdeFrame.java
// static interface SaveCallback {
// public void codeSaved(String code, boolean save);
// }
| import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import javax.swing.JLabel;
import javax.swin... | in.close();
}
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
IdeFrame.launch(true);
try {
sb2 = new JWebBrowser();
sb2.setBarsVisible(false);
sb2.setButtonBarVisible(false);
... | // Path: src/apu/scratch/converter/IdeFrame.java
// static interface SaveCallback {
// public void codeSaved(String code, boolean save);
// }
// Path: src/apu/scratch/converter/IdeMain.java
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
impo... | IdeFrame.instance.callback = new SaveCallback() { |
jpmml/jpmml-sparkml | src/test/java/org/jpmml/sparkml/ClassificationTest.java | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | import java.util.Map;
import java.util.function.Predicate;
import com.google.common.base.Equivalence;
import org.dmg.pmml.general_regression.GeneralRegressionModel;
import org.jpmml.evaluator.ResultField;
import org.jpmml.evaluator.testing.ArchiveBatch;
import org.jpmml.evaluator.testing.PMMLEquivalence;
import org.jpm... | /*
* Copyright (c) 2016 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | options.put(HasRegressionTableOptions.OPTION_REPRESENTATION, GeneralRegressionModel.class.getSimpleName()); |
jpmml/jpmml-sparkml | src/test/java/org/jpmml/sparkml/ClassificationTest.java | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | import java.util.Map;
import java.util.function.Predicate;
import com.google.common.base.Equivalence;
import org.dmg.pmml.general_regression.GeneralRegressionModel;
import org.jpmml.evaluator.ResultField;
import org.jpmml.evaluator.testing.ArchiveBatch;
import org.jpmml.evaluator.testing.PMMLEquivalence;
import org.jpm... | /*
* Copyright (c) 2016 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | options.put(HasTreeOptions.OPTION_ESTIMATE_FEATURE_IMPORTANCES, Boolean.TRUE); |
jpmml/jpmml-sparkml | src/test/java/org/jpmml/sparkml/SparkMLTestBatch.java | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
| import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
impor... | /*
* Copyright (c) 2020 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
// Path: src/test/java/org/jpmml/sparkml/Sp... | options.put(HasRegressionTableOptions.OPTION_LOOKUP_THRESHOLD, 5); |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/ClassificationModelConverter.java | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
| import java.util.ArrayList;
import java.util.List;
import org.apache.spark.ml.PredictionModel;
import org.apache.spark.ml.linalg.Vector;
import org.apache.spark.ml.param.shared.HasFeaturesCol;
import org.apache.spark.ml.param.shared.HasLabelCol;
import org.apache.spark.ml.param.shared.HasPredictionCol;
import org.apach... | /*
* Copyright (c) 2016 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
// Path: src/main/java/org/jpmml/sparkml/ClassificationModelConverter.java
import java.util.Arra... | Boolean keepPredictionCol = (Boolean)getOption(HasPredictionModelOptions.OPTION_KEEP_PREDICTIONCOL, Boolean.TRUE); |
jpmml/jpmml-sparkml | src/test/java/org/jpmml/sparkml/RegressionTest.java | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | import java.util.Map;
import java.util.function.Predicate;
import com.google.common.base.Equivalence;
import org.dmg.pmml.FieldName;
import org.dmg.pmml.general_regression.GeneralRegressionModel;
import org.jpmml.evaluator.ResultField;
import org.jpmml.evaluator.testing.ArchiveBatch;
import org.jpmml.evaluator.testing.... | /*
* Copyright (c) 2016 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | options.put(HasRegressionTableOptions.OPTION_REPRESENTATION, GeneralRegressionModel.class.getSimpleName()); |
jpmml/jpmml-sparkml | src/test/java/org/jpmml/sparkml/RegressionTest.java | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | import java.util.Map;
import java.util.function.Predicate;
import com.google.common.base.Equivalence;
import org.dmg.pmml.FieldName;
import org.dmg.pmml.general_regression.GeneralRegressionModel;
import org.jpmml.evaluator.ResultField;
import org.jpmml.evaluator.testing.ArchiveBatch;
import org.jpmml.evaluator.testing.... | /*
* Copyright (c) 2016 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interface HasRegressionTableOptions extends HasSparkMLOptions {
//
// String OPTION_LOOKUP_THRESHOLD = "lookup_threshold";
//
// String OPTION_REPRESENTATION = "representation";
// }
//
// Path: src/main/java/org/jpmml/sparkml/... | options.put(HasTreeOptions.OPTION_ESTIMATE_FEATURE_IMPORTANCES, Boolean.TRUE); |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/RegressionModelConverter.java | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
| import org.dmg.pmml.OutputField;
import org.jpmml.converter.ContinuousFeature;
import org.jpmml.converter.DerivedOutputField;
import org.jpmml.converter.Label;
import org.jpmml.converter.ModelUtil;
import org.jpmml.sparkml.model.HasPredictionModelOptions;
import java.util.Collections;
import java.util.List;
import org.... | /*
* Copyright (c) 2016 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
// Path: src/main/java/org/jpmml/sparkml/RegressionModelConverter.java
import org.dmg.pmml.Outpu... | Boolean keepPredictionCol = (Boolean)getOption(HasPredictionModelOptions.OPTION_KEEP_PREDICTIONCOL, Boolean.TRUE); |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/Main.java | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interf... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.zip.ZipFile;
import com.beust.jcommander.JCo... | } catch(IOException ioe){
break zipFile;
}
try {
pipelineDir = File.createTempFile("PipelineModel", "");
if(!pipelineDir.delete()){
throw new IOException();
}
pipelineDir.mkdirs();
ZipUtil.uncompress(zipFile, pipelineDir);
} finally {
zipFile.close();
}
... | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interf... | options.put(HasPredictionModelOptions.OPTION_KEEP_PREDICTIONCOL, this.keepPredictionCol); |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/Main.java | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interf... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.zip.ZipFile;
import com.beust.jcommander.JCo... | break zipFile;
}
try {
pipelineDir = File.createTempFile("PipelineModel", "");
if(!pipelineDir.delete()){
throw new IOException();
}
pipelineDir.mkdirs();
ZipUtil.uncompress(zipFile, pipelineDir);
} finally {
zipFile.close();
}
}
long begin = System.cur... | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interf... | options.put(HasTreeOptions.OPTION_COMPACT, this.compact); |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/Main.java | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interf... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.zip.ZipFile;
import com.beust.jcommander.JCo... |
try {
pipelineDir = File.createTempFile("PipelineModel", "");
if(!pipelineDir.delete()){
throw new IOException();
}
pipelineDir.mkdirs();
ZipUtil.uncompress(zipFile, pipelineDir);
} finally {
zipFile.close();
}
}
long begin = System.currentTimeMillis();
pipel... | // Path: src/main/java/org/jpmml/sparkml/model/HasPredictionModelOptions.java
// public interface HasPredictionModelOptions extends HasSparkMLOptions {
//
// String OPTION_KEEP_PREDICTIONCOL = "keep_predictionCol";
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasRegressionTableOptions.java
// public interf... | options.put(HasRegressionTableOptions.OPTION_LOOKUP_THRESHOLD, this.lookupThreshold); |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/model/KMeansModelConverter.java | // Path: src/main/java/org/jpmml/sparkml/ClusteringModelConverter.java
// abstract
// public class ClusteringModelConverter<T extends Model<T> & HasFeaturesCol & HasPredictionCol> extends ModelConverter<T> {
//
// public ClusteringModelConverter(T model){
// super(model);
// }
//
// abstract
// public int getNu... | import org.jpmml.converter.PMMLUtil;
import org.jpmml.converter.Schema;
import org.jpmml.converter.clustering.ClusteringModelUtil;
import org.jpmml.sparkml.ClusteringModelConverter;
import org.jpmml.sparkml.VectorUtil;
import java.util.ArrayList;
import java.util.List;
import org.apache.spark.ml.clustering.KMeansModel;... | /*
* Copyright (c) 2016 Villu Ruusmann
*
* This file is part of JPMML-SparkML
*
* JPMML-SparkML is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | // Path: src/main/java/org/jpmml/sparkml/ClusteringModelConverter.java
// abstract
// public class ClusteringModelConverter<T extends Model<T> & HasFeaturesCol & HasPredictionCol> extends ModelConverter<T> {
//
// public ClusteringModelConverter(T model){
// super(model);
// }
//
// abstract
// public int getNu... | Cluster cluster = new Cluster(PMMLUtil.createRealArray(VectorUtil.toList(clusterCenters[i]))) |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/PMMLBuilder.java | // Path: src/main/java/org/jpmml/sparkml/model/HasFeatureImportances.java
// public interface HasFeatureImportances {
//
// Vector getFeatureImportances();
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasTreeOptions.java
// public interface HasTreeOptions extends HasSparkMLOptions, HasNativeConfiguration {... | import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
im... | SparkMLEncoder encoder = new SparkMLEncoder(schema, converterFactory);
Map<FieldName, DerivedField> derivedFields = encoder.getDerivedFields();
List<org.dmg.pmml.Model> models = new ArrayList<>();
List<String> predictionColumns = new ArrayList<>();
List<String> probabilityColumns = new ArrayList<>();
//... | // Path: src/main/java/org/jpmml/sparkml/model/HasFeatureImportances.java
// public interface HasFeatureImportances {
//
// Vector getFeatureImportances();
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasTreeOptions.java
// public interface HasTreeOptions extends HasSparkMLOptions, HasNativeConfiguration {... | if(modelConverter instanceof HasFeatureImportances){ |
jpmml/jpmml-sparkml | src/main/java/org/jpmml/sparkml/PMMLBuilder.java | // Path: src/main/java/org/jpmml/sparkml/model/HasFeatureImportances.java
// public interface HasFeatureImportances {
//
// Vector getFeatureImportances();
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasTreeOptions.java
// public interface HasTreeOptions extends HasSparkMLOptions, HasNativeConfiguration {... | import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
im... |
List<org.dmg.pmml.Model> models = new ArrayList<>();
List<String> predictionColumns = new ArrayList<>();
List<String> probabilityColumns = new ArrayList<>();
// Transformations preceding the last model
List<FieldName> preProcessorNames = Collections.emptyList();
Iterable<Transformer> transformers = getT... | // Path: src/main/java/org/jpmml/sparkml/model/HasFeatureImportances.java
// public interface HasFeatureImportances {
//
// Vector getFeatureImportances();
// }
//
// Path: src/main/java/org/jpmml/sparkml/model/HasTreeOptions.java
// public interface HasTreeOptions extends HasSparkMLOptions, HasNativeConfiguration {... | Boolean estimateFeatureImportances = (Boolean)modelConverter.getOption(HasTreeOptions.OPTION_ESTIMATE_FEATURE_IMPORTANCES, Boolean.FALSE); |
qiniu/android-netdiag | library/src/main/java/com/qiniu/android/netdiag/NsLookup.java | // Path: library/src/main/java/com/qiniu/android/netdiag/localdns/Record.java
// public final class Record {
// /**
// * A 记录 类型
// */
// public static final int TYPE_A = 1;
//
// /**
// * CName 类型
// */
// public static final int TYPE_CNAME = 5;
//
// /**
// * 具体的值,A 记录时为... | import com.qiniu.android.netdiag.localdns.Record;
import com.qiniu.android.netdiag.localdns.Resolver;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException; | this.complete = complete;
}
public static void start(String domain, Output output, Callback complete) {
start(domain, null, output, complete);
}
public static void start(String domain, String serverIp, Output output, Callback complete) {
if (serverIp == null) {
Stri... | // Path: library/src/main/java/com/qiniu/android/netdiag/localdns/Record.java
// public final class Record {
// /**
// * A 记录 类型
// */
// public static final int TYPE_A = 1;
//
// /**
// * CName 类型
// */
// public static final int TYPE_CNAME = 5;
//
// /**
// * 具体的值,A 记录时为... | Resolver r = null; |
qiniu/android-netdiag | library/src/main/java/com/qiniu/android/netdiag/NsLookup.java | // Path: library/src/main/java/com/qiniu/android/netdiag/localdns/Record.java
// public final class Record {
// /**
// * A 记录 类型
// */
// public static final int TYPE_A = 1;
//
// /**
// * CName 类型
// */
// public static final int TYPE_CNAME = 5;
//
// /**
// * 具体的值,A 记录时为... | import com.qiniu.android.netdiag.localdns.Record;
import com.qiniu.android.netdiag.localdns.Resolver;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException; | }
final NsLookup t = new NsLookup(domain, serverIp, output, complete);
Util.runInBack(new Runnable() {
@Override
public void run() {
t.run();
}
});
}
private void run() {
if (serverIp == null) {
Result r = n... | // Path: library/src/main/java/com/qiniu/android/netdiag/localdns/Record.java
// public final class Record {
// /**
// * A 记录 类型
// */
// public static final int TYPE_A = 1;
//
// /**
// * CName 类型
// */
// public static final int TYPE_CNAME = 5;
//
// /**
// * 具体的值,A 记录时为... | Record[] records = r.resolve(domain); |
ykaragol/checkersmaster | CheckersMaster/test/checkers/domain/TestModel.java | // Path: CheckersMaster/src/checkers/sandbox/SquareState.java
// public enum SquareState{
// BLANK (null),
// WHITE (Player.WHITE),
// BLACK (Player.BLACK),
// KING_WHITE (Player.WHITE),
// KING_BLACK (Player.BLACK);
//
// public final Player owner;
//
// private SquareState(Player owner){
// thi... | import static org.junit.Assert.*;
import org.junit.Test;
import checkers.sandbox.SquareState;
| package checkers.domain;
public class TestModel {
@Test
public void testBaslat() {
Model model = new Model();
model.baslat();
| // Path: CheckersMaster/src/checkers/sandbox/SquareState.java
// public enum SquareState{
// BLANK (null),
// WHITE (Player.WHITE),
// BLACK (Player.BLACK),
// KING_WHITE (Player.WHITE),
// KING_BLACK (Player.BLACK);
//
// public final Player owner;
//
// private SquareState(Player owner){
// thi... | assertEquals(SquareState.WHITE, model.state[0][0]);
|
ykaragol/checkersmaster | CheckersMaster/src/checkers/domain/CalculationContext.java | // Path: CheckersMaster/src/checkers/algorithm/IAlgorithm.java
// public interface IAlgorithm {
// Move algorithm(CalculationContext context, Model model, Player whosTurn);
//
// String getName();
// }
//
// Path: CheckersMaster/src/checkers/evaluation/IEvaluation.java
// public interface IEvaluation {
// double... | import checkers.algorithm.IAlgorithm;
import checkers.evaluation.IEvaluation;
import checkers.rules.ISuccessor;
| package checkers.domain;
/**
* Tüm algoritmalar için yapılandırma parametreleri içerir.
*
*/
public class CalculationContext{
private int depth;
private Player player;
| // Path: CheckersMaster/src/checkers/algorithm/IAlgorithm.java
// public interface IAlgorithm {
// Move algorithm(CalculationContext context, Model model, Player whosTurn);
//
// String getName();
// }
//
// Path: CheckersMaster/src/checkers/evaluation/IEvaluation.java
// public interface IEvaluation {
// double... | private IEvaluation evaluationFunction;
|
ykaragol/checkersmaster | CheckersMaster/src/checkers/domain/CalculationContext.java | // Path: CheckersMaster/src/checkers/algorithm/IAlgorithm.java
// public interface IAlgorithm {
// Move algorithm(CalculationContext context, Model model, Player whosTurn);
//
// String getName();
// }
//
// Path: CheckersMaster/src/checkers/evaluation/IEvaluation.java
// public interface IEvaluation {
// double... | import checkers.algorithm.IAlgorithm;
import checkers.evaluation.IEvaluation;
import checkers.rules.ISuccessor;
| package checkers.domain;
/**
* Tüm algoritmalar için yapılandırma parametreleri içerir.
*
*/
public class CalculationContext{
private int depth;
private Player player;
private IEvaluation evaluationFunction;
| // Path: CheckersMaster/src/checkers/algorithm/IAlgorithm.java
// public interface IAlgorithm {
// Move algorithm(CalculationContext context, Model model, Player whosTurn);
//
// String getName();
// }
//
// Path: CheckersMaster/src/checkers/evaluation/IEvaluation.java
// public interface IEvaluation {
// double... | private ISuccessor successorFunction;
|
ykaragol/checkersmaster | CheckersMaster/src/checkers/domain/CalculationContext.java | // Path: CheckersMaster/src/checkers/algorithm/IAlgorithm.java
// public interface IAlgorithm {
// Move algorithm(CalculationContext context, Model model, Player whosTurn);
//
// String getName();
// }
//
// Path: CheckersMaster/src/checkers/evaluation/IEvaluation.java
// public interface IEvaluation {
// double... | import checkers.algorithm.IAlgorithm;
import checkers.evaluation.IEvaluation;
import checkers.rules.ISuccessor;
| package checkers.domain;
/**
* Tüm algoritmalar için yapılandırma parametreleri içerir.
*
*/
public class CalculationContext{
private int depth;
private Player player;
private IEvaluation evaluationFunction;
private ISuccessor successorFunction;
| // Path: CheckersMaster/src/checkers/algorithm/IAlgorithm.java
// public interface IAlgorithm {
// Move algorithm(CalculationContext context, Model model, Player whosTurn);
//
// String getName();
// }
//
// Path: CheckersMaster/src/checkers/evaluation/IEvaluation.java
// public interface IEvaluation {
// double... | private IAlgorithm algorithm;
|
ykaragol/checkersmaster | CheckersMaster/src/checkers/sandbox/SquareState.java | // Path: CheckersMaster/src/checkers/domain/Player.java
// public enum Player {
// WHITE,
// BLACK;
//
// public Player opposite() {
// return this==WHITE ? BLACK : WHITE;
// }
// }
| import checkers.domain.Player;
| package checkers.sandbox;
public enum SquareState{
BLANK (null),
| // Path: CheckersMaster/src/checkers/domain/Player.java
// public enum Player {
// WHITE,
// BLACK;
//
// public Player opposite() {
// return this==WHITE ? BLACK : WHITE;
// }
// }
// Path: CheckersMaster/src/checkers/sandbox/SquareState.java
import checkers.domain.Player;
package checkers.sandbox;
... | WHITE (Player.WHITE),
|
ykaragol/checkersmaster | CheckersMaster/src/checkers/domain/Move.java | // Path: CheckersMaster/src/checkers/sandbox/SquareState.java
// public enum SquareState{
// BLANK (null),
// WHITE (Player.WHITE),
// BLACK (Player.BLACK),
// KING_WHITE (Player.WHITE),
// KING_BLACK (Player.BLACK);
//
// public final Player owner;
//
// private SquareState(Player owner){
// thi... | import checkers.sandbox.SquareState;
| package checkers.domain;
public class Move {
private double value = Double.NEGATIVE_INFINITY;
public int fromX;
public int fromY;
public int toX;
public int toY;
public boolean must = false;
| // Path: CheckersMaster/src/checkers/sandbox/SquareState.java
// public enum SquareState{
// BLANK (null),
// WHITE (Player.WHITE),
// BLACK (Player.BLACK),
// KING_WHITE (Player.WHITE),
// KING_BLACK (Player.BLACK);
//
// public final Player owner;
//
// private SquareState(Player owner){
// thi... | public SquareState eat;
|
ykaragol/checkersmaster | CheckersMaster/src/checkers/domain/Model.java | // Path: CheckersMaster/src/checkers/controller/GameCenter.java
// public class GameCenter {
//
// /**
// * Oyunun tahtası
// */
// private Model model;
//
// // /**
// // * Tahtada yapılan değişiklikleri dinleyecek sınıflar
// // */
// // private List<ModelListener> listeners = new LinkedList<ModelListener>... | import checkers.controller.GameCenter;
import checkers.sandbox.SquareState;
| package checkers.domain;
public class Model {
public SquareState state[][];
| // Path: CheckersMaster/src/checkers/controller/GameCenter.java
// public class GameCenter {
//
// /**
// * Oyunun tahtası
// */
// private Model model;
//
// // /**
// // * Tahtada yapılan değişiklikleri dinleyecek sınıflar
// // */
// // private List<ModelListener> listeners = new LinkedList<ModelListener>... | private GameCenter callBack;
|
msk610/3D-TETRIS | html/src/com/tetris/game/client/HtmlLauncher.java | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.gwt.GwtApplication;
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
import com.tetris.game.Tetris; | package com.tetris.game.client;
public class HtmlLauncher extends GwtApplication {
@Override
public GwtApplicationConfiguration getConfig () {
return new GwtApplicationConfiguration(480, 320);
}
@Override
public ApplicationListener getApplicationListener () { | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | return new Tetris(); |
msk610/3D-TETRIS | ios/src/com/tetris/game/IOSLauncher.java | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.uikit.UIApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
import com.tetris.game.Tetris; | package com.tetris.game;
public class IOSLauncher extends IOSApplication.Delegate {
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration(); | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | return new IOSApplication(new Tetris(), config); |
msk610/3D-TETRIS | desktop/src/com/tetris/game/desktop/DesktopLauncher.java | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | import com.badlogic.gdx.Files;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.tetris.game.Tetris; | package com.tetris.game.desktop;
public class DesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "3D TETRIS";
config.addIcon("Pictures/icon.png", Files.FileType.Internal);
config.resizable = false; | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | new LwjglApplication(new Tetris(), config); |
msk610/3D-TETRIS | android/src/com/tetris/game/android/AndroidLauncher.java | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | import android.os.Bundle;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.tetris.game.Tetris; | package com.tetris.game.android;
public class AndroidLauncher extends AndroidApplication {
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); | // Path: core/src/com/tetris/game/Tetris.java
// public class Tetris extends Game {
// AssetLoader assets;
// ButtonLoader buttonLoader;
// Button music, sound;
//
// @Override
// public void create () {
// assets = new AssetLoader();
// buttonLoader = new ButtonLoader(assets);
// music = buttonLoader.getM... | initialize(new Tetris(), config); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/MeanCenteredFacesDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagLayout;
import java.io.IOException;
import javax.swing.JPanel;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.openimaj.data.dataset.VFSGroupDatase... | package uk.ac.soton.ecs.comp3204.l3;
/**
* Visualise mean-centered face images
*
* @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
*
*/
@Demonstration(title = "Mean-centred faces demo")
public class MeanCenteredFacesDemo implements Slide {
@Override
public Component getComponent(int width, int height) throw... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | final VFSGroupDataset<FImage> dataset = FaceDatasetProvider.getDataset(); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/MeanCenteredFacesDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagLayout;
import java.io.IOException;
import javax.swing.JPanel;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.openimaj.data.dataset.VFSGroupDatase... | outer.setOpaque(false);
outer.setPreferredSize(new Dimension(width, height));
outer.setLayout(new GridBagLayout());
final JPanel base = new JPanel();
base.setOpaque(false);
base.setPreferredSize(new Dimension(width, height - 50));
base.setLayout(new FlowLayout());
for (int i = 0; i < 60; i++) {
fin... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | new SlideshowApplication(new MeanCenteredFacesDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l8/SpectrogramDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.io.IOException;
import org.openimaj.audio.AudioFormat;
import org.openimaj.audio.AudioGrabberListener;
import org.openimaj.audio.JavaSoundAudioGrabber;
import org.openimaj.audio.SampleChunk;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.o... |
while (grabber.isStopped()) {
try {
Thread.sleep(50);
} catch (final InterruptedException e) {
}
}
return spectrogram;
}
@Override
public void close() {
if (grabber != null) {
grabber.stop();
grabber = null;
}
}
@Override
public void samplesAvailable(SampleChunk s) {
spectrogram... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new SpectrogramDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l6/Lecture6.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openimaj.content.slideshow.PictureSlide;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import uk.ac.soton.ecs.comp3204.utils.Utils;
import uk.ac.soton.ecs.comp3204.utils.a... | slides.add(new HarrisResponseDemo());
for (int i = 19; i <= 20; i++)
slides.add(new PictureSlide(Lecture6.class.getResource(String.format("l6.%03d.jpg", i))));
slides.add(new ThresholdedHarrisResponseDemo());
for (int i = 21; i <= 21; i++)
slides.add(new PictureSlide(Lecture6.class.getResource(String.f... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(slides, 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l4/GlobalThresholdDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagLayout;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.swing.BoxLayout;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextField;
im... |
cb.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (cb.isSelected()) {
final float threshold = slider.getValue() / 255f;
ic.setImage(bimg = ImageUtilities
.createBufferedImageForDisplay(oimage.clone().threshold(threshold), bimg));
} else ... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l0/Lecture0.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openimaj.content.slideshow.PictureSlide;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import uk.ac.soton.ecs.comp3204.utils.Utils;
import uk.ac.soton.ecs.comp3204.utils.a... | package uk.ac.soton.ecs.comp3204.l0;
@Lecture(title = "L0: Fork Me!",
handoutsURL = "",
slidesURL = "http://jonhare.github.io/COMP3204/lectures/pdf/L0-forkme.pdf")
@JvmArgs(vmArguments = "-Xmx1G")
public class Lecture0 {
public static void main(String[] args) throws IOException {
final List<Slide> slides = n... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(slides, 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l4/KMeansSpatialSegmentationDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.List;
import javax.swing.JButton;
import jav... | public void run() {
ic.setImage(bimg = ImageUtilities.createBufferedImageForDisplay(
segmentImage(oimage, (Integer) kSpinner.getValue(), (Integer) wSpinner.getValue()),
bimg));
segmentBtn.setEnabled(true);
kSpinner.setEnabled(true);
wSpinner.setEnabled(true);
}
}).... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new KMeansSpatialSegmentationDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l7/Lecture7.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openimaj.content.slideshow.PictureSlide;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import uk.ac.soton.ecs.comp3204.utils.Utils;
import uk.ac.soton.ecs.comp3204.utils.a... | package uk.ac.soton.ecs.comp3204.l7;
@Lecture(title = "L7: Local features and matching",
handoutsURL = "http://jonhare.github.io/COMP3204/handouts/pdf/L7-matching.pdf",
slidesURL = "http://jonhare.github.io/COMP3204/lectures/pdf/L7-matching.pdf")
@JvmArgs(vmArguments = "-Xmx1G")
public class Lecture7 {
public ... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(slides, 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/MeanFaceDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.io.IOException;
import javax.swing.JPanel;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.openimaj.data.dataset.VFSGroupDataset;
import org.openimaj.image... | package uk.ac.soton.ecs.comp3204.l3;
/**
* Visualise the mean face
*
* @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
*
*/
@Demonstration(title = "Mean face demo")
public class MeanFaceDemo implements Slide {
@Override
public Component getComponent(int width, int height) throws IOException { | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | final VFSGroupDataset<FImage> dataset = FaceDatasetProvider.getDataset(); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/MeanFaceDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.io.IOException;
import javax.swing.JPanel;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.openimaj.data.dataset.VFSGroupDataset;
import org.openimaj.image... | package uk.ac.soton.ecs.comp3204.l3;
/**
* Visualise the mean face
*
* @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
*
*/
@Demonstration(title = "Mean face demo")
public class MeanFaceDemo implements Slide {
@Override
public Component getComponent(int width, int height) throws IOException {
final VFSGro... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | new SlideshowApplication(new MeanFaceDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l5/AlignmentDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowAppli... | Float[][] colours)
{
final MBFImage image = new MBFImage(width, height - 20, ColourSpace.RGB).fill(RGBColour.BLACK);
int i = 0;
for (final PointList p : points) {
final PointList pts = p.clone();
pts.scale(1.5f);
final Float[] c = colours[i++];
image.drawPoints(pts, c, 5);
for (final Line2d li... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new AlignmentDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/EigenFaceReconstructionDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Li... | package uk.ac.soton.ecs.comp3204.l3;
/**
* Demonstration of the effect of changing weights on principal components.
*
* @author Jonathon Hare (jsh2@ecs.soton.ac.uk)
*
*/
@Demonstration(title = "Eigenface reconstruction demo")
public class EigenFaceReconstructionDemo implements Slide {
private static final ... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | final VFSGroupDataset<FImage> dataset = FaceDatasetProvider.getDataset(); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/EigenFaceReconstructionDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Li... | valField.setText(String.format("%2.2f", slider.getValue() / 10.0));
ic.setImage(bimg = ImageUtilities.createBufferedImageForDisplay(image, bimg));
}
});
container.add(slider);
container.add(valField);
controls.add(container);
}
controls.add(new JSeparator(JSeparator.HORIZONTAL));
final J... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java
// public static class FaceDatasetProvider {
// static File tmpFile;
// static {
// try {
// tmpFile = File.createTempFile("faces", ".zip");
// FileUtils.copyURLToFile(FaceDatasetDemo.class.getResource("att_faces.zip"), tmpFile);
// ... | new SlideshowApplication(new EigenFaceReconstructionDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l9/Lecture9.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openimaj.content.slideshow.PictureSlide;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.openimaj.content.slideshow.VideoSlide;
import org.openimaj.video.VideoDis... | package uk.ac.soton.ecs.comp3204.l9;
@Lecture(title = "L9: Image Search and Bags of Visual Words",
handoutsURL = "http://jonhare.github.io/COMP3204/handouts/pdf/L9-imagesearch.pdf",
slidesURL = "http://jonhare.github.io/COMP3204/lectures/pdf/L9-imagesearch.pdf")
@JvmArgs(vmArguments = "-Xmx1G")
public class Lecture... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | slides.add(new VideoSlide(Lecture9.class.getResource("TrentoDuomo.mov"), Utils.BACKGROUND_IMAGE_URL, |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l2/KMeansDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.ArrayList;
import ... | initKMeans();
for (int i = 0; i < 30 && isRunning; i++) {
if (isRunning)
kmeansAssignmentStep(true);
if (isRunning && kmeansUpdateStep()) {
break;
}
}
if (isRunning)
kmeansAssignmentStep(false);
if (isRunning)
drawVoronoi();
runBtn.setEnable... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new KMeansDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/EigenDecompositionDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.io.IOException;
import java.util.Random;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import or... | }
final MBFImageRenderer renderer = image.createRenderer(RenderHints.ANTI_ALIASED);
if (drawEllipse)
renderer.drawShape(e, 3, RGBColour.RED);
int x = (int) (100 * decomp.getV().get(0, 0) * Math.sqrt(decomp.getRealEigenvalues()[0]));
int y = (int) (100 * decomp.getV().get(1, 0) * Math.sqrt(decomp.get... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new EigenDecompositionDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l1/ColourSpacesDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplica... | * @param colourSpace
*/
public static void convertColours(MBFImage frame, ColourSpace colourSpace) {
// update the frame from the camera by converting to the selected colour
// space before display
final MBFImage cvt = colourSpace.convert(frame);
// if the converted image has fewer than 3 bands, add more ... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new ColourSpacesDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l4/KMeansSegmentationDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.List;
import javax.swing.JButton;
import jav... |
@Override
public void run() {
ic.setImage(bimg = ImageUtilities.createBufferedImageForDisplay(
segmentImage(oimage, (Integer) kSpinner.getValue()),
bimg));
segmentBtn.setEnabled(true);
kSpinner.setEnabled(true);
}
}).start();
}
});
return base;
}
protect... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new KMeansSegmentationDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l4/ConnectedComponentsDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import gnu.trove.map.hash.TIntIntHashMap;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Ar... |
if (!callback.apply(labels))
return labels;
}
}
}
return labels;
}
private void merge(TIntIntHashMap linked, int start, int target) {
if (start == target)
return;
final int old = linked.get(start);
if (old > target) {
linked.put(start, target);
merge(linked, old, target);
}... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new ConnectedComponentsDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l6/MultiscaleHarrisPointsDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | import java.awt.Font;
import java.io.IOException;
import javax.swing.JPanel;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.openimaj.image.FImage;
import org.openimaj.image.MBFImage;
import org.openimaj.image.colour.RGBColour;
import org.openimaj.image.feature.local.interest.HarrisIPD;
import or... | public void beforeUpdate(MBFImage frame) {
FImage gimg = frame.flatten();
// bring to sigma = 1.0
gimg.processInplace(new FGaussianConvolve(1f));
for (int i = 0; i < 3; i++) {
final int t = (int) Math.pow(2, i);
final double sigma = Math.sqrt(t);
final float sf = t;
harris.setDetectionScale((flo... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | new SlideshowApplication(new MultiscaleHarrisPointsDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l11/KinectDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import javax.swing.ButtonGroup;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import org.open... | return base;
}
return base;
}
@Override
public void close() {
if (display != null) {
final VideoDisplay<MBFImage> tmp = display;
display = null;
tmp.close();
controller.close();
}
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand() == RGB) {
depth = fal... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new KinectDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l5/PuppeteerDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | import gnu.trove.map.hash.TObjectIntHashMap;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.swing.JPanel;
import org.openimaj.content.slideshow.SlideshowApplication;
i... | final int ymin = (int) Math.max(0, bounds.y);
final int ymax = (int) Math.min(Math.min(fore.getHeight(), back.getHeight()), bounds.y + bounds.height);
final int xmax = (int) Math.min(Math.min(fore.getWidth(), back.getWidth()), bounds.x + bounds.width);
for (int y = ymin; y < ymax; y++) {
for (int x = xmin;... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | new SlideshowApplication(new PuppeteerDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l6/ThresholdedHarrisResponseDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.io.IOException;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import org.openimaj.content.slideshow.SlideshowApplic... | c.add(controls, gbc);
return c;
}
@Override
public void afterUpdate(VideoDisplay<MBFImage> display) {
// do nothing
}
@Override
public void beforeUpdate(MBFImage frame) {
harris.setDetectionScale(0);
harris.setImageBlurred(true);
harris.setIntegrationScale(computeScale());
harris.findInterestPoi... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | new SlideshowApplication(new ThresholdedHarrisResponseDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l6/DoGResponseDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.io.IOException;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.... | }
@Override
public void beforeUpdate(MBFImage frame) {
final float k = this.kSlider.getValue() / 10f;
final float sigma2 = this.scaleSlider.getValue();
final float ksigma2 = sigma2 * (k * k - 1);
final FImage gimg = frame.flatten();
final FImage blur1 = gimg.processInplace(new FGaussianConvolve((float)... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | new SlideshowApplication(new DoGResponseDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l4/Lecture4.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openimaj.content.slideshow.PictureSlide;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import uk.ac.soton.ecs.comp3204.utils.Utils;
import uk.ac.soton.ecs.comp3204.utils.a... |
slides.add(new AdaptiveThresholdDemo());
for (int i = 23; i <= 24; i++)
slides.add(new PictureSlide(Lecture4.class.getResource(String.format("l4.%03d.jpg", i))));
slides.add(new AdaptiveThresholdVideoDemo());
for (int i = 25; i <= 26; i++)
slides.add(new PictureSlide(Lecture4.class.getResource(String.... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(slides, 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l6/HarrisPointsDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.io.IOException;
import java.util.List;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import org.openimaj.content.sl... |
return c;
}
@Override
public void afterUpdate(VideoDisplay<MBFImage> display) {
// do nothing
}
@Override
public void beforeUpdate(MBFImage frame) {
harris.setDetectionScale(0);
harris.setImageBlurred(true);
harris.setIntegrationScale(computeScale());
harris.findInterestPoints(frame.flatten());
... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/l1/SimpleCameraDemo.java
// @Demonstration(title = "Simple Camera Demo")
// public class SimpleCameraDemo implements Slide {
// protected VideoCaptureComponent vc;
//
// @Override
// public JPanel getComponent(int width, int height) throws IOException {
// // th... | new SlideshowApplication(new HarrisPointsDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l1/Lecture1.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openimaj.content.slideshow.PictureSlide;
import org.openimaj.content.slideshow.Slide;
import org.openimaj.content.slideshow.SlideshowApplication;
import org.openimaj.content.slideshow.VideoSlide;
import org.openimaj.video.VideoDis... | package uk.ac.soton.ecs.comp3204.l1;
@Lecture(title = "L1: Building machines that see",
handoutsURL = "http://jonhare.github.io/COMP3204/handouts/pdf/L1-machines-that-see.pdf",
slidesURL = "http://jonhare.github.io/COMP3204/lectures/pdf/L1-machines-that-see.pdf")
@JvmArgs(vmArguments = "-Xmx1G")
public class Le... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | slides.add(new VideoSlide(Lecture1.class.getResource("grader.mp4"), Utils.BACKGROUND_IMAGE_URL, |
jonhare/COMP3204 | app/src/main/java/uk/ac/soton/ecs/comp3204/l3/FaceDatasetDemo.java | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagLayout;
import java.io.File;
import java.io.IOException;
import javax.swing.JPanel;
import org.apache.commons.io.FileUtils;
import org.apache.commons.vfs2.FileSystemException;
import org.openimaj.content.slideshow.S... | outer.setOpaque(false);
outer.setPreferredSize(new Dimension(width, height));
outer.setLayout(new GridBagLayout());
final JPanel base = new JPanel();
base.setOpaque(false);
base.setPreferredSize(new Dimension(width, height - 50));
base.setLayout(new FlowLayout());
for (int i = 0; i < 60; i++) {
fin... | // Path: app/src/main/java/uk/ac/soton/ecs/comp3204/utils/Utils.java
// public class Utils {
// public static URL BACKGROUND_IMAGE_URL = Utils.class.getResource("/uk/ac/soton/ecs/comp3204/background.png");
// public static BufferedImage BACKGROUND_IMAGE = null;
// static {
// try {
// BACKGROUND_IMAGE = ImageIO... | new SlideshowApplication(new FaceDatasetDemo(), 1024, 768, Utils.BACKGROUND_IMAGE); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.