Re: Anyone willing to do a tutorial on minecraft modding in clojure?

2014-09-18 Thread Jeb Beich
Is Bukkit an option? I've used https://github.com/CmdrDats/clj-minecraft.
Active project, fun and easy to use.

On Thu, Sep 18, 2014 at 4:30 AM, Hi-tech Robert 
wrote:

> Hi, I am looking for tutorial on modding minecraft 1.7.4 in clojure. There
> are plenty of tutorial that use java e.g.
> http://www.youtube.com/watch?v=e6v5egIkThk but I want to use clojure
> instead as Java is too verbose. The closest i managed to find is this
> http://metaphysicaldeveloper.wordpress.com/2012/04/20/conjcraft-a-minecraft-mod-implemented-in-clojure/
> , however it is too outdated to be useful as minecraft modding is mainly
> done with minecraft forge, a third party library these days. Forge uses a
> custom gradle build script to build the mods and I have no idea how to get
> it to work with clojure. Help would be appreciated.
>
> --
> 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 are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with writing a function to merge two maps

2014-06-17 Thread Jeb Beich
Here's what I came up with:

(require '[clojure.set :as set])
(let [->map-fn (fn [s] (->> s (map (juxt :id :val)) (into {})))
  xs-m (->map-fn xs)
  ys-m (->map-fn ys)]
  (->> (set/union (keys xs-m) (keys ys-m))
   (map (fn [k] {:id k :val (* (get xs-m k 1) (get ys-m k 1))}


On Tue, Jun 17, 2014 at 7:24 AM, Shoeb Bhinderwala 
wrote:

> Can someone help me write the following function:
>
> I have two lists of maps as inputs:
>
> (def xs [{:id 1 :val 10}
>  {:id 2 :val 20}
>  {:id 3 :val 30}
>  {:id 4 :val 40}])
>
> (def ys [{:id 2 :val 20}
>  {:id 3 :val 30}
>  {:id 5 :val 50}
>  {:id 6 :val 60}])
>
> I want to create a result zs which is the union of xs and ys, except that
> if the :id occurs in BOTH then I want to multiply the corresponding :val.
>
> The result zs should be:
>
> [{:id 1 :val 10}
>   {:id 2 :val 400}  <-- :id 2 occurs in both collections, so multiply the
> :val fields
>   {:id 3 :val 900}  <-- :id 3 occurs in both collections, so multiply the
> :val fields
>  {:id 4 :val 40}
>  {:id 5 :val 50}
>  {:id 6 :val 60}]
>
> Thanks in advance,
> Shoeb
>
>  --
> 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 are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: query on clojure maps / vectors

2014-02-13 Thread Jeb Beich
You sure this isn't what you're looking for?

https://gist.github.com/stuarthalloway/2645453


On Thu, Feb 13, 2014 at 8:34 PM, David Jagoe  wrote:

> Here's an example:
>
>
> http://www.bagdemir.com/2013/07/30/implementing-relational-algebra-in-clojure/
>
>
> On 13 February 2014 18:32, David Jagoe  wrote:
>
>> Would this work for you?
>>
>> http://clojure.github.io/clojure/clojure.set-api.html
>>
>> (in particular select for your example)
>>
>>
>> On 13 February 2014 17:27, t x  wrote:
>>
>>> Hi,
>>>
>>> Preemptive: :-)
>>>
>>>   * I'm not looking for datomic.
>>>   * I'm also not looking for sqlkorma.
>>>
>>>   * An "in-memory" data-log might be what I'm after.
>>>
>>> Context:
>>>
>>>   I'm reading:
>>> http://code.kx.com/wiki/JB:QforMortals2/tables
>>>
>>>   and it struck me -- why can't I view a clojure {vector,list} of maps
>>> as a table? I.e.:
>>>
>>>   [{:tag :animal :type :dog :age 2}
>>>   {:tag :animal :type :cat :age 4}]
>>>
>>>   then do queries on things like:
>>>
>>> "get me all vector-indices of cats' of age >= 3"
>>>
>>> Question:
>>>
>>>   Is there a library (or even a blog post) about doing sql-like
>>> querying on _in memory clojure data structures_ ?
>>>
>>> Thanks!
>>>
>>> --
>>> 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 are moderated - please be patient with
>>> your first post.
>>> To unsubscribe from this group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> --
>> David Jagoe
>>
>> davidja...@gmail.com
>> +18053284389
>>
>
>
>
> --
> David Jagoe
>
> davidja...@gmail.com
> +18053284389
>
> --
> 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 are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Need help with recursion!

2013-10-24 Thread Jeb Beich
Tweaked slightly...

(defn my-filter [pred? a-seq]
  (if (empty? a-seq)
a-seq
(if (pred? (first a-seq))
  (cons (first a-seq) (my-filter pred? (rest a-seq)))
  (my-filter pred? (rest a-seq)


On Thu, Oct 24, 2013 at 9:51 AM, Wilson  wrote:

> I am supposed to make my own filter function without using "remove". I
> have this made, but it is not working like it should be working. I don't
> have any idea what is wrong with it. Please help me out. For example, if I
> give the function the parameters odd? and [1 2 3 4]. It only returns (1),
> but it should obviously return (1 3). I don't know why it works like that.
>
> (defn my-filter [pred? a-seq]
>   (if (empty? a-seq)
> a-seq
> (if (pred? (first a-seq))
>   (cons (first a-seq)
> (my-filter (rest a-seq) '())
>
>
>  --
> --
> 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 are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Best IDE

2012-01-18 Thread Jeb Beich
Any suggestions for a vim man?

On Wed, Jan 18, 2012 at 1:29 PM, Cedric Greevey  wrote:

> On Wed, Jan 18, 2012 at 11:18 AM, Jay Fields  wrote:
> > Use emacs, if you want the path of least resistance
>
> *boggles*
>
> Say WHAT?
>
> You've got to be kidding. That's like suggesting that the path of
> least resistance in taking a trip to L.A. involves climbing the north
> face of Everest instead of using an airplane. In particular, the
> learning curve of emacs and the north face of Everest, in a shocking
> coincidence, turn out to have exactly the same geometry. :)
>
> --
> 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 are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en




-- 
Jeb Beich
http://www.red-source.net/jeb

-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Good database for local storage in Clojure

2012-01-11 Thread Jeb Beich
sqlite (www.sqlite.org) is another obvious choice, right?
On Jan 10, 2012 9:46 PM, "Sean Corfield"  wrote:

-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Destructuring syntax

2012-01-08 Thread Jeb Beich
"Joy of Clojure" adds a second reason for this:

"The second reason is because it allows us to conjure up other
destructuring features by using forms that would otherwise make no sense.
Because the item on the left of each pair will be a new local name, it must
be a symbol or possibly a nested destructuring form. But one thing it can’t
be is a keyword, unless the keyword is a specially supported feature such
as :keys, :strs, :syms, :as, and :or."

On Wed, Jan 4, 2012 at 7:20 PM, Matthew Boston wrote:

> I'm with Alex. I think of it as though it's a let binding, cause
> that's basically what's happening; the is bound to the scoped name.
>
> On Jan 4, 11:29 am, Alex Miller  wrote:
> > I had the same thought when I first started learning Clojure - I think
> > the idea is that there is some nice mental resonance when
> > destructuring matches up to your mental model of the data structure
> > (it's literal form).  In sequential destructuring, that holds but in
> > maps it doesn't so things look "backwards".  I think the way I've come
> > to understand it is that when doing a let-style binding, the thing
> > being bound is always "on the left" so when destructuring a map, you
> > specify the variable, then the key which is looked up to provide the
> > value.
> >
> > On Jan 4, 12:36 am, Johnny Weng Luu  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > One thing that seems weird is the way Clojure destructures a map
> >
> > > I have this map: {:last-name "Vinge" :first-name "Vernor"} which is
> passed
> > > to this function: (defn greet-author-2 [{fname :first-name}] ... )
> >
> > > Wouldn't it be better doing: (defn greet-author-2 [{:first-name
> fname}] ...
> > > )
> >
> > > You first type the keyword, then followed by the parameter to bind to.
> It
> > > reads that the value is bound to the parameter in the same place.
> >
> > > Feels more natural to me in a way.
> >
> > > Thoughts?
>
> --
> 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 are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en




-- 
Jeb Beich
http://www.red-source.net/jeb

-- 
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 are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en