This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-28
Channels
- # aleph (50)
- # announcements (3)
- # aws (35)
- # beginners (74)
- # boot (25)
- # calva (39)
- # cider (18)
- # clara (2)
- # cljdoc (18)
- # cljs-dev (24)
- # cljsrn (11)
- # clojure (166)
- # clojure-europe (13)
- # clojure-italy (5)
- # clojure-nl (6)
- # clojure-spec (35)
- # clojure-uk (263)
- # clojurescript (22)
- # clojutre (1)
- # code-reviews (34)
- # cursive (58)
- # data-science (2)
- # datascript (4)
- # datomic (4)
- # duct (6)
- # emacs (7)
- # figwheel-main (9)
- # fulcro (2)
- # graphql (3)
- # hoplon (22)
- # hyperfiddle (2)
- # juxt (5)
- # kaocha (6)
- # leiningen (33)
- # luminus (15)
- # off-topic (1)
- # pedestal (5)
- # reagent (18)
- # reitit (12)
- # shadow-cljs (171)
- # vim (5)
Morning
morning
måning
morning
Anyone else seen it? https://github.com/active-group/reacl
what's your big re-frame complaint/s @dominicm ?
component composition sure is difficult in re-frame
but on the other hand, a single state-store is very nice
Composition is one of them. Reframe components are far too aware of the shape of the global atom in the name of performance.
that’s to be fair true of redux with prop types as well
I'd rather pass everything down to children, so that I can preview them with devcards.
to some extent at least
lots of shared knowledge of the shape of the state
The other thing is that I'm constantly either denormalising my state atom, or writing awkward first/filter stuff. I think datascript as state-atom is the answer here.
> I’m constantly either denormalising my state atom could you explain what you mean by this a little? Not 100% sure that I follow
so to me it sounds like that dominicm would make the data stored in the global state like flatter rather than having nested maps?
If you have a Polish bakery nearby, go shopping and you will be able to get a large stack of very fresh doughnuts!
Note: Polish doughnuts are a bit different from the ones you’re most likely used to, denser, larger, with rose or plum filling and no fancy icing
And, oh, yeah, traditionally fried in lard because that is actually one of the fats most resistant to high temperatures.
You wouldn’t want doughnuts fried in burnt fat @jasonbell 😄
(I think these days professionals use fancy vegetable-based fats, but tradition is tradition)
I hard eat doughnuts now @lady3janepl - Best ones I had were in York but since I moved well nothing compares.
@lady3janepl I believe @jasonbell wishes that were true. My singing escapes.
Rinkoff's in Whitechapel does them. I find them a bit much. Fudge donuts in Dundee are good tho. 🙂
there’s a couple of places in manchester that do them and I have to restrain myself
The other thing you really want to try is chrust (direct translation, kindling), which apparently is Angel Wings over here https://en.wikipedia.org/wiki/Angel_wings
Just putting this out there https://www.the-insurance-surgery.co.uk/medical-conditions-life-insurance/heart-attacks-insurance/
Yeah but i wonder if they do cheaper insurance if ur cover only covers doughnut related heart attacks
It’s a niche risk, don’t let me dwell on it too long otherwise I’ll make a blog post out of it.
what about pepperoni pizza induced heart attacks... pretty sure my risk level is very high after soooo many events 🙂
@jasonbell I would be much healthier if I didnt have a serious Greggs Cheese n Onion pasty addiction (still strong even after they changed their name to 'bakes'). I used to love the Vegetable pasty even more, then they changed the recipe and I really don't like them now.
After years of not having Greggs in Northern Ireland @jr0cket we got them…. Steak “Bakes” were okay but then something changed. So back to Cafe Nero for polite company, non-screaming children and an constantly out of order toilet.
Hopefully my "vegan at home" lifestyle will start to un-fur my arteries after all those bakes and pepperoni pizza... may take a decade though 💓
I did the vegan thing for nearly 5 years. I'm making up for lost time now 😉
I would be vegan, if I could get an exemption for cheese. I am afraid that vegan “cheese” is not ok (for me, other people are welcome to love it) and there is never going to be a vegan alternative to Stilton or Rocquefort that I am ok with… 😞
I realise that this makes me a bad person(tm) and a failure in the sight of my fellow SJWs, but I am doing my best 😉
The upside to my failure is that as I won’t do half-measures I can continue to eat bacon and seafood 🙂
I’ve adopted a vegan diet in the past, for about 3 weeks all told, I do know what it really__ means.
I am saying that I would never be able to do it full-time because cheese, specifically Stilton and Rocquefort
Seeing as I am not even trying, I may as well retain my full-on omnivore credentials.
I was having the concept of vegan milk
explained to me the other week
as coming from a herd where they didn't automatically slaughter the male calves
which wasn't an angle I've ever heard before
seems to be an extremely wide variety of opinion about what constitutes 'vegan'
as in everything, I suppose
yeah me too
but fungus is okay ?
what about slime-molds?
(I have entamoeba living in my gut. Does that mean I cannot be vegan?)
yeah you end up in the Jain predicament of not being able to eat anything with a clear conscience
I guess a conscience is an analogue thing
Yeah. Personally before we solve the problem of ethical food, I’d like to solve the problem of everyone having enough food (and housing, and medical care, and safety) please. Because I have a feeling that this will solve ethical food as a byproduct.
that’s a great angle for ethical consumption, and if you follow it you end up vary close to veganism
A society should be judged by how it treats its least fortunate members.
the very idea of a “person who doesn’t add to GDP” is faintly unpleasant, as if human value can only be measured under a capitalist system in financial terms
so it forces you to face up to your life decisions
trouble is, enough food is a pretty miserable existence
I'm fairly glad I am not vegan. Talked to a lot of these people. Many of them seem to have convinced themselves that humans and non-human animals are entirely equivalent from a perspective of moral consideration. Walking around a supermarket must be like watching all the saw movies at once.
you want morethan enough ffood, to live comfortably
well and a Cheetah does not seem overly worried about the rights of the antelope that it just took
Forces us to come up with an idea of what to do with people who aren’t generating profit.
Living conditions of farmed animals should be a big consideration
@ben.hammond I agree with you on that. Actually, once did a fun argument making the case that eating ethically farmed animals was the correct moral choice (over veganism), because if they were not eaten, they would not be farmed and a comfortable existence is morally better than no-existence. I'm super fun at parties btw.
Since most of these animals are now human creations, perhaps we have an ethical responsibility to continue their line, and for this, they must pay their way.... by tasting nice after being fried and put inside bread 🙂
just as we in turn will feed all the wiggly worms
and so the corkscrew of life keeps churning
how would you know what's in a tracker bar?
They can also survive a nuclear fallout (apparently). Does that mean I gain the same ability by proxy of eating them? :thinking_face:
I'm sensing a potential flaw to testing this https://clojurians.slack.com/archives/C064BA6G2/p1551365049072500?thread_ts=1551365018.072100&cid=C064BA6G2
When the cockroaches take over after nuclear war. "Cockroach protein bars, for all your cockroachy needs!"
see if they can adapt to rising sea levels by learning to swim
I need to get back to work... I am supposed to be saving the world, and you guys have got me talking about whether cockroaches can front crawl.
surely those things are connected
we will create gigantic rafts of tethered cockroaches and build our cities upon them
crunchy?
Is that like a chocolate brownie that you buy at a cricket match :cricket_bat_and_ball:
did it chirp when you opened the packet?
what was in the icecream?
caterpillar?
is it properly deep-fried in lard?
@ben.hammond I'm not sure what they fry them in at Clarkie's
@lady3janepl when labelling I'd warn the shellfish people as they often don't know about the insect issue
is it basically that shellfish are insects that we all agreed are not insects and therefore we can eat them?
yes, eating prawns is pretty much equivalent to eating crickets
just glad you don't get grasshoppers the size of a lobster
glad I'm unaware of it
I'd call that crayfish sized not lobster size
haha. so many invertibrates so little time
my Dad always used to tell me stories about the 'Tanker' mosquito, that could drink a man dry
I sorta half believed him for a couple of years
he was quite reliable about most other things
Wow, that's a prize convo this morning... Veganism, insects... Wish I'd been awake sooner 😁
I do have an op-topic question... When managing a web-resource that may need to be paginated, how do y'all pass the limit and offset on the URL and how do you handle the differences in your queries?
drive by data nerd warning, check for max resource size, offset-based pagination gets really painful for larger datasets
(I am using postgreSQL and HugSQL, so I am erring on the side of always passing a LIMIT and an OFFSET, just setting them to x & 0 if not supplied - where x=configured number)
(also depending on what you want to cache / allow to be cached, you may want them to be in query vars rather than url)
FWIW I am using querystring vars as it makes URL matching generic whether they are present or not.
From inside the let binding on my handler...
options (if (and
(not (nil? limit))
(not (nil? offset)))
{:limit (bigint limit) :offset (bigint offset)}
{})
We tend to pass page number (1, 2, 3, ...) and page size (default to, say, 15, but can be overridden by client). We validate those params are reasonable, then convert to limit/offset in MySQL.
another alternative (our db doesn't support offset) is to use > or < and limit
it works very well for infinite scrolls
What are your preferred ways of consuming API's, either sever or client (ClojureScript) side. Looking for ideas for the weekly Clojure study group. I'm starting off with a simple JSON API, but will be consuming more interesting APIs soon. Do you just use slurp or http-kit clj-http for simple Api's? Any neat little libraries lik https://github.com/Raynes/tentacles? Anthing CLJS specific, like cljs-ajax or websockets stuff Are you using Cheshire (JSON) or Transit (many things) to manage transformation of formats? Or do you just drop all the data as a nice Clojure map onto a Kafka topic? Perhaps with some relatively simple ingestion scripts/tools. Interested in understanding what people are using and why. Thanks.
For my personal use:
I use http-kit for client stuff
I use cheshire for json stuff
I do edn / json /avro on a kafka topic.
I use spec for validation on boundaries, e.g (s/valid? ...)
.
As to why?
http-kit, i think i just found it easier to understand when i first started clojure. So no real reason 🤷 .
I like cheshire simply because i can do true
for converting json to keywords. (parse-string "{\"foo\":\"bar\"}" true)
and that covers most cases 😂 .
I use json for very raw data, edn for internal data and avro for data other people outside my team are gonna read.
I use spec, partly because i’m still trying to get my head around it and I never really liked schema.
Hope that helps :thumbsup:
JSON all the time and jsonista for serialisation
Also interested in knowing if you are managing data to or from API's with Spec, Plumatic schema or other libraries. Thanks
schema and swagger auto generated from that FTW
Mostly clj-http
right now but we're shifting to http-kit
. We're using Cheshire for JSON (`clj-http`'s default, and as a callback for http-kit
). For the most part, where we're consuming APIs, we're doing something synchronous, to get some specific data to process right there and then.
We don't (currently) use Spec around APIs we consume -- we do use it around APIs we expose to clients.
We've run into bugs with the version we're using, and more recent versions break our code in some weird way that we just gave up debugging after seeing that it worked just fine with http-kit instead.
Also, we have places where we need an async call that we can cancel/timeout which did not seem possible with clj-http (or, at least, not with any version that actually works with our code).
And, to be honest, clj-http seems to be a bit kitchen-sink-y for a Clojure library at this point.
I'm a big fan of "simple" and clj-http is far beyond simple at this point, even tho' it is mostly "easy".
HTTP client - clj: aleph
, cljs: goog.net.XhrIo
. JSON - clj: cheshire , cljs: js/JSON. websockets: cljs: jarohen/chord, promises - clj: manifold/deferred, cljs: promesa, promise composition - clj: cats/mlet + cats.labs.manifold, cljs: cats/mlet + cats.labs.promise... we use mostly JSON for APIs for interop with non-clj universe (although we do use EDN and transit in different contexts), schema for API validation and JSON coercion on both ends of the wire (not spec, thanks to yada and history)
@mccraigmccraig I haven't looked at manifold/deferred -- what does it add over the built-in promise
?
everything @seancorfield 😁 built-in promise
has no completion callbacks so doesn't compose, so is no use for building non-blocking systems
There's a CLJ JIRA ticket for that and it's been triaged so may be on the list for 1.11 🙂
(I told Alex recently it was one of my top three "wants" for 1.11)
you mean this one @seancorfield https://dev.clojure.org/jira/browse/CLJ-2487 ?
Yeah, fingers crossed 🙂
There are 65 issues slated for 1.11 so far so... ¯\(ツ)/¯
(and two slated for 1.10.1)
could be nice - manifold deferreds are pretty cool though - they interact very nicely with manifold streams and core.async and give you fine control of the underlying j.u.c executor if you need it
@seancorfield fwiw, aleph is a drop in replacement for clj http that is async
I suspect it would conflict with a different version of Netty that we're already using... looking its project.clj
file.
We've had a lot of problems with compatibility across different versions of Netty. It seems really fragile.
yeah, true - netty is famously version fragile. we've got two different versions of it in our api which is only sane because one of them is shadowed