Earlier quoted context omitted.
It seems "white-space: pre-wrap" on code block would solve most of the problem. There is also additional "max-width" on the pre that I think is not needed.
That would break actual code snippet. What would solve most of the problems is HN actually implementing markdown instead of the current half-assed crap.
For the Love of Pipes
201–210 of 323 posts
Re: For the Love of Pipes
#202Earlier quoted context omitted.
It seems "white-space: pre-wrap" on code block would solve most of the problem. There is also additional "max-width" on the pre that I think is not needed.
That would break actual code snippet. What would solve most of the problems is HN actually implementing markdown instead of the current half-assed crap.
But I think the very limited formatting is just fine anyway. For the above comment as an example, I agree the code formatting looks awful, especially on mobile. But the version with >'s is ok, and I don't think proper bullet points or a quote bar would have improved it dramatically.
Re: For the Love of Pipes
#203Earlier quoted context omitted.
You can if input is a file. It might be a program with no arguments or something else.
In your original command, how can 'input' be a program with no arguments?
OK, to save some of my face, this will work:
grep 'foo'
... at least in zsh and probably bash.Re: For the Love of Pipes
#204Can do with named pipes, but an operator would be nice
Re: For the Love of Pipes
#205Re: For the Love of Pipes
#206Earlier quoted context omitted.
That would break actual code snippet. What would solve most of the problems is HN actually implementing markdown instead of the current half-assed crap.
What is it with so many products (HN, Discord, Slack) building half assed markdown implementations that aren't actually markdown?
- Slack product development
(that was a joke but is likely the answer to your question)
Re: For the Love of Pipes
#207I have wondered for a long time why pipes are not used more often in production-grade applications. I have seen plenty pipe use in bash scripts, especially for build and ETL purposes. Other languages, have ways to do pipes as well (e.g. Python https://docs.python.org/2/library/subprocess.html#replacing-... ) but I have seen much less use of it. It appears to me, that for more complex applications one rather opts for…
The biggest issue is that pipes are unidirectional, while not all data flow is unidirectional. Some functional programming styles are pipe-like in the sense that data-flow is unidirectional: Foo(Bar(Baz(Bif(x)))) is analagous to: cat x | Bif| Baz |Bar| Foo Obviously the order of evaluation will depend on the semantics of the language used; most eager languages will fully evaluate each step before the next. (Actually…
Re: For the Love of Pipes
#208Re: For the Love of Pipes
#209Earlier quoted context omitted.
In Julia, this would be: 1:3 |> x->x+1 |> x->join(x,",") |> length
Small correction (or it won't run on my system): 1:3 |> x -> map(y -> y+1, x) |> x -> join(x, ",") |> length All those anonymous functions seem a bit distracting, though https://github.com/JuliaLang/julia/pull/24990 could help with that.
(1:3 .|> x->x+1) |> x->join(x,",") |> lengthRe: For the Love of Pipes
#210Earlier quoted context omitted.
> When was the last time your Unix workstation was as useful as a Macintosh? Some of that discussion has not aged well :)
MacOs is layered on a UNIX-like OS. You can use pipes in your command windows.