This file contains 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 java.awt.*; | |
import javax.swing.JScrollPane; | |
import javax.swing.SwingUtilities; | |
public class WrapLayout extends FlowLayout | |
{ | |
private Dimension preferredLayoutSize; | |
public WrapLayout() | |
{ |
This file contains 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 java.io.*; | |
import java.util.ArrayList; | |
public class FileManager { | |
private static volatile FileManager instance; | |
private static final Object lock = new Object(); | |
private final ArrayList<String> msg; | |
private final String FILE_NAME = "Data.txt"; |
This file contains 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 'package:easy_localization/easy_localization.dart'; | |
final flogger = Logger(); | |
final logger = Logger(); | |
class Logger { | |
bool debug = true; | |
log(String message) { |
This file contains 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
BEGIN | |
FOR cur_rec IN (SELECT object_name, object_type | |
FROM user_objects | |
WHERE object_type IN | |
('TABLE', | |
'VIEW', | |
'PACKAGE', | |
'PROCEDURE', | |
'FUNCTION', | |
'SEQUENCE' |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple Template</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta property="og:title" content="Simple Template" /> | |
<style> |
This file contains 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
// Three Laws of Robotics | |
public void processAction(Ai ai, Action action, Environment environment) { | |
List<Human> humans = detectHumans(environment); | |
// A robot may not injure a human being or, through inaction, | |
// allow a human being to come to harm. | |
if (ai.predict(action).injure(humans)) { | |
throw new FirstLawsException(); | |
} |
This file contains 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 java.util.Date; | |
import java.util.HashMap; | |
public class Attempt { | |
private String gamer; | |
private Date timestamp; | |
private int score; | |
private int round; |
This file contains 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
#!/usr/bin/env bash | |
docker stop elasticsearch-2.3.4 elasticsearch-5.5.2 kibana-5 kibana-2 elasticsearch-6.1.1 kibana-6 | |
docker rm elasticsearch-2.3.4 elasticsearch-5.5.2 kibana-5 kibana-2 elasticsearch-6.1.1 kibana-6 | |
docker network rm elastic-network | |
docker pull docker.elastic.co/elasticsearch/elasticsearch:6.1.1 | |
docker pull docker.elastic.co/kibana/kibana:6.1.1 | |
docker network create -d overlay --attachable elastic-network |
This file contains 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
Aether aether = Aether.builder() | |
.setLocalRepo(temp.newFolder().getPath()) | |
.addRemoteRepo("maven-central", "http://repo1.maven.org/maven2").build(); | |
List<Artifact> dependencies = aether.resolveDependencies(new DefaultArtifact("org.elasticsearch:elasticsearch:5.5.2")); | |
List<URL> urls = new ArrayList<>(); | |
for (Artifact artifact : dependencies) { | |
URL url = new URL(new URL("file:"), artifact.getFile().getAbsolutePath()); | |
urls.add(url); |
This file contains 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 demo; | |
public class Calculator { | |
enum Operation { | |
Addition, Subtraction | |
} | |
public int calculate(Operation operation, int a, int b) { | |
switch (operation) { |
NewerOlder