Fork me on GitHub
#off-topic
<
2022-09-20
>
Daniel Craig03:09:12

It seems like this wiki page might have been vandalized yesterday, it was edited by 'wesley87' who no longer exists and some of the important urls were changed

seancorfield03:09:17

Thanks for fixing the wiki @USDPTD3FY

seancorfield03:09:41

The pros and cons of public wikis: anyone can fix them, but anyone can deface them 😐

Daniel Craig03:09:48

Yeah 😞. Sorry that I @'d you this late

seancorfield03:09:00

You didn't at me 🙂 I'm an interested third party.

seancorfield03:09:37

(and I'm West Coast so it's early for me... I should apologize for @-ing you at this late hour!)

Daniel Craig03:09:49

I actually did, briefly. Then I deleted it for fear of awakening the moderator 😆

seancorfield03:09:36

And yet, here I am 🙂 Seriously, thanks for proactively fixing the problem. I am sure Alex will appreciate it and it's better to have that likely phishing/malware link removed a.s.a.p.

gratitude 3
1
Adam Helins09:09:48

Using Bash as a shell, I have a little Babashka task that prints aliases I need that I can then use like that:

clojure -M$( bb aliases:test :module/break )
On Powershell, I eventually figured it ought to be double-quoted for it to work:
clojure "-M$( bb aliases:test :module/break )"
However, my Github Actions job still fails on windows-latest (uses Powershell by default). Any idea how to fix it? 🙏
Run clojure "-M$( bb aliases:test :module/break )"
Clojure tools not yet in expected location: C:\Users\runneradmin\.deps.clj\1.11.1.1155\ClojureTools\clojure-tools-1.11.1.1155.jar
Downloading  to C:\Users\runneradmin\.deps.clj\1.11.1.1155\ClojureTools
Successfully installed clojure tools!
Cloning: 
Downloading: org/clojure/clojure/1.11.1/clojure-1.11.1.pom from central
Checking out:  at b98268e8e6df2d99b9a3a1b376a8254a013c996b
Downloading: org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.pom from central
Downloading: org/clojure/pom.contrib/1.1.0/pom.contrib-1.1.0.pom from central
Downloading: org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.pom from central
Downloading: org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar from central
Downloading: org/clojure/clojure/1.11.1/clojure-1.11.1.jar from central
Downloading: org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar from central
WARNING: WARNING: Implicit use of clojure.main with options is deprecated, use -M
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-M:ext\timbre:ext\slf4j-timbre:ext\convex-core:module\cvm:ext\clojure.test.check:module\gen:test\break:module\break:ext\kaocha:ext\mprop:bundle\test:task\test (The filename, directory name, or volume label syntax is incorrect)

borkdude09:09:22

@adam678 Try bb -e '(let [alias ...] (babashka.tasks/clojure (str "-M:" alias))' :)

👍 1
Adam Helins09:09:02

I was hoping for a simpler solution but maybe it's time to be more trickier indeed

borkdude09:09:20

The simpler solution is probably to just launch clojure from a babashka task

borkdude09:09:27

This will work the same on any platform

Adam Helins09:09:09

Indeed When in doubt, use Babashka even more...

borkdude09:09:48

Powershelling quoting is very confusing and powershell also has special rules for colons, so it's probably better to avoid this

ericdallo13:09:08

Kind of a offtopic CLI question: I have a CLI app that when I call my-app dump it should return a edn/json. but the app has some loading prints before print the result, and that makes jq and other parsing commands fail to parse the final result, would make sense to print the loadings to stderr and leave stdout only for the return?

p-himik13:09:16

That's exactly how e.g. wget and curl do it, among many other CLI tools.

ericdallo13:09:06

Awesome, glad it makes sense 😅 thank you!

👍 2
Cora (she/her)13:09:27

and/or you can add a quiet option to suppress those extra messages (curl uses --silent/-s for this)

Cora (she/her)13:09:47

(and wget uses --quiet/-q for this)

ericdallo13:09:16

oh yeah, it does have a --raw already which avoids those things and fancy terminal coloring

adi17:09:09

Yes, it's fine to send diagnostic information to stderr. I do just that: https://github.com/adityaathalye/bash-toolkit/blob/master/logging.sh, https://github.com/adityaathalye/shite/blob/master/bin/utils.sh. Another option is to send non-stdout diagnostic data to a log file. Perhaps even to syslog, if it is a serious program (i.e. used for real production stuff). For my tiny-scope programs, I prefer streaming it all to STDOUT in a format I can filter on downstream. In addition: 1. By the "don't be chatty" principle of Unix tools, perhaps avoid sending any log/diagnostic output in "default" operation mode, if possible? 2. Instead of providing a flag to suppress output, I'd favour providing a flag that explicitly asks for more output. A -v flag may be useful. 3. If the loading prints / logs are also structured data, then jq won't barf. This way one can safely mix startup prints / logs with "regular" stdout, by including some record type information, that a downstream tool can filter on.

ericdallo17:09:45

Thanks for the input @U051MHSEK, it really makes sense all those points, I'll consider it for sure!

🙌 1
Stuart14:09:39

Sometimes generic type error messages are just incomprehensible

Cannot resolve method 'Join(Microsoft.EntityFrameworkCore.DbSet<Blah.Data.Relational.Entities.FBFGQ>, lambda expression, lambda expression)', candidates are: System.Collections.Generic.IEnumerable<TResult> Join<{int Foo, int Bar, string Quax},FBFGQ,{int Foo, int Bar, string Quax},TResult>(this System.Collections.Generic.IEnumerable<{int Foo, int Bar, string Quax}>, System.Collections.Generic.IEnumerable<Blah.Data.Relational.Entities.FBFGQ>, System.Func<{int Foo, int Bar, string Quax},{int Foo, int Bar, string Quax}>, System.Func<Blah.Data.Relational.Entities.FBFGQ,{int Foo, int Bar, string Quax}>, System.Func<{int Foo, int Bar, string Quax},Blah.Data.Relational.Entities.FBFGQ,TResult>) (in class Enumerable) System.Collections.Generic.IEnumerable<TResult> Join<{int Foo, int Bar, string Quax},FBFGQ,{int Foo, int Bar, string Quax},TResult>(this System.Collections.Generic.IEnumerable<{int Foo, int Bar, string Quax}>, System.Collections.Generic.IEnumerable<Blah.Data.Relational.Entities.FBFGQ>, System.Func<{int Foo, int Bar, string Quax},{int Foo, int Bar, string Quax}>, System.Func<Blah.Data.Relational.Entities.FBFGQ,{int Foo, int Bar, string Quax}>, System.Func<{int Foo, int Bar, string Quax},Blah.Data.Relational.Entities.FBFGQ,TResult>, System.Collections.Generic.IEqualityComparer<{int Foo, int Bar, string Quax}>) (in class Enumerable) System.Linq.IQueryable<TResult> Join<{int Foo, int Bar, string Quax},FBFGQ,{int Foo, int Bar, string Quax},TResult>(this System.Linq.IQueryable<{int Foo, int Bar, string Quax}>, System.Collections.Generic.IEnumerable<Blah.Data.Relational.Entities.FBFGQ>, System.Linq.Expressions.Expression<System.Func<{int Foo, int Bar, string Quax},{int Foo, int Bar, string Quax}>>, System.Linq.Expressions.Expression<System.Func<Blah.Data.Relational.Entities.FBFGQ,{int Foo, int Bar, string Quax}>>, System.Linq.Expressions.Expression<System.Func<{int Foo, int Bar, string Quax},Blah.Data.Relational.Entities.FBFGQ,TResult>>) (in class Queryable) System.Linq.IQueryable<TResult> Join<{int Foo, int Bar, string Quax},FBFGQ,{int Foo, int Bar, string Quax},TResult>(this System.Linq.IQueryable<{int Foo, int Bar, string Quax}>, System.Collections.Generic.IEnumerable<Blah.Data.Relational.Entities.FBFGQ>, System.Linq.Expressions.Expression<System.Func<{int Foo, int Bar, string Quax},{int Foo, int Bar, string Quax}>>, System.Linq.Expressions.Expression<System.Func<Blah.Data.Relational.Entities.FBFGQ,{int Foo, int Bar, string Quax}>>, System.Linq.Expressions.Expression<System.Func<{int Foo, int Bar, string Quax},Blah.Data.Relational.Entities.FBFGQ,TResult>>, System.Collections.Generic.IEqualityComparer<{int Foo, int Bar, string Quax}>) (in class Queryable)

😱 5
😂 1
Martynas Maciulevičius18:09:51

From what I understand this some nested IEnumerable stuff. How else would you be able to tell where the exception comes from if you nest them?