I am more or less terrible at Maven, but I'm OK with Leiningen. Given that
I have some information about a Maven repository (
https://code.google.com/p/libgdx/wiki/MavenProjectSetup#Maven_Archetype),
how do I use it with Leiningen?
Thanks
--
--
You received this message because you are subsc
+1
On Sat, May 25, 2013 at 8:12 PM, Austin Haas wrote:
>
> Hi Brian,
>
> You should post your question to the miniKanren Google group.
>
> minikan...@googlegroups.com
>
> -austin
>
> --
> Austin Haas
> Pet Tomato, Inc.
> http://pettomato.com
>
>
> On Sat May 25 10:21 , Brian Craft wrote:
> > Wo
I think Nada Amin has already done something like this with the nominal
feature and at least her version was quite simple. Best to ask this
question on the miniKanren/core.logic mailing list -
http://groups.google.com/forum/#!forum/minikanren
David
On Sat, May 25, 2013 at 8:44 PM, Adam Saleh wr
The most common way to do this in Clojure is to define your function such
that if the input is not in the domain, the function returns nil.
Since nil and false are the only "falsey" values in Clojure, you can use
ordinary tests to determine if the function returned a result. The idiom
that lets y
The combination of CES and LibGDX seems intriguing. I think I'd like to go
with that.
Stephen, how would you feel about me extending/using your library for the
contest? Technically, it's not against the rules, but I still wouldn't
feel right if I didn't ask for permission.
On Saturday, 25 Ma
Thanks for the demo ... the next part of my code will decide if the key is
in an atom feed so I will be testing for false in the results too - FTW
indeed :D
On Saturday, 25 May 2013 21:01:31 UTC+2, atkaaz wrote:
>
> => (doall (map #(remove :dh-uuid %)
> '(({:a2p-id "1", :dh-uuid "ab
=> (doall (map #(remove :dh-uuid %)
'(({:a2p-id "1", :dh-uuid "abc-def-ghi-klm"} {:a2p-id "2",
:dh-uuid "def-ghi-klm-opq"} {:a2p-id "3", :dh-uuid nil}) ({:a2p-id "1",
:dh-uuid "abc-def-ghi-klm"} {:a2p-id "2", :dh-uuid "def-ghi-klm-opq"}
{:a2p-id "3", :dh-uuid *false*}))
))
(
Hi,
I am trying to implement a simple knowledge derivation program in
clojure.core.logic,
and I am not sure how to approach it. To be more specific, after I am done,
it will be used as a toy cryptographic protocol verifier,
that tries to infer what knowledge can attacker get based on some initi
This is my latest working invocation:
(doall (map #(remove :dh-uuid %) (map find-records query-parts)))
(({:a2p-id "3", :dh-uuid nil}) ({:a2p-id "3", :dh-uuid nil}))
The list of maps is retained which might be useful later.
Thanks
On Saturday, 25 May 2013 20:15:19 UTC+2, sdegutis wrote:
>
> Wou
It's as I presented it - a list of a list of maps
On Saturday, 25 May 2013 13:27:45 UTC+2, atkaaz wrote:
>
> can you tell what this returns?
> (map find-records query-parts)
>
>
> On Sat, May 25, 2013 at 2:21 PM, Mond Ray
> > wrote:
>
>> I am missing something obvious... I get a list of maps bac
On the other hand ... does that mean that the sequence being filtered is
not lazy?
On Saturday, 25 May 2013 20:09:05 UTC+2, Mond Ray wrote:
>
> Bingo:
>
> user=> (filter (complement :dh-uuid) (apply concat (map find-records
> query-parts)))
> ({:a2p-id "3", :dh-uuid nil} {:a2p-id "3", :dh-uuid n
Wouldn't (remove :dh-uuid (apply concat (map find-records query-parts))) be
better?
On Sat, May 25, 2013 at 1:09 PM, Mond Ray wrote:
> Bingo:
>
> user=> (filter (complement :dh-uuid) (apply concat (map find-records
> query-parts)))
> ({:a2p-id "3", :dh-uuid nil} {:a2p-id "3", :dh-uuid nil})
>
>
Hi Brian,
You should post your question to the miniKanren Google group.
minikan...@googlegroups.com
-austin
--
Austin Haas
Pet Tomato, Inc.
http://pettomato.com
On Sat May 25 10:21 , Brian Craft wrote:
> Wondering if anyone can give me some pointers with this, as I dive into
> logic progra
Bingo:
user=> (filter (complement :dh-uuid) (apply concat (map find-records
query-parts)))
({:a2p-id "3", :dh-uuid nil} {:a2p-id "3", :dh-uuid nil})
Thanks everyone!
On Saturday, 25 May 2013 19:29:55 UTC+2, Andy Fingerhut wrote:
>
> Woops, and here I wasn't being careful enough... You have a
Woops, and here I wasn't being careful enough... You have a list (or
sequence) of two elements, both of which are lists (or sequences) of maps.
You can use (apply concat (map find-records query-parts)) to return a
single list containing nothing but maps.
Andy
On Sat, May 25, 2013 at 10:27 AM, A
If (map find-records query-parts) is returning this expression:
(({:a2p-id "1", :dh-uuid "abc-def-ghi-klm"} {:a2p-id "2", :dh-uuid
"def-ghi-klm-opq"} {:a2p-id "3", :dh-uuid nil}) ({:a2p-id "1", :dh-uuid
"abc-def-ghi-klm"} {:a2p-id "2", :dh-uuid "def-ghi-klm-opq"} {:a2p-id "3",
:dh-uuid nil}))
the
Hello,
This is my first post to this group. If my post or the tone of my post is
not up to this communities standards, please give me feedback so that I can
integrate with the community.
I'm coming from Scala-land.
In Scala, there's a PartialFunction:
http://www.scala-lang.org/archives/downloads
Sweet. Thanks Stuart, I had never heard of ST before but now I've read some
of the professors papers... I'm in!
Op vrijdag 28 augustus 2009 16:39:07 UTC+2 schreef Stuart Sierra het
volgende:
>
> My recommendation would be to keep your localized strings separate
> from your source code, either i
Wondering if anyone can give me some pointers with this, as I dive into
logic programming. Or point me to a more appropriate forum, if this is the
wrong one. I know a lot of you have been trying out core.logic.
It was all going well until chapter four. The story so far: introduce some
simple fu
I'm currently working on a book on concurrent/parallel development for The
Pragmatic Programmers. One of the subjects I'm covering is parallel programming
in Clojure, but I've hit a roadblock with one of the examples. I'm hoping that
I can get some help to work through it here.
The example coun
I'm writing a generic database API, and would love some advice on how you
think it should handle field types. Let me give a little background.
My project's goal is to offer a single, simplified, Clojure-friendly API
for most of your data persistence needs, so that:
- you can easily use it in idio
Another solution, repeats itself slightly less:
(assoc obj
:key (or (:key obj)
(something-else-with-side-effects-maybe?)))
Not sure I like it much better than the first one. But I usually prefer not
writing my own macros/functions when I can avoid it, so it has that plus.
On Sat, M
I just realised you can also do this to get the same effect of
pred-transform...This is the first time I'm using cond->! I'm starting
to realise its usefuleness... :)
(let [rpred (complement pred)]
(cond-> obj
(pred obj) identity ;;if true return it untouched
(rpred obj) t
Here's my solution to your problem. Let me know if it helps.
```
user> (defn if-attr [-key obj missing]
(if-let [ret (get obj -key)] ret (assoc obj -key missing)))
#'user/if-attr
user> (if-attr :abc {} "missing-value")
{:abc "missing-value"}
user> (if-attr :abc {:abc 123} "missing-value")
1
yep that was interesting thanks btw; it was a function that was acting like
a macro, how odd
On Sat, May 25, 2013 at 4:26 PM, Jim - FooBar(); wrote:
> so maybe a let + gensym would be in order?
>>
>
>
> yes that is what you do to avoid double-evaluation...:) I was making a
> different point thou
so maybe a let + gensym would be in order?
yes that is what you do to avoid double-evaluation...:) I was making a
different point though, the fact that definline produces a first class
fn which still expands like a macro.
Jim
--
--
You received this message because you are subscribed to t
Seems like I almost want arbitrary or-like behavior, like
only-sometimes-evaluation of a conditional form.
I feel like this could have something to do with lazy sequences, since
technically has the option of never getting evaluated. We could use map.
Will test some things out in nrepl.el and retu
Are you bumping the version number or are you just trying to overwrite an
existing artefact with the same version?
When not using SNAPSHOT dependencies, you should always bump the version
number when releasing a new artefact. That way, a
groupid/artifactid/version triple will unambiguously refer t
(update-in obj [:attr] #(or %1 %2) something)
(cond-> obj (not (:attr obj)) (assoc :attr something))
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members
If the condition is true of the transformed object (e.g., it's "if this
condition isn't met, use this method to massage it so it is"), then there's
this:
(first (filter condition? (map #(%1 obj) [identity transformation])))
It can even use laziness to avoid the transformation, but you'll need (li
Here's how I did it, which is similar to what atkaaz and Jim were
suggesting:
(defn whenever [x applies-to? f] (if (applies-to? x) (f x) x))
(whenever obj :attr #(assoc % :attr something))
(whenever obj some-test some-transformation)
On 25 May 2013 15:19, atkaaz wrote:
>
>
>
> On Sat, May 25,
On Sat, May 25, 2013 at 3:16 PM, Steven Degutis wrote:
>
> Also I just remembered, sometimes to solve the second one, I would do ((if
> condition transformer identity) obj) but that feels ugly.
>
but the condition has to contain obj, so obj is referred twice ? otherwise
i kinda like it
>
>
> On
Thanks, that solution's pretty great, although you're right about the
side-effects problem, so I can't always use this solution.
Also I just remembered, sometimes to solve the second one, I would do ((if
condition transformer identity) obj) but that feels ugly.
On Sat, May 25, 2013 at 7:13 AM, C
Seems to me that (merge {:attr something} obj) answers the OP's question,
mentions obj only once, and is short and pithy. OTOH it computes the
"something" every time, whether it's needed or not, so in cases where
"something" is expensive to compute (or has side effects that should only
happen if it
Cedric's answer is best: either (filter :dh-uuid some-list) or (remove
:dh-uuid some-list) depending on which list you want.
On Sat, May 25, 2013 at 7:10 AM, Cedric Greevey wrote:
> Why not just (filter (complement :dh-uuid) seq-of-maps)? Or (remove
> :dh-uuid seq-of-maps) even?
>
>
> On Sat, M
I wonder why the definline didn't act like a function?
=> (defn pred-transform [obj pred tf]
(if (pred obj) obj
(tf obj)))
#'cgws.notcore/pred-transform
=> (pred-transform (println 1) #(not (nil? %)) #(println % "."))
1
nil .
nil
=> (pred-transform (println 1) nil? #(println % "."))
1
n
Why not just (filter (complement :dh-uuid) seq-of-maps)? Or (remove
:dh-uuid seq-of-maps) even?
On Sat, May 25, 2013 at 7:41 AM, sdegutis wrote:
> (def some-list
> [{:a2p-id "1", :dh-uuid "abc-def-ghi-klm"}
>{:a2p-id "2", :dh-uuid "def-ghi-klm-opq"}
>{:a2p-id "3", :dh-uuid nil}])
>
>
like:
=> (definline pred-transform [obj pred tf]
`(let [o# ~obj]
(if (~pred o#) o#
(~tf o#
#'cgws.notcore/pred-transform
=> (pred-transform (println 1) nil? #(println % "."))
1
nil
=> (pred-transform (println 1) #(not (nil? %)) #(println % "."))
1
nil .
nil
On Sat, May 25, 201
in which case it does get evaluated twice if form:
=> (pred-transform (println 1) #(not (nil? %)) #(println % "."))
1
1
nil .
nil
=> (pred-transform (println 1) nil? #(println % "."))
1
1
nil
so maybe a let + gensym would be in order?
On Sat, May 25, 2013 at 3:04 PM, atkaaz wrote:
> Shouldn'
Have you restarted the JVM that can't see the new function?
Have you checked for older copies along the classpath for that JVM?
Is Maven capable of showing an old, stale cached copy under some
circumstances? If so, find out how and flush the relevant cache.
On Sat, May 25, 2013 at 2:29 AM, Davi
Shouldn't it be like:
(definline pred-transform [obj pred tf]
`(if (~pred ~obj) ~obj
(~tf ~obj)))
=> (pred-transform 1 #(not (nil? %)) println)
1
=> (pred-transform 1 nil? println)
1
nil
On Sat, May 25, 2013 at 2:55 PM, atkaaz wrote:
> just wondering if obj is a form does it get eva
just wondering if obj is a form does it get evaluated twice?
On Sat, May 25, 2013 at 2:51 PM, Jim - FooBar(); wrote:
> no need for macros... :)
>
> (definline safe-assoc [m k v]
> `(if (contains? ~m ~k) ~m
> (assoc ~m ~k ~v)))
>
> (definline pred-transform [obj pred tf]
> `(if ~(pred obj) ~ob
didn't know about definline, thanks Jim!
On Sat, May 25, 2013 at 2:51 PM, Jim - FooBar(); wrote:
> no need for macros... :)
>
> (definline safe-assoc [m k v]
> `(if (contains? ~m ~k) ~m
> (assoc ~m ~k ~v)))
>
> (definline pred-transform [obj pred tf]
> `(if ~(pred obj) ~obj
> ~(tf obj)))
no need for macros... :)
(definline safe-assoc [m k v]
`(if (contains? ~m ~k) ~m
(assoc ~m ~k ~v)))
(definline pred-transform [obj pred tf]
`(if ~(pred obj) ~obj
~(tf obj)))
Jim
On 25/05/13 12:44, atkaaz wrote:
may I see the macro for the latter, if you decide to go that way ? thx
On
may I see the macro for the latter, if you decide to go that way ? thx
On Sat, May 25, 2013 at 2:24 PM, Steven Degutis wrote:
> There are two patterns I find in my code that I'm still unhappy with but I
> don't know how to clean up.
>
> The first is: (if (:attr obj) obj (assoc obj :attr somethi
(def some-list
[{:a2p-id "1", :dh-uuid "abc-def-ghi-klm"}
{:a2p-id "2", :dh-uuid "def-ghi-klm-opq"}
{:a2p-id "3", :dh-uuid nil}])
If you want to filter out only nil: (filter (comp (complement nil?)
:dh-uuid) some-list)
If you want to filter out nil or false: (filter (comp identity :dh-uui
On 25/05/13 12:24, Steven Degutis wrote:
The first is: (if (:attr obj) obj (assoc obj :attr something))
I'm basically saying, give this hash-map an attribute if it doesn't
already have it. And just return the thing with an attribute,
regardless if I had to add it or not.
(if (contains? obj :
can you tell what this returns?
(map find-records query-parts)
On Sat, May 25, 2013 at 2:21 PM, Mond Ray wrote:
> I am missing something obvious... I get a list of maps back from a
> function and I want to find the elements with nil
>
> (({:a2p-id "1", :dh-uuid "abc-def-ghi-klm"} {:a2p-id "2",
without giving this much thought is the % actualy a vector like [:dh-uuid
"abc-def-ghi-klm"] ?
On Sat, May 25, 2013 at 2:21 PM, Mond Ray wrote:
> I am missing something obvious... I get a list of maps back from a
> function and I want to find the elements with nil
>
> (({:a2p-id "1", :dh-uuid "
There are two patterns I find in my code that I'm still unhappy with but I
don't know how to clean up.
The first is: (if (:attr obj) obj (assoc obj :attr something))
I'm basically saying, give this hash-map an attribute if it doesn't already
have it. And just return the thing with an attribute, r
I am missing something obvious... I get a list of maps back from a function
and I want to find the elements with nil
(({:a2p-id "1", :dh-uuid "abc-def-ghi-klm"} {:a2p-id "2", :dh-uuid
"def-ghi-klm-opq"} {:a2p-id "3", :dh-uuid nil}) ({:a2p-id "1", :dh-uuid
"abc-def-ghi-klm"} {:a2p-id "2", :dh-uu
My updated approach is now like this:
(defn find-uuids [query a2p-id]
(sql/with-connection sqlserver
(sql/with-query-results rs
[query a2p-id]
(:uuid (first rs)
(defn find-records [{query :main-query from-date :from-date to-date
:to-date sub-query-fn :sub-query-fn}]
(sql/
It's another interesting Lisp variant to JavaScript compiler but besides a
surface like similarity, it doesn't really preserve many of Clojure's
semantics (keyword behavior, data structures, immutability, notion of
truth, protocols, multimethods, etc).
David
On Sat, May 25, 2013 at 1:59 AM, Rich
ok I got the command (run inside foo-two project):
mvn install:install-file
-Dfile=../foo-one/target/uberjar+provided/foo-one-0.1.0-SNAPSHOT.jar
-DgroupId=self -DartifactId=foo-one-Dversion=0.1.0
-Dpackaging=jar -DgeneratePom=true
-DcreateChecksum=true -DlocalRepositoryP
I could be wrong if it's checking the .md5 (which probably does) I should
try to update foo-one and install it in local repo, but I don't really know
the command :)
On Sat, May 25, 2013 at 11:11 AM, atkaaz wrote:
> or let me put it this way, if I touch all the files in local_mvn_repo and
> the
or let me put it this way, if I touch all the files in local_mvn_repo and
then run lein repl (or lein deps then lein repl) the newer foo-one from
local_mvn_repo is not copied to .m2 folder, ergo I'll still be using the
existing one (I assume you already have an existing one where you didn't
define
ok nevermind I guess it works anyway:
user=> (use 'foo-two.core)
nil
user=> foo-one.core/bar
#
I notice that lein copied that self/foo-one-0.1.0.jar into my .m2 folder
I wonder if somehow lein didn't do that for you and you're still using the
old one check your ~/.m2/self/ folder
On Sat, May 2
quick note: the foo-one in local_mvn_repo (inside foo_two) is just v 0.1.0
without SNAPSHOT
the foo-one project however is 0.1.0-SNAPSHOT
On Sat, May 25, 2013 at 10:00 AM, David Williams
wrote:
> This is really important, and I am totally stumped and on a deadline.
> Help is greatly appreciate
Please note, this is a duplicate post of a stackoverflow question I just
posted, Im extremely stumped and dont know what to make of this
http://stackoverflow.com/questions/16747039/clojure-major-emergency-with-import
This is really important, and I am totally stumped and on a deadline. Help
is
This is really important, and I am totally stumped and on a deadline. Help
is greatly appreciated.
I have a Clojure project called red-black, which in particular contains a
file called interval_tree.clj
I have been compiling this project with lein uberjar and then using the
resulting jar in o
60 matches
Mail list logo