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 tk.skuro; | |
public class Bean { | |
private final String _value; | |
public Bean(String value) { | |
_value = value; | |
} |
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://www.hackerrank.com/challenges/functional-programming-warmups-in-recursion---fibonacci-numbers | |
(let [fibos (iterate (fn [[a0 a1]] [a1 (+ a0 a1)]) [0 1]) | |
fibo (fn [n] (->> n dec (nth fibos) first))] | |
(-> | |
(read) | |
fibo | |
println)) | |
;https://www.hackerrank.com/challenges/pascals-triangle | |
(let [k (read) |
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
#_( | |
Amsterdam Clojurians Dojo#3: A nonogram solver | |
============================================== | |
Fork this gist and provide your solution! | |
) |
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
@PropertySource(["classpath:application.properties"]) | |
@Configuration | |
@ComponentScan("org.sample") | |
public class AppConfig { | |
@Autowired | |
private Environment environment | |
} |
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 protocols) | |
(defprotocol Flying | |
(fly [this from to])) | |
(extend-type String ; <- protocols are "open", as they install a dispatch facility rather than fussing with type inheritance | |
Flying | |
(foo [this from to] (println "Even a String can fly from" from "to" to))) |
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 foo; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.Properties; | |
/** |
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
# | |
# Debian useful commands | |
#---- | |
# look for eventually installed packages that provide filename.ext | |
dpkg -D filename.ext | |
# | |
# Various stuff | |
#---- |
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
<%-- | |
Original source: http://paste.lisp.org/display/71541 | |
--%> | |
<%-- | |
This JSP page is intended to start swank-clojure | |
in a running Java system executed in an HTTP | |
container like Tomcat, so that you can connect to | |
it from SLIME and interactively inspect, control and | |
modify it. |
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 skuro.alfresco.clojure | |
:import (org.alfresco.util ApplicationContextHelper ApplicationContextHelper$RunAsWork) | |
(org.alfresco.repo.transaction RetryingTransactionHelper RetryingTransactionHelper$RetryingTransactionCallback)) | |
;; this is problematic: it looks like swank is launched in a separated class loader! | |
;; this usually results in the spring ctx to be recreated | |
(def ctx (. ApplicationContextHelper getApplicationContext)) | |
(defn run-as [user work] | |
(. AuthenticationUtil runAs |
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
$ sc-server | |
SproutCore v1.4.1 Development Server | |
Starting server at http://0.0.0.0:4020 in debug mode | |
To quit sc-server, press Control-C | |
>> Thin web server (v1.2.7 codename No Hup) | |
>> Maximum connections set to 1024 | |
>> Listening on 0.0.0.0:4020, CTRL+C to stop | |
LocalJumpError: no block given | |
/Library/Ruby/Gems/1.8/gems/sproutcore-1.4.1/lib/sproutcore/models/manifest.rb:26:in `each' | |
/Library/Ruby/Gems/1.8/gems/sproutcore-1.4.1/lib/sproutcore/models/manifest.rb:26:in `visible' |
OlderNewer