我想通过计数和超时在core.async chan上批量消息(即10ms或10条消息,以先到者为准).Tim Baldridge 有关于批处理的视频,但它在core.async中使用了已弃用的函数,并且不使用传感器.我正在寻找类似以下的东西......
(defn batch [in out max-time max-count]
...
)
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用jayq和jquery.ui.sortable来对页面进行排序.看看http://jqueryui.com/demos/sortable/看起来它应该像下面这样简单:
(.sortable ($ :#sortable))
Run Code Online (Sandbox Code Playgroud)
其中编译为:
jayq.core.$.call(null, "\ufdd0'#sortable").sortable();
Run Code Online (Sandbox Code Playgroud)
并抛出:
Uncaught TypeError: Cannot call method 'call' of undefined
Run Code Online (Sandbox Code Playgroud)
当我尝试将其包含在页面中时.有趣的是,当我将它粘贴到js控制台时,生成的代码在页面中起作用,这意味着在执行该行之后会加载必要的东西.
我修改了
(def cljs-options {:advanced {:externs ["externs/jquery.js"]}})
Run Code Online (Sandbox Code Playgroud)
至
(def cljs-options {:advanced {:externs ["externs/jquery.js" "js/ui/jquery-ui.js]}})
Run Code Online (Sandbox Code Playgroud)
在阅读 http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html之后 ,这似乎不够.我猜jquery.ui会修改$ Prototype,但我不知道如何在clojurescript中完成此操作
我也使用黑色和黑色 - 如果它有任何区别.
看看使用jQueryUI和闭包编译器, 它可能只是jquery-ui需要一个手动滚动的externs文件才能被使用,这可能是一项重大任务.谁能确认一下?
给定正则表达式和目录路径,如何获得其路径与正则表达式匹配的seq文件?
即,我想要
(require '[clojure.java.io :as io])
(regex-file-seq #"\.ssh/.*\.pub$" (io/file "/home")) =>
(#<File /home/x/.ssh/iaf_dsa.pub> #<File ....>)
Run Code Online (Sandbox Code Playgroud)
我花了几分钟把这些碎片放在一起,所以我想我会发布它.