Fork me on GitHub
#clojure
<
2017-05-21
>
ghadi02:05:48

@noisesmith @kzeidler the problem wasn't the regex but re-find. Use re-matches instead with the original simple regex

ghadi02:05:43

Unless you want to handle rounding

noisesmith02:05:09

+user=> (re-matches #"\d+" "1.23")
nil

ghadi02:05:35

Exactly - it ain't an integer simple_smile

lincpa02:05:51

parse-number: #"^(\-|\+)?(([0-9])+|([0-9]{1,3}(,[0-9]{3})))([.]?\d)?%?$"

lincpa02:05:37

parse-int?: #"^(\-|\+)?(([0-9])+|([0-9]{1,3}(,[0-9]{3})*))"

lincpa02:05:33

-1,000 +6,000

lxsameer08:05:23

I'm looking for a distributed data store to store immutable data. any suggestion

lxsameer08:05:06

ow I need a free tool

qqq09:05:37

is there a way to tell wrap-resource to have NO CACHE ?

tatut09:05:28

datomic starter is free (as in no cost)

mpenet10:05:51

if you need an update after 1 year you need to upgrade to pro.

qqq11:05:12

I don't want to use lein beanstalk.

noisesmith14:05:32

qqq: what lein beanstalk does is create an uberwar. An uberwar is like an uberjar, but it makes sure not to include the classes that will be provided by tomcat.

noisesmith14:05:07

when I used elasticbeanstalk I just used lein ring uberwar to create the war files

qqq20:05:10

@noisesmith : creating + dropping a WAR worked; thanks!

qqq11:05:25

I just want a basic tutorial on how to put a hello world clojure app on elastic beanstalk.i

qqq11:05:30

Why is this so hard to find on the Google?

borkdude11:05:02

I’m trying to understand this blogpost. Why exactly do they need the intermediate eduction? https://tech.grammarly.com/blog/building-etl-pipelines-with-clojure

joost-diepenmaat12:05:54

@qqq as far as I can remember all you need to deploy clojure apps on beanstalk is a war. Then you can deploy manually from the beanstalk console or use whatever tools you like

plins13:05:12

hello everyone, what is the best way to stop a go-loop block from outside the loop? right now i have a boolean atom which gets checked, if its false, i omit the (recur) call

schaueho13:05:04

@borkdude Note that parse-json-reducible takes a single file, but they actually want to operate on (transform) a stream of lines. eduction returns a "reducible application of the transducers to the collection". As the author wrote, "Eduction returns a recipe for the values to come." In their case it's the collection of lines (turned to JSON) as produced by the reader. By doing this they can basically transduce over all lines of all the files.

ghadi13:05:01

@borkdude that post uses eduction as a way of pre-transforming a stream of values. That way the transformation doesn't have to be applied at every use site of the stream.

borkdude15:05:23

I know why this post confused me. It assumes that every line in the file is a complete JSON expression. E.g. an input file like this breaks the code:

{“a”:
 1}

borkdude15:05:19

I read this like this program was going to parse entire files, this is why it didn’t type check in my head

noisesmith15:05:03

@plins the standard idiom is to make a poison-pill channel, that closes when you want the loop to stop

noisesmith15:05:34

somewhere in your loop, you use alts! or one of its variants, and if you get the nil from a closed poison-pill channel, you don't recur

borkdude15:05:17

I really like the new http://clojure.org site. Maybe the Github README could get a new look as well (e.g. convert to Markdown instead of raw ascii)?

noisesmith15:05:20

my understanding is the github source is not canonical, it's a clone of the canonical repo, and they don't assume people reading the README are using markdown

Alex Miller (Clojure team)16:05:29

@noisesmith the github source is the canonical repo

noisesmith15:05:42

@plins the advantage of a channel/ alts! over checking an atom, is that with channel/alts! your loop can be stopped while waiting for something else

mpenet15:05:32

A nil returning put/take on a channel you are using can also be used: ex if someone closed the channel upstream. In short, use channel(s) and associated ops

noisesmith15:05:07

@mpenet definitely true - though I think of that as "the data channel is also the poison channel"

noisesmith15:05:04

@mpenet but be aware it won't work as expected with a buffer - the go-loop will keep receiving buffered items until the buffer is empty, you want a separate or unbuffered channel if you want immediate exit

noisesmith15:05:15

and sometimes you might want to close the consumer channel (not that people typically check the return value of channel writes...)

mpenet15:05:42

I do quite often

piotr-yuxuan19:05:21

Here, have you ever thought about moving from Slack to gitter to fight over-zealous message archival? https://medium.freecodecamp.com/so-yeah-we-tried-slack-and-we-deeply-regretted-it-391bcc714c81

eveko19:05:20

Hey all I have been out of the API/Backend loop in regards to Clojure. For an university assignment I have the task to introduce an API/Microservice outside of the JAVA EE landscape, usual tips from Uni is to either use Node or Spring. I thought about using clojure, last time I made an API was with ring/compojure. Are there any new way about serving micro services in Clojure?

madstap20:05:27

@eveko You could check out https://github.com/cognitect-labs/vase . It's "microservices as data" from the cognitect guys.

eveko20:05:22

will give it a look, thansk for the lead

noonian20:05:57

Also nothing wrong with sticking with ring

eveko20:05:46

welp so much for vase, I can't get Datomic to play nice with windows

noonian20:05:33

But if this is just a small toy API it might be simpler to whip up a small app with Compojure. Vase is built on http://pedestal.io/ btw and you can also use it directly (without datomic).

lilactown21:05:16

I'm looking for something like clojure.async/pipe, but that will close the from channel when the to channel is closed. any ideas?

plins22:05:24

is it possible to add a transducer to an already created channel? using a http lib which returns a channel and id like to filter out non 200 requests

plins22:05:22

or im suppposed to pipeline it?

tbaldridge22:05:38

@plins no it's not possible, and that's one reason why it might be better to pass a channel into your function instead of having the function create it