(map #(.getName %) (.getMethods java.io.File))
; -> ("equals" "toString" "hashCode" "compareTo" "compareTo" "getName" "length" "getParent" "isAbsolute" "getCanonicalPath" "setReadOnly" "list" "list" "delete" "getParentFile" "getPath" "getAbsolutePath" "getAbsoluteFile" "getCanonicalFile" "toURL" "toURI" "canRead" "canWrite" "exists" "isDirectory" "isFile" "isHidden" "lastModified" "createNewFile" "deleteOnExit" "listFiles" "listFiles" "listFiles" "mkdir" "mkdirs" "renameTo" "setLastModified" "setWritable" "setWritable" "setReadable" "setReadable" "setExecutable" "setExecutable" "canExecute" "listRoots" "getTotalSpace" "getFreeSpace" "getUsableSpace" "createTempFile" "createTempFile" "wait" "wait" "wait" "getClass" "notify" "notifyAll")
(map (memfn getName) (.getMethods java.io.File))
do the same.
(let [sdf (java.text.SimpleDateFormat. "yyyyMMddHHmmss")]
(->>
(clojure.java.io/resource "project-name/core__init.class")
(.openConnection)
(.getLastModified)
(.format sdf)))
- literal:
0xff ; -> 255
- value -> string in hexadecimal representation:
(Integer/toString 255 16) ; -> "ff"
- string in hexadecimal representation -> value:
(Integer/parseInt "ff" 16) ; -> 255
- string -> array of ascii bytes:
(.getBytes "0000") ; -> #<byte[] ...>
- array of bytes -> list of values:
(apply list (.getBytes "0000")) ; -> (48 48 48 48)
(use '[clojure.main :only (repl)])
(repl)
(. System exit 0)
Set the environment variable _JAVA_OPTIONS
to -Dfile.encoding=UTF-8
.
- Add paths of sources and classes of your program, compile and execute it: https://gist.github.com/3205162
ありがとうございます. 絵文字が使えるとは知らなかった 😅