Bitfields access in Clojure

2009-07-21 Thread Daniel Janus
have been done better. I would be extremely grateful if someone had a look at this code and comments on how to make it more Clojurish. Thanks! Daniel Janus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure

Bitfields access in Clojure

2009-07-21 Thread Daniel Janus
jure Way, I'm pretty certain that some things might have been done better. I would be extremely grateful if someone had a look at this code and comments on how to make it more Clojurish. Thanks! Daniel Janus --~--~-~--~~~---~--~~ You received this message because

Re: Bitfields access in Clojure

2009-07-22 Thread Daniel Janus
o read it back and access the individual fields. Best regards, Daniel Janus --~--~-~--~~~---~--~~ 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 tha

Re: Bitfields access in Clojure

2009-07-24 Thread Daniel Janus
e the ordering explicit. Thanks once again! Daniel Janus --~--~-~--~~~---~--~~ 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 ne

Re: Confusion with namespaces and SLIME

2009-07-28 Thread Daniel Janus
both Clojure 1.0.0 and current git. Perhaps you should try upgrading your setup? Best, Daniel Janus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to c

Re: java 1.4 class files

2009-07-29 Thread Daniel Janus
I'd try to first compile Clojure to 1.5 bytecode, then translate it to 1.4 using Retroweaver (http://retroweaver.sourceforge.net/). I don't know whether that'll work, though, since I think the Clojure compiler generates and loads bytecode at runtime. You might need to patch Clojure to somehow sq

inlining bitwise operations?

2009-07-29 Thread Daniel Janus
Hello, Is there any reason for some of the bitwise functions (bit-and-not, bit-clear, bit-set, bit-flip, bit-test, bit-shift-left and bit-shift- right) not having inline variants? Thanks, Daniel --~--~-~--~~~---~--~~ You received this message because you are subs

rebinding fn definitions not effective in lambdas?

2009-10-05 Thread Daniel Janus
Dear Clojurians, Consider the following three simple functions: (defn foo [] 42) (defn bar [] 44) (defn baz [s] (map (fn [_] (foo)) s)) Now let's rebind foo to bar: user=> (binding [foo bar] (foo)) 44 ;; Just as I expected. user=> (binding [foo bar] (baz [1 2 3])) (42 42 42) ;; while I would e

[ANN] clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread Daniel Janus
Dear all, I am happy to announce the public availability of clj-iter, an Iterate- like iteration macro. It is free (available under the terms of MIT license) and can be found on GitHub: http://github.com/nathell/clj-iter The design goal was to keep it as simple as possible, and make it blend wel

Re: clj-iter, an iteration macro for Clojure inspired by Common Lisp's Iterate

2009-11-05 Thread Daniel Janus
On 6 Lis, 02:02, John Harrop wrote: > On Thu, Nov 5, 2009 at 7:03 PM, Daniel Janus wrote: > > To avoid citing the entire README blurb, I'll just give you some > > examples: > > >    (iter (for x in [31 41 59 26]) > >          (for y from 1) > >        

Re: Another "closure" available

2009-11-08 Thread Daniel Janus
On 8 Lis, 08:11, pmf wrote: > > Hmm, someone else has made another "closure" available :). > > >http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html > > There's also Clozure Common Lisp [1], which is conceptually closer to > Clojure. There's also a web browser written in CL cal

ANN: clj-tagsoup

2010-03-30 Thread Daniel Janus
for registration. See " [:a {:shape "rect", :href "http://www.rfc- editor.org/rfc/rfc2606.txt"} "RFC \n 2606"] ", Section 3."]]] The code is on http://github.com/nathell/clj-tagsoup. I've pushed i

[ANN] Skyscraper 0.2.3

2016-11-17 Thread Daniel Janus
Dear Clojurians, Skyscraper 0.2.3, an Enlive-based library for scraping information from whole sites in a structural way, has been released. Homepage / GitHub: https://github.com/nathell/skyscraper Clojars: https://clojars.org/skyscraper New in this release: - New feature: Custom parse fu

[ANN] Skyscraper 0.3

2020-02-18 Thread Daniel Janus
Hello! After more than 3 years in the making, I am proud to announce the release of Skyscraper 0.3.0, a scraping framework that helps you build structured dumps of whole websites. Home: https://github.com/nathell/skyscraper/ Major improvements in 0.3.0: - Skyscraper has been rewritten from

[ANN] Skyscraper 0.1.0, a library for scraping entire websites

2015-08-11 Thread Daniel Janus
h” the website to obtain the information she’s interested in. Sites have tree-like structure, and you want to keep track of this structure as you traverse the site, and reflect it in your output. I call it “structural scraping”. This is where Skyscraper comes in. Happy using, --Daniel Janus -- You recei

Re: [ANN] Skyscraper 0.1.0, a library for scraping entire websites

2015-08-24 Thread Daniel Janus
non-chunking). - Fixed a bug where relative URLs were incorrectly resolved in certain circumstances. Happy using, -dj W dniu wtorek, 11 sierpnia 2015 19:29:03 UTC+2 użytkownik Sergey Didenko napisał: > > Looks interesting, thank you. > > On Tue, Aug 11, 2015 at 5:00 PM, Dan

[ANN] Skyscraper 0.1.2, a library for scraping entire websites

2015-09-17 Thread Daniel Janus
Skyscraper 0.1.2 has been released. New in this release: - A processor can now return one context only. (Thanks to Bryan Maass.) - The processed-cache option to scrape now works as advertised. - New scrape option: :html-cache. (Thanks to ayato-p.) - New official defprocessor clauses: :

Re: [ANN] Skyscraper 0.2.0, a library for scraping entire websites

2015-10-03 Thread Daniel Janus
Skyscraper 0.2.0 has been released. New in this release: - Skyscraper now supports pluggable cache backends. - The caching mechanism has been completely overhauled and Skyscraper no longer creates temporary files when the HTML cache is disabled. - Support for capturing scraping resul

Re: [ANN] Skyscraper 0.2.0, a library for scraping entire websites

2015-12-17 Thread Daniel Janus
Skyscraper 0.2.1, an Enlive-based library for scraping information from whole sites in a structural way, has been released. Homepage / GitHub: https://github.com/nathell/skyscraper Clojars: https://clojars.org/skyscraper New in this release: - New function: get-cache-keys. - scrape and

[ANN] Skyscraper 0.2.2

2016-05-06 Thread Daniel Janus
Skyscraper 0.2.2, an Enlive-based library for scraping information from whole sites in a structural way, has been released. Homepage / GitHub: https://github.com/nathell/skyscraper Clojars: https://clojars.org/skyscraper New in this release: - - Skyscraper now uses Timbre for logging.

Re: Instaparse - thank you!

2014-06-13 Thread Daniel Janus
I'd like to join the thank-you chorus -- Instaparse rocks, period. I'm using it to integrate my concordancing utility, Smyrna [1] with a POS-tagging engine for Polish originally written in C++; specifically, to parse the rules generated by the latter. I've given a talk on it this year at Lambda

how to await for a potentially erring agent?

2010-06-11 Thread Daniel Janus
dition (what if the error occurs between agent-errors and await?) How best to cope with this? Best regards, Daniel Janus -- 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 tha

Re: looking for a simpler implementation of a function I'm using

2010-08-08 Thread Daniel Janus
Here's my take using my clj-iter (http://github.com/nathell/clj-iter): (defn partition-when [pred coll] (iter (for x in coll) (for p = (when x (pred x))) (for y initially () then (if p (list x) (cons x y))) (collect (reverse y) if p) (finally-collect (reverse y)

1.2 contrib shuffles

2010-08-27 Thread Daniel Janus
Hi, so I finally got around to port my app to Clojure 1.2 and got confused about the contrib shuffles. There's clojure.java.io and clojure.contrib.io. The docs on the latter says that most of the functions defined in there are deprecated, and one should use clojure.java.io instead. But clojure.ja

Re: 1.2 contrib shuffles

2010-08-30 Thread Daniel Janus
On 28 Sie, 07:00, Stuart Sierra wrote: > On Aug 27, 3:42 pm, B Smith-Mannschott wrote: > > > This thread got me thinking that when a namespace is partially promoted to > > Clojure proper, it might be good to provide a reduced version of the old > > namespace, providing just the functionality that

Bug with map keys containing quotes in clojure.contrib.json

2010-09-30 Thread Daniel Janus
Hi, c.c.json/json-str seems to handle maps with keys containing quotes incorrectly: > (println (json-str {"\"" 1})) {""":1} ...while I (and my parsers) would expect {"\"":1}. I'd much rather report this on Assembla than here, but I seem to be needing a CA to post a ticket there, and I'm in way

Re: Bug with map keys containing quotes in clojure.contrib.json

2010-09-30 Thread Daniel Janus
I forgot to add that this happens both with contrib 1.2.0 and 1.3- alpha1. 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

Re: Bug with map keys containing quotes in clojure.contrib.json

2010-09-30 Thread Daniel Janus
On 30 Wrz, 20:46, Steve Purcell wrote: > You can file the bug as a support ticket without a CA here: > > http://www.assembla.com/spaces/clojure/support/tickets Thanks, I've reported it as a contrib support ticket. I wasn't aware of this functionality. Daniel -- You received this message becau

Re: clojure.core/some expected behaviour

2011-04-02 Thread Daniel Janus
Hi Andreas, > (some #{:fred} [:fred :barney]) > => :fred > This expected. > Would one be write to expect > (some #{:fred} {:fred "flinstone" :barney "rubble"}) > to return > => :fred > as well? (some #{:fred} (keys {:fred "flinstone" :barney "rubble"})) will get you what you need. Best, Daniel

Re: clojure.core/some expected behaviour

2011-04-02 Thread Daniel Janus
On 3 Kwi, 07:37, Andreas Kostler wrote: > Hi Daniel, > Thanks for your reply. I know how to get to :fred. > I'm just wondering why some wouldn't work on maps. Well, `some' finds an element in a seq that satisfies the given predicate, and seq'ing a map will get you a sequence of key/value pairs.

Re: Build tool for mixed Clojure/Java projects

2011-07-04 Thread Daniel Janus
> 2) Network independence. I often work without Internet access, and I   > don't want to be blocked at some point because some build tool wants   > to access some repository to see if my version is still current. For the record, this is easily doable with both Leiningen and Cake (which both use Ma

Odp: Re: a lazy version of shuffle.

2011-07-11 Thread Daniel Janus
One thing to keep in mind when shuffling is that, by default, if the input sequence is large enough then most permutations can never be generated by shuffle. This follows naturally from the Dirichlet's pigeonhole principle: there are only 2^64 possible seeds (states of the RNG), but (factorial (cou

Odp: Re: Convert HTML to Vector Notation

2011-07-12 Thread Daniel Janus
Hey, thanks for recommending my library! :-) Best, 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 firs

Odp: Unable to resolve var: subset? in this context (NO_SOURCE_FILE:1)

2011-07-14 Thread Daniel Janus
subset? is in the clojure.set namespace, so you must (use 'clojure.set) before you can use subset? unqualified. -- 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 mem

Odp: Re: FleetDB or other "NoSQL" store for Clojure?

2011-07-17 Thread Daniel Janus
> > As far as I know, the only NoSQL DB supporting transactions right now > is Redis. It also satisfies the rest of your points (well, I'm not > sure if Redis run on windows...). > +1 for Redis -- we are using it in production, in fact it's a central piece of our architecture, and so far it'

objects with metadata inside eval -- bug?

2012-02-20 Thread Daniel Janus
Hello, In Clojure 1.3 this works: (eval `(let [f# ~(fn [x] (+ x 1))] f#)) This does not, failing with an ExceptionInInitializerError: (eval `(let [f# ~(with-meta #(+ % 1) {:foo :bar})] f#)) Both work in Clojure 1.2.1. Have I hit a regression bug? If not, what is the rationale of this not wo

[ANN] clj-json-rpc 0.1: a Ring-compatible handler for JSON-RPC web services

2012-02-25 Thread Daniel Janus
Hi, I've just released version 0.1 of clj-json-rpc to Clojars. clj-json-rpc is a Clojure library that makes it easy to create web services using the JSON-RPC protocol and Ring. Check it out at https://github.com/nathell/clj-json-rpc Enjoy, Daniel -- You received this message because you are

Re: [ANN] clojure-py 0.1.0 Clojure on Python

2012-03-08 Thread Daniel Janus
I'm seeing it on Arch Linux as well, using both pip2 and easy_install-2.7. Thanks, Daniel W dniu czwartek, 8 marca 2012, 12:00:24 UTC użytkownik tbc++ napisał: > > >Congrat's on the release! I am getting the following error on my > >Macbook (running 64-bit Lion, Python 2.7.1) when trying to run "

[ANN] clj-tagsoup 0.3.0

2012-05-01 Thread Daniel Janus
Dear Clojurians, I have released version 0.3.0 of clj-tagsoup [1], the HTML parser for Clojure. clj-tagsoup is a wrapper around TagSoup [2] and can parse arbitrary (potentially malformed) HTML (or XML) into Clojure data structures. New in this release is the ability to lazily parse XML using T

Re: Lambda: A lniux distro for clojurists

2012-05-28 Thread Daniel Janus
What *I* would very much like to see is something along the lines of http://www.informatimago.com/linux/emacs-on-user-mode-linux.html but with the JVM running Clojure directly on top of the Linux kernel. Plus some editor/IDE to hack comfortably (Clooj?). This cannot be done easily since the sto

*print-dup* and struct maps

2011-11-22 Thread Daniel Janus
Hi, I've encountered this behaviour of *print-dup*: user> (defstruct foo :field) #'user/foo user> (binding [*print-dup* true] (pr-str (struct foo 10))) "#=(clojure.lang.PersistentStructMap/create {:field 10})" user> (read-string (binding [*print-dup* true] (pr-str (struct foo 10 java.lang.Il

deprecating butlast?

2011-11-22 Thread Daniel Janus
Hi, Why keep both butlast and drop-last in clojure.core? The latter has the advantage that it's lazy and can drop off more than one element from the end of a seq. In contrast, I can't think of any advantage of butlast, except that it seems to be slightly (ca 20%) faster than (doall (drop-last

Re: deprecating butlast?

2011-11-24 Thread Daniel Janus
On Wednesday, November 23, 2011 10:42:13 PM UTC, Nils Bertschinger wrote: > It solves a > common problem, namely to drop the last element of a sequence and > reads better in this case than the equivalent idiom using drop-last. > I don't quite get it. How does (butlast x) read better than (drop-

Re: Alternative structures to arrays?

2011-12-22 Thread Daniel Janus
On Thursday, December 22, 2011 3:35:35 PM UTC, Tassilo Horn wrote: > > Brian Hurt writes: > > Hi Brian, > > > Vectors are actually a great trade-off, giving you almost the same > > access and memory costs arrays do, but with all the advantages of > > being immutable (multi-threaded goodness). >

Re: Sort a vector and keep the elements' indexes

2012-01-06 Thread Daniel Janus
(sort-by second (map-indexed vector [25 5 70])) -- 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

Re: how to get font-lock to work in swank repl buffer

2012-01-20 Thread Daniel Janus
On Thursday, January 19, 2012 9:52:44 PM UTC, bsmith.occs wrote: > Incidentally, what's with this strange form of let? > > (let (font-lock-mode) ;; <- shouldn't this bind variables? > (clojure-mode-font-lock-setup)) > In Common Lisp (and presumably in Emacs Lisp as well), 'let' takes an a

Re: mapmap?

2010-12-07 Thread Daniel Janus
While on the topic, I'd like to raise a naming issue. The 'mapmap' function seems to be a recurring theme (see, e.g., http://tech.puredanger.com/2010/09/24/meet-my-little-friend-mapmap/) and many Clojure projects include one -- Incanter comes to mind. My project used to, too. But we found out that

Re: Erlang-esque bit syntax in Clojure?

2010-12-16 Thread Daniel Janus
Hi Daniel, I'm fairly certain this is not exactly what you're looking for, but it's somewhat related and it might give you a fuller image -- my tiny clj-bitfields library: https://github.com/nathell/clj-bitfields Best, Daniel Janus -- You received this message because you ar

Re: get the total memory used by a data structure?

2010-12-23 Thread Daniel Janus
On 23 Gru, 05:51, Robert McIntyre wrote: > I think it would be really cool to have a function that gives the > total number of bytes that a data structure consumes. Here is a tiny utility I wrote some time ago; it's not very accurate, but might come in handy: https://gist.github.com/417669 bes

locals clearing

2011-01-30 Thread Daniel Janus
Hi, I've recently heard about the locals clearing feature of Clojure 1.2 (from a recent post by Ken Wesson), and decided to test-drive it. Here is a contrived example: (defn garbage [] (make-array Byte/TYPE 10485760)) (defn -main [& args] (let [a (garbage) b (garbage) c (ga