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
// beliebige Komponente | |
final Component component = ...; | |
PrinterJob job = PrinterJob.getPrinterJob(); | |
job.setPrintable(new Printable() | |
{ | |
@Override | |
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException | |
{ |
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 net.mabako.zwickau.autohaendler; | |
import javax.swing.JButton; | |
public class Dashboard extends JPanel | |
{ | |
/** | |
* Serial | |
*/ | |
private static final long serialVersionUID = -2754350246072768836L; |
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 net.mabako.zwickau.db; | |
import static net.mabako.zwickau.autohaendler.G.db; | |
import java.util.Vector; | |
public class UserTable extends TableHandler | |
{ | |
/** | |
* {@inheritDoc} |
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
:gsub("&#%d%d%d%d;", decode) | |
function decode(str) | |
local num = tonumber(str:sub(3,6)) | |
local first = math.floor(num/4096) | |
num = num - 4096 * first | |
return string.char(first+224, math.floor(num/64)+128, num%64+128) | |
end |
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
/** | |
* Read complete file into a String | |
*/ | |
try(InputStream is = ...) { | |
try(Scanner s = new Scanner(is).useDelimiter("\\A")) { | |
return s.hasNext() ? s.next() : ""; | |
} | |
} |
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
(define (primHelp num count) | |
(cond | |
((zero? (modulo num count)) #f) | |
((< count (sqrt num)) (primHelp num (+ count 1))) | |
(else #t) | |
) | |
) |
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
(define (a8 a . r) | |
(let | |
( | |
(m (apply max r)) | |
) | |
(if (>= a m) | |
(+ (quadrat a) (quadrat m)) | |
(apply a8 (append r (list a))) | |
) | |
) |
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
(define (euklid a b) | |
(if (= b 0) a (euklid b (modulo a b))) | |
) | |
(print (euklid 1071 1029)) | |
(print (euklid 1029 1071)) |
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
(define (erweiterter_euklid a b) | |
(if (= b 0) | |
(list a 1 0) | |
(begin | |
(let* | |
( | |
(tmp (erweiterter_euklid b (modulo a b))) | |
(d (car tmp)) | |
(s (cadr tmp)) | |
(t (caddr tmp)) |
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
(define (a8 a . r) | |
(let | |
( | |
(m (apply max r)) | |
) | |
(if (>= a m) | |
(+ (quadrat a) (quadrat m)) | |
(apply a8 (append r (list a))) | |
) | |
) |