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
final JCommandPopupMenu menu = new JCommandPopupMenu(); | |
menu.addMenuButton(new JCommandMenuButton("Hallo",null)); | |
button.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY); | |
button.setPopupCallback(new PopupPanelCallback() { | |
@Override | |
public JPopupPanel getPopupPanel(final JCommandButton commandButton) { | |
return menu; | |
} |
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
g.translate(getTranslateX(), getTranslateY()); | |
g.translate(-viewport.width / 2, -viewport.height / 2); | |
g.scale(getZoom(), getZoom()); | |
g.translate((viewport.width / 2) * getZoom(), (viewport.height / 2) * getZoom()); | |
// As soon as getZoom() is not 1.00, it breaks! |
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 org.wikijava.sound.playWave; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import javax.sound.sampled.AudioFormat; | |
import javax.sound.sampled.AudioInputStream; | |
import javax.sound.sampled.AudioSystem; | |
import javax.sound.sampled.LineUnavailableException; | |
import javax.sound.sampled.SourceDataLine; |
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
local monitor = peripheral.wrap("right"); | |
rednet.open("top"); | |
maxX, maxY = monitor.getSize(); | |
curX, curY = 1,1; | |
print("Max X: " .. maxX .. " Max Y: " .. maxY); | |
names = {}; |
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
Exception in thread "main" org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [CREATE TABLE test (id INTEGER PRIMARY KEY)]; nested exception is org.h2.jdbc.JdbcSQLException: Tabelle "TEST" besteht bereits | |
Table "TEST" already exists; SQL statement: | |
CREATE TABLE test (id INTEGER PRIMARY KEY) [42101-188] | |
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) | |
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) | |
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:415) | |
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:439) | |
at TestMain.main(TestMain.java:19) | |
Caused by: org.h2.jdbc.JdbcSQLException: Tabelle "TEST" besteht bereits | |
Table "TEST" already exists; SQL statement: |
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 csv | |
import datetime | |
import math | |
##TODO: Ändere die zeiten an denen du die mittelwerte berechnene willst | |
# Liste von allen zeiden von denen du das mittel willst | |
mittelZeiten = [{'hour': 13, 'min': 10}, | |
{'hour': 16, 'min': 30}] |
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
CC = gcc | |
OBJDIR = bin | |
exec = udp/server udp/client tcp/server tcp/client | |
.PHONY: all clean | |
all: $(OBJDIR) $(exec) | |
clean: | |
rm -r $(OBJDIR) |
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
function queryObject(object, path) { | |
const parts = path.split('.'); | |
let objects = wrapArray(object); | |
while (parts.length > 0 && objects.length > 0) { | |
const prop = parts.shift(); | |
objects = objects | |
.flatMap((o) => wrapArray(o[prop])) | |
.filter((o) => o != null); | |
} | |
return objects; |
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> | |
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"> | |
<meta content="utf-8" http-equiv="encoding"> | |
<title>Stopwatch</title> | |
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@600&display=swap" rel="stylesheet"> | |
</head> |
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 | |
# This script should be called inside a docker container | |
# to backup the database. | |
# $ ./backup.sh [hourly|daily|weekly|monthly|yearly] | |
# The environment variables for pg_dumpall need to be set. | |
set -e | |
# First command line arg. |
OlderNewer