Re: Why we cannot do this now?
I just wanted to raise my hand as a developer who rarely uses a long-lived REPL and is glad that startup time is a priority. (I've been doing Lisp for decades and have done lots of the long-lived REPL style of development, so I know the tradeoffs involved.) John On Mon, Jun 20, 2016 at 1:51 PM, Gregg Reynoldswrote: > +1 > On Jun 20, 2016 3:41 PM, "Sean Corfield" wrote: > >> On 6/19/16, 4:11 PM, "Sungjin Chun" > of chu...@castlesoft.co.kr> wrote: >> > yes, I found that java -jar clojure.jar thing is very fast compared to >> boot repl >> >> It’s probably worth pointing out here that most developers’ typical >> workflow involves starting up a REPL and then just leaving it running for a >> long time so they don’t have to deal with the startup time very often. See >> things like Component et al and various people talking about the “Clojure >> Reloaded Workflow” in blog posts and conference talks. >> >> I use Emacs + CIDER and probably only start up a REPL two or three times >> a week. The rest of the time, I’m just eval’ing into an existing REPL >> process. >> >> Sean Corfield -- (904) 302-SEAN >> An Architect's View -- http://corfield.org/ >> >> "Perfection is the enemy of the good." >> -- Gustave Flaubert, French realist novelist (1821-1880) >> >> >> >> >> >> -- >> 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. > -- 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.
ANN: turboshrimp 2.0.2, for control of Parrot AR.Drone
I've released a new version of turboshrimp, my library to control the Parrot AR.Drone. https://github.com/wiseman/turboshrimp Version 2.0.2 includes the following: - A more consistent API. E.g., instead of (drone/command drone :animate :flip-left) to make the drone do a flip in mid-air, you can use (drone/animate :flip-left). - Much more comprehensive documentation at http://wiseman.github.io/turboshrimp/, including an example of how to process a drone's video stream with a latency reduction queue. Turboshrimp is compatible with clojure-android. https://github.com/wiseman/shrimpdroid is a complete android app that you can use to fly a drone. -- 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: ANN Langohr 3.4.2 is released
(Michael, thanks for putting an excellent summary of what each of your libraries is and does as the first sentence of your announcements. I see a lot of messages posted to this mailing list announcing a new version of tardiquox or turboshrimp or pluus that forget to mention what it actually is.) On Sun, Dec 20, 2015 at 8:22 AM, Michael Klishin < michael.s.klis...@gmail.com> wrote: > Langohr [1] is a minimalistic feature complete Clojure client for RabbitMQ. > > Release notes: > http://blog.clojurewerkz.org/blog/2015/12/20/langohr-3-dot-4-2-is-released/ > > 1. http://clojurerabbitmq.info > -- > MK > > http://github.com/michaelklishin > http://twitter.com/michaelklishin > > -- > 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: [ANN] Gorilla REPL v0.3.5
> * Update to support CIDER-nrepl version 0.9.1. This is the part I'm most excited about :) Thanks, Jony! On Wed, Nov 25, 2015 at 10:43 AM, Fergal Byrnewrote: > Great to hear Jony. You wouldn't believe the diversity of projects using > this for exposition and explanation, and the stack trace is going to make a > big difference. Hats to you and all your contributors. > > -- > > Fergal Byrne, Brenter IT > > Author, Real Machine Intelligence with Clortex and NuPIC > https://leanpub.com/realsmartmachines > > Speaking on Clortex and HTM/CLA at euroClojure Krakow, June 2014: > http://euroclojure.com/2014/ > and at LambdaJam Chicago, July 2014: http://www.lambdajam.com > > http://inbits.com - Better Living through Thoughtful Technology > http://ie.linkedin.com/in/fergbyrne/ - https://github.com/fergalbyrne > > e:fergalbyrnedub...@gmail.com t:+353 83 4214179 > Join the quest for Machine Intelligence at http://numenta.org > Formerly of Adnet edi...@adnet.ie http://www.adnet.ie > > > On Wed, Nov 25, 2015 at 6:39 PM, Jony Hudson > wrote: > >> There's a new release of Gorilla REPL available on Clojars. The biggest >> change - which should make the lives of students of Clojure a tiny bit >> better - is that exceptions are now displayed with their stack traces >> (thanks to cider-nrepl's stacktrace middleware). There are a number of >> other smaller fixes and enhancements. Thanks to all that contributed :-) >> >> From the changelog: >> >> ## Version 0.3.5 >> >> - AT LAST: exceptions show stacktraces! >> - Serve resources from less generic location to avoid clashing with project >> files. >> - Port files are now configurable (thanks to @mattexx). >> - Separate out handlers from embedded HTTPKit to ease embedding (thanks to >> @deas). >> - Make URLs relative to support easier embedding (thanks to @deas). >> - Viewer properly supports non-ASCII text. >> - Update to support CIDER-nrepl version 0.9.1. >> - Large worksheets (>8MB) now save successfully. >> - Can view worksheets hosted on BitBucket (thanks for @tbrx). >> - Command to delete output from the worksheet (thanks to @dasmoth). >> >> >> Enjoy! >> >> >> Jony >> >> -- >> 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. > -- 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.
ANN: clj-pronouncing
I ported Allison Parrish's Pronouncing python library, an interface to the CMU Pronouncing Dictionary, to clojure: https://github.com/wiseman/clj-pronouncing You can use it to count syllables, find rhymes, etc.: user (require '[com.lemonodor.pronouncing :as pro]) user (- literally pro/phones-for-word (map pro/syllable-count)) (4 3) ;; Some people say it with 4 syllables, some with 3. user (require '[com.lemonodor.pronouncing :as pro]) user (pro/rhymes failings) (mailings railings tailings) I use it in songku, which finds haiku in song titles: https://songku.herokuapp.com/ John -- 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: Using :refer 'sparingly'
There's a close parallel in Python, where the same issue comes up of typically using several modules or packages in a source file and the language offers a way to import the functions and classes of those modules in such a way that they can be used without any syntactic marker of their origin. For years I've used the Google style guideline https://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Imports which says Use imports for packages and modules only, as distinct from functions, classes, etc., and the justification is The source of each identifier is indicated in a consistent way; x.Obj says that object Obj is defined in module x. I've found that when reading code that I haven't written it lowers the friction for understanding just a little bit but that's multiplied by roughly the number of names in the source code. It makes it (mostly) self-evident whether an identifier names a concept from the file I'm looking at, or somewhere else. And if it's from somewhere else, it says right there where that other place is. It's a significant advantage and I think the same advantage applies to clojure source code. On Sun, May 17, 2015 at 8:28 AM, Colin Yates colin.ya...@gmail.com wrote: As stated in the article, I find the extra context of using :as aids maintenance more than you might expect. The only time I use refer is if the referred vars are conceptually owned, or the context is implicit by the name space using them. For me it is about responsibility and ignorance. :as implies distance/ignorance, :refer implies closeness/knowledge. A concrete example, in my use-case tests I refer most vars from clojure.test for convenience but the thing being tested is aliased as 'sut'. I could swallow referring the forms being tested in the test case as well but I am used to the convention of 'sut' (subject under test). On 17 May 2015 at 16:23, Akiva akiva.sch...@gmail.com wrote: Makes sense. I guess my other question then would be if there are any benefits to using :refer along with :as. :A. Stuart Sierra May 17, 2015 at 10:21 AM via Postbox Just like the rest of the article, it's about readability. With `:refer` you don't know where a symbol came from when you encounter it in the middle of the code. –S On Sunday, May 17, 2015 at 4:05:14 PM UTC+1, Akiva Schoen 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 --- 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. Akiva May 17, 2015 at 10:04 AM via Postbox In Stuart Sierra's article here (http://stuartsierra.com/2015/05/10/clojure-namespace-aliases), he recommends to use :refer sparingly but doesn't explain why this is a good idea. Only thing I could think of without putting too much effort into it is that it makes it slightly more tedious when you want to use a function from a namespace that hasn't been already explicitly referred. Are there no benefits other than possibly excluding function names that might otherwise suffer a namespace clash (assuming their namespace isn't being aliased already)? Thanks, Akiva -- Sent from Postbox -- 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
Re: Generating .clj files with content
Since I'm not sure what your purpose is, I'll also mention yasnippet for emacs, which is a general-purpose template system for generating pieces of text, but there are sets of clojure templates like https://github.com/swannodette/clojure-snippets Basically you create a file in the right place that looks like this: #name: ns # -- (ns `(clojure-expected-ns)` $0 (:require []) (:import ())) (set! *warn-on-reflection* true) And then when you type n s TAB you get something like this, with the point inside the empty docstring: (ns com.lemondronor.orbital-detector.airportdata (:require []) (:import ())) (set! *warn-on-reflection* true) John On Wed, Apr 8, 2015 at 10:54 AM, Michael Blume blume.m...@gmail.com wrote: What James said -- if you want the results to be human readable, if you want control of how it's formatted, if you want to be able to comment it, if you want people to use it as a starting point for code they're going to write, then check out the punctions in https://github.com/technomancy/leiningen/blob/master/src/leiningen/new/templates.clj -- if not, pr-str will do you fine. On Wed, Apr 8, 2015 at 10:25 AM James Reeves ja...@booleanknot.com wrote: On 8 April 2015 at 14:20, Sven Richter sver...@googlemail.com wrote: I want to create clojure source files with some code and a namespace and everything else what is useful for some source code. What I am looking for is a templating language for clojure code, is there something like this already? What would be the most idiomatic way to do that besides just writing strings into a file? What's the purpose? If it's just to generate some Clojure code that will never be read by a human, then you can use Clojure's backtick syntax with the pr-str function. If it's to generate human-readable code, then you're probably best using a text templating language. You may also want to look at Leiningen templates or lein-generate. - James -- 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. -- 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: [ANN] Contrail: interactive tracing
That looks interesting, thanks. I've been missing the convenience of the ACL- and SBCL-style function tracing--mostly the ability to redefine functions without having to re-trace them. On Mon, Apr 6, 2015 at 9:56 AM, Eli Naeher e...@naeher.name wrote: https://github.com/enaeher/contrail Contrail is a tool for interactive function tracing. It's similar in purpose to clojure.tools.trace, but has some additional features which I found myself wanting (many inspired by SBCL's trace): * Control over what the trace output looks like and where it goes * Control over whether and when lazy sequences are realized by the trace machinery * Conditional tracing, with helpers for common use cases * Tracing for a limited number of calls * Re-compiling a file doesn't blow away trace state for the vars defined there This version (0.2.0) is its initial public release. Thank you, -Eli -- 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: [ANN] leaflet-gorilla 0.1.2 released with GeoJSON support
FYI I only first used PostGIS a few days ago, so it's not hard to at least get started with the basics. John On Thu, Apr 2, 2015 at 9:39 AM, Jony Hudson jonyepsi...@gmail.com wrote: This is lovely. Am now inspired to get around to learning PostGIS over the easter break! Jony On Wednesday, 1 April 2015 23:19:31 UTC+1, John Wiseman wrote: I've add GeoJSON support to leaflet-gorilla, which makes it easy to use with PostGIS. Example worksheet online (the PostGIS example is at the bottom): http://viewer.gorilla-repl.org/view.html?source=github; user=wisemanrepo=leaflet-gorillapath=example-worksheet.cljw Code: https://github.com/wiseman/leaflet-gorilla I've also attached a screenshot showing a GeoJSON example. John [image: Inline image 1] -- 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: [OT?] Best DB/architecture for n-gram corpus?
OK, I see. Well, on non-trivially sized corpora, I think storage requirements can become an issue, and in a situation where you're handling user queries one might wonder how often someone will query a 10-gram. But if you can make it work, go nuts! For a lot of statistical language modeling there seems to be a sweet spot at the 3-gram point. I feel like I even saw a paper recently that compared different human languages and concluded something about the importance of trigrams, but I can't find it now. On Tue, Mar 10, 2015 at 10:58 AM, Sam Raker sam.ra...@gmail.com wrote: I more meant deciding on a maximum size and storing them qua ngrams--it seems limiting. On the other hand, after a certain size, they stop being ngrams and start being something else--texts, possibly. On Tuesday, March 10, 2015 at 1:29:44 PM UTC-4, John Wiseman wrote: By hard coding n-grams, do you mean using the simple string representation, e.g. aunt rhodie as the key in your database? If so, then maybe it helps to think of it from the perspective that it's not really just text, it's a string that encodes an n-gram just like [\aunt\, \rhodie\] is another way to encode an n-gram--the encoding/decoding uses clojure.string/join and clojure.string/split instead of json/write and json/read, and escaping tokens that contain spaces is on your TODO list at a low priority :) (And I think the Google n-gram corpus https://catalog.ldc.upenn.edu/LDC2006T13 uses the same format.) John On Mon, Mar 9, 2015 at 7:09 PM, Sam Raker sam@gmail.com wrote: That's interesting. I've been really reluctant to hard code n-grams, but it's probably the best way to go. On Monday, March 9, 2015 at 6:12:43 PM UTC-4, John Wiseman wrote: One thing you can do is index 1, 2, 3...n-grams and use a simple fast key-value store (like leveldb etc.) e.g., you could have entries like aunt rhodie - song-9, song-44 woman - song-12, song-65, song-96 That's basically how I made the Metafilter N-gram Viewer http://mefingram.appspot.com/, a clone of Google Books Ngram Viewer https://books.google.com/ngrams. Another possibility is using Lucene. Just be aware that Lucene calls n-grams of characters (au, un, nt) n-grams but it calls n-grams of words (that the, the old, old gray) shingles. So you would end up using (I think, I haven't done this) the ShingleFilter https://lucene.apache.org/core/4_2_0/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html . You might also find this article by Russ Cox interesting, where he describes building and using an inverted trigram index: http://swtch.com/~rsc/regexp/regexp4.html John Three things that you might find interesting: Russ Cox' explanation of doing indexing and retrieval with an inverted trigram index: http://swtch.com/~rsc/regexp/regexp4.html On Sat, Mar 7, 2015 at 3:22 AM, Matching Socks phill...@gmail.com wrote: A lot of guys would use Lucene. Lucene calls n-grams of words shingles. [1] As for architecture, here is a suggestion to use Lucene to find keys to records in your real database. [2] [1] https://lucidworks.com/blog/whats-a-shingle-in-lucene-parlance/ [2] https://groups.google.com/d/msg/datomic/8yrCYxcQq34/GIomGaarX5QJ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@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+u...@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+u...@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 clo...@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+u...@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+u...@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
Re: [OT?] Best DB/architecture for n-gram corpus?
By hard coding n-grams, do you mean using the simple string representation, e.g. aunt rhodie as the key in your database? If so, then maybe it helps to think of it from the perspective that it's not really just text, it's a string that encodes an n-gram just like [\aunt\, \rhodie\] is another way to encode an n-gram--the encoding/decoding uses clojure.string/join and clojure.string/split instead of json/write and json/read, and escaping tokens that contain spaces is on your TODO list at a low priority :) (And I think the Google n-gram corpus https://catalog.ldc.upenn.edu/LDC2006T13 uses the same format.) John On Mon, Mar 9, 2015 at 7:09 PM, Sam Raker sam.ra...@gmail.com wrote: That's interesting. I've been really reluctant to hard code n-grams, but it's probably the best way to go. On Monday, March 9, 2015 at 6:12:43 PM UTC-4, John Wiseman wrote: One thing you can do is index 1, 2, 3...n-grams and use a simple fast key-value store (like leveldb etc.) e.g., you could have entries like aunt rhodie - song-9, song-44 woman - song-12, song-65, song-96 That's basically how I made the Metafilter N-gram Viewer http://mefingram.appspot.com/, a clone of Google Books Ngram Viewer https://books.google.com/ngrams. Another possibility is using Lucene. Just be aware that Lucene calls n-grams of characters (au, un, nt) n-grams but it calls n-grams of words (that the, the old, old gray) shingles. So you would end up using (I think, I haven't done this) the ShingleFilter https://lucene.apache.org/core/4_2_0/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html . You might also find this article by Russ Cox interesting, where he describes building and using an inverted trigram index: http://swtch.com/~rsc/regexp/regexp4.html John Three things that you might find interesting: Russ Cox' explanation of doing indexing and retrieval with an inverted trigram index: http://swtch.com/~rsc/regexp/regexp4.html On Sat, Mar 7, 2015 at 3:22 AM, Matching Socks phill...@gmail.com wrote: A lot of guys would use Lucene. Lucene calls n-grams of words shingles. [1] As for architecture, here is a suggestion to use Lucene to find keys to records in your real database. [2] [1] https://lucidworks.com/blog/whats-a-shingle-in-lucene-parlance/ [2] https://groups.google.com/d/msg/datomic/8yrCYxcQq34/GIomGaarX5QJ -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@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+u...@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+u...@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. -- 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: [OT?] Best DB/architecture for n-gram corpus?
One thing you can do is index 1, 2, 3...n-grams and use a simple fast key-value store (like leveldb etc.) e.g., you could have entries like aunt rhodie - song-9, song-44 woman - song-12, song-65, song-96 That's basically how I made the Metafilter N-gram Viewer http://mefingram.appspot.com/, a clone of Google Books Ngram Viewer https://books.google.com/ngrams. Another possibility is using Lucene. Just be aware that Lucene calls n-grams of characters (au, un, nt) n-grams but it calls n-grams of words (that the, the old, old gray) shingles. So you would end up using (I think, I haven't done this) the ShingleFilter https://lucene.apache.org/core/4_2_0/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html . You might also find this article by Russ Cox interesting, where he describes building and using an inverted trigram index: http://swtch.com/~rsc/regexp/regexp4.html John Three things that you might find interesting: Russ Cox' explanation of doing indexing and retrieval with an inverted trigram index: http://swtch.com/~rsc/regexp/regexp4.html On Sat, Mar 7, 2015 at 3:22 AM, Matching Socks phill.w...@gmail.com wrote: A lot of guys would use Lucene. Lucene calls n-grams of words shingles. [1] As for architecture, here is a suggestion to use Lucene to find keys to records in your real database. [2] [1] https://lucidworks.com/blog/whats-a-shingle-in-lucene-parlance/ [2] https://groups.google.com/d/msg/datomic/8yrCYxcQq34/GIomGaarX5QJ -- 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: Architectural doubts
One trick I've used to speed up use of gloss is to use a lazy map so I only actually parse a piece of data if I need to. In my particular application this was an easy optimization because I was parsing a tagged data format, and I could do minimal parsing just to determine the tag of the next chunk of data, and then build a lazy map entry that used a gloss codec specific to that tag. I was also lucky that in most cases only a few tags are of interest to anyone, so I was able to avoid lots of parsing overhead. Without this optimization gloss might have been too slow for my purposes, which is unfortunate. On Sat, Jan 31, 2015 at 6:52 AM, Timothy Baldridge tbaldri...@gmail.com wrote: Since the data you are handing to the datomic query engine is un-indexed, portions of the query will effectively be O(n). However if you do as Jan suggests and put the data into Datomic the data will automatically indexed several ways. Then when you query against the datomic db, the engine will pick up on these indexes and your queries could be much faster. In addition, Datomic has some rather advanced caching logic that should help with data usage if you are writing the data to a transactor (i.e. using the in-memory storage won't help much here, use free or dev storage). Timothy On Sat, Jan 31, 2015 at 5:53 AM, Jan-Paul Bultmann janpaulbultm...@googlemail.com wrote: Why not stream frames directly into the datomic db as they fall out of gloss? This should be faster at query time anyhow due to indexes, and let's datomic handle the memory management. cheers Jan On 31 Jan 2015, at 11:39, Milton Silva milton...@gmail.com wrote: While using wireshark to analyse libpcap files (= 200 MB) I routinely think that it would be great to preform relational queries but, wireshark only supports search. I thought I would decode the entire file, hold it in memory as clojure data structures and use datomic's datalog. Besides relational queries, a requirement is for the file to be decoded (libpcap, ethernet-II, IP, TCP, diameter) in less then a minute(for a 200MB) and the typical queries should also be less than a minute. I thought the frames could be represented like this: {:frame-id 1 :timestamp java's instant-object :src-mac string :dest-mac string :src-ip :dest-ip ... ...} {:frame-ids [1 3] :diameter-session-id ...} So, I started by using gloss to decode a 200MB file. Gloss is fantastic to specify frames but, it is not meeting the time requirements. It appear the problem has to do with the creation of a lot of objects. Even with 3G of ram for the heap, it still crawls to a halt. I could try to perform some experiments to determine approximate answers but, I think it is better to talk with people with more experience in order to avoid common pitfalls.. My questions are: Will the JVM (with 3G) support a million hashmaps like the above? Is Buffy able to do something like what I want? Will datomic be able to handle this use case? What would you suggest to solve this(e.g. don't use clojure data structures.. but then datomic's datalog is not available to query?)? -- 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. -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- 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
Re: [ANN] Amazonica: Clojure client for the entire AWS api
I just wanted to say that while amazonica is also my AWS library of choice, and I'm so glad it exists, and running code wins, I also run into all the same issues that Greg listed. On Thu, Nov 20, 2014 at 12:32 PM, Greg Mitchell metroidphr...@gmail.com wrote: Thanks for creating this library, Michael. Your solutions for writing the library are creative for sure, and this library has helped with developing with AWS. However, I've been using the amazonica library to communicate with AWS components in an enterprise-scale project for about a year now, and I've come to believe that some of the design choices in the library and its maintenance are big anti-patterns. All of these are things I've struggled with in developing against Amazonica: * The documentation is sparse and the code is not self-documenting. Clojure in general tends to have worse and less documentation than Java. This is usually mitigated in well-designed Clojure libraries by being able to break into the source and read short, comprehensible functions with descriptive names. Amazonica is in the worst of both worlds by having no documentation in source, sparse documentation on github, and using dynamically generated code. Specific improvements to documentation I'd love to see: a comprehensive list of keys that credential maps and functions take as well as their valid values. The one or two examples per API on Github are insufficient for different combinations of functionality in real-world use cases. Pointing to AWS javadoc is not sufficient because Amazonica does name-munging and unwrapping - in order to understand the Amazonica input/output, you have to be an expert with the library and look at the implementation for name-munging. It is effectively a new API. A comprehensive list of functions would be nice, but finding them at the repl is a reasonable work around. * Dynamically generating an API doesn't save anyone time This is an extension of the previous point. You have almost 800 lines of code, mostly dedicated to reflection and interning methods. It's impressive that the whole thing works as well as it does, but doesn't actually save time vs. explicitly targeting an API with small wrapper functions. That has the benefit of being very obvious and easy to understand (as described above). It does mean you have to do some work when the Java SDK changes or you add a client, but I see there is already some nasty logic to switch on the client class if it has a different interface. There's a performance cost in reflection too. * Functions are both variadic and dispatch on argument type Especially without clear javadoc style documentation for function arguments, types, and keys, having functions that take a smorgasborg of different arguments is incredibly confusing. I think the root of this problem is the choice to make the client methods variadic, because then there can't be well-specified arities for the various cases (no credentials or arguments, credential map, just arguments, credential map and arguments), using repl. If the functions instead had 0, 1, and 2 arities that took nothing, an argument map, or a credential map and an argument map, it would be so much clearer. Also argument maps are generally a little easier to work with than destructuring the rest. * There are no releases or tags on github My company has a tedious process for importing third-party packages into source control. It's not ideal, but I'm sure it's not unique. It would be great to be able to pull in a stable release built against well-specified versions of dependencies. I hope this doesn't come across as harsh, that's not my intent. I really do appreciate you writing this library, and I realize that given how mature it is, completely changing the implementation is probably unfeasible. I just want to raise these concerns and see whether other people share them. If so, maybe they can serve as patterns or anti-patterns for future libraries. -Greg Mitchell On Monday, March 25, 2013 2:51:42 PM UTC-7, Michael Cohen wrote: Curious to hear opinions on this: https://github.com/mcohen01/amazonica -- 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
Re: Eastwood the Clojure lint tool version 0.2.0
Excellent, thank you. The unwieldy default output format was the main thing stopping me from investigating eastwood. On Tue, Nov 18, 2014 at 8:41 AM, Andy Fingerhut andy.finger...@gmail.com wrote: Eastwood is a Clojure lint tool. It analyzes Clojure (on the JVM) source code, reporting things that may be errors. Installation instructions are in the documentation here: https://github.com/jonase/eastwood#installation--quick-usage Updates since the last release are described in the change log here: https://github.com/jonase/eastwood/blob/master/changes.md#changes-from-version-015-to-020 My #1 favorite change in this release was probably the simplest one to make: change the default output format for warnings so they are 1 per line, FILE:LINE:COL: MSG, a format used by Emacs and Vim from other compilers and they have special modes for quickly stepping from one warning to the next in one window, while jumping to the file/line/column specified in another. Very handy. I should have done it months ago. See [1] for details. If anyone wants to help add instructions are a different file format for other text editors, please email me or open an issue on GitHub. There has been significant effort put into making the Eastwood docs informative. If you get a warning and it is not obvious what it means, I encourage you to go to [2], then click on the [more] link for the linter in question. This takes you to what is often a page or more of text describing the warning, why it occurs, and sometimes suggestions on what you can do about it. A few of the other bigger changes made were: - Enhanced :suspicious-expression linter so it always uses macroexpanded forms, not original source forms. Thus it no longer produces incorrect warnings for expressions using - or - like (- 1 (= 1)), as it used to. - New linter :constant-test that warns when a test expression in an if, cond, if-let, etc. is obviously a constant, or a literal collection that will always evaluate as true. - New linter :unused-meta-on-macro that warns when metadata is used to annotate a macro invocation, but the Clojure compiler will ignore it because it is discarded during macro expansion. - New linter :unused-locals that warns when a let binds values to symbols, but those symbols are never used. Disabled by default. Go squash some bugs! Jonas Enlund, Nicola Mometto, and Andy Fingerhut [1] https://github.com/jonase/eastwood#editor-support [2] https://github.com/jonase/eastwood#whats-there -- 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: Programmable drones with Clojure/Java support?
Hi, JPH. I'm interested in clojure + drones too. I'll try to describe the relevant parts of the current landscape as I see it. Unless you're writing your own firmware, at the moment most higher level drone programming is done with libraries that communicate with a remote drone, over a comms link: - clj-drone https://github.com/gigasquid/clj-drone. The Clojure library by Carin Meier/gigasquid that speaks the AR.Drone protocol. Includes some computer vision (with OpenCV) and belief-oriented programming. - turboshrimp https://github.com/wiseman/turboshrimp. My fork of clj-drone. Fewer dependencies (OpenCV is not required) and can run on Android. Focuses more on drone control/protocol without mixing in higher level concepts like belief-oriented programming. Supports receiving telemetry data from AR.Drone, like altitude, speed, heading, GPS location, onboard vision capabilities (marker identification), etc. - mavjava https://github.com/geeksville/arduleader/tree/master/thirdparty. A Java library that implements the MAVLink protocol, which is the currently the leader in the open drone communications protocol category. MAVLink is spoken by a lot of different drone systems including APM Autopilot/Arducopter/Arduplane http://ardupilot.com/ by 3D Robotics and PIXHAWK/PX4 https://pixhawk.ethz.ch/ by ETH. The AR.Drone supports a subset of MAVLink. - Drone API http://dev.ardupilot.com/wiki/droneapi-tutorial/. This is a Python library that speaks MAVLink but provides higher-level functionality for management of waypoints, etc. It's Python, but is relevant because MAVLink is a rather low-level, somewhat annoying protocol and this code will be useful to look at if you want to build higher level abstractions on top of MAVLink. The AR.Drone is a fun platform because the API is easy, the drone itself has a lot of functionality (video, wifi, GPS) and can be flown indoors. It usually just works. It has an ARM CPU running Linux and has USB, which makes it easy to cross-compile your own code, run it on-board, and interface to other hardware. E.g. see these experiments with connecting a software defined radio to the drone so it can pick up aircraft transponders: Augmented Reality Display of Air Traffic for Drones http://lemondronor.com/blog/indexphp/2013/5/augmented-reality-display-of-air-traffic-for-drones and Cheap ADS-B on Amateur Drones http://lemondronor.com/blog/indexphp/2013/4/cheap-ads-b-on-amateur-drones. The AR.Drone is limited by wifi range and payload capability, and it is closed software and hardware. APM Autopilot is the current leader of open source drone hacking. It runs on lots of different drone platforms (including the AR.Drone) and is open hardware and software. The comms links are typically 1 km/line of sight, and there are a variety of payloads available. The software is very capable, though it's not always stable. The development process is maturing, but it still has a way to go (today's announcement of the creation of the Dronecode foundation https://www.dronecode.org/about is a good sign). It uses the NuttX OS on really limited hardware (168 MHz Cortex M4F CPU w/ 256 KB RAM, compared to the AR.Drone's 1 GHz ARM Cortex A8 w/ 1 GB RAM), which is annoying, though they have just started experimenting with a port to Linux on a Beaglebone Black. An example of some awesome hacking using APM is the search rescue work done by CanberraUAV http://canberrauav.org.au/2014-uav-challenge/. The PX4FMU autopilot is by the same group that came up with the PX4 hardware that APM Autopilot currently uses, and while it's probably not as mature as APM it seems to have a lot of potential. My current project is porting this demo I did last year of voice control of an AR.Drone, using Python running on a laptop, to clojure running on an Android phone: https://www.youtube.com/watch?v=uhBa11gdbeU John On Mon, Oct 13, 2014 at 8:20 PM, JPH j...@hackworth.be wrote: I watched Carin Meier's great talk last year at OSCon on The Joy of flying robots with Clojure (http://www.youtube.com/watch?v=Ty9QDqV-_Akhtml5=1), and seen her work on clj-drone (https://github.com/gigasquid), and have wanted a hackable drone ever since. I'm now in a position to purchase one, and was wondering what the options were if I wanted a programmable drone (ideally with Clojure). The Google namespace for clojure drone is dominated by clj-drone, which is designed for AR Parrot (http://ardrone2.parrot.com/), but my searches haven't found much else. Are there any / many alternatives to AR Parrot if I want to program one in Clojure/Java? JPH -- 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
Re: [ANN] Marginalia 0.8.0 and lein-marginalia 0.8.0 released (now supports javascript literals)
Two quick questions: 1. Are there change/release notes anywhere? 2. What are some of the things that have come out recently that will make this library easier to maintain? On Thu, Sep 4, 2014 at 8:24 AM, Gary Deer gdee...@gmail.com wrote: Please update your profiles.clj to point to lein-marginalia 0.8.0 I'd like to thank Fogus for his guidance through my first time maintaining a library people actually use. It's been a fun learning experience. I'd also like thank Murphy McMahon (pandeiro) for the help with adding support for javascript literals. His patch was a lot quicker to get into production than my attempt at swapping out the parser entirely. Eventually I'll start taking advantage of all of the new things that have come out recently that will make this library easier to maintain, but for now, I'm just glad it doesn't break on clojurescript projects. I'd also like to thank benjamin-bader and Kevin Neaton (neatonk) for their contributions as well. -- 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: What to use for serializing reference types?
Interestingly, it looks like early versions of clojure.pprint had *print-circle* to handle printing of cyclic data structures: http://clojuredocs.org/clojure_contrib/clojure.contrib.pprint/*print-circle* Maybe something along the lines of Common Lisp's reference syntax was considered and rejected? E.g. #1=(1 2 3 . #1#) On Sun, Aug 10, 2014 at 11:36 AM, MS 5lvqbw...@sneakemail.com wrote: I'm trying to write an EE schematic capture program in clojure. I'd like to be able to define a prototype component, say a resistor with value=10k, then be able to instantiate that many times, with each instance having an additional property such as a name string. It's easy to ensure (identical? (proto instance1) (proto instance2)) returns true while in-memory, however I'm not sure how to write this out to disk. It seems the serialization libraries, print-dup, edn, etc., operate on values, so reading the database back in won't guarantee it's really the same object. I'd like to have the thing defined *once* then instantiated many times, and have this captured in the on-disk version. Am I barking up the wrong tree? ie, given immutable data structures, there's kind of no point in doing this. I'm actually trying to save disk space, so I'd like to be able to refer in a few characters a potentially large structure that was defined earlier. It would also be nice to have this be human readable. Would one of the JSON serializers do this for me? -- 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: Instaparse - thank you!
Yes, instaparse is awesome. (I use it to parse the grammar definitions of my own natural language parser, which is a little funny). On Thu, Jun 12, 2014 at 4:23 PM, Daniel Kersten dkers...@gmail.com wrote: I started playing with Instaparse recently too and its by far the nicest parsing library I've used (after having used a few in C++, Java and Python over the years). It makes parsing a pleasant and fun experience :) So: Thank You Mark! On 12 June 2014 03:43, Devin Walters dev...@gmail.com wrote: I think it's annularly understood that Mark is the bee's knees. Thanks for the fantastic, well-documented instaparse. It's saved me a *lot* of time to date, and it taught me a lot about parsers. Honorable mention to Sean Corfield for starting this thread and being such a model member of the community for what is shaping up to be the better part of a decade. Crazy, but true. Oh yeah, and all of you reading this. It's extremely exciting (and lucrative) to me to see all of my ranty Clojure is the future! bets paying off. :) Rhetorical question: How cool is it to be a part of this whole Clojure thing? Best Regards, '(Devin Walters) On Jun 11, 2014, at 20:25, Scott Thoman sc...@thoman.org wrote: +1 ! I'm about to use it in a production deployment. It has been a pleasure to use! -- 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. -- 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: problem creating lein uberjar of my cascalog +clojure project
Hi, Sindhu. The problem is in how you've specified the org.apache.hadoop/hadoop-core dependency (I just ran into this myselfhttps://github.com/paxan/ccooo/pull/1very recently). It shouldn't be in the :dev profile, it should be in the :provided profile. This should work for you: (defproject torunproject 0.1.0-SNAPSHOT :description FIXME: write description :url http://example.com/FIXME; :license {:name Eclipse Public License :url http://www.eclipse.org/legal/epl-v10.html} :dependencies [[cascalog 1.10.2-SNAPSHOT] [org.clojure/clojure 1.5.1][clj-time 0.7.0]] :profiles {:provided {:dependencies [[org.apache.hadoop/hadoop-core 1.1.2]]}} :jvm-opts [-Xmx768m] :repositories [[conjars.org http://conjars.org/repo;]] :main torunproject.core) About :provided, the lein tutorialhttps://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.mdsays the following: --- Many Java frameworks expect deployment of a jar file or derived archive sub-format containing a subset of the application's necessary dependencies. The framework expects to provide the missing dependencies itself at run-time. Dependencies which are provided by a framework in this fashion may be specified in the :provided profile. Such dependencies will be available during compilation, testing, etc., but won't be included by default by the uberjar task or plugin tasks intended to produce stable deployment artifacts. For example, Hadoop job jars may be just regular (uber)jar files containing all dependencies except the Hadoop libraries themselves: (project example.hadoop 0.1.0 ... :profiles {:provided {:dependencies [[org.apache.hadoop/hadoop-core 0.20.2-dev]]}} :main example.hadoop) John On Thu, May 1, 2014 at 5:54 AM, sindhu hosamane sindh...@gmail.com wrote: I have a cascalog project which is working perfect in eclipse . Now i have single node hadoop cluster up and running . To run my cascalog project on hadoop cluster , i have to create a jar using lein uberjar. But i have the error and cannot create a jar : Exception in thread main java.lang.ClassNotFoundException: org.apache.hadoop.fs.FileSystem, compiling:(core.clj:1:1) Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FileSystem What could be the reason ? my core.clj(source code) of project contains ( defn -main) and also included :main in my project.clj . For reference i am also attaching my project for which i want to create a jar using uberjar . I need a help. -- 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: Style question (predicates)
In the Common Lisp world it's common for predicates to return a useful value instead of T, when applicable. It seems possible the same principle could apply to clojure. From CLtL2 http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node69.html: Often a predicate will return nil if it ``fails'' and some useful value if it ``succeeds''; such a function can be used not only as a test but also for the useful value provided in case of success. An example is memberhttp://clhs.lisp.se/Body/f_mem_m.htm . On Thu, Apr 17, 2014 at 10:20 AM, Colin Yates colin.ya...@gmail.com wrote: My 2p - I interpret the contract as being boolean. Truthy values are 'polymorphically' equivalent*1 so sure. The concern would be people relying on the implementation and treating the values as none-truthy (i.e. in your example relying on the fact it is a string being returned, so (= someString (is-nsf-code? someString))) I should reduce it to 1p really as I am only contributing in an abstract design sense, not in the specifics of the coding standards you mentioned. *1 If this doesn't hold (i.e. caller depends upon receiving a java.lang.Boolean or associated primitive) then I think the caller has bigger problems. On Thursday, April 17, 2014 5:33:42 PM UTC+1, Sean Corfield wrote: The library coding standards[1] say: * Use '?' suffix for predicates. - N.B. - predicates return booleans and the community Clojure style guide[2] says: * The names of predicate methods (methods that return a boolean value) should end in a question mark. (i.e.even?). Both of these imply that if you have a function that returns a boolean (and that is intended for use as a predicate), it should be named to end in '?'. Fair enough. My question is about the reverse implication: * Should a function whose name ends in '?' return a (strict) boolean value? Looking at the docstrings of a random selection of functions found by (apropos ?), they all seem to return specifically true or false. I did not do an exhaustive check. Is the intent that foo? implies a result of true or false - or could foo? return any truthy / falsey value (and therefore any Clojure value). Concrete example that spurred this discussion from some code at work: (defn is-nsf-code? Given an error code, return truthy if it is NSF. [code] (#{BE1 BE2} code)) Clearly the result here could be nil or a string but it's definitely meant to be used as a predicate. Similarly: (defn nsf? Given the result of an SBW sale, return true if it failed with NSF. [result] (and (= failure (:result result)) (some is-nsf-code? (:errors result Again, the result could be false or nil or a string but is meant to be used as a predicate. As an aside, for core.typed, we annotate the first as [String - Boolean] with ^:no-check so it type checks as a true/false predicate and then we annotate the second as [SBWResult - (Nilable Boolean)] and that's all fine... but is it good style? [1] http://dev.clojure.org/display/community/Library+Coding+Standards [2] https://github.com/bbatsov/clojure-style-guide#naming Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- 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: threading operators
A generalized threading macro, as-, is built into clojure as of 1.5 (I wonder if clojuredocs.org having so much googlejuice while also being so out of date makes this sort of thing harder to find): (as- /tmp x (foo x) (bar 1 2 x) (baz x 3 4) (quux 5 x 6)) On Fri, Mar 21, 2014 at 7:08 AM, Paul L. Snyder p...@pataprogramming.comwrote: On Fri, 21 Mar 2014, Andy Smith wrote: Im wondering if it is worthwhile to create a macro to thread together arbitrary forms (x, f, g, h) injecting the result into different positions into the list as required? (thread-together (- x f - g - h)) Maybe swiss-arrows has what you are looking for? (- x f (g 1 2 ) (h 3 4) (i 5 6)) https://github.com/rplevy/swiss-arrows Paul -- 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.
Defining test cases at runtime
I think I'd like to be able to define test cases at run-time. For example, I have some data files that define the tests I want to run (tuples of [program input, class name, program output]). I've looked at clojure.test and midje but they only seem to have macro interfaces to their testing engines, not functional interfaces, so I can do something like this: (deftest functional-tests (testing Test cases (doseq [[input class expected-output] (read-test-cases)] (is (= (with-out-str (with-in-str input (run-main class))) expected-output) But ideally I would do something like this: (deftest functional-tests (doseq [[input class expected-output] (read-test-cases)] (testing* (str class) #(is (= (with-out-str (with-in-str input (run-main class))) expected-output) Or the equivalent using midje instead of clojure.test I realize the difference between the two seems small, but conceptually the latter does more closely match what I'm doing and generates slightly more useful output (failure names, test counts), and is only not possible because the designers of the testing libraries didn't consider this use-case (unless I've missed something). Any tips? (And wouldn't it be neat if functional versions of macros could be automatically or almost automatically generated, so either you didn't have to rely on library authors to consider the functional use-case, or they were encouraged by the design of the macro system to consider it?) Thanks, John -- 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: Is it possible to get Clojure files in Spotlight search?
I've written a Spotlight plugin that indexes Common Lisp code and lets you search by function, variable, class, etc.: https://web.archive.org/web/20101125184356/http://lemonodor.com/archives/001232.html The source code for the plugin is in the .dmg file linked from that blog post, and it might be a starting point for indexing clojure code. On Wed, Feb 19, 2014 at 10:16 AM, Stephen Gilardi squee...@mac.com wrote: I’m aware of one Mac application that declares to OS X that it handles Clojure source files: Light Table http://www.lighttable.com/. In its info.plist, Light Table declares “.clj” “.cljs” and “.edn” to map to Document Type Name “Clojure Source” and marks itself as the default Editor for them. However, in contrast to its Document Type entry for Javascript Source file, it does not declare any Document Content Type UTIs” values for them. Wikipedia has a good article on the UTI system ( https://en.wikipedia.org/wiki/Uniform_Type_Identifier). It’s possible that Light Table could be changed to associate the file extensions above with the UTI public.source-code”. That might give the effect you’re after. —Steve On Feb 19, 2014, at 4:10 AM, Matt Mower matt.mo...@gmail.com wrote: Hi. I recently bought a nice OSX app called Tembo which makes spotlight searching a more pleasant experience. In particular it has a Source Code grouping which is handy but know nothing about Clojure files. I spoke to the author of Tembo and quote his response here Tembo relies on the Universal Type Identifier hierarchy to map files to groups. It hard-codes only very few exception. In the case of source code, there is currently no exception. It will probably not be possible to hard-code an exception for clj/cljs Tembo works only with UTIs. The application owning the clj file extension will need to provide the mapping from file extension to UTI When doing so, it can also specify which high level UTI this conforms to. I.e. it can declare it to be source code. Googling the file extension, I found this: http://softnoise.wordpress. com/tag/quicklook/ It is a hack to have a QuickLook plug-in declare the UTI. This should be good enough and should get QuickLook working. You probably won't have Spotlight indexing the file contents though. I had a look at the QLColourCode plugin but it doesn't build for me in Xcode4 and doesn't appear to be maintained. There's also a suggestion that it stopped working in the 10.6-10.7 transition. Do any Clojure users on OSX have a working solution for this problem? Kind regards, Matt p.s. I realise this is a Mac specific question but I figured I had a better shot of finding an answer among Clojure using Mac folk. -- 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. -- 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: Is it possible to get Clojure files in Spotlight search?
For easier access, I put the source code of my indexer at https://github.com/wiseman/lisp-spotlight-indexer I'd happily accept pull requests updating it and adding Clojure indexing, or maybe someone will just find the code to be a useful starting point for something new. On Wed, Feb 19, 2014 at 11:25 AM, John Wiseman jjwise...@gmail.com wrote: I've written a Spotlight plugin that indexes Common Lisp code and lets you search by function, variable, class, etc.: https://web.archive.org/web/20101125184356/http://lemonodor.com/archives/001232.html The source code for the plugin is in the .dmg file linked from that blog post, and it might be a starting point for indexing clojure code. On Wed, Feb 19, 2014 at 10:16 AM, Stephen Gilardi squee...@mac.comwrote: I’m aware of one Mac application that declares to OS X that it handles Clojure source files: Light Table http://www.lighttable.com/. In its info.plist, Light Table declares “.clj” “.cljs” and “.edn” to map to Document Type Name “Clojure Source” and marks itself as the default Editor for them. However, in contrast to its Document Type entry for Javascript Source file, it does not declare any Document Content Type UTIs” values for them. Wikipedia has a good article on the UTI system ( https://en.wikipedia.org/wiki/Uniform_Type_Identifier). It’s possible that Light Table could be changed to associate the file extensions above with the UTI public.source-code”. That might give the effect you’re after. —Steve On Feb 19, 2014, at 4:10 AM, Matt Mower matt.mo...@gmail.com wrote: Hi. I recently bought a nice OSX app called Tembo which makes spotlight searching a more pleasant experience. In particular it has a Source Code grouping which is handy but know nothing about Clojure files. I spoke to the author of Tembo and quote his response here Tembo relies on the Universal Type Identifier hierarchy to map files to groups. It hard-codes only very few exception. In the case of source code, there is currently no exception. It will probably not be possible to hard-code an exception for clj/cljs Tembo works only with UTIs. The application owning the clj file extension will need to provide the mapping from file extension to UTI When doing so, it can also specify which high level UTI this conforms to. I.e. it can declare it to be source code. Googling the file extension, I found this: http://softnoise.wordpress. com/tag/quicklook/ It is a hack to have a QuickLook plug-in declare the UTI. This should be good enough and should get QuickLook working. You probably won't have Spotlight indexing the file contents though. I had a look at the QLColourCode plugin but it doesn't build for me in Xcode4 and doesn't appear to be maintained. There's also a suggestion that it stopped working in the 10.6-10.7 transition. Do any Clojure users on OSX have a working solution for this problem? Kind regards, Matt p.s. I realise this is a Mac specific question but I figured I had a better shot of finding an answer among Clojure using Mac folk. -- 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. -- 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
Re: range-sum
In the olden lisp days, reduce was often preferred to apply because apply could hit limits on the number of arguments that could be passed to a function. Is that a potential issue with clojure? Thanks, John On Wed, Feb 12, 2014 at 12:06 PM, Vincent vhenneb...@gmail.com wrote: On Wednesday, February 12, 2014 2:47:07 PM UTC, Stuart Sierra wrote: On Wednesday, February 12, 2014 8:46:41 AM UTC-5, Vincent wrote: On a slightly different topic: why reduce and not apply? The implementation of `+` with more than 2 arguments uses `reduce` internally. So they amount to the same thing. Ah ok, interesting. I do seem to have, in the past, come across a function that was significantly faster when used with apply rather than reduce, but I can't remember which one. There isn't really a performance difference: user= (dotimes [i 7] (time (reduce + (range 1000 Elapsed time: 354.475 msecs Elapsed time: 346.235 msecs Elapsed time: 348.124 msecs Elapsed time: 348.894 msecs Elapsed time: 379.9 msecs Elapsed time: 356.337 msecs Elapsed time: 362.788 msecs nil user= (dotimes [i 7] (time (apply + (range 1000 Elapsed time: 360.067 msecs Elapsed time: 353.281 msecs Elapsed time: 345.694 msecs Elapsed time: 355.162 msecs Elapsed time: 346.511 msecs Elapsed time: 350.61 msecs Elapsed time: 353.674 msecs nil Thanks, Vincent -- 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: range-sum
Just to be clear, and to check my understanding, that's not an issue with the number of arguments, right? It's a limit on the size of a literal or something? I ask because (apply + (range 1)) works fine, but maybe I've missed some subtlety. Thanks, John On Wed, Feb 12, 2014 at 3:32 PM, Mars0i marsh...@logical.net wrote: On Wednesday, February 12, 2014 5:14:42 PM UTC-6, Mars0i wrote: On Wednesday, February 12, 2014 2:33:34 PM UTC-6, John Wiseman wrote: Is that a potential issue with clojure? (range 1) Then copy its output from the terminal window. (apply + 'paste here ) CompilerException java.lang.ClassFormatError: Invalid method Code length 109957 in class file user$eval1179, compiling:(/private/var/ folders/AV/AVc7bySmE4a+vcamS7JSTE+++TQ/-Tmp-/form- init2649824128421176665.clj:1:1) But '(reduce +' has the same difficulty. The limit was somewhere between 5000 and 8000 arguments. I can live with that. -- 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: Security implications of code is data/data is code
I don't think homoiconicity is the issue, except in a very indirect way. Note that Common Lisp does have a rather annoying, insecure default that did allow the kind of attack you're talking about: *read-eval* defaults to T http://clhs.lisp.se/Body/v_rd_eva.htm, which enables the #. reader macro, which can be used to execute code when reading input. This could have been bad news at a nuclear weapons labshttps://gist.github.com/wiseman/4709438 . But note that code written in Rubyhttp://blog.codeclimate.com/blog/2013/01/10/rails-remote-code-execution-vulnerability-explained/, PHP http://stackoverflow.com/questions/3115559/exploitable-php-functions, Perlhttp://www.iss.net/security_center/reference/vuln/DataProtector_EXEC_CMD_Exec.htmand just about every language has had basically the exact same sort of vulnerability at some point. It's not homoiconicity that makes it possible (or likely), it's having an interpreter or compiler available. On Tue, Jan 21, 2014 at 9:10 PM, Luc Prefontaine lprefonta...@softaddicts.ca wrote: Your last statement is incomplete. It all depends on trust. We do eval at runtime of code and data w/o edn but we know it comes from a secured source. Doing such thing from an unsecured alien source would potentially look insane. Lets not presume about the insanity of the designer w/o some deeper analysis :))) Luc P. Hi Daniel, I'm not an expert in security but AFAIK this is not a problem. Every user input is a string and you chose how to parse it. There is a edn reader that is safe, but you can use specific parsers depending on the input. Of course if you read and eval the string anything could happen, but nobody would do that. Best, mynomoto On Tuesday, January 21, 2014 10:22:11 PM UTC-2, Daniel Compton wrote: I've been thinking for a while about what the security implications are for a homoiconic language like Clojure where code is data and data is code. What protections do you have against malicious input being automatically evaluated by the reader? It seems like every user input would be a possible case of 'Clojure injection'. Is this an issue or am I missing something really obvious here? Thanks, Daniel. -- -- 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. -- Luc Prefontainelprefonta...@softaddicts.ca sent by ibisMail! -- -- 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: string/replace regex help
(clojure.string/replace myText #(?s)START.*?END ==) ;; a==\nee\nff\nggg\n==\n\n (?s) specifies multi-line mode, *? is the non-greedy form of *. On Thu, Jan 16, 2014 at 1:02 PM, Kuba Roth kuba.r...@gmail.com wrote: Hi, This is more of a regex specific question the clojure, but anyway... I have the a multiline string as follow: (def myText aSTART END ee ff ggg START ii E END ) .. and I need to replace all text between START END 'keywords' blocks. The following regex: (clojure.string/replace myText #START([^END])* ==) does sort of what I'm hoping to get but does not guard me against cases when one of the END (in this case E) characters shows up in the middle of the block to be cut. So my question comes down to what am I missing here? :) Any suggestions are highly appreciated. Thanks, kuba -- -- 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: Who is doing something worthwhile in Clojure?
Suggestions of endeavors using clojure for something worthwhile itself seems like an entirely worthwhile discussion if people can resist the temptation to debate what worthwhile means and to disagree with other people's concept of worthwhile. For example, here's a recipe for a useful discussion: If you know of activity X that you in good faith believe is worthwhile or, more specifically, (and I'm guessing at RIch's original intention so I could be wrong) philanthropic then post about X. If you disagree with a poster about whether X is worthwhile, do not post. John On Thu, Dec 19, 2013 at 6:15 PM, Sean Corfield seancorfi...@gmail.comwrote: On Thu, Dec 19, 2013 at 5:19 PM, Rich Morin r...@cfcl.com wrote: I have no argument with The Climate Corporation's business model; my problems are with Monsanto. That said, I don't want to dive off into that discussion. In fact, my comment about them should probably have been left out of my initial posting. If you think that discussion is inappropriate for this list (and I agree - it is), then why do you think this discussion is appropriate: Can we get back to talking about folks who are using Clojure to make a positive impact? It seems to me this is bound to be a political or at least a very subjective one based on people's own moral compass and their ideology? As such I don't think it's a particularly useful discussion on what is primarily a technical list. Perhaps post the question on Quora? That seems to be very friendly toward political / moral discussions... -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Perfection is the enemy of the good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- 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: Implementation options for auto-complete and symbol resolution while coding
Just for background, Steve Yegge's grok project seems relevant. It is a cross-language static analysis system intended to be useable on a large scale. (And is intended to be open sourced, when it's done.) http://www.youtube.com/watch?v=KTJs-0EInW8 On Wed, Dec 18, 2013 at 8:27 AM, juan.facorro juan.faco...@gmail.comwrote: Hi Clojurers, I'm building a tool for Clojure and I've been hitting the same bump for quite some time now, namely auto-completion and finding the definition of a symbol. After doing some research I've found that some tools rely on a running REPL to figure out where a symbol might be coming from; these include emacs [1], Counter-Clockwise, clooj and maybe others I don't know about (like Nightcode or Cursive). This seems the natural thing to do since while developing we always have a REPL running to try out what we code, after all this is one of the best LISP features. This approach results in very accurate locations for global symbol definitions, but locals are not found since they are not accesible form the REPL. Another approach I've seen used for auto-completion in Clojure is the token-based, which involves looking for tokens in the code base associated with the current project and then providing the nearest match regardless of context; these include J Editor [2], Light Table (which I think uses inter-buffer token matching [3]) and emacs when it uses dictionary files (maybe not specifically in existing Clojure modes but it's something that emacs can do). Although this approach resolves the auto-completion, it is not very accurate when locating symbol definitions. From what I've read this is not a trivial problem so I was wondering if there's some implementation that actually resolves symbols statically (I mean without having a running REPL) in an accurate way or, if there's no implementation, maybe someone could point me in the right direction (or any direction) as to what would ease the pain to accomplish such a task. Building something on my own to do this static symbol resolution is out of the question, since that sounds like a whole project on its own and I'm currently trying to build something else entirely. There are parsing libraries which provide good parse trees (i.e. Parsley, Instaparse), but my understanding is that what needs to be mantained is a full abstract syntax tree for the whole code base and although clojure.tools.analyzer [4] does the job of creating an AST, generating and mantaining all these trees sounds very costly and not the right way to do it. If the running REPL approach is the saner one, then I would have no problem with going down that road, but I just wanted to make sure what the viable options were. If you got this far, thank you for your time. :) Any help, thoughts or comments will be greatly appreciated! Juan [1] https://github.com/clojure-emacs/ac-nrepl [2] http://armedbear-j.sourceforge.net/ [3] https://groups.google.com/forum/#!msg/light-table-discussion/Q-ZvOJSr1qo/-D6tAV_XiMUJ [4] https://github.com/clojure/tools.analyzer -- -- 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: [ANN] projars.com
On Thu, Nov 28, 2013 at 2:53 AM, Bastien bastiengue...@gmail.com wrote: I'm working on a website where people will be able to ask donations more easily for their FLOSS achievements and future projects, I'd love to see both directions (more commercial options and more crowdfunded FLOSS libraries) encouraged at the same time. On this topic, I recently ran across https://www.suprmasv.com/ -- -- 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.