mvn clean spring-boot:run
src/main/java/Procfile
в котором написаноworker: sh target/bin/commybot
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Displaying value of 'something' property</echo>
<echo>[something]: ${something}</echo>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
System.err.println(
String.format("%s/src/main/resources/%s",
System.getProperty("user.dir"), resourceFileName));
System.err.println(
String.format("The running application resource path: \"%s\"",
Thread.currentThread().getContextClassLoader()
.getResource("").getPath()));
this.getClass().getClassLoader()
.getResourceAsStream(
// interface Comparable<T> {
// public int compareTo(T o);/
// }
@Override
public int compareTo(Sticks sticks_object) {
example.Sticks@15db9742
example.Sticks@6d06d69c
example.Sticks@7852e922
interface A {
}
interface B {
}
class X implements A, B {
}
class X extends Y {
}
@SpringBootApplication
@EnableDiscoveryClient
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
jsoupDocument = Jsoup.parse(pageSource);
jsoupElements = jsoupDocument.getElementsByAttributeValue("class",
"people_cell");
assertThat(jsoupElements.size(), greaterThan(0));
jsoupElements.forEach(link -> {
Element imgElement = link.getElementsByTag("img").get(0);
assertThat(imgElement, notNullValue());
// NOTE: url has empty string in html()
attributeValue = imgElement.attr("src");
assertThat(attributeValue, startsWith("https://"));
String url = attributeValue.replaceAll(".jpg?.*$", "");
articleList.add(new Article(url));
});
articleList.forEach(System.err::println);
Article{url='https://sun6-16.userapi.com/c628420/v628420404/e2ca/wKt7vWFzMOA'}
Article{url='https://pp.userapi.com/c841228/v841228591/113bc/UDcryzU7E6I'}
Article{url='https://pp.userapi.com/c9267/u00190/e_d11db660'}
fx:id
<Image fx:id="dialogImage" url="@image.png"/>
@FXML
private Image dialogImage;
if (dialogImage != null) {
System.err.println(String.format("The image url: %s",
dialogImage.impl_getUrl()));
}
The image url: file:/<путь к моему проекту>/src/main/resources/image.png
<Label fx:id="dialogImageLabel">
<graphic>
<ImageView fx:id="dialogImageView" fitHeight="128" fitWidth="128" pickOnBounds="true" preserveRatio="true">
<image>
<Image fx:id="dialogImage" url="@watchglass.png"/>
</image>
</ImageView>
</graphic>
</Label>
for (int i = 0; i != dialogImageLabel.getChildrenUnmodifiable()
.size(); i++) {
Node itemNode = dialogImageLabel.getChildrenUnmodifiable().get(i);
if (itemNode.getClass().getName().equals("javafx.scene.image.ImageView")) {
ImageView imageView = (ImageView) itemNode;
System.err.println(String.format("The child image url: %s",
imageView.getImage().impl_getUrl()));
}
}
то же самоеThe child image url: file:/<путь к проекту>/src/main/resources/картина.png
label.setOnMouseEntered(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent e) {
System.err.println(String.format("The label.bounds: %.2f %.2f,
Math.floor(label.getBoundsInLocal().getWidth()),
Math.floor(label.getBoundsInLocal().getHeight())));
The label.bounds: 54.00 18.00
label.setScaleX(0.82);
sudo update-alternatives --list java
Usage: update-alternatives [<option> ...] <command>
Commands:
--install <link> <name> <path> <priority>
[--slave <link> <name> <path>] ...
add a group of alternatives to the system.
<link> is the symlink pointing to /etc/alternatives/<name>.
(e.g. /usr/bin/pager)
<name> is the master name for this link group.
(e.g. pager)
<path> is the location of one of the alternative target files.
(e.g. /usr/bin/less)
<priority> is an integer; options with higher numbers have higher priority in
automatic mode.
sudo update-alternatives --install /usr/local/bin/java /usr/lib/jvm/java-9-openjdk-i386/bin/java java 100
./mvnw
?.travis.yml
install: mvn install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true -B -V
а не свои собственные скриптыpublic void mouseReleased(MouseEvent mouseEvent) {
if (SwingUtilities.isLeftMouseButton(mouseEvent)) {
System.out.println("Left button released.");
System.err.println("Counting down from " + i);
// NOTE: SwingUtilities.invokeLater shows only the last update of the
// text
// SwingUtilities.invokeLater(new Runnable() {
// });
Runnable r = new Runnable() {
@Override
public void run() {
final int progress = i;
for (int cnt = progress; cnt > 0; cnt--) {
final int current = cnt;
String buttonText = String.format("Calculated %d of %d",
current, progress);
button.setVisible(false);
button.setText(buttonText);
button.doLayout();
button.setVisible(true);
System.err.println("updated butto text to " + buttonText);
try {
Thread.sleep(300);
} catch (InterruptedException e) {
System.err.println("Exception (ignored): " + e.toString());
}
}
}
};
Thread t = new Thread(r);
t.start();
}