On 6 December 2017 at 11:23, Jacek Grzebyta wrote:
>
> I have to populate a triple store with a big number of data (~38k records
> x 12) and there is a deadly narrow bottleneck - IO operations speed. To fix
> it I did:
> 1. To avoid threads overflow I put all compute
If I've understood your problem correctly, clojure.core/lazy-cat does
exactly what you need.
Ray.
On 22 November 2017 at 22:31, Stephen Nelson wrote:
> ```
> (->> (repeatedly
>(fn []
> (lazy-seq
>(println "New seq...")
>(map (fn [x]
Hi,
Here at Metail we have been using Clojure for medium-sized data processing
on AWS EMR. We started out with Cascalog about 5 years ago, switched to
Parkour 2 years ago, and are now considering a move to Spark.
My question is: is Clojure still a good choice for medium/large data
processing on
On 6 September 2017 at 11:01, Cecil Westerhof
wrote:
> With the help of this list I rewrote it to:
> (def digits
> (apply str (map char (range (int \0) (inc (int \9))
> (def hex-digits
> (apply str digits (map char (range (int \A) (inc (int \F))
>
>
On 6 September 2017 at 09:50, Cecil Westerhof
wrote:
>
> I am trying the following throwaway code:
> (defn create-pin
> ([] (create-pin 8))
> ([n]
>{:pre [(<= n 128)
>(>= n 4)]}
>(let [chars (into [] (concat (range (int \0) (inc (int \9))) (range
> (int
If you're using ring, you can use the lein-ring plugin to build the
uberwar: simply `lein ring uberwar`. Check out the README for options if
you need to deviate from the defaults:
https://github.com/weavejester/lein-ring
You'll end up with an uberwar for each application you want to deploy.
These
Hi,
I ran into a problem reading a private key from a file using buddy-core
version 1.1.1. I created a private key using:
openssl genrsa -aes256 -out resources/auth_privkey.pem 2048
Here's the code:
(ns tryme-buddy.core
(:require [buddy.core.keys :as ks]
[clojure.java.io :as io])
I also got excited about pallet a year or so ago. There are some awesome
ideas in there, but I found that in practice it was slow to develop with
and much less flexible than it promised. In the end I switched to ansible
and achieved more in 1 day than I had in a week's effort with pallet. I
think
On 25 April 2016 at 21:03, Rafał Cieślak wrote:
> Hi,
>
> I'm writing a turn-based game and one of the biggest functions is the one
> which handles player moves. It receives the current game state (a map) and
> the index of the cell that the player clicked on (an integer).
>
On 17 November 2015 at 13:21, Bobby Bobble wrote:
> Say there's a dependency that I fork and add some features I need for my
> team's project. I can use my fork locally with lein install no problem, and
> so can others *if* they clone my fork and do the same. It would be more
>
On 3 November 2015 at 01:23, William la Forge wrote:
> There was just so much more there than I had ever dreamed. I had looked at
> destructuring, but had been unaware of the various directives. :D
>
> I found this post by Jay Fields a useful resource for learning about
You need Java interop for this:
(import 'java.nio,file.Files)
(Files/isSymbolicLink (.toPath (io/file "/some/path")))
See http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html
for the other methods provided by this class.
On 5 October 2015 at 16:47, wrote:
>
>
If I've understood the problem correctly, you can simplify the code by
implementing a transpose function:
(defn transpose [xs] (apply map vector xs))
Then define a wanted? function for filtering the lines you want to include:
(defn wanted? [xs] (some zero? xs))
...and a helper function to
Looks like the exception is thrown during config parsing. You probably
need to enclose the email addresses in a vector [] rather than a list
().
Ray.
On 8 May 2015 at 08:01, Alexey Astafyev av.astaf...@gmail.com wrote:
I'm new to Riemann and Clojure. All I want to do is to send email
On 10 March 2015 at 20:03, Sam Raker sam.ra...@gmail.com wrote:
That's honestly closer to what I was originally envisioning--I've never
really looked into graph dbs before, but I'll check out Neo4j tonight. Do
you know whether you can model multiple edges between the same nodes?
Yes, certainly
On 10 March 2015 at 17:58, 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.
Exactly. When I first read
On 7 March 2015 at 00:25, Sam Raker sam.ra...@gmail.com wrote:
I'm trying to create an n-gram[1] corpus out of song lyrics. I'm breaking
individual songs into lines, which are then split into words, so you end up
with something like
{0 {0 go 1 tell 2 aunt 3 rhodie} 1 {0 the 1 old 2 grey 3
A general rule of thumb is to prefer higher-order functions to explicit
recursion. When you are trying to accumulate something (here, you are
accumulating a list of zeroes and ones), you can usually use reduce. This
is a little bit more tricky here as you need to keep track of which bits of
the
https://github.com/xsc/lein-ancient
On 11 September 2014 14:41, Jonathon McKitrick jmckitr...@gmail.com wrote:
I thought for sure I saw this feature, but I can't find it.
Isn't there a way to scan for possible updates to dependencies in a project?
--
You received this message because you
On 30 August 2014 06:26, Colin Fleming colin.mailingl...@gmail.com wrote:
I want to use a map to cache values based on a key. I'm planning to use an
atom for this. My basic operation is give me the value for this key - if
the value exists in the map then that value should be returned,
On 17 June 2014 13:24, Shoeb Bhinderwala shua...@gmail.com wrote:
Can someone help me write the following function:
I have two lists of maps as inputs:
(def xs [{:id 1 :val 10}
{:id 2 :val 20}
{:id 3 :val 30}
{:id 4 :val 40}])
(def ys [{:id 2 :val
On 12 June 2014 09:44, Hussein B. hubaghd...@gmail.com wrote:
Hi,
I like to use (defn-) when it comes to internal implementation functions.
But since they aren't exposed, how to unit test them?
Of course, I'm using Lein and clojure.test
It feels like a bit of a hack, but:
On 9 June 2014 02:03, gvim gvi...@gmail.com wrote:
(ns gh1.tmp
(:require [clj-commons-exec :as exec]
[clj-time.core :as t]))
(defn calc [day month year hour min sec zone]
(let [bin /Users/zephyr/html/astro/bin/swetest
data (str -p0123456789t -fPZl -b
On 9 June 2014 12:39, gvim gvi...@gmail.com wrote:
Then why does this work when executed manually in the shell?
./swetest -p0123456789t -fPZl -b14.10.1960 -ut13:45 -roundmin -head
-true -eswe
I suspect exec/sh is expecting a list of options. The way you are
calling it, swetest is called
On 27 May 2014 01:02, Michael Cramm gmcr...@gmail.com wrote:
Good question. I had originally wanted a separate, untracked config file but
couldn't decide on a format. (like separating out protocol, host, port, etc)
Exporting the environment variable felt the most non-committal at the time.
On 27 May 2014 09:35, Manuel Paccagnella manuel.paccagne...@gmail.com wrote:
I've found confijulate, here. It might be useful.
Well, ok. Another configuration library that I wasn't aware of when I wrote
confunion. Another one that I found after writing mine is carica, which
seems quite
I was looking at the source for clojure.java.jdbc, and came across the
following macro:
(defmacro with-db-transaction
[binding body]
`(db-transaction* ~(second binding)
(^{:once true} fn* [~(first binding)] ~@body)
~@(rest (rest binding
I
-me.cgrand.net/2013/09/11/macros-closures-and-unexpected-object-retention/
Ray.
On Mon, May 26, 2014 at 9:08 AM, Ray Miller r...@1729.org.uk wrote:
I was looking at the source for clojure.java.jdbc, and came across the
following macro:
(defmacro with-db-transaction
[binding body]
`(db-transaction
On 8 May 2014 16:22, Dave Tenny dave.te...@gmail.com wrote:
James, All well and good, but you still need to know if you're running in a
REPL environment, and make sure you do NOT call System/exit for any
(typical) reason in that environment. The idea is to test your (-main)
function from the
On 18 April 2014 15:05, sd song sd.s...@gmail.com wrote:
i use clojure and korma libs.
now i need to add some search conditions to users-sql at
need_do_something_here,i can describe it in imperative style:
if ( nick_name != nil)
users-sql = (where users-sql (like :nick_name nick_name)
Have you considered pushing your build of the package to Clojars under
the org.clojars.USERNAME group?
Ray.
On 27 March 2014 09:16, t x txrev...@gmail.com wrote:
Hi,
## Context:
* I'm using lein.
* In my project.clj, I have something like:
:dependencies[ [org.clojure/clojure
I'm not sure if that function exists in a new contrib library, but
it's trivial to implement:
(defn rotations [xs] (take (count xs) (partition (count xs) 1 (cycle xs
On 11 February 2014 05:53, Mars0i marsh...@logical.net wrote:
At one time there was a function named rotations in
On 22 January 2014 13:21, Alf Kristian Støyle alf.krist...@gmail.com wrote:
Thanks! That does explain it :)
Would be nice to be able to specify that an option must be specified in
every invocation though. I think it would lead to better error messages,
e.g. if several mandatory options are
A UK-based Clojure job for a change... Metail is a start-up with a tech
team based in the centre of Cambride. We are looking to recruit a junior
developer to work on a mix of RESTful API handlers and frontend web
applications, all build using Clojure. This is an ideal job for a recent
graduate or
On 10 January 2014 14:59, Colin Yates colin.ya...@gmail.com wrote:
I have a sequence of file names and I want to make them unique. (uniquify
[a b c a]) = [a b c a_1])
This is what I have come up with, but surely there is a better way?
I would do something like:
(defn uniquify
([xs]
On 20 November 2013 22:25, Sean Corfield seancorfi...@gmail.com wrote:
Is anyone using the java.jdbc.sql namespace? (besides World Singles :)
Only the 'where' function, in a few places.
Ray.
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To
Just for contrast, here's a fairly succinct solution I put together:
https://gist.github.com/ray1729/7534528#file-ring_of_primes-clj
It uses a basic depth-first search.
Ray.
--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group,
Hi Gary et al,
On 15 November 2013 23:55, Gary Johnson gwjoh...@uvm.edu wrote:
I really like your approach, but I've also been feeling the burn a bit
with having to store each SQL query in its own file (especially since my
data exploration frequently leaves me cataloging hundreds of them).
On 30 October 2013 11:47, Kris Jenkins krisajenk...@gmail.com wrote:
FWIW, I too am interested in a better SQL tool for Clojure, but my take on
it is that we don't need a new language on top of SQL, but a better way to
use SQL directly.
My thinking, plus an *alpha-grade* library, can be
On 18 August 2013 17:21, John Jacobsen eigenhom...@gmail.com wrote:
On Aug 17, 2013, at 4:52 PM, Ray Miller r...@1729.org.uk wrote:
One option is simply to write an upstart script that invokes 'lein
ring server-headless' and sit an apache or nginx proxy in front of it.
That's how my website
On 18 August 2013 12:31, Timo Mihaljov t...@mihaljov.info wrote:
On 17.08.2013 08:40, David Chelimsky wrote:
Which led me to this:
(defn to-consolidated-map [parts]
(apply merge-with + (map (partial apply hash-map) parts)))
This is exactly what I came up with after reading your first
if any of you are in Cambridge (UK) next Thursday evening, you're be
welcome to join us at the next Camclj Meetup. Details below.
-- Forwarded message --
From: Ray Miller r...@1729.org.uk
Date: 17 August 2013 15:47
Subject: Hands-on Clojure: Collaborative Filtering
To: cam
On 17 August 2013 21:52, John Jacobsen eigenhom...@gmail.com wrote:
So, what do all y'all do? What is a good lightweight but robust way to get
a fairly simple Compojure/Ring app backed by Datomic facing the outside
world? Not too worried about massive scalability at this point; simplicity
On 9 July 2013 16:11, Alexander Gunnarson alexandergunnar...@gmail.comwrote:
*Example 1: Tail-call recursion*
*Scheme*
One example would be tail-call recursion. For instance, normally in Scheme
I'd naively implement an iterative exponent function like this:
(define (expt x n)
On 1 July 2013 21:39, Cedric Greevey cgree...@gmail.com wrote:
What bugs me is that sorted-set-by needs apply to convert a coll into
a sorted set; there's no short-and-pithy into for that case, and no
coll-taking and varargs version pair like vec/vector either.
(into (sorted-set) coll)
--
, 2013 at 2:40 AM, Ray Miller r...@1729.org.uk wrote:
On 1 July 2013 21:39, Cedric Greevey cgree...@gmail.com wrote:
What bugs me is that sorted-set-by needs apply to convert a coll
into a sorted set; there's no short-and-pithy into for that case, and no
coll-taking and varargs version pair
The Cambridge (UK) Clojure group used to meet monthly, but has recently
lost momentum. I'm trying to turn that around and get us back on track with
a regular monthly meet-up. If you are in the Cambridge area and might be
interested in attending these meet-ups, please take a few minutes to
Hi,
Is there a maintained and widely-adopted Clojure interface to any of
the Java DBM libraries (jdbm, jdbm2, BerkeleyDB or MapDB) ?
If not, is there a preferred alternative for persisting a large
hash-map to disk? (Ideally I'd like random access to records without
reading the whole thing into
The 'reduce' solution is very elegant, but you can simplify it further:
(defn filter-file [filename]
(with-open [rdr (io/reader filename)]
(reduce (fn [words line]
(into words (filter #(= 4 (count %) 9) (str/split line #\s+
#{}
(line-seq rdr
On 12 May 2013 10:37, Dick Davies rasput...@hellooperator.net wrote
I've got a half-decent utility written that i want to provide to our
ops team (and not let them know it's Clojure based ssshhh).
Works great with 'lein run -m thingy.core/fn1 arg', but there are several
functions
I
You've assigned to date-formatter-set-to-gmt-time the return value
from the setTimeZone method call. This method returns null, hence the
null pointer exception when you try to call the format method. 'doto'
might help here, like:
(let [gmt-date-formatter (doto (SimpleDateFormat. -MMM-dd
(repeatedly 10 #(ref 100))
Ray.
On 11 December 2012 16:44, Thomas th.vanderv...@gmail.com wrote:
Hi,
How do I create a vector of different refs?
I would like to have a vector with in each cell a ref so that I can
manipulate them independently from each other (Is that a good idea
As Dave says, you can do this using line-seq, but you'll have to
accumulate some state as you read the lines so you can return all the
lines for a given thread's ReqStart to ReqEnd. Once you've returned
that block, you can delete the state for that thread-id, so your
accumulated state will only
On 8 December 2011 01:51, Andy Fingerhut andy.finger...@gmail.com wrote:
I've been going through the PLEAC web site, writing Clojure examples
corresponding to the Perl code examples from the Perl Cookbook:
http://pleac.sourceforge.net
Michael Bacarella started a github repo to collect these
On 6 October 2011 19:38, Ray Miller r...@1729.org.uk wrote:
Incidentally, I used the Apache Commons Base64 encoder, as the one in
contrib was producing different results from the Apache Commons and
Perl implementations. Perhaps a bug?
Here's the problem I alluded to above. I'm trying
On 9 October 2011 20:13, Teemu Antti-Poika antti...@gmail.com wrote:
On Oct 9, 12:56 pm, Ray Miller r...@1729.org.uk wrote:
On 6 October 2011 19:38, Ray Miller r...@1729.org.uk wrote:
Incidentally, I used the Apache Commons Base64 encoder, as the one in
contrib was producing different
On 6 October 2011 18:27, Aaron Bedra aaron.be...@gmail.com wrote:
This actually introduces an opportunity for a much larger set of utilities.
clojure.data.crypto
base64 is part of this idea anyways, and putting it in place along with
nice wrappers around the messy java crypto bits I think
On 19 April 2011 22:34, Michael michael-a...@db.com wrote:
As far as I can tell, ClojureQL does not directly support Oracle. Has
anybody been able to get Clojure QL to work with Oracle? Are there
plans to directly support it? Would be great to use this with Clojure
inside the corporate ship.
On 15 March 2011 08:46, Saul Hazledine shaz...@gmail.com wrote:
On Mar 15, 1:30 am, Paul Dorman paul.dor...@gmail.com wrote:
One thought though is that it may be quicker simply do a lookup on the
directory server, obtain the password and then do a compare. In
OpenLDAP, posixUser uids are
59 matches
Mail list logo