👋
Good Morning!
Morning
Morning!
Morning!
Morning!
More Ning
moarning!
Good morning!
Quick, can you use babashka to pretty print an edn file easily?
^--- Could not resolve symbol: pprint/pprint
Oh, got it.
bb -e '(clojure.pprint/pprint (edn/read-string (slurp "deps.edn")))'
bb -I -e '(clojure.pprint/pprint (first *input*))'
hmmm, I wonder if an output parameter --pretty
would make sense.
I
is only needed when you are reading multiple top level EDN values from stdin
well, read-string
also only returns the first one, doesn’t it?
@ordnungswidrig I use this tool for pretty-printing including colors on the terminal: https://github.com/borkdude/puget-cli
Just cat deps.edn | puget
oh, nice
What I meant is *input*
reads EDN by default, no other flags needed
unless you want to read e.g. {:a 1} {:b 2}
from stdin without a wrapping coll
clojure -M -e "(require 'clojure.pprint) (clojure.pprint/pprint (clojure.edn/read-string (slurp *in*)))"
This also works where you have no babashka
yep. the same expression also works when you do have bb
nice
Morning
morning
Oh I see.
So bb -e '(clojure.pprint/pprint *input*)' -O
actually does it. ☝️
I’ve just registered a name on ENS with ethers I have trader with Lumens and it was the most thrilling thing I did in the recent past.
@ordnungswidrig Actually cat deps.edn | bb -e '(clojure.pprint/pprint *input*)'
is sufficient
I believe that Ethereum is the most interesting and complex tech project of the decade. And now that they reduce energy consumption, it’s also a little more responsible
I read that the miners nowadays use more and more rather excess engery e.g. from hydro plants in china.
cljoure commandline golf 😛
hmm... hydro never needs to be excess tho
I read that, too. That those damns in China would have no use for the excess energy, and cannot sell it to anybody, so it’s okay for it to go to Bitcoin & Co. Always wanted to read up on that
I should maybe map the REPL requires (pprint, etc,) also to the user namespace, so you can just write (pprint *input*)
and (doc inc)
for one-liners
That’d be awesome
$ bb -e '(clojure.repl/doc inc)'
-------------------------
clojure.core/inc
([x])
Returns a number one greater than num. Does not auto-promote
longs, will throw on overflow. See also: inc'
that isn't how hydro works tho, there should never be "excess hydro" tho there can be excess capacity to produce more electricity
you can have excess coal and nuclear, but if you create a market to sell that at a good cost you remove the incentive to get rid of it
you can have excess wind and solar (as they are intermittent) and that is probably a sort of good thing to use the electricity on, but it would have to be a better use than storage
(the original Mastodon idea was to use unused baseload power to do big data analytics w/o increasing co2 emissions (follow the moon rather than follow the sun), when we ran the numbers, doing things on 0ish carbon sources was far, far better)
I thought the nice thing about hydro is you can turn it on at times of peak demand (and deplete the contents of the reservoir) and then turn it off when demand is sufficiently low to be served by power sources that you can’t turn off and on so easily (and allow the reservoir to fill up again during those times). I don’t really understand how you’d end up with peak hydro power, unless the reservoir gets completely full or something.
Other types of power plants - e.g. coal/nuclear - take much longer to start up and shut down so there are situations where there might not be much demand for power right now but you still have to keep running the plant, so you could possible advance an argument that meh, you might as well do bitcoin mining during that time, and as otfrom points out, you don’t get to choose how much power you get from wind/solar at anmy particular moment (depends on the weather etc).
Anyway, you should probably listen to otfrom and not to me about this stuff.
Note that there are also hydro plants on rivers rather than in mountains; for those, you don't have much control over the power, and you can't do much storage.
But to be frank folks, having spent quite a bit of time studying climate and energy issues, when I see Bitcoin advocates telling us that Bitcoin mining is the best use for that electricity, it seems to me that they're simply not conscious of what's at stake with energy in the 21st century, and not really treating it as something precious. The task of replacing fossil fuels is absolutely daunting even when being optimistic about renewables, and the goal of the energy transition should be to preserve what we can on basic needs like heating, food security, healthcare and mobility while limiting damage, not to advance the world into a transcending new digital era. We just won't be that high in the Maslow pyramid. This reality is especially hard to accept for us programmers, who have made a career out of digital progress. E.g if we had so much excess decarbonized power that we don't know what to do with it, we should probably first spend it on hydrogen generation or other industrial applications.
I'm ignoring bitcoin as hard and as long as I can.
Don't ignore it - undermine it 😉
(pun intended)
I like the idea of a decentralised currency, but BTC is not that (certainly at the moment)
This is just on the HN frontpage https://news.ycombinator.com/item?id=26088455
Yeah, pumped hydro is awesome. And to think of those barbarians that choose to live in plains rather than mountains, forcing us to have thermal power stations.
(Seriously though, hydro is not all good. There are risks associated with it, and it causes more environmental damage than we used to think)
yeah, hydro can be bad for the rivers and other waterways they are on and big dams can damage communities and ecosystems and fail catastrophically (as witness recent events)
Also emits more methane than we used to think a few decades ago.
which bits emit the methane?
Anaerobic decomposition of flooded biomass.
I thought that might be the case. I wonder then about whether that methane could be captured and then burned (not sure where the economic/tech tipping points are on that)
I like anaerobic digesters for power as well. 🙂
https://en.wikipedia.org/wiki/Environmental_impact_of_reservoirs#Greenhouse_gases https://www.un.org/esa/sustdev/sdissues/energy/op/hydro_tremblaypaper.pdf https://pubs.acs.org/doi/abs/10.1021/es401820p (Haven't read them thoroughly)
Also see her writing on Indian dams - a very impressive summary of the BS around such projects as well as explaining how local and Western elites benefit from such projects more than the locals https://en.wikipedia.org/wiki/Arundhati_Roy#Sardar_Sarovar_Project
I'd be surprised if that were the case - I guess if those emissions were concentrated enough to make that viable, we'd have detected them sooner, and more accurately 🙂
sounds like it is a location dependent (or exacerbated) problem. I think there are some other river based systems that don't have the big reservoir problem (I'd have to dig up sources)