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
(ns busy-cursor.core | |
(:use seesaw.core)) | |
(defn long-running-task | |
[] | |
(Thread/sleep 5000) | |
"The result") | |
(defn run-task-with-busy-cursor | |
[c] |
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
[503,1] joyspring [master *]$ lein2 vimclojure | |
Could not find artifact lein-tarsier:lein-tarsier:pom:0.9.3 in central (http://repo1.maven.org/maven2) | |
Retrieving lein-tarsier/lein-tarsier/0.9.3/lein-tarsier-0.9.3.pom (3k) | |
from https://clojars.org/repo/ | |
Could not find artifact lein-tarsier:lein-tarsier:jar:0.9.3 in central (http://repo1.maven.org/maven2) | |
Retrieving lein-tarsier/lein-tarsier/0.9.3/lein-tarsier-0.9.3.jar (8k) | |
from https://clojars.org/repo/ | |
Exception in thread "main" java.lang.ClassNotFoundException: vimclojure.nailgun.NGServer, compiling:(NO_SOURCE_PATH:1) | |
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6462) | |
at clojure.lang.Compiler.analyze(Compiler.java:6262) |
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
$ lein2 version | |
Leiningen 2.0.0-preview3 on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM | |
$ lein2 new hi | |
Generating a project called hi based on the 'default' template. | |
$ cd hi | |
$ lein2 deps | |
$ lein2 repl | |
Retrieving org/clojure/tools.nrepl/0.2.0-beta1/tools.nrepl-0.2.0-beta1.pom | |
from http://repo1.maven.org/maven2/ | |
Could not find artifact org.thnetos:cd-client:pom:0.3.3 in central (http://repo1.maven.org/maven2) |
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
(ns table-test.core | |
(:use [seesaw core table swingx])) | |
; A predicate that decides whether a row should be highlighted | |
; adapter is an instance of JXTable.TableAdapter | |
; http://projects.joshy.org/projects/painterreview/swingx/org/jdesktop/swingx/JXTable.TableAdapter.html | |
(defn hl-predicate [renderer adapter] | |
; Highligh all rows where :age is over thirty | |
(> (.getValueAt adapter (.row adapter) 0) 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
[Wed, 28 Mar 2012 10:52:02 -0700] FATAL: Chef::Exceptions::ShellCommandFailed: execute[mysql-install-privileges] (mysql::server line 136) had an error: Expected process to exit 0, but it exited with 1 | |
---- Begin output of /usr/bin/mysql -u root -p"B0MAn1h8e3LFoV_4iDzA" < /etc/mysql/grants.sql ---- | |
STDOUT: | |
STDERR: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) | |
---- End output of /usr/bin/mysql -u root -p"B0MAn1h8e3LFoV_4iDzA" < /etc/mysql/grants.sql ---- | |
Ran /usr/bin/mysql -u root -p"B0MAn1h8e3LFoV_4iDzA" < /etc/mysql/grants.sql returned 1 | |
that is, maybe mysql isn't up yet when it tries to set the root password. |
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
[Wed, 28 Mar 2012 10:51:58 -0700] INFO: Processing gem_package[mysql] action install (mysql::client line 50) | |
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. | |
Gem.source_index called from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/provider/package/rubygems.rb:202. | |
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01. | |
Gem::SourceIndex#search called from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/provider/package/rubygems.rb:76. | |
and then fails with: | |
[Wed, 28 Mar 2012 10:52:02 -0700] FATAL: Chef::Exceptions::ShellCommandFailed: execute[mysql-install-privileges] (mysql::server line 136) had an error: Expected process to exit 0, but it exited with 1 | |
---- Begin output of /usr/bin/mysql -u root -p"B0MAn1h8e3LFoV_4iDzA" < /etc/mysql/grants.sql ---- | |
STDOUT: | |
STDERR: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock |
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
user=> (use 'korma.core) | |
nil | |
user=> (use 'korma.db) | |
nil | |
user=> (defdb dev (sqlite3 {:classname "org.sqlite.JDBC" | |
:subprotocol "sqlite" | |
:subname "db/dev.sqlite3"})) | |
{:pool #<Delay@4471dfd7: :pending>, :options {:naming {:keys #<core$identity clojure.core$identity@76612ef6>, :fields #<core$identity clojure.core$identity@76612ef6>}, :delimiters ["\"" "\""]}} | |
user=> (defentity users) | |
#'user/users |
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
; very basic example of driving a listbox with binding in Seesaw | |
(use 'seesaw.core) | |
(require '[seesaw.bind :as b]) | |
; create a text box and a listbox next to each other | |
(defn make-ui [] | |
(frame | |
:size [400 :by 400] | |
:content (left-right-split | |
(scrollable (text :id :text :multi-line? true)) |
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
# https://github.com/daveray/familiar | |
require 'familiar' | |
class DoSyncTest | |
def initialize() | |
@my_ref = Familiar.ref 0 | |
end | |
def test_threaded_refs | |
threads = [] |
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
// Hacked from headius' version here: https://github.com/headius/clojr/blob/master/src/main/java/com/headius/clojr/ClojrLibrary.java | |
// See also https://jira.codehaus.org/browse/JRUBY-6149 | |
public static IRubyObject dosync(final ThreadContext context, final IRubyObject self, final Block block) throws Exception { | |
final Ruby ruby = context.runtime; | |
return (IRubyObject) LockingTransaction.runInTransaction(new Callable() { | |
public Object call() throws Exception { | |
// re-get transaction in case this gets run in different threads | |
try { |