Re: Bit rot and leiningen?

2020-02-06 Thread Aditya Athalye
On Thursday, February 6, 2020 at 4:04:42 AM UTC+5:30, Sean Corfield wrote:
>
> > because I still haven't found a development environment I like better 
> than LightTable
>
>  
>
> Have you looked at Atom/Chlorine recently? It has the same inline result 
> display that LightTable had, it has a built-in ClojureScript REPL, support 
> for Socket REPLs (in local and remote processes), and support for 
> shadow-cljs if you’re in the ClojureScript world.
>
>  
>
> I used to use LightTable all the time but after it stopped being 
> maintained I gave up on it and went back to Emacs for a while, then 
> switched to Atom/ProtoREPL – until ProtoREPL stopped being maintained – and 
> then to Atom/Chlorine where I’ve been extremely happy for over a year.
>

Going a bit OT for this thread because LightTable came up here a couple of 
times in context of bitrot.

Pratik Karki, who took on LightTable's maintainership, is scheduled to 
speak about the IDE at IN/Clojure (https://inclojure.org) next week.

Incidentally, Bozhidar is also going to speak and his subject is the Future 
of Clojure tooling. 

As an Emacs/Prelude/CIDER user who also _really_ like LightTable, I dearly 
hope their futures are promising.

May the Source be with us,
- Aditya
https://github.com/adityaathalye
https://inclojure.org/#team

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/fd1794ab-6980-4de9-b06e-ad551a16b1b0%40googlegroups.com.


Re: Loop causing OutOfMemoryError: GC overhead limit exceeded ?

2018-03-03 Thread Aditya Athalye
On Saturday, March 3, 2018 at 1:39:23 PM UTC+5:30, Aditya Athalye wrote:
>
> On Friday, March 2, 2018 at 9:58:35 PM UTC+5:30, Rob Nikander wrote:
>>
>>
>>
>> On Friday, March 2, 2018 at 12:48:28 AM UTC-5, Daniel wrote:
>>>
>>> How do you know this code is causing the error? Unless this is all your 
>>> code does, descriptions of the error suggest the memory leak might be 
>>> coming from anywhere. This tight loop might trigger too many successive GCs 
>>> though: have you observed if the error only occurs under load, or under 
>>> large time intervals? Some combination?
>>>
>>
>> Okay, thanks for looking it over. This is a single-threaded, short lived 
>> script, so this is the only thing happening. But it's possible there is an 
>> unexpected large result set. I'll look into that. It may be smarter to use 
>> `limit N` in my SQL, rather than the time range.
>>
>
> Rob, 
>
> While I could see the intent of the original code, I found it hard to 
> reason about where the problem might lie, given the loops in loops in loops.
>
> Assuming the code is causing an error, I feel it will help to separate out 
> the db query, and factor the rest of the logic into a pipeline.
>
> This way one could:
>  - profile the DB query and fix it separately
>  - isolate and check each part of the records transformation pipeline
>  - make more obvious what's going on (aid visual audit)
>
> [snip ...]
>

P.S. Oops, replied to the wrong message. I took a slight departure from 
Gary Johnson's approach and meant to add on top of 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/d/optout.


Re: Loop causing OutOfMemoryError: GC overhead limit exceeded ?

2018-03-03 Thread Aditya Athalye
On Friday, March 2, 2018 at 9:58:35 PM UTC+5:30, Rob Nikander wrote:
>
>
>
> On Friday, March 2, 2018 at 12:48:28 AM UTC-5, Daniel wrote:
>>
>> How do you know this code is causing the error? Unless this is all your 
>> code does, descriptions of the error suggest the memory leak might be 
>> coming from anywhere. This tight loop might trigger too many successive GCs 
>> though: have you observed if the error only occurs under load, or under 
>> large time intervals? Some combination?
>>
>
> Okay, thanks for looking it over. This is a single-threaded, short lived 
> script, so this is the only thing happening. But it's possible there is an 
> unexpected large result set. I'll look into that. It may be smarter to use 
> `limit N` in my SQL, rather than the time range.
>

Rob, 

While I could see the intent of the original code, I found it hard to 
reason about where the problem might lie, given the loops in loops in loops.

Assuming the code is causing an error, I feel it will help to separate out 
the db query, and factor the rest of the logic into a pipeline.

This way one could:
 - profile the DB query and fix it separately
 - isolate and check each part of the records transformation pipeline
 - make more obvious what's going on (aid visual audit)

May I suggest something like this (If I've understood what the original 
code is trying to achieve):

(defn query-recs
  [db min-time max-time]
  (jdbc/query db
  ["select id, a, b, c from sometable where t > ? and t <= ? 
order by t"
   min-time max-time]))


(define intervals
  [min-time max-time]
  (->> (iterate (partial plus-minutes min-t) 30)
   (take-while #(before? max-time %))
   (partition 2 1)))


(defn find-db-records [db min-time max-time]
  (let [group-rows
(fn [min-t max-t]
  (->> (query-recs db min-t max-t)
   (partition-all 200)))

extract-relevant-records
(fn [[rows foo]]
  (filter #(relevant-record? foo (:a %) (:b %))
  rows))

proc-relevant-records
(fn [rows]
  (map #(assoc % :d (computed-d (:a %) (:b %) (:c %)))
   rows))]
(reduce (fn [rxs [min-t max-t]]
  (->> (group-rows min-t max-t)
   (map (juxt identity make-foo))
   (map extract-relevant-records)
   (mapcat proc-relevant-records)
   (into rxs)))
[]
(intervals min-time max-time

 

-- 
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: Help please: New to clojure development

2018-02-06 Thread Aditya Athalye
Welcome to Clojure, Nadeen.

A few friends and I created "Clojure by example" for programmers not 
familiar with Clojure https://github.com/inclojure-org/clojure-by-example

This is intended as a quick-start to a common way of problem-solving with 
Clojure. 

The README explains more, and should help you decide if it's for you.

(Shameless plug, because I think it's going to be useful in your particular 
case.)

Further, in case you have not come across it yet, the official Clojure 
website also links to many resources, under the "Getting Started" page 
https://clojure.org/guides/getting_started

Enjoy!

-- 
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] Clojure By Example: IN/Clojure'18 workshop source material

2018-01-19 Thread Aditya Athalye
Hello,

I'd like to share the material (source code etc.) for a Clojure workshop 
for programmers.

The material supported a 1-day guided workshop conducted at the 
recently-concluded IN/Clojure conference in Bangalore, India 
(http://inclojure.org/).

While the material is most fun and effective in a live interactive session, 
we've documented it heavily so one may follow along at home too.

The README explains more (study goals, setup, design perspective).

The source is available here: 
https://github.com/inclojure-org/clojure-by-example

My friends[1] and I enjoyed making and teaching this material.

We hope it will be another useful entry point into the weird and wonderful 
land of Clojure.

Sincerely,
Aditya
---
[1] https://github.com/inclojure-org/clojure-by-example#credits

-- 
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: Real World Example

2014-04-09 Thread Aditya Athalye
Welcome, Anthony. 

I'm not aware of complete applications that fit your requirement, 
however I think you'll find value in the newly-minted Clojure Cookbook 
http://clojure-cookbook.com/ ... many, many examples of real-world 
problems, 
across domains, solved by Clojure practitioners.

All the examples and solutions are available here:
https://github.com/clojure-cookbook/clojure-cookbook

Cheers, and once again, welcome!



On Wednesday, April 9, 2014 12:53:06 AM UTC+5:30, Anthony Ortiz wrote:
>
> Hello world!
>
> I'm a C# developer who recently went to an interview at a major bank here 
> in NYC and found that they've been using Clojure for their business logic 
> for over a year already and that got me curious, so I find myself on 
> unfamiliar territory learning how to program in a functional language. So 
> far so good, Moxley Stratton's online tutorial combined with Try Clojure 
> (the online interpreter) has been very helpful (kudos to you guys!) and I'm 
> now going through the book 'Programming Clojure'. So far I've seen a lot of 
> utility/academic examples such as fibonacci but little in the way of an 
> actual real-world example of a top-to-bottom desktop application built 
> using Clojure on either the JVM or CLR, something simple that would 
> demonstrate how Clojure fits into the event-driven model on the client-side 
> behind, let's say, WPF, and how it would interact with more Clojure on the 
> service-side via, let's say, WCF. Does anyone know of an example they can 
> direct me to?
>
> Many thanks!
>
> Anthony
>

-- 
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: How did you learn Clojure?

2014-03-27 Thread Aditya Athalye
@Marcus, Thanks for your kind words, Marcus.

@Gareth, +1. I feel re-implementing a past solution is a really good 
learning technique.
Half the battle is to correctly understand a problem/domain and work out 
how to solve it.
No point taking on that kind of friction if the purpose is to learn a new 
language.



On Thursday, March 27, 2014 10:20:11 PM UTC+5:30, Marcus Blankenship wrote:
>
> Awesome, thanks for the advice.  I need to find something I’ve written and 
> translate it to Clojure...
> On Mar 26, 2014, at 7:14 PM, gaz jones > 
> wrote:
>
> A technique I use whenever I need to learn a new language is to write the 
> same application I already have in another language.  I generally choose 
> downloading nzbs from usenet as it can involve a number of interesting 
> programming techniques, at least enough to give you a pretty good idea of 
> how a language handles things like:
>
> * threading and work queues (downloading files concurrently)
> * socket io (writing a simple nntp client)
> * xml processing (parsing nzb files)
> * binary encoding/decoding (yenc implementation)
> * curses style ui
> * web ui
> * command line arguments
> * configuration
> * signal handling
> * testing (haha kidding)
>
> TBH I usually get about 50% of the way through and have enough of a handle 
> on the language at that point to abandon my efforts and move on.
>
> On Wed, Mar 26, 2014 at 7:22 PM, Daniel Higginbotham 
> 
> > wrote:
>
>> Chiming in a bit late, but here was my path:
>>
>> * Read "Land of Lisp" by Conrad Barski. This was my first real contact 
>> with lisp and functional programming. I found it challenging, but the book 
>> is well-written and the technique of teaching through writing games was 
>> perfect for me. It uses common lisp which is almost baroque compared to 
>> Clojure, but it was helpful later in getting a better sense of Clojure's 
>> roots. Also, most of the classic lisp books out there use common lisp
>> * Tried to write my own web-based game using common lisp. This was true 
>> fun and I learned a ton
>> * Read "On Lisp" by Paul Graham. It is an excellent book
>> * Was introduced to Clojure through a talk given by Alan Dipert at my 
>> workplace
>> * Learned Clojure by skipping around Clojure in Action, Programming 
>> Clojure, and Clojure Programming. Settled on Clojure Programming.
>> * projecteuler.net has been a good help
>> * I've been teaching Clojure to folks at work, which forces me to deeply 
>> understand the material
>> * At the same time, I've kept building little web apps to solidify my 
>> knowledge. One of them, http://gratefulplace.com, is actually used :)
>>
>> I feel like I know enough to get stuff done, but there's still so much 
>> more to learn. Most recently I've been brushing up on math/logic so that I 
>> can better understand the more mathy texts whenever I encounter them.
>>
>>
>> On Thursday, March 20, 2014 9:08:41 PM UTC-4, Marcus Blankenship wrote:
>>>
>>> Hi Folks, 
>>>
>>> I'm a post technical PM who's fascinated by Clojure, and want to learn 
>>> it, but am having a hard time without a "real" project to work on. It's 
>>> actually excited me so much I'm considering hanging up my PM hat and diving 
>>> back in the "programmer pool" again! 
>>>
>>> My problem appears to be 1) focus, and 2) fear. Focus because I can't 
>>> (yet) earn a living on a clojure project, so it must be done during "off 
>>> hours". Fear because it's harder and more different than the old OO 
>>> languages I've used in the past. 
>>>
>>> So I'm curious: how did you learn Clojure well enough to be proficient 
>>> with it, or how are you working on learning it? 
>>>
>>> Anyone else facing the focus + fear dilemma? 
>>>
>>> Sent from my iPhone
>>
>>
>> -- 
>> 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.
> T

Re: How should I begin this project?

2014-03-24 Thread Aditya Athalye
Thanks for the lead on exercism.io, Tim. 

I just set it up, to peek at how it looks/works.

The setup itself was a breeze, and the very first exercise is 
a nice little text processing problem. (Based on "Deaf Grandma", 
found here: http://pine.fm/LearnToProgram/?Chapter=06)

Feels like a good follow-on to the "medium" difficulty level on 4clojure,
and to Clojure Koans.

Cool!



On Monday, March 24, 2014 6:45:42 PM UTC+5:30, Tim Visher wrote:
>
> On Thu, Mar 20, 2014 at 1:43 PM, kurofune > 
> wrote: 
> > Thank you very much for both of those emails Gary. Your programming 
> advice rang very true and doodle does look almost exactly like what I need. 
> I'll look into that and google calendar, but now I need a good project to 
> work on! How does one go about getting mentored in Clojure? Is that even a 
> thing? 
>
> The mailing list and IRC channels are _amazing_ resources in this 
> community. Pick something and start lurking! :) 
>
> I've also heard really good things lately about exercism.io, though I 
> have no personal experience with it. http://exercism.io/ 
>
> -- 
>
> In Christ, 
>
> Timmy V. 
>
> http://blog.twonegatives.com/ 
> http://five.sentenc.es/ -- Spend less time on mail 
>

-- 
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: How did you learn Clojure?

2014-03-24 Thread Aditya Athalye
Marcus, 
Thanks for asking the question and instigating this discussion.

A bit late into the thread, but I just want to narrate my experience so far
as I'm a Clojure n00b (actually, I'm really a programming n00b).

I found 4clojure and Clojure Koans useful, to get an initial feel 
for the language and some of the basic ideas contained therein.
I used (and use) Halloway's Programming Clojure to understand
the basic concepts. 

I also found it incredibly helpful to attend a hands-on (fantastic)
Clojure workshop that @ghoseb conducted.

I'd term this phase as picking up some of the "motor skills".

I think the following minimum set of things helps become 
creatively productive with Clojure:
- Clojure's primary data structures and sequence abstraction
- Manipulation of collections / sequences
- Core functions (it's sufficient to be only peripherally aware of 
  macros / protocols/multi-methods / concurrency semantics,
  to begin with... They reveal themselves through libraries, 
  once one deep-dives into those through daily use.)
- REPL-driven development / the inside-out flavour of FP
  (particularly to visualize and plan intermediate data transformations
   that will lead to the final output of the function;
   inspecting types and classes of things, and trying to understand
   the various errors one produces.)

Beyond that IMHO only a "real" project will provide the context
and the constraints, both of which are required to produce focus.
Ideally this project would involve ongoing development by other people.

By happy accident I happen to be writing a fair amount of Clojure for 
browser automation, with clj-webdriver, at a company where Clojure
is the workhorse of our server-side software (@helpshift).

My particular situation has the following characteristics:
- Specific problem domain
- Write clojure daily
- Read clojure daily
- Get and do peer-reviews of code by other 
  (often way way better) programmers
- Fast feedback cycles (<= 1 day)
- Heavy use of at least one library from the Clojure ecosystem... 
   - to have to keep cross-referencing the docs, 
   - be forced to look into library functions when you misuse them
 (therefore read s'more code by an orders of magnitude superior 
engineer)
- and having to do double-takes at the fundamentals (especially when 
  abstractions 
leak http://www.joelonsoftware.com/articles/LeakyAbstractions.html)
- Bonus: other people happen to depend on this work, so there's no easy way
  to slack off "thinking" if something particularly nasty starts to block 
progress :-)
- Bonus: reading application error logs to see what's happening under the 
hood

Also, I'm working through Dimitri Sotnikov's "Web Development with Clojure",
and I have the Clojure cookbook handy to look through for ideas. 
I tend to use Clojuredocs's quick reference several times a day 
(http://clojuredocs.org/quickref/Clojure%20Core), and often read core docs 
and library docs to understand what I just did that so magically worked! :)

Eric Normand's video series also looks very interesting 
(http://www.purelyfunctional.tv/).

Beyond that, I found working through SICP has given (is giving) me the tools
to reason better about Clojure's data structures and about functional 
concepts
in general (hat tip @ghoseb, again).

As I try to pick up more working proficiency, I intend to explore 
different approaches to writing web apps with Clojure/Clojurescript 
(through small projects using ring/compojure, Hoplon, Pedestal, 
Caribou, Om... I may actually try to write and rewrite the same small 
project,
with at least two or three of these libraries.)

Afterthought:
Initially I struggled with the notion of "real" projects. Now, I prefer to 
interpret it 
as whatever makes the work real for oneself, as opposed to being predicated 
on utility to lots of people, or on novelty (I'd argue it's actually better 
to 
solve problems other people have solved many times over).

My 0.0002 BTC.
Thanks for reading! 
- Aditya.




On Sunday, March 23, 2014 9:15:04 PM UTC+5:30, Marcus Blankenship wrote:
>
> Thanks to all who responded! 
>
>
> On Mar 21, 2014, at 7:17 AM, Lee Spector > 
> wrote: 
>
> > 
> > A little thing but I use it in when teaching Clojure to newbies and 
> maybe it'll be useful for others: 
> > 
> > https://github.com/lspector/clojinc/blob/master/src/clojinc/core.clj 
> > 
> > -Lee 
> > 
> > -- 
> > 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 emai