This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-07
Channels
- # bangalore-clj (1)
- # beginners (255)
- # boot (29)
- # cider (16)
- # cljs-dev (13)
- # cljsrn (6)
- # clojure (200)
- # clojure-berlin (1)
- # clojure-dev (13)
- # clojure-dusseldorf (6)
- # clojure-greece (1)
- # clojure-india (1)
- # clojure-italy (1)
- # clojure-russia (33)
- # clojure-spec (28)
- # clojure-uk (27)
- # clojurescript (47)
- # cursive (32)
- # data-science (3)
- # datascript (1)
- # datomic (40)
- # emacs (39)
- # events (4)
- # fulcro (55)
- # graphql (16)
- # immutant (2)
- # luminus (2)
- # lumo (5)
- # off-topic (142)
- # onyx (50)
- # portkey (1)
- # re-frame (45)
- # reagent (80)
- # remote-jobs (2)
- # ring-swagger (3)
- # rum (9)
- # schema (3)
- # shadow-cljs (184)
- # spacemacs (3)
- # test-check (4)
- # unrepl (2)
- # yada (5)
for OCR purposes, is there a simple / standard algorithm for 'smoothig out jpeg artifacts'
@seancorfieldI just followed the weather forecasts that @annapawlicka posted on Twitter. Also the wildfires are caused by the heat I think? Half Santa Rosa burned down.
I don't live on the Peninsula. I live in East Bay, further inland, and it gets really hot here during summer. Whenever I want to cool off i just drive to Oakland, San Francisco, San Bruno etc. Wildfires were north of the bay but they could have happened anywhere in the bay area, probably. It doesn't rain in spring/summer/fall in most of the places here so the vegetation is super dry. Add dry air, wind, and electric company failing to trim dead tree branches and bushes.
Yeah, once you cross the hills just east of me, the heat can be brutal. As for the wildfires, a decade of drought followed by a wet winter causing everything to sprout and grow followed by yet another warm, dry summer is a recipe for disaster!
Re: PG&E trimming trees -- I called them out to look at one of my trees and because it is on my property, it's my responsibility, not theirs -- even tho' it's grown up all around the electrical cables! They only trim trees around the high-voltage lines now -- everything else is supposed to be county/personal responsibility. Like that will work... 😞
(I paid a gardener to cut it all down)
All the time. I deal with loads of data (genomic data) that, if not always 'embarrassingly' parallel, is naturally parallel in most cases. From folding RNA, to alignments, to creating and matching distributions with RE, to ...
I've never found a need for reducers (as in the library) but I'm finding I'm using transducers more and more in everyday code now, so lots of "reducing functions".
You use it every time you want to get a single value from a collection of values. ie
(defn max-coll [vals] (reduce max vals)
"reducers" not reduce
-- or am I misunderstanding your response @U7V9HE682?
yeah I was talking about reduce. But a reducer is any function you can pass to reduce
You can also see a reducer function as a function that takes a state and some value/action and returns an updated state. Like in redux.
@U7V9HE682 You need to be a bit more specific with terminology: "A reducer is the combination of a reducible collection (a collection that knows how to reduce itself) with a reducing function (the "recipe" for what needs to be done during the reduction)." -- https://clojure.org/reference/reducers
I got fast at typing by playing MUDs - games where typing faster than other people is a major tactical advantage. But it's easy to get to a place with clojure in particular where you are typing faster than you are thinking, and there's no advantage to that.
if you mean, how fast you can make correct, working code, the only way to speed that up is reading a lot of code, writing a lot of code, and fixing a lot of code
there's no shortcut
Indeed. 80% of my coding time is thinking about how to solve the problem efficiently and in an easy-to-understand way. Only 20%, if not less, is actual typing
I don’t want any shortcut. I just need road-map and on the way learning. What do you guys suggest me for that ?
@U3JJH3URY As one of the old guys here, all I can offer is "practice, practice, practice".
@seancorfield Thank you. I am practicing on exercism. Three days is not long, but I feel quite agile. But is there any new-generation technique about this. All suggestions are welcome.
I don't think there are any shortcuts so it's really about setting aside time to practice as much as you can. Sorry.
master the tools. e.g. how quickly can you find the definition of a function you find in code, and where it is used? i can do it almost instantly (i use emacs and global; that's not the only way.) do you understand how your xompiler works (flags, search paths, etc)? no matter how great your thinking and design is, if you do not master the tools that help you actually do things you will suck as a programmer. because your work will be slow and error-prone.
@bcbradley @qqq as a counterpoint to last weeks discussion about Scala being a better experience, I have a friend who does Scala work in FL. He said their start-to-finish build times for their app are about 30min. With the toolchain taking >8GB of ram during compilation.
Do they have a good sense of how much of that is Scala overhead, versus the business-logic code (if it was implemented in other languages like Clojure or even C++)?
@tbaldridge: I've heard horror stories about scala compile time. However, my current chocies, for certain tensors ops are: 1. clojure + type hints ==> slow anytime I make a mistake 2. write tensor code in java 3. write tensor code in scala
I have basically zero experience with most of that, so can't really comment, other than to sarcastically suggest they'd have lower build times if they used Python instead! 😉
I think it's a combination of several things. * Scala includes about 3 complete type systems * In order to stay sane a compiler of that complexity needs to be modular, that modularity normally carries a perf cost * Parts of scala is implemented/maintained by junior devs or students (not sure how much this plays into it)
But the end effect is that the compiler itself is very slow.
But I've also seen static typing make a impact on the size/quality of the code. In Clojure code, with maps there's very little "object conversion" going on. What I used to do C# code, about 1/2 of our app was conversion between DTO objects.
IIRC, full compiles of our app in C# took about a minute.
You get faster compiles by removing higher level concepts, but take that too far and you get GoLang...super fast...and a complete lack of metaprogramming
@tbaldridge: it may be we're looking at different problems; in the problem I'm looking at, literally everything is an tensor of flloats (okay, maybe a few ints here/there for indexing)
So there's a price for all those fancy type features.
Also a key reason why Clojure is a 1.5 pass (or 2 pass, idk what to call it) compiler and not a nanopass
honestly if i decide based purely on the tools, i'd choose clojure every day all day
I’ve worked in Scala for 5 months but I came crawling back to Clojure. My feeling is you can make more momentum with Clojure, although this is absolutely subjective. Also I’ve only experienced it within one specific company.
There were many details people would discuss about that weren’t worth fuzzing about (imo) with regard to the business problems that needed to be solved. E.g. a discussion about returning Try[Unit] or Try[Boolean], or Boolean in a build script.
i don't think scala would be a terrible language if everyone just dropped the type system and used Any for everything
It’s not a terrible language in theory, but it can be used in very different styles and attracts a mix of people that do not always form great teams together
i think the hope of scala was to allow object oriented professionals to work together with functional mindsetted people to allow cross pollination of different kinds of ideas
it doesn't work out though because scala has so much syntax it makes it difficult for those two groups of people to talk to eachother
things like this would be much easier if people just realized that Clojure is object oriented - it has all the good OO features
@borkdude I agree with you. I don't want to use Haskell, but I admire its purity and how it knows what it wants to be, and does it well.
Scala suffers quite a bit from trying to be all things to all people. You have to restrict your language or it will grow out-of-control. And end up like Scala (or C++)
if only we could post this conversation every time someone asks "Why doesn't clojure have feature x"
I used to beg for new features in Clojure. Today...I'm not actually sure that I want anything.
More spec stuff, but that can be done as a library
core.async really opened my mind to the possibility of experimenting with things that in other languages would be built in, but in clojure is just a collection of functions and macros
@borkdude I agree...if anything, I'd take more out of core.
.zip, .test, .reducers,
all that could be pulled out
@tbaldridge yes, e.g. letfn
, I never use that construct
@tbaldridge yes, as libraries right
https://dev.clojure.org/jira/browse/CLJ-1959, this is what I'm referring to in particular
what I want more than new functions is an enhanced way to find the function I'm looking for
In Haskell at least they’ve got Hoogle, but without types, it’s difficult. There is lein find-fn which is a cool way to find functions by example
clojure.spec might make it easier to find functions if the functions in core get specs?
Yesterday for the first time ever I discovered the {foo :foo-key}
destructuring, or properly understood that it allows you to rename the destructured key. Many features you don’t really need, but come in handy for writing more elegant code
@danieleneal wrote a PoC that does that @hmaurer https://gist.github.com/danielneal/d82c142c9eab9f8caec0fa93b87ff7f3
and the bindings are initialized as if they were being initialized in parallel rather than serial like let
https://github.com/clojure/clojure/blob/2a08ef40018f1b504602545603eec840b05b33b1/src/jvm/clojure/lang/Compiler.java#L6187 if anyone wants to glance
I see! So what benefit do you have as a user from writing (let [f (fn [x] ...)] (f 1))
vs letfn
?
I guess some people like writing (letfn [(f [x] ..)] ..)
better over let + fn even if they don't need letfn but eugh
@bronsa you do need letfn for mutually recursive functions
Ah right sorry
@bronsa
> letfn
needs to be in core as it requires compiler support
what I actually meant was that I personally never needed this myself, but I can imagine other people do
it's more likely that some things seemed more useful 10 years ago than they actually turned out to be
I don't think it is any less useful today, just that the overall number of use cases is fairly small. But when you have one of those use cases, things like the STM and letfn
have off the chart value.
Yeah, I think both of those are cases where the problem is often reframed in a way that we don't need those features.
STM is often "replaced" by a single atom esp in systems where writes are rare. In more complex systems you often want the data store to be durable, and then Datomic or something like that replaces the need for STM
And letfn is a very function-centric macro, I think that's why I've never used it (except perhaps once, 6 years ago?). Most code I write is data-centric, so I would simply make two passes over the data, or run till fixedpoint.
Same thing with agents, I use the more than most clojure devs, but core.async has replaced 80% of my usage of agents
One of the comments Alex made to me in a thread recently was that the tools.deps
stuff, which grew out of the need for Clojure to be able to pull in clojure.spec
and clojure.core.specs
, will allow more of the "core" namespaces to be pulled out of the main Clojure JAR so they can then be evolved as separate libraries.
If you are in the loop, consider trying to push for moving zippers out as well-- it could use a serious implementation rework (in terms of protocols for instance).
@bcbradley Anyone -- including you -- is welcome to create JIRA issues for such things. I have no dog in that particular "fight" 🙂
That was in response to me pushing on criteria for libraries being in Contrib (since one of the original -- and still -- stated goals for Contrib was a proving ground for code that could migrate into the core JAR). He said it's now more likely that code would go the other way. Which seems like a good thing.
i lied btw, mutual recursion can be implemented with combinators so technically doesn't need compiler support
((fn [x' y'] (let [x (x' y') y (y' x')] (x 6)))
(fn x' [y'] (fn x [a] (let [y (y' x')] (if (zero? a) :even (y (dec a))))))
(fn y' [x'] (fn y [a] (let [x (x' y')] (if (zero? a) :odd (x (dec a)))))))
is equivalent to
(letfn [(x [a] (if (zero? a) :even (y (dec a))))
(y [a] (if (zero? a) :odd (x (dec a))))]
(x 6))
what's your problem? there was a change to checkout and tags that bit us recently if that's what you're dealing with
I'm trying to make a build trigger upon either push to master or open a PR. If I configure the hooks to be push events + open PR events, then I get duplicate builds when someone opens a PR. One build for when they push to their branch, another for when they open the PR.
the only way it'd work if all devs pushed to their own forks and PR'd back into upstream
hmm, looks like you can filter refs on the Jenkins side... https://github.com/jenkinsci/gitlab-plugin#branch-filtering