Re: Architectural doubts

2015-01-31 Thread Timothy Baldridge
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 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: Om 0.8.6, Hello CLJSJS

2015-01-31 Thread David Nolen
Template preferred.

On Saturday, January 31, 2015, Sebastian Bensusan sbe...@gmail.com wrote:

 Sure, I'll explore Figwheel's new REPL and add that instead.

 What about adding/configuring Figwheel? Should it be step by step inside
 the tutorial, from mies-om to mies-om + Figwheel? Or it should just start
 with a ready to go template mies-om-wheel?

 Thanks

 Sebastian Bensusan

 On Saturday, January 31, 2015 at 1:26:34 AM UTC+1, David Nolen wrote:
  I would prefer just Figwheel. Relying only on Figwheel also means you
 could probably go out with an updated tutorial much sooner.
 
 
  Thanks,
  David
 
 
  On Fri, Jan 30, 2015 at 4:10 PM, Sebastian Bensusan sbe...@gmail.com
 javascript:; wrote:
 
 
  Hi David and Dan,
 
  I edited Om's Basic Tutorial (
 https://github.com/swannodette/om/wiki/Basic-Tutorial) to be used with
 Chestnut. Most of the work (not much!) was changing evaluate in
 LightTable to save in your text editor. I don't know what the procedure
 is for updating a Wiki and having this conversation, should I open an issue
 on Om? I have it as a standalone repo in case someones wants to propose a
 change or make a pull request:
 
 
  https://github.com/bensu/basic-om-tut
 
 
 
  Two issues:
 
 
  1. Chestnut 0.6.0 (current stable version) uses Om 0.7.3 and I needed to
 deref a cursor inside a go loop in order for things to work. See
 https://github.com/swannodette/om/issues/315 and
 https://github.com/swannodette/om/commit/92a3e0cf698769fb59bb3744faddaea40b37412d.
 Om version is bumped to 0.8.3 beta in v0.7.0-SNAPSHOT-20141226
 
 
  2. Chestnut's 0.6.0 doesn't reload the index.html (not on save, not on
 refresh). The whole process needs to be restarted. See:
 https://github.com/plexus/chestnut/issues/84 This was addressed
 in v0.7.0-SNAPSHOT-20141207.
 
 
  I would wait until Chestnut 0.7.0 stable is published in Clojars before
 adding this tutorial to the Om Wiki. Otherwise, if you feel the extra
 dependency on Chestnut is also too much, I'll fork mies-om and add Figwheel
 there for the tutorial.
 
 
  After revising this work, I'll move on to the next tutorial.
 
 
  Best
 
 
  Sebastian Bensusan
 
 
 
 
 
 
  On Tuesday, January 27, 2015 at 5:25:09 PM UTC+1, David Nolen wrote:
  I think expecting every last thing to work especially from third parties
 who may be wisely lagging behind is unlikely at least for the near future.
 
 
  I haven't kept up with Light Table and what issues it may have. Now is
 probably a good time to remove the Light Table centric nature of the Om
 tutorials and switch to a Figwheel based thing that doesn't require
 anything more than your text editor of choice.
 
 
  The wiki has always been community editable and I would love to see
 people push it forward especially with stuff like this. I will have less
 time for such things as I focus more on Om core and ClojureScript
 enhancements.
 
 
 
  David
 
 
  On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen ol...@comoyo.com
 javascript:; wrote:
  Just testing clojurescript out so many possible pitfalls on my side here.
 
 
 
  Does the new javascript externals stuff break lighttables live external
 browser functionality?
 
 
 
  Following the basic intro tutorial I cannot get live updates to work.
 The mies-om om-tut is based on 0.8.4 , and it cannot reference
 com.facebook.react, while 0.8.6 cannot find cljsjs.react.
 
 
 
  It compiles nicely with lein, but I can't seem to get the lighttable
 live REPL stuff to work.
 
 
 
  Olav
 
 
 
 
 
  On Tuesday, January 27, 2015 at 1:57:19 AM UTC+1, David Nolen wrote:
 
   The only significant change is that Om now relies on the cljsjs.react
 artifact instead of the one I maintained myself. cljsjs.react has the
 benefit that usage of React with addons instead of plain React may be
 configured via Maven in your pom.xml or your project.clj. It's exciting to
 see that we are already reaping the benefits of :foreign-libs and Maven
 over existing JavaScript solutions for managing dependencies.
 
  
 
  
 
   This release also includes a fix for a very subtle set-state! bug
 discovered by Brenton Ashworth.
 
  
 
  
 
  
 
   Feedback welcome!
 
  
 
  
 
   https://github.com/swannodette/om
 
  
 
  
 
  
 
   David
 
 
 
  --
 
  Note that posts from new members are moderated - please be patient with
 your first post.
 
  ---
 
  You received this message because you are subscribed to the Google
 Groups ClojureScript group.
 
  To unsubscribe from this group and stop receiving emails from it, send
 an email to clojurescrip...@googlegroups.com javascript:;.
 
  To post to this group, send email to clojur...@googlegroups.com
 javascript:;.
 
  Visit this group at http://groups.google.com/group/clojurescript.
 
 
 
 
 
 
 
 
  --
 
  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
 javascript:;
 
  Note that posts from new members are moderated - please be patient with
 your 

Extending the LispReader with embeded language lorms

2015-01-31 Thread henrik42
Hi,

I would like to be able to include non-Lisp-ish DSLs in my clojure code 
(like bash HERE documents) e.g. for copypasting CSV data into the code 
without having to go through an external file and consume that. 

So I hacked an experiment that does the parsing and embeding (transforming 
to Clojure target form is missing in the examples).
If you're interested have a look at 
https://github.com/henrik42/extended-lisp-reader

What do you think? 

Henrik

-- 
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: Q: How to parse stream of text (from java.io.Reader) via instaparse with minimal input consuption

2015-01-31 Thread henrik42
Hi,
I finally came up with a simple function that incremenally consumes the 
input stream, building the head of the input and calls an instaparse parser 
when it encounters a ]. If this fails, the function recurs.
This function is not even dependent on instaparse directly.
You can find the source at 
https://github.com/henrik42/extended-lisp-reader/blob/master/src/extended_lisp_reader/stream_parser.clj
In 
https://github.com/henrik42/extended-lisp-reader/blob/master/src/extended_lisp_reader/instaparse_adapter.clj
 
you find (parser-for) that builds an instaparse parser that parses input 
text from a stream/Reader.
Henrik

-- 
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: call superclass constructor in clojure class generation with defrecord

2015-01-31 Thread coco
thanks Michael this does the job...in this code, now I've other doubt

public class MyWindow extends Window
{
public MyWindow()  // --- not clear where I need declare it
{
super(My Window!);
Panel horizontalPanel = new Panel(new Border.Invisible(), 
Panel.Orientation.HORIZONTAL);
Panel leftPanel = new Panel(new Border.Bevel(true), 
Panel.Orientation.VERTICAL);
Panel middlePanel = new Panel(new Border.Bevel(true), 
Panel.Orientation.VERTICAL);
Panel rightPanel = new Panel(new Border.Bevel(true), 
Panel.Orientation.VERTICAL);

horizontalPanel.addComponent(leftPanel);
horizontalPanel.addComponent(middlePanel);
horizontalPanel.addComponent(rightPanel);

addComponent(horizontalPanel); // this is a confusing part too
}
}



in this code addComponent(horizontalPanel)  is basically something like
this.addComponent(horizontalPanel)

does clojure have the this reference??...how can I call the 
constuctor...I'm thinkingin something like this

  (defn MyWindow []
  (proxy [Window] [My windows!!]
(MyWindow [] (. this addComponent (Label. Bang!!)  

is it wrong no? :D

thanks!!!

El viernes, 30 de enero de 2015, 18:47:48 (UTC-4:30), Michael Blume 
escribió:

 (defn my-window []
   (proxy [Window] []))

 should do the trick

 Proxy takes a vector of implemented interfaces and at most one superclass 
 (in your case, Window), and then a second vector of arguments to pass to 
 the superclass constructor (in your case, an empty vector) and then a 
 series of methods implemented/overridden on the parent class/interfaces -- 
 in your case there's none of those.

 My understanding is that proxy is not quite as performant as 
 reify/defrecord, but it's the only game in town if you actually want to 
 subclass something.

 Hope this helps =)

 On Fri Jan 30 2015 at 3:05:11 PM coco clasespart...@gmail.com 
 javascript: wrote:

 Hi everybody, I need implement this java code in clojure

  public class MyWindow extends Window
  {
 public MyWindow()
  {
   super(My Window!);
  }
 }

 MyWindow myWindow = new MyWindow();


 unfortunately the clojure documentation for generate classes is not so 
 complete or straightforward for my understand...must I use gen-class or can 
 I use defrecord for this task?...how can I call super class 
 constructors??...

 thanks

 -- 
 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 
 javascript:
 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 javascript:
 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 javascript:.
 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: heaps in clojure vs SML

2015-01-31 Thread Mars0i
You also might want to use Criterium 
https://github.com/hugoduncan/criterium rather than *time *for accurate 
benchmarking*.*

On Friday, January 30, 2015 at 6:54:52 AM UTC-6, Maris wrote:


 yes,  it helped :-)

 type hints make non-trivial difference   

 thank you

 On Friday, 30 January 2015 12:43:40 UTC, Nicola Mometto wrote:


 If you set! *warn-on-reflection* to true, you'd see a lot of reflection 
 warnings from your code. 

 Type-hinting the code like this: http://sprunge.us/ATiV makes your 
 example execute in 120ms on my machine. 

 Maris writes: 

  I implemented leftist heap (from Purely Functional Data Structures 
 book) 
   in clojure. 
  
  https://gist.github.com/maruks/135fef92455578b61de2 
  
  It takes 32 seconds to insert 10 elements in heap: 
  
  (time  (peek   (reduce conj (empty-heap)  (range 1000 2000 100) 
  ))) 
  Elapsed time: 32649.71438 msecs 
  1000 
  
  Why is it so much slower than SML NJ?  Something wrong with my code? 
  
  
  Here is SML version: 
  https://gist.github.com/maruks/c863eac9cf057a071307 
  
  And function that inserts 10 elements in *54* milliseconds ! 
  
  fun test(n:int) : int  = 
  let 
  val r = List.tabulate(n, fn x = 1000 + 100 * x) 
  val h = foldl ( fn (e, h) = IntHeap.insert(e , h) )  IntHeap.empty  r 
  in 
  IntHeap.findMin(h) 
  end 

 -- 



-- 
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] Quil 2.2.5 Release

2015-01-31 Thread Nikita Beloglazov
Happy to announce Quil 2.2.5 release.

Quil is a Clojure/ClojureScript library for creating interactive drawings
and animations. Github repo https://github.com/quil/quil.

The release available on clojars: https://clojars.org/quil. This is a minor
release with only 2 changes:

   - Support global-key-events option for cljs sketch. It allows sketches
   to listen to all key events even if sketch doesn't have focus.
   - Use latest cljs capabilites to simplify setting up cljs project: no
   more externs, preamble and easy-to-use :none optimization level.

More about second change:

You no longer need to specify externs or preamble files in project.clj and
no need to include processing.js file on a page if you did. Everything will
be wired up automatically by clojurescript so advanced compilation is a
piece of cake now: just change optimizations to :advanced and that's all.

Using :none optimization level became easier: you no longer need to change
html page to switch between none and other level. quil-cljs template has
been updated to use :none so you can try it out to see how it works. Just
run lein quil-cljs my-sketch.

Note that Quil 2.2.5 supports only clojurescript 0.0-2727 and above.

Documentation on http://quil.info has been updated as well.

Happy hacking!
Nikita

-- 
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

2015-01-31 Thread John Wiseman
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: call superclass constructor in clojure class generation with defrecord

2015-01-31 Thread Michael Blume
The defn wrapping the call to proxy basically is the constructor, so you
wind up with something roughly like

(defn get-window []
  (let [this (proxy [Window] [My Window!]
  ; any methods you want to override on Window go here
  )
; stuff making panels goes here
 ]
(.addComponent this horizontal-panel)
this))

Note, I'm calling a variable 'this' but it's *just a variable, the only
reason I called it 'this' was to make it look more like the java version.

On Sat Jan 31 2015 at 9:53:30 AM coco clasesparticulares...@gmail.com
wrote:

 thanks Michael this does the job...in this code, now I've other doubt

 public class MyWindow extends Window
 {


 public MyWindow()  // --- not clear where I need declare it
 {
 super(My Window!);
 Panel horizontalPanel = new Panel(new Border.Invisible(), 
 Panel.Orientation.HORIZONTAL);
 Panel leftPanel = new Panel(new Border.Bevel(true), 
 Panel.Orientation.VERTICAL);
 Panel middlePanel = new Panel(new Border.Bevel(true), 
 Panel.Orientation.VERTICAL);
 Panel rightPanel = new Panel(new Border.Bevel(true), 
 Panel.Orientation.VERTICAL);

 horizontalPanel.addComponent(leftPanel);
 horizontalPanel.addComponent(middlePanel);
 horizontalPanel.addComponent(rightPanel);

 addComponent(horizontalPanel); // this is a confusing part too
 }
 }



 in this code addComponent(horizontalPanel)  is basically something like
 this.addComponent(horizontalPanel)

 does clojure have the this reference??...how can I call the
 constuctor...I'm thinkingin something like this

   (defn MyWindow []
   (proxy [Window] [My windows!!]
 (MyWindow [] (. this addComponent (Label. Bang!!) 

 is it wrong no? :D

 thanks!!!

 El viernes, 30 de enero de 2015, 18:47:48 (UTC-4:30), Michael Blume
 escribió:

 (defn my-window []
   (proxy [Window] []))

 should do the trick

 Proxy takes a vector of implemented interfaces and at most one superclass
 (in your case, Window), and then a second vector of arguments to pass to
 the superclass constructor (in your case, an empty vector) and then a
 series of methods implemented/overridden on the parent class/interfaces --
 in your case there's none of those.

 My understanding is that proxy is not quite as performant as
 reify/defrecord, but it's the only game in town if you actually want to
 subclass something.

 Hope this helps =)

 On Fri Jan 30 2015 at 3:05:11 PM coco clasespart...@gmail.com wrote:

 Hi everybody, I need implement this java code in clojure

  public class MyWindow extends Window
  {
 public MyWindow()
  {
   super(My Window!);
  }
 }

 MyWindow myWindow = new MyWindow();


 unfortunately the clojure documentation for generate classes is not so
 complete or straightforward for my understand...must I use gen-class or can
 I use defrecord for this task?...how can I call super class
 constructors??...

 thanks

 --
 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 

Re: [ClojureScript] Re: ANN: Om 0.8.6, Hello CLJSJS

2015-01-31 Thread Sebastian Bensusan
Sure, I'll explore Figwheel's new REPL and add that instead.

What about adding/configuring Figwheel? Should it be step by step inside the 
tutorial, from mies-om to mies-om + Figwheel? Or it should just start with a 
ready to go template mies-om-wheel?

Thanks

Sebastian Bensusan

On Saturday, January 31, 2015 at 1:26:34 AM UTC+1, David Nolen wrote:
 I would prefer just Figwheel. Relying only on Figwheel also means you could 
 probably go out with an updated tutorial much sooner.
 
 
 Thanks,
 David
 
 
 On Fri, Jan 30, 2015 at 4:10 PM, Sebastian Bensusan sbe...@gmail.com wrote:
 
 
 Hi David and Dan,
 
 I edited Om's Basic Tutorial 
 (https://github.com/swannodette/om/wiki/Basic-Tutorial) to be used with 
 Chestnut. Most of the work (not much!) was changing evaluate in LightTable 
 to save in your text editor. I don't know what the procedure is for 
 updating a Wiki and having this conversation, should I open an issue on Om? I 
 have it as a standalone repo in case someones wants to propose a change or 
 make a pull request:
 
 
 https://github.com/bensu/basic-om-tut
 
 
 
 Two issues:
 
 
 1. Chestnut 0.6.0 (current stable version) uses Om 0.7.3 and I needed to 
 deref a cursor inside a go loop in order for things to work. See 
 https://github.com/swannodette/om/issues/315 and 
 https://github.com/swannodette/om/commit/92a3e0cf698769fb59bb3744faddaea40b37412d.
  Om version is bumped to 0.8.3 beta in v0.7.0-SNAPSHOT-20141226
 
 
 2. Chestnut's 0.6.0 doesn't reload the index.html (not on save, not on 
 refresh). The whole process needs to be restarted. See: 
 https://github.com/plexus/chestnut/issues/84 This was addressed in 
 v0.7.0-SNAPSHOT-20141207.
 
 
 I would wait until Chestnut 0.7.0 stable is published in Clojars before 
 adding this tutorial to the Om Wiki. Otherwise, if you feel the extra 
 dependency on Chestnut is also too much, I'll fork mies-om and add Figwheel 
 there for the tutorial.
 
 
 After revising this work, I'll move on to the next tutorial.
 
 
 Best
 
 
 Sebastian Bensusan
 
 
 
 
 
 
 On Tuesday, January 27, 2015 at 5:25:09 PM UTC+1, David Nolen wrote:
 I think expecting every last thing to work especially from third parties who 
 may be wisely lagging behind is unlikely at least for the near future.
 
 
 I haven't kept up with Light Table and what issues it may have. Now is 
 probably a good time to remove the Light Table centric nature of the Om 
 tutorials and switch to a Figwheel based thing that doesn't require anything 
 more than your text editor of choice.
 
 
 The wiki has always been community editable and I would love to see people 
 push it forward especially with stuff like this. I will have less time for 
 such things as I focus more on Om core and ClojureScript enhancements.
 
 
 
 David
 
 
 On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen ol...@comoyo.com wrote:
 Just testing clojurescript out so many possible pitfalls on my side here.
 
 
 
 Does the new javascript externals stuff break lighttables live external 
 browser functionality?
 
 
 
 Following the basic intro tutorial I cannot get live updates to work. The 
 mies-om om-tut is based on 0.8.4 , and it cannot reference 
 com.facebook.react, while 0.8.6 cannot find cljsjs.react.
 
 
 
 It compiles nicely with lein, but I can't seem to get the lighttable live 
 REPL stuff to work.
 
 
 
 Olav
 
 
 
 
 
 On Tuesday, January 27, 2015 at 1:57:19 AM UTC+1, David Nolen wrote:
 
  The only significant change is that Om now relies on the cljsjs.react 
  artifact instead of the one I maintained myself. cljsjs.react has the 
  benefit that usage of React with addons instead of plain React may be 
  configured via Maven in your pom.xml or your project.clj. It's exciting to 
  see that we are already reaping the benefits of :foreign-libs and Maven 
  over existing JavaScript solutions for managing dependencies.
 
 
 
 
 
  This release also includes a fix for a very subtle set-state! bug 
  discovered by Brenton Ashworth.
 
 
 
 
 
 
 
  Feedback welcome!
 
 
 
 
 
  https://github.com/swannodette/om
 
 
 
 
 
 
 
  David
 
 
 
 --
 
 Note that posts from new members are moderated - please be patient with your 
 first post.
 
 ---
 
 You received this message because you are subscribed to the Google Groups 
 ClojureScript group.
 
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to clojurescrip...@googlegroups.com.
 
 To post to this group, send email to clojur...@googlegroups.com.
 
 Visit this group at http://groups.google.com/group/clojurescript.
 
 
 
 
 
 
 
 
 -- 
 
 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

Architectural doubts

2015-01-31 Thread Milton Silva
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.


Re: Extending the LispReader with embeded language lorms

2015-01-31 Thread henrik42
*LOL* Can anybody change the title to embeded language forms? :-)

-- 
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

2015-01-31 Thread Jan-Paul Bultmann
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.