This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type ErrorType1 struct { | |
Message string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"runtime" | |
"time" | |
) | |
// GetWebResults test | |
func GetWebResults(cancel chan bool) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UndertowResteasyServer { | |
public static void main(String[] args) { | |
ResteasyDeployment deployment = new ResteasyDeployment(); | |
deployment.setApplicationClass(MyRestApplication.class.getName()); | |
UndertowJaxrsServer server = new UndertowJaxrsServer(); | |
DeploymentInfo deploymentInfo = server.undertowDeployment(deployment, "/") | |
.setClassLoader(UndertowResteasyServer.class.getClassLoader()) | |
.setContextPath("/api").setDeploymentName("WS"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.lang.System.out; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class SoAnswer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fasterxml.jackson.annotation.JsonSubTypes; | |
import com.fasterxml.jackson.annotation.JsonTypeInfo; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import java.io.IOException; | |
import java.util.Collections; | |
import java.util.Map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package concepts; | |
import java.util.Collection; | |
import java.util.LinkedList; | |
import java.util.UUID; | |
import java.util.stream.Stream; | |
public class ItemProcessor { | |
public static void main(String[] args) { | |
generateStreamOf(5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger; | |
import javax.enterprise.context.ApplicationScoped; | |
import javax.enterprise.context.Initialized; | |
import javax.enterprise.event.Observes; | |
import javax.inject.Inject; | |
@javax.enterprise.context.ApplicationScoped | |
public class StartupCdiBean { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gr.iserm.java.javaplayground.lambdas; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; | |
import static java.lang.System.out; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ocp; | |
/** Static methods of hierarchy classes are called on the reference variable type. */ | |
public class NestedClassTest { | |
/** Nested classes need to be static in order to define static methods (Nested class, not Inner) */ | |
static class A { | |
public void parentMethod() { | |
System.out.println("parent method"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImageUtils { | |
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int radius, int bgcolor) { | |
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); | |
Canvas canvas = new Canvas(output); | |
final Paint paint = new Paint(); | |
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); | |
final RectF rectF = new RectF(rect); | |
final float roundPx = radius; |