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
;; https://k11i.biz/blog/2016/12/05/fastest-gaussian-rng-in-java/ | |
(boot.core/merge-env! :repositories | |
[["bintray-komiya-atsushi-maven" {:url "https://dl.bintray.com/komiya-atsushi/maven"}]] | |
:dependencies | |
'[[biz.k11i/fast-rng "0.2.0"]]) | |
(import java.util.Random) | |
;; https://en.wikipedia.org/wiki/Normal_distribution | |
(let [r (Random.)] |
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
<?php | |
// 結論 PHP の built in web server は シングルスレッドなので上手く評価できない | |
if (PHP_SAPI === 'cli') { | |
echo <<<EOU | |
Usage: | |
run: php -S localhost:8080 {$argv[0]} | |
browse http://localhost:8080/ | |
EOU; | |
exit; |
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
<?php | |
if (PHP_SAPI === 'cli') { | |
echo <<<EOU | |
This is something like a http://stevesouders.com/hpws/sleep.txt | |
Usage: | |
run: php -S localhost:8080 {$argv[0]} | |
browse http://localhost:8080/ | |
NOTICE: |
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
<?php | |
if (PHP_SAPI === 'cli') { | |
echo <<<EOS | |
Usage: | |
run: php -S localhost:8080 {$argv[0]} | |
browse http://localhost:8080/ | |
EOS; | |
exit; | |
} |
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.logging LogRecord Logger Formatter SimpleFormatter StreamHandler) | |
(java.awt Image Color Dimension Insets Graphics) | |
(java.awt.image ImageObserver) | |
(javax.swing UIManager UnsupportedLookAndFeelException | |
BorderFactory | |
JComponent | |
JFrame JPanel Box JDialog | |
JScrollPane JScrollBar | |
JFileChooser | |
JLabel JTextField JPasswordField JTextArea |
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
(boot.core/set-env! :dependencies '[[io.github.bonigarcia/webdrivermanager "3.7.1"] | |
;; https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager | |
]) | |
(System/getProperty "webdriver.chrome.driver") | |
;; => "/bin/chromedriver" | |
(.setup (io.github.bonigarcia.wdm.WebDriverManager/chromedriver)) | |
(System/getProperty "webdriver.chrome.driver") |
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 JFrame JLabel) | |
(java.awt GridLayout)) | |
(defn- rand-str [len] | |
(apply str (take len (repeatedly #(char (+ (rand 26) 65)))))) | |
(let [n-rows 10 | |
n-cols 3 | |
frame (doto (JFrame. "GRIDの大きさは全部同じみたい") | |
(.setDefaultCloseOperation JFrame/DISPOSE_ON_CLOSE))] |
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
(->> (java.lang.management.ManagementFactory/getRuntimeMXBean) | |
.getSystemProperties | |
(into {})) | |
(= (->> (java.lang.management.ManagementFactory/getRuntimeMXBean) | |
.getSystemProperties | |
(into {}) | |
keys sort) | |
(->> (System/getProperties) | |
(into {}) |
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
(let [f #(-> (System/getProperty "os.name") | |
.toLowerCase | |
(.startsWith %))] | |
(def linux? #(f "linux")) | |
(def windows? #(f "windows")) | |
(def mac? #(f "mac"))) |
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
(boot.core/set-env! :dependencies '[[org.jasypt/jasypt "1.9.3"]]) | |
;;; https://www.codeflow.site/ja/article/jasypt | |
(import (org.jasypt.util.text BasicTextEncryptor)) | |
(let [pass "foo" | |
msg "今日は晴れです。" | |
encryptor (doto (BasicTextEncryptor.) | |
(.setPassword pass)) |