(jdbc/query db [select blob_contents from ce_blob where event_id in
(?,?,?) [10024279,10024280,10024281]]
:row-fn (fn [r]
(some- r
:blob_contents
.getBinaryStream
On Jan 30, 2014, at 01:36 , Steffen steffen.die...@gmail.com wrote:
If you would like to use a specific codec other than :byte or :ubyte but also
restrict the number of bytes read this would only work if you expected to
have some kind of optional padding after your objects, like:
I'm writing a an ETL process to read event level data from a product
database, transform / aggregate it and write to to an analytics data
warehouse. I'm using clojure's core.async library to separate these process
into concurrently executing components. Here's what the main part of my
code
Wow! This looks really cool.
+1
On Thu, Jan 30, 2014 at 05:13:36AM -0800, Magnar Sveen wrote:
clj-refactor.el
Since the last update, there's been lots of activity for
clj-refactor.elhttps://github.com/magnars/clj-refactor.el
. Alex Baranosky https://github.com/AlexBaranosky and Lars
The bean function is a very useful Java interop feature that provides a
read-only view of a Java Bean as a Clojure map.
As it stands, the function performs introspection on the bean's class
whenever the function is called:
(defn bean
Takes a Java object and returns a read-only implementation
Hi all,
I think we are all familiar with the wonderful core.logic implementation
of a sudoku solver by David Nolen. Now, I am trying to combine his
solver with the `random-puzzle` generator shown here (
http://jkkramer.com/sudoku.html). I have made the necessary changes (to
deal with seqs
Am Donnerstag, 30. Januar 2014 14:05:07 UTC+1 schrieb Michael Gardner:
On Jan 30, 2014, at 01:36 , Steffen steffen...@gmail.com javascript:
wrote:
If you would like to use a specific codec other than :byte or :ubyte but
also restrict the number of bytes read this would only work if you
Hi,
Not every bean is immutable, so you cannot cache its values by default. If
reading from the bean is expensive for you, either create a normal hash-map
with into {} and select-keys, or use memoize.
user= (def b (bean (java.util.Date.)))
#'user/b
user= (def hm (into {} (select-keys b [:year
I'm not caching the values, only the mapping from keywords to methods (the
caching is per class, not per bean). It's just saving the
introspection/reflection on each call. The values themselves are always
obtained directly from the bean.
On Thursday, January 30, 2014 4:12:31 PM UTC+2, Jozef
Sorry, I've misread your post. If you want this feature to be added to
Clojure, please submit a ticket at http://dev.clojure.org/jira/browse/CLJ
JW
On Thu, Jan 30, 2014 at 3:16 PM, pron ron.press...@gmail.com wrote:
I'm not caching the values, only the mapping from keywords to methods (the
Is there any way to invalidate this cache?
Thanks,
Ambrose
On Thu, Jan 30, 2014 at 9:35 PM, pron ron.press...@gmail.com wrote:
The bean function is a very useful Java interop feature that provides a
read-only view of a Java Bean as a Clojure map.
As it stands, the function performs
On Jan 30, 2014, at 08:10 , Steffen Dienst steffen.die...@gmail.com wrote:
That's exactly what padding is designed to do: Let's say you know there is a
run of bytes with a known length (from a header field maybe) and you want to
parse an unbounded number of objects within this area. You
Well there is a remove method in ClassValue,
http://docs.oracle.com/javase/7/docs/api/java/lang/ClassValue.html#remove(java.lang.Class)and
it seems that the cache is implemented in a way that it does not hold
class objects, thus it does not prevent class from GCing (the cached value
is stored in
Sorry, you're right. No WeakReferences on the class keys, rather a map is
stored in a field of Class (similarly to ThreadLocal). BTW, this ClassValue
was written by John Rose as part of JSR 292, and a very interesting
implementation vis-a-vis concurrency
On Thursday, January 30, 2014 4:59:40
Thanks to the work and thought of Mark Engelberg, Alex Miller, Rich Hickey,
myself, and likely several others who I should be naming here but am
forgetting, the latest (not yet released) Clojure master version has an
improved hash function that gives a much better variety of hash values, and
thus
Here's the
Javadochttp://docs.oracle.com/javase/7/docs/api/java/lang/ClassValue.html
.
You can invalidate individual entries with the remove method.
A class object itself - or at least those parts visible at runtime through
reflection - can never change. Reloading a class with the same name
Niels,
Cant thank you enough.
Regards
Bryan
On Sunday, January 26, 2014 10:21:18 PM UTC-6, bww00...@yahoo.com wrote:
ANyone have some examples reading a blob column from an oracle db.
We have a database with a blob column.
A entity can be split acroos multiple rows.
If there are multiple
I think your case is exactly where not to use go blocks. Stuff in go
blocks is executed on a limited size thread pool so with enough blocking
I/O in there you could in theory slow down async processing.
The win in using ! and ! in go blocks is that they don't block async
threads _while they are
Hi,
Consider this block of code:
(async/go (async/chan))
This creates a go-thread and a go-chan.
The go-thread is linked from the list of blocked go-threads.
The go-chan is linked from the go-thread.
Thus, did we just create a go-thread and a go-chan which is NOT gc-ed at all?
The key thing to remember in all questions of core.async GC is that there
is no global blocked gos queue. Instead, the blocked gos are attached
directly to the channel. When the channel is GC'd all attached gos are GC'd
as well.
So in this case, it's actually even simpler.the go never blocks.
go blocks, together with !, !, alt!, etc... do not create any new threads
and are not run in separate thread. There is no thread pool for go blocks.
Code inside go blocks is transformed into state machine, and the state
machine 'object' is parked in the corresponding channel. When the
The key thing to remember in all questions of core.async GC is that there is
no global blocked gos queue. Instead, the blocked gos are attached
directly to the channel. When the channel is GC'd all attached gos are GC'd
as well.
This is the source of all my mis-understanding. Thanks for
Thanks for posting that here Andy - I've been mostly off the grid this week
and haven't had time to do some of this followup. I would also like to say
many thanks to Mark and Andy who have spent a lot of time elucidating the
original issue and working on how to address it.
Alex
On Thursday,
Following up on this. Is the following correct:
* async/thread creates Java threads -- these _are_ root gc objects
* async/go creates go blocks, which in reality, is just a state
machine. go-blocks are NOT root gc objects
* go-blocks do _NOT_ have stackframes -- they're just a simple, flat
Couple of points:
- If this piece of code is a performance bottleneck, benchmark whether go
'threads' or real threads better suits your needs.
- Handle edge cases, e.g. how your code behave when the channels close,
mainly if you have (while true ...) combo.
- async/thread uses growing thread
Seems OK. Note that code inside go blocks is transformed into state machine
'object' immediatelly, not waiting for hitting !, as go is a macro.
On Thu, Jan 30, 2014 at 8:36 PM, t x txrev...@gmail.com wrote:
Following up on this. Is the following correct:
* async/thread creates Java threads
Hi Jim
Using this https://gist.github.com/swannodette/3217582 version of Davids
solver and and the random puzzle generator you refer to the below works for
me:
(sudokufd (vec (map #(if (= % \.) 0 (Integer. (str %))) (random-puzzle
I did adapt David's solver to work with core.logic 0.8.5,
On Thu, Jan 30, 2014 at 8:01 AM, Jim - FooBar(); jimpil1...@gmail.comwrote:
Now, I am trying to combine his solver with the `random-puzzle` generator
shown here ( http://jkkramer.com/sudoku.html).
[...]
any clues? I'd like to be able to generate random-puzzles that can be
passed to the
Great! Thanks for verifying.
On Thu, Jan 30, 2014 at 11:46 AM, Jozef Wagner jozef.wag...@gmail.com wrote:
Seems OK. Note that code inside go blocks is transformed into state machine
'object' immediatelly, not waiting for hitting !, as go is a macro.
On Thu, Jan 30, 2014 at 8:36 PM, t x
I work on a Java team, so our use of clojure is either
a) calling into clojure from java or
b) directly using the clojure data structures.
Recently we had an app fail because, as it was starting up, one thread was
trying to require a clojure namespace, and another was trying to use a
+1
On Thu, Jan 30, 2014 at 11:13 AM, Andy Fingerhut
andy.finger...@gmail.comwrote:
Thanks to the work and thought of Mark Engelberg, Alex Miller, Rich
Hickey, myself, and likely several others who I should be naming here but
am forgetting, the latest (not yet released) Clojure master version
On Thu, Jan 30, 2014 at 12:48 PM, Jozef Wagner jozef.wag...@gmail.comwrote:
go blocks, together with !, !, alt!, etc... do not create any new
threads and are not run in separate thread. There is no thread pool for go
blocks.
I thought that go blocks do run in a thread pool of size 42 + (2 *
To quote Jozef it can happen all in one thread. This is somewhat true,
there are some rare situations where this can happen, but it is fairly
rare.
Many times putting a value into a channel will mean that the callback on
the other end of the channel needs to be dispatched. In that case Mauricio
Hi,
With apologies for a soft question:
This question is NOT:
I'm in a situation where client = cljs, server = clj, and I want to
figure out how to setup a core.async channel, using pr-str and
edn/read-string, where I can seamlessly push data back and forth
between client and server.
This
On Jan 30, 2014, at 8:22 PM, Michael Blume blume.m...@gmail.com wrote:
Recently we had an app fail because, as it was starting up, one thread was
trying to require a clojure namespace, and another was trying to use a
PersistentHashSet. Somehow these two threads wound up in deadlock. I've
My question would be “Why not?”
If you have a client using core.async and a server using core.async and you
have a library that feeds data from certain channels back and forth over
websockets, then you have channels everywhere.
So I’m not sure why you think your “con” is actually a thing?
36 matches
Mail list logo