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 java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.regex.Pattern; | |
| /** | |
| * Utility class for computing differences between sequences and applying patches. | |
| */ | |
| public final class UniDiffStatic { |
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 javax.swing.*; | |
| // usage example: jshell --startup JAVASE desktop_swing.jsh | |
| class MyGui extends JFrame { // class with own GUI components | |
| public void createGUI() { | |
| setTitle("HelloGUI"); | |
| setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
| setSize(320, 240); | |
| setLayout(null); | |
| final JTextField tf=new JTextField(); | |
| tf.setBounds(20,10,95,30); |
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
| @Grapes(@Grab(group='org.eclipse.swt', module='org.eclipse.swt.win32.win32.x86_64', version='4.3')) | |
| import org.eclipse.swt.widgets.* | |
| def display = new Display() | |
| def shell = new Shell(display) | |
| shell.setText("Snippet 1") | |
| shell.open() | |
| while (!shell.isDisposed()) { | |
| if (!display.readAndDispatch()) display.sleep() | |
| } |
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
| @Grapes([ | |
| @Grab(group='org.xerial',module='sqlite-jdbc',version='3.34.0'), | |
| @GrabConfig(systemClassLoader=true) | |
| ]) | |
| import groovy.sql.Sql | |
| def sql = Sql.newInstance("jdbc:sqlite:sample.db", "org.sqlite.JDBC") | |
| sql.execute("drop table if exists person") | |
| sql.execute("create table person (id integer, name 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
| @Grapes([ | |
| @Grab(group='io.vertx', module='vertx-lang-groovy', version='4.1.0.Beta1'), | |
| @Grab(group='io.vertx', module='vertx-core', version='4.1.0.Beta1'), | |
| @Grab(group='io.vertx', module='vertx-web', version='4.1.0.Beta1') | |
| //@GrabExclude("org.codehaus.groovy:groovy-swing") | |
| ]) | |
| import io.vertx.core.Vertx | |
| import io.vertx.core.http.HttpClientRequest | |
| import io.vertx.core.http.HttpServer |
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
| @Grapes([ | |
| @Grab(group='io.vertx', module='vertx-lang-groovy', version='4.1.0.Beta1'), | |
| @Grab(group='io.vertx', module='vertx-core', version='4.1.0.Beta1'), | |
| @Grab(group='io.vertx', module='vertx-web', version='4.1.0.Beta1') | |
| //@GrabExclude("org.codehaus.groovy:groovy-swing") | |
| ]) | |
| import io.vertx.core.Vertx | |
| import io.vertx.core.http.HttpClientRequest | |
| import io.vertx.core.http.HttpServer |
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
| @Grapes([ | |
| @Grab(group='io.vertx', module='vertx-lang-groovy', version='4.1.0.Beta1'), | |
| @Grab(group='io.vertx', module='vertx-core', version='4.1.0.Beta1'), | |
| @Grab(group='io.vertx', module='vertx-web-client', version='4.1.0.Beta1') | |
| //@GrabExclude("org.codehaus.groovy:groovy-swing") | |
| ]) | |
| import io.vertx.ext.web.client.WebClientOptions | |
| import io.vertx.ext.web.client.WebClient | |
| import io.vertx.core.Vertx |
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
| @Grab('javax.servlet:javax.servlet-api:3.0.1') | |
| @Grab(group='org.eclipse.jetty', module='jetty-webapp', version='8.1.8.v20121106') | |
| @Grab(group='org.eclipse.jetty', module='jetty-server', version='8.1.8.v20121106', transitive=false) | |
| @Grab(group='org.eclipse.jetty', module='jetty-servlet', version='8.1.8.v20121106', transitive=false) | |
| @GrabExclude('org.eclipse.jetty.orbit:javax.servlet') | |
| import org.eclipse.jetty.server.Server | |
| import org.eclipse.jetty.servlet.* | |
| import groovy.servlet.* |