Livemark-mode

2013-07-09 Thread Andreas Liljeqvist
An Emacs-mode for live-ish display of a markdown-buffer in a webbrowser. Nothing terrible usefull, but it could serve as a small example for people looking to write Emacs-modes that communicate with Clojure. https://github.com/bonega/livemark-mode -- -- You received this message because you ar

test.generative and data.generators

2013-07-15 Thread Andreas Liljeqvist
So, I find that what they provide are absolutely fantastic. But I don't see much action around them, are they considered maintained? Things on my wishlish: Shrinking of failing inputs. More readable reports. A couple of blogs or videos discussing them, I think that most people don't know what they

Re: test.generative and data.generators

2013-07-15 Thread Andreas Liljeqvist
/simple-check/ > > I've been using it for some weeks now with good results. > > Cheers, > > - Chas > > On Jul 15, 2013, at 7:35 AM, Andreas Liljeqvist wrote: > > So, I find that what they provide are absolutely fantastic. > But I don't see much action around

Re: the snake game with core.async and swing

2013-08-06 Thread Andreas Liljeqvist
+1 for Daniels suggestion. Swing can be quite bothersome if you just want a canvas and key-events. I would avoid multimethods: (defn calc-new-pos [xy prev-pos dir] (condp = [xy dir] [:x :right] (+ prev-pos step) [:x :left]) (- prev-pos step) [:y :down] (+ prev-pos step) [:y :up]

Re: roundtripping using data.xml?

2015-06-22 Thread Andreas Liljeqvist
Seems like the "Prefix cannot be null" is still a problem. Do anyone have a solution to this? I am trying to roundtrip inkscape-svg to be exact. It happens to contain a whole lot of namespaces. Smallest example: (-> "test.svg" slurp clojure.data.xml/parse-str clojure.data.xml/emit-str) On Thu, O

Re: roundtripping using data.xml?

2015-07-19 Thread Andreas Liljeqvist
Matching socks and Herwig, thanks for your answers. https://github.com/bendlas/data.xml works for roundtripping the data. Currently using raw-parsing and raw-emit. Great work, hope it will be accepted into master eventually. On Tue, Jun 23, 2015 at 1:56 PM Herwig Hochleitner wrote: > Matching

Re: REPL: viewing data structures containing infinite lists

2014-04-01 Thread Andreas Liljeqvist
Is there any good reason for not providing a default value for *print-length*? I think that if you *really* want to print a list containing 100K items, you would have to set *print-length*. Basically it seems less harmful to set it to a nice value by default(42?) than possible locking up the REPL.

Re: Does Pedestal have a future in the long run

2013-11-07 Thread Andreas Liljeqvist
I sure hope it does. Not a master of it yet, but the concept seems very interesting. I know that there is a guy writing a book about it. Many of the other somewhat related technologies like Django are a completely different cognitive model. More tutorials would be great, also they should stress t

Re: Does Pedestal have a future in the long run

2013-11-08 Thread Andreas Liljeqvist
Will there by any presentation on Pedestal, or just announcements? On Fri, Nov 8, 2013 at 1:38 AM, Ryan Neufeld wrote: > Speaking as a core Pedestal team member and engineer at Cognitect I can > say we are *very* serious about continuing to grow and support Pedestal. > It may be quiet, but we're

Re: Proposal: Suppressing tracebacks from clojure.core

2013-01-22 Thread Andreas Liljeqvist
I haven't looked at the technical side of your mail, but improvements to stacktraces are highly appreciated Den 19 jan 2013 20:57 skrev : > Hi all > > I've been thinking about how long tracebacks get for pure Clojure errors, > and it would be really nice if we could hide the Java traceback from th

Re: Proposal: Suppressing tracebacks from clojure.core

2013-01-23 Thread Andreas Liljeqvist
I have found that I can get a bit nicer stacktraces by installing clj-stacktrace. Should probably do my duty and do a documentation pullrequest to nrepl.el Thanks On Tue, Jan 22, 2013 at 8:10 PM, David Nolen wrote: > Better tracebacks have been available in Clojure since 1.3: > > user=> (requi

Re: style questions -- clojure newbie

2013-04-26 Thread Andreas Liljeqvist
I agree with using the trush operator since that certainly is a pipeline. A few comments though: (fn [image] [(:size image) (:#text image)]) Can be changed to: (juxt :size :#text) I wouldn't do api/get in search, the function is much easier to test if you keep it pure. Setup unittests with ex

Re: take-while2?

2010-08-07 Thread Andreas Liljeqvist
It should use "+" for reducing the taken list. Behind the scenes I would envision some accumulator passed to pred. This examples takes elements while their total sum is less than 100. 2010/8/7 Steve Purcell > On 7 Aug 2010, at 11:15, bonega wrote: > > > Hi. > > > > Are there some function like t

Re: take-while2?

2010-08-07 Thread Andreas Liljeqvist
9 10 11 12 13] > > -Steve > > > On 7 Aug 2010, at 13:57, Andreas Liljeqvist wrote: > > It should use "+" for reducing the taken list. > Behind the scenes I would envision some accumulator passed to pred. > This examples takes elements while their total sum is le

Re: take-while2?

2010-08-08 Thread Andreas Liljeqvist
That's succinct :) I haven't tested it against Meikels version which seems to be based upon take-while. However I think this functionality would be nice to have in core or contrib, how do one propose it? Thanks for all contributing to this thread. btw bOR_: I was reading the same blogpost :) 20

Re: Writing conditions on geometric coordinates

2011-05-29 Thread Andreas Liljeqvist
Not sure if I understand your problem. Is it the verbosity of extracting coordinates? (rect-one :x1) Or is the problem with increasing the dimensionality? Anyhow I would define the types as following: (def point [1 2 3]) (def rect [point point]) (defn point-in-rect? [p [[r1 r2]]] (every? tru

Re: ANN: Emacs auto-complete plugin for slime users

2011-06-08 Thread Andreas Liljeqvist
This is great stuff for sure! I have a problem though: If I press 'tab' before the doc strings show up I get a Nullpointerexception. Any ideas? 2010/8/14 Steve Purcell > Hi all, > > A while ago I hooked Slime's completion and documentation features into the > popular Emacs auto-completion frame

Re: Radically simplified Emacs and SLIME setup

2011-06-09 Thread Andreas Liljeqvist
One week ago on windows. install latest stable Emacs. install Emacs starter kit. M-x package-install clojure-mode lein plugin install swank-clojure 1.3.1 Be sure to remove any old swank-clojure from your plugin dir. invoke M-x clojure-jack-in from a project Works for me atleast. Phil - Thanks f

Re: Radically simplified Emacs and SLIME setup

2011-06-09 Thread Andreas Liljeqvist
Engelberg > Andreas, can you clarify exactly where you got emacs from? I got it from > here: > http://ftp.gnu.org/gnu/emacs/windows/ > > Is there another/better source? > > On Thu, Jun 9, 2011 at 1:18 AM, Andreas Liljeqvist > wrote: > > One week ago on windows. >

Re: ANN: Emacs auto-complete plugin for slime users

2011-06-09 Thread Andreas Liljeqvist
e popup-face ac-slime-menu-face document ac-slime-documentation symbol "l"))) My first thought was to do a stringp check in ac-source-slime-simple-candidates. But apparently that is a string, I would have guessed set... Any proficient elispers out there? 2011/6/9 Andreas Liljeqvist

Re: Modelling complex data structures (graphs and trees for example)

2011-06-16 Thread Andreas Liljeqvist
I would make the graph immutable. If performance is a objective it might not work though. My tip for learning it: Sit down and think about the problem. Consider your Clojure structures. 2011/6/16 Colin Yates > (newbie warning) > > Our current solution is an OO implementation in Groovy and Java.

Re: Modelling complex data structures (graphs and trees for example)

2011-06-17 Thread Andreas Liljeqvist
Surely you must have rooted my box. That is my code more or less :) To the op: Use the immutable structures if possible. Make your types as basic as possible. Use Clojure's higer order functions reduce, map etc I consider loop as a last resort. Then your solution will closely match the problem

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Andreas Liljeqvist
Never used Cake, but Lein works great. Emacs is all about customization - something bothers you? Just change it The standard keybindings are extremely bad, change them. I use this one: http://xahlee.org/emacs/ergonomic_emacs_keybinding.html Just ignore the controversy around the guy, the binding

User.clj and set!

2011-06-19 Thread Andreas Liljeqvist
I am trying to set! *printlength* to something not insanity inducing. Problem is that user.clj doesn't support set! I found some old discussion about adding post-repl init, did anything come of this? There exists :repl-init in Lein, but it only takes a symbol. I would like to have one config for

Clojure and swedish characters on windows...

2011-06-19 Thread Andreas Liljeqvist
M-x: clojure-jack-in users>ä Debugger entered: nil (condition-case error (slime-net-read) (error (debug) (slime-net-close process t) (error "net-read error: %S" error))) slime-net-read-or-lose(#) slime-process-available-input(#) slime-net-filter(# "19(:debug-activate 1 1 nil)") recu

Re: User.clj and set!

2011-06-19 Thread Andreas Liljeqvist
Thanks for the answer. Would there be any problems associated with changing the root bindings? 2011/6/19 David Powell > > On Sun, Jun 19, 2011 at 11:58 AM, Andreas Liljeqvist wrote: > >> I am trying to set! *printlength* to something not insanity inducing. >> Problem is

Re: Clojure and swedish characters on windows...

2011-06-19 Thread Andreas Liljeqvist
Thank you Phil, that fixed it. 2011/6/19 Phil Hagelberg > Andreas Liljeqvist writes: > > > M-x: clojure-jack-in > > > > users>ä > > > > Debugger entered: nil > > (condition-case error (slime-net-read) (error (debug) > > (slime-net

Re: Clojure and swedish characters on windows...

2011-06-20 Thread Andreas Liljeqvist
I still have encoding problems in repl outside of Emacs (of course...). This is fine while I am developing, but problematic for rolling out to customers. Setting -Dfile.encoding=UTF8 Doesn't solve it. Anyone? 2011/6/20 Andreas Liljeqvist > Thank you Phil, that fixed it. > > &g

Re: Clojure and swedish characters on windows...

2011-06-20 Thread Andreas Liljeqvist
Lein repl. It doesn't really matter to me since I use Emacs to develop. Just afraid that the encoding problems would follow ever JAR I distribute to end-users. Will test it when I get the time. 2011/6/20 Rasmus Svensson > 2011/6/20 Andreas Liljeqvist : > > I still have encoding pr

Handling java streams..

2011-06-26 Thread Andreas Liljeqvist
Are there any libraries out there for making java stream handling nicer? My current project involves reading images from zipfiles, scaling them and then write them to a new zipfile. Any code I have seen involve mostly writing java in clojure and setting up buffers and such. Certainly I could do t

Re: Handling java streams..

2011-06-27 Thread Andreas Liljeqvist
Yes, bit ashamed that I didn't know that.. Kind of surprised though that not many seem to use it, most clojurists(?) seems to roll their own solution. Thanks. 2011/6/27 Alan Malloy > clojure.java.io? > > On Jun 26, 2:25 pm, Andreas Liljeqvist wrote: > > Are there any lib

Construct map without associng nil values..

2011-07-18 Thread Andreas Liljeqvist
Got something like this: (for [e entries] {:filename (.getName e) :comment (.getComment e) :manymorekeys xxx}) Quite often I get nil as comments. Problem is that I don't want any keys added for comment if there are none. I could wrap the whole thing in a (defn remove-nil-com

Re: Construct map without associng nil values..

2011-07-18 Thread Andreas Liljeqvist
Thanks, but I still feel that it's a little verbose though. Is there some sort of thrush that returns nil if any steps are nil? One might do something like this: (--> e .getComments (hashmap :comments)) not necessarily clear though... 2011/7/18 Meikel Brandmeyer > Hi, > > Am Montag, 18. Juli 2

Re: User.clj and set!

2011-07-24 Thread Andreas Liljeqvist
lly do (set! *print-length* 100) in user.clj. Great stuff! How would I require clojure.java.javadoc as something shorter and have it visible in all namespaces? 2011/6/22 Paul Stadig > On Jun 19, 5:11 pm, Andreas Liljeqvist wrote: > > Thanks for the answer. > > Would

Re: [ANN] ClojureScript

2011-07-25 Thread Andreas Liljeqvist
There is some small mentions about mobile around Clojurescript. What is the plan for Mobile integration? Why wouldn't Clojure be a better fit on the androidplatform? (performance and build problems aside) -- You received this message because you are subscribed to the Google Groups "Clojure" group

Re: protocols and records -- use when?

2011-07-28 Thread Andreas Liljeqvist
I would say that protocols are a subset of multimethod functionality. You want protocols because they are faster and simpler. Protocols only does dispatch on the type, with multimethods you can do dispatch on several args of whatever. 2011/7/28 Oskar > Thank you Alex and abp! > > Your posts ce

Defrecord and Interfaces..

2011-07-29 Thread Andreas Liljeqvist
Is this a bug? (defprotocol Notcloseable (dosomething [this])) (defrecord Archive [] java.io.Closeable (close [_] (print "closeable")) Notcloseable (dosomething [_] (print "something"))) user> (def a (Archive.)) user> (.close a) closeable user> (close a) Unable to resolve symbol

Re: Defrecord and Interfaces..

2011-07-30 Thread Andreas Liljeqvist
Thanks, that was very informative. I got no technical reason to expect that implementing an interface would define a function, lets just say that it felt right :/ 2011/7/29 Aaron Cohen > On Fri, Jul 29, 2011 at 3:18 PM, Andreas Liljeqvist wrote: > >> Is this a bug? >> >

Re: Defrecord and Interfaces..

2011-07-30 Thread Andreas Liljeqvist
cond try"))) user> (.close (make-archive)) first try user> (.close (Archive.)) second try Apparently "make-archive" keeps a reference to the old class. Should I just learn to evalute all my constructor functions when the implementation changes? 2011/7/30 Andreas Liljeqvis

Re: Published a library for archive handling.

2011-08-02 Thread Andreas Liljeqvist
ug 1, 2011 at 6:51 PM, Andreas Liljeqvist wrote: > >> https://github.com/bonega/pacl >> >> From the readme: >> >> This library is just wrapping https://github.com/edmund-wagner/junrar and >> sun's zip utilities. >> It provides a more sane cloju

Agents has stopped working for me (emacs)

2011-08-04 Thread Andreas Liljeqvist
Not really sure when it happened. It works in a repl launched from lein. simple example from somewhere: M-x clojure-jack-in (def abc (agent "Initial Value of Agent = This string")) ;; (B) The function to send a message to the agent. (defn go [] (send abc (fn [_] ;; Wa

Re: Agents has stopped working for me (emacs)

2011-08-04 Thread Andreas Liljeqvist
Thanks, that solved it. I went to 1.4.0-SNAPSHOT and removed any old versions of swank-clojure. 2011/8/4 Phil Hagelberg > On Thu, Aug 4, 2011 at 7:46 AM, Andreas Liljeqvist > wrote: > > Not really sure when it happened. > > It works in a repl launched from lein. >

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-08-05 Thread Andreas Liljeqvist
I have problem getting it to work. Windows 7. swank-clojure 1.4.0-SNAPSHOT clojure-mode 1.10.0 lein 1.6.1 GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600) of 2011-03-10 on 3249CTO project.clj: (defproject tetris "1.0.0-SNAPSHOT" :description "FIXME: write" :dependencies [[org.clojure/clojure "1.2.1"]

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-08-14 Thread Andreas Liljeqvist
Hi, sorry for not reporting back. I did a bit of digging yesterday. Turns out that "sa-jdi.jar" isn't included in JDK6 for windows. Seems like I must use the sharedmemory connector. Also it seems that add-classpath doesn't work on windows? (-> "file:///C:/Program/Java/jdk1.6.0_26/jre/../lib/tool

Re: Regarding Starting Clojure

2012-10-01 Thread Andreas Liljeqvist
Probably they wouldn't, but that's not the point. The clojure community is doing something wrong for providing a coherent beginner experience. Maybe we aren't good at encouraging people to contribute documentation. Or the composability of Clojure leads to small "library islands" without much commu

Example of Tetris in Clojurescript.

2012-10-11 Thread Andreas Liljeqvist
Hi. Feel free to check out my Clojurescript Tetris at this location: http://clojure-tetris.herokuapp.com/ Github: https://github.com/bonega/tetris/tree/clojurescript Originally started as a swing application and later seesaw. I am very impressed with how easy it was adapting the codebase to cloj

Re: Simple way to get image from url

2012-10-15 Thread Andreas Liljeqvist
Haven't got access to my tools, but couldn't you just slurp it? (slurp "http://somesite/picture.jpg";) On Mon, Oct 15, 2012 at 11:08 AM, dennis zhuang wrote: > I think you can use clj-http: > https://github.com/dakrone/clj-http > > (client/get "http://site.com/favicon.ico"; {:as :byte-array}) >

Re: CDS progress report, week 1

2012-10-16 Thread Andreas Liljeqvist
Great work guys! This is a great gift to the community. On Mon, Oct 15, 2012 at 7:01 PM, Wes Freeman wrote: > I've been watching the repo. Thanks for all the effort on this, guys. > > Wes > > > On Mon, Oct 15, 2012 at 12:07 PM, Michael Klishin < > michael.s.klis...@gmail.com> wrote: > >> ## TL;D

ANN: LibTetris and cljs-tetris

2012-10-16 Thread Andreas Liljeqvist
So the time had come to make a library version of my Tetris-project. [libtetris "0.1.0] github: https://github.com/bonega/libtetris There is even some documentationthanks to Marginalia. I have ported my Clojures

Midje popularity?

2012-10-17 Thread Andreas Liljeqvist
Hi. A couple of weeks ago I ported midje-mode over to nrepl. I did a post on the midje-group and made a pullrequest to the Midje-mode maintainer. Since I haven't got any response either on the mailinglist or the pullrequest I will ask here. Does anyone use Midje currently? Is there any other fram

Re: Midje popularity?

2012-10-17 Thread Andreas Liljeqvist
d, Oct 17, 2012 at 5:15 PM, Ben Mabey wrote: > On 10/17/12 7:31 AM, Andreas Liljeqvist wrote: > > Hi. > > A couple of weeks ago I ported midje-mode over to nrepl. > I did a post on the midje-group and made a pullrequest to the Midje-mode > maintainer. > > Sinc

Re: Midje popularity?

2012-10-17 Thread Andreas Liljeqvist
ojure-test-mode, but it certainly seems to fit my requirements. Will see what I can do about that. On Wed, Oct 17, 2012 at 6:28 PM, Brian Marick wrote: > > On Oct 17, 2012, at 8:31 AM, Andreas Liljeqvist wrote: > > Since I haven't got any response either on the mailinglist or t

Re: Sonian is hiring Clojure developers

2012-10-31 Thread Andreas Liljeqvist
Is US-based a requirement set in stone? Have to ask since you phrase it as "fully remote". On Wed, Oct 31, 2012 at 2:07 PM, joegallo wrote: > http://www.sonian.com/about/careers/software-engineer-clojure-cloud/ > > Come work at Sonian and you'll be writing Clojure full-time, working > on interes

Re: [Ann] Kibit 0.0.6

2012-11-12 Thread Andreas Liljeqvist
I would prefer the use of vec. If I am using an empty 'to' then I would always replace it with the type constructor. Feels more clean to me. You aren't logically taking an empty vector and filling it with stuff, you are converting your original coll. On Sun, Nov 11, 2012 at 5:04 PM, Jim - FooBar(

Re: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-19 Thread Andreas Liljeqvist
c, *B)*have >> the network architecture (how many hidden and output neurons, etc) be >> configurable, and *C)* add more and more types of training data. >> >> >> Tim >> >> >> >> >> On Sun, Nov 18, 2012 at 7:55 PM, Andreas Liljeqvist wrot

Re: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-19 Thread Andreas Liljeqvist
ropagation ii) ResilentPropagation iii) etc, *B)*have the > network architecture (how many hidden and output neurons, etc) be > configurable, and *C)* add more and more types of training data. > > > Tim > > > > > On Sun, Nov 18, 2012 at 7:55 PM, Andreas Liljeqvist w

Re: strangeloop presentations

2011-10-02 Thread Andreas Liljeqvist
Actually I am mostly looking forward to Phil's "Getting Cozy with Emacs". I am very disappointed that there aren't more buzz about it. Come on people - it's about Emacs! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: strangeloop presentations

2011-10-03 Thread Andreas Liljeqvist
N!! 2011/10/2 Alex Miller > Phil's was a 3 hour workshop and was not recorded sorry. > > > On Oct 2, 4:01 am, Andreas Liljeqvist wrote: > > Actually I am mostly looking forward to Phil's "Getting Cozy with Emacs". > > I am very disap

Euler 14

2011-01-17 Thread Andreas Liljeqvist
Hi. I am using max-key to get the longest sequence from a couple of sequences. (defn cseq [n] (if (= 1 n) [1] (cons n (cseq (if (even? n) (/ n 2) (+ (* 3 n) 1 )) (apply max-key count (map cseq (range 1 100))) This gives me a heap error. To my understan

Re: Euler 14

2011-01-17 Thread Andreas Liljeqvist
ious" way to > solve the problem is often too slow and further cleverness is > required. > > On Mon, Jan 17, 2011 at 7:53 AM, Andreas Liljeqvist > wrote: > > Hi. > > > > I am using max-key to get the longest sequence from a couple of > seque

Problem with garbage collection? Was Euler 14

2011-01-19 Thread Andreas Liljeqvist
Engelberg > On Mon, Jan 17, 2011 at 11:55 AM, Andreas Liljeqvist > wrote: > > I don't see why the cseq's have to be lazy, they are at the most 525 > > elements long. > > shouldn't each sequence only be produced when it is reduced in max-key > and > &

Re: Problem with garbage collection? Was Euler 14

2011-01-19 Thread Andreas Liljeqvist
user> (defn cseq [n] (if (= 1 n) [1] (lazy-seq (cons n (cseq (if (even? n) (/ n 2) (+ (* 3 n) 1 ))) #'user/cseq user> (count (apply max-key count (map cseq (range 1 100 525 user> (first (apply max-key count (map cseq (range 1 100 83

Re: Euler 14

2011-01-20 Thread Andreas Liljeqvist
Thank you, that explains the failure of the lazy-cseq using top-level defs. I really hope it gets fixed, Clojure is going to be a hard sell if I have to explain things like this to my coworkers :( Anyhow there is still the problem with nonlazy cseq blowing the heap. (defn cseq [n] (if (= 1 n)

Re: Euler 14

2011-01-20 Thread Andreas Liljeqvist
I am sorry, I can't seem to reproduce the behavior at the moment :( Mark, please tell me that I am not delusional... Will try at home also. 2011/1/20 ka > Andreas, How are you running that? Also what do you see in the heap > dump and what is the jvm heap size? > > -- > You received this message

Infinite seqs and testing

2011-02-13 Thread Andreas Liljeqvist
I have a statemap with a couple of infinite lazy-seq. When doing testing I want to check states for equality. This of course fails on the whole infinite thing. The sane thing is taking only the first item from the seqs when doing the equality check. How would I accomplish this in the easiest way?

Re: Infinite seqs and testing

2011-02-13 Thread Andreas Liljeqvist
Roger that. Thanks for the help. 2011/2/13 Stuart Sierra > Redefining equality is not something to be taken lightly. It can break in > subtle ways with identity and hash codes. > > You may want a custom equality function, like "equal up to n elements of a > sequence," for use in your tests. >