Recent Forum Posts
From categories:
page 1123...next »
<a href="http://1yongevip.ca/r (guest) 01 May 2017 06:29
in discussion Hidden / Per page discussions » Extending Java Classes Using proxy

Finally I found a great post with interesting topic. I have read every points of this post that is really so enjoyable and I have bookmark your site for get back again here.

by <a href="http://1yongevip.ca/r (guest), 01 May 2017 06:29
Pharmk145 (guest) 21 Apr 2016 03:02
in discussion Hidden / Per page discussions » Clojure Cookbook: Numbers

Very nice site!

by Pharmk145 (guest), 21 Apr 2016 03:02
Smithc617 (guest) 14 Apr 2016 22:28
in discussion Hidden / Per page discussions » Clojure Cookbook: Numbers

Because here is a list of multiplayer games bafaeddadckaecek

by Smithc617 (guest), 14 Apr 2016 22:28
Smithb117 (guest) 11 Nov 2015 02:22
in discussion Hidden / Per page discussions » Clojure Cookbook: Numbers

Howdy! This article could not be written any better! Looking at this post reminds me of my previous roommate! He constantly kept preaching about this. I'll send this information to him. Fairly certain he's going to have a good read. Thanks for sharing! gkfedcgbeekaaadf

by Smithb117 (guest), 11 Nov 2015 02:22
Smithd800 (guest) 19 Oct 2015 04:25
in discussion Hidden / Per page discussions » Clojure Cookbook: Numbers

Hey are using WordPress for your blog platform? I'm new to the blog world but I'm trying to get started and set up my own. Do you require any coding knowledge to make your own blog? Any help would be really appreciated! febeddfeeaefefeb

by Smithd800 (guest), 19 Oct 2015 04:25
theophilusx (guest) 31 Aug 2015 22:37
in discussion Beginners' Corner / How Do I ... ? » How Do I get a map from a string

A very simple, off the top of my head as I drink my morning coffee, solution (untested)

(reduce (fn [m x]
(assoc m (keyword (first x)) (second x))) {} (partition 2 '("0" "2" "1" "5" "2" "8" "3" "15" "4" "9")))

- You could shorten the reduce function with just #(assoc %1 (keyword (first %2)) (second %2))

- keyword will only work with string input, so if your data is not strings, you will need to make some changes

- if you want your values to be numbers, you need to parse them

by theophilusx (guest), 31 Aug 2015 22:37
Paul (guest) 02 Mar 2014 17:44
in discussion Hidden / Per page discussions » Clojure Cookbook: Numbers

Hi Gregg,

Thanks for the response. I worked out a graceless solution:

0x1010101010101011 is the two's complement of 0xefefefefefefefef and (- 0x1010101010101011) has the same bit pattern as 0xef… but is still recognized as a long so (bit-xor (- 0x1010101010101011) someLongVal) returns a long. Ugly. I hope there's a more graceful solution out there.

Thanks again,

Paul

by Paul (guest), 02 Mar 2014 17:44

…this website is pretty much dead. If David Sletten (the author of this page) doesn't respond, try posting your question in the Clojure mailing list at Google or on stackoverflow.com. Sorry I can't help.

Thanks for posting but... by GreggWGreggW, 01 Mar 2014 05:25
Paul (guest) 01 Mar 2014 04:09
in discussion Hidden / Per page discussions » Clojure Cookbook: Numbers

(class 0xefefefefefefefef) returns BigInt and hence (long 0xefefefefefefefef) fails. I need to work with 8 byte bit patterns where the high order bit is 1 without having them treated as positive values that need to be promoted. Suggestions?

Many thanks,

Paul

by Paul (guest), 01 Mar 2014 04:09
Rajeev (guest) 23 Dec 2013 11:53
in discussion Hidden / Per page discussions » Clojure Cookbook

would like to see what the language can do :)

by Rajeev (guest), 23 Dec 2013 11:53
Teo (guest) 19 Jun 2013 11:05
in discussion Hidden / Per page discussions » Clojure Cookbook: Functional Programming

Hi and thanks for the tutorial/examples. I noticed a small issue in one of the examples:
In the Practical Recursion section, the function

(defn sum-vec [v]
  ([v] (sum-vec v 0 0))
  ([v i sum]
    (if (== i (count v))
      sum
      (sum-vec (inc i) (+ sum (v i)))) ))

Won't work unless changed to:

(defn sum-vec
  ([v] (sum-vec v 0 0))
  ([v i sum]
    (if (== i (count v))
      sum
      (sum-vec v (inc i) (+ sum (v i)))) ))

Regards,
Teo
by Teo (guest), 19 Jun 2013 11:05
Ryan Troxler (guest) 24 Feb 2013 05:26
in discussion Hidden / Per page discussions » Clojure Cookbook: XML/HTML Processing

Used this to help parse xml data for one of my courses.
Could have done it with Python, but wanting to find more excuses to use Clojure.
Thanks for writing this!

by Ryan Troxler (guest), 24 Feb 2013 05:26
PKHG (guest) 07 Jun 2012 16:14
in discussion Hidden / Per page discussions » Graphics

You forgot a working definition for 'round' ;-)

by PKHG (guest), 07 Jun 2012 16:14
Alex Baranosky (guest) 17 Apr 2012 01:21
in discussion Hidden / Per page discussions » Clojure Cookbook: System

Thanks David, this was just what I needed.

by Alex Baranosky (guest), 17 Apr 2012 01:21

This code does not work as I expected. Could you please explain why?

(defn make-str [s c]
    (let [my-str (ref s)]
        (dosync (alter my-str str c))))

(defn make-str-from-chars
    "make a string from a sequence of characters"
    ([chars] make-str-from-chars chars "")
    ([chars result]
        (if (= (count chars) 0) result
        (recur (drop 1 chars) (make-str result (take 1 chars))))))

Thank you!

octopusgrabbus, thanks for answering someone else's query in another forum—that's what will make this website work!

Given what I've just said, what I'm about to say won't come as a surprise. Your post above, about re-envisioning programs from other languages in Clojure, is a good one. So (and here it comes…) please feel free to do it yourself and send it in. Articles on this website will allow comments, so if somebody else has a different idea of how the program "should" be written and why, they will be able to do so.

As for a Getting Clojure magazine, for the time being, this website is the magazine. Once there's enough content, I'll create an actual magazine (PDF and/or print-on-demand) and make that available. Then when there's enough new content, I'll repeat the process.

You can send me the article directly if you want me to edit it. For instant gratification, do the following:

  1. Click the "Home" text link at the top left of this page
  2. At the bottom of the Home page, type your article title in the text box and click the "new article" button to its right.

Voila! You now have a wiki page for your article. Type in your text, click "Post it" at the bottom of the page, and your article appears on the "All articles" page, which is http://www.gettingclojure.com/system:all-articles. (Again, I can edit your article if you wish.)

Thanks again for posting—this is what will make GettingClojure.com successful!

You don't have to use Emacs. You can use any programmer's editor and make use of REPL. I'm using vim.

As to learning the Java libraries, you'll learn what the Java API does, but you'll be calling it natively from Clojure. From my learning perspective, you can obtain documentation on the Java API all over the place.

I would get one of three books, Programming Clojure and Practical Clojure to start and eventually The Joy of Clojure. O'Reilly is publishing a Clojure book that appears to be geared more towards learning Clojure's LISP-ness.

The Cookbook here is quite good, and there are lots of blogs.

Good Luck.

I think a magazine would be very helpful. In addition to a cookbook section, a section on transition to Clojure would be helpful. For example, I can read a .csv file into a Python program, and make logic decisions based on any column in that row. I would want to know the best way to approach that in Clojure.

Achoo, I'm sure you carried out the instructions perfectly. The question is not "What am I doing wrong?" The question is "What do I need to do to get this working—any ideas?", and the place to do it (for all installation problems, advanced questions, and non-simple questions about specific Clojure software packages) is the Clojure Google Group. Here's the URL: http://groups.google.com/group/clojure?hl=en

Installations never go right; this is the inevitable result of non-commercial software (with documentation of varying quality and comprehensiveness) being combined in countless permutations on at least three different OS platforms. Nine months ago, it took me almost two weeks to get SLIME running. Now, things are much better…but these things will still happen.

I've got something older working, and I'm not touching it. I connect via M-x slime-connect, so your error message re. lein-jack-in is unfamiliar to me. So good luck! Google the error message first, and if that doesn't work, try posting on the Clojure Google Group. You can get these things working, but it takes perseverence (ask me how I know).

Who needs puzzle games? I install open-source software!

page 1123...next »
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License