Better HN
topnewbestaskshowjobs
Log inSign up

usrbinbash

4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions

Submissions

comment 3y ago · link · parent

> You can also select specific lines and commit them as you want.

You can do that on the command line as well;

    git add -p

comment 3y ago · link · parent

Yes there are multiple learning styles, but two fundamental truths about learning are almost universal:

    * Retention requires repetition
    * Understanding requires interaction
That's one of the reasons why learning by reading is so powerful: Reading is an active involvement, it's an interaction.

Videos CAN deliver that, but it's a lot harder, because a video is not something I conciously need to interact with; I press play and it plays, whether my mind wanders to something else or no.

Videos can deliver repetition, but the format in which social media present them (with the next clickbait always only a small flick of the cursor way) doesn't exactly help.

IMHO, Videos can excel at explaining topics with laser focus on a small, complex topic, that is then explained in detail with multiple examples. When trying to teach broad topics reading wins out most of the time.

comment 3y ago · link · parent

Exactly. Good chat implementations are great; meaningful automated information, fast handover to human operators while also providing them with the relevant information, and all that in the comfort of my browser window is a great experience.

Being stuck in a loop against what's essentially a buggy ELIZA-Clone however, or a system that somehow is incapable of authenticating me even though I've logged into my account on their website, is not.

comment 3y ago · link · parent

> You're going to google what the error message says anyway

If an error message says:

    syntax error: unexpected {, expecting )
...I don't have to google anything. I know that there is a '{' that shouldn't be there, or that something else is missing before it, done.

If the error message would instead read:

    syntax error: unexpected NAMIKAKKO, expecting MARUKAKKO
...then I would indeed have to google it, unless I just so happened to know the japanese words for "wave bracket" and "round bracket"

My point is: a good message about an error as simple as an unexpected or missing syntactical element can convey all the information I need to fix the problem, without requiring me to invoke a supremely powerful search engine, indexing the largest repository of collective human knowledge in existence, to make sense of it.

comment 3y ago · link · parent

Because programming languages are tools, and tools should be as simple as possible, and as complex as they have to be.

It's not the tools job to be needlessly complex. Tools exist so we can build complex things with them.

comment 3y ago · link · parent

Because Unix jokes don't make something that should be easy needlessly hard. If a double-colon is missing, then the error message should state that, in the language that 99.9% of the language is written in.

comment 3y ago · link · parent

There are a lot of words in French or Japanese that rhyme with keywords or English variable names in the projects I am working on. But I don't think my PO would be very happy if someone called him at 3 'o clock asking what the hell that line in the logs means.

comment 3y ago · link · parent

The thing is, most of the language is anglophone; just as an example here is the reserved keywords list;

http://www.nusphere.com/kb/phpmanual/reserved.htm

the string functions;

https://www.w3schools.com/php/php_ref_string.asp

the JSON functions and constants;

https://www.w3schools.com/php/php_ref_json.asp

comment 3y ago · link · parent

The best meat-alternative for me is still fried seitan;

https://en.wikipedia.org/wiki/Seitan#History

comment 3y ago · link · parent

> Why would Microsoft (or Google, or anyone) continue to operate in Europe in that model

Because the european single market has a GDP of about 16.3 TRILLION dollars (2020 estimate, source; https://en.wikipedia.org/wiki/European_single_market)

By GDP, it's the third biggest market in the world, directly behind the US and China.

comment 3y ago · link · parent

> Why aren’t Europeans producing competitive software?

They absolutely do;

https://en.wikipedia.org/wiki/SAP

https://en.wikipedia.org/wiki/DeepL_Translator

https://en.wikipedia.org/wiki/TeamViewer_(company)

https://en.wikipedia.org/wiki/Lufthansa_Systems

Just 4 examples from Germany. There are countless software companies in Europe, and not just western...eastern Europe is going big in IT in some areas as well. The ability is certainly there.

As to why that didn't (yet) result in good EU-centric alternatives to some of the big US providers in certain areas of IT...good question. I think the correct answer will be a mix of startup culture, government appreciation for the topics importance, convenience of existing solutions, marketing, and several other topics. Certainly not an easy question to give an answer to.

comment 4y ago · link · parent

Investments in that area would be investment into European open source development as a whole and European IT in general. Businesses can spring up around such efforts, people can find employment, technology can be developed, and the European market could be strengthened.

comment 4y ago · link · parent

The stinger of bees evolved as a defense/attack mechanism against other insects, covered by a chitineous exoskeleton.

Sticking it into the elastic material that covers mammals is not it's intended use case.

comment 4y ago · link · parent

> I mean: unless the attacker knows exactly how much coins you have,

They don't need to know the exact number. They need to have a rough idea of the number. In the most likely scenario, where a state wants access, they tend to have a pretty good idea, because they get that information from investors, state agencies, banks and seized records.

comment 4y ago · link · parent

> $5 wrench attack, here's my real password: take the 50 millions. Oops. Decoy. On the other password there's $2bn.

Somehow I don't see state actors falling for that, especially when they have a rough idea of the actual numbers involved, based on the shitton of angry people, some of which are very rich and very well connected, clamouring about it.

comment 4y ago · link · parent

Completely agree with this.

I have several python services running as glue between some of our components. They all use threading. I find it alot easier to reason about.

comment 4y ago · link · parent

It's just another round in an endlessly repeating cycle.

Remember "Unicorn Devs"? "Framework Evangelist"? "Superstar Developer?"

In a few years "10x dev" will fall out of use, and we will have the next term du jour. My money is on "Astronaut Dev".

comment 4y ago · link · parent

Hello from another surprisingly-real-but-currently-text-based being.

I share your sentiment about the earlier stages of the internet. Even though there already were several million users worldwide when I came of the age to explore technology, it still had the feeling of a close-knit community of enthusiasts and experts.

Good times :-)

comment 4y ago · link · parent

VR Headset? Hard nope for me.

Lightweight AR headset? I would definitely give this a try.

To specify what I am talking about: If the device is much bigger|bulkier|heavier than thick eyeglasses, I won't use it. If the device relies on controllers (aka. something I have to hold), I won't use it (gloves would be okay as long as they don't prevent me from typing or using a pen and paper).

comment 4y ago · link · parent

In case someone wants to read a really good explanation about this;

http://www.physicsmatt.com/blog/2016/8/25/why-ftl-implies-ti...

Generally speaking, all three of FTL (travel/communication), causality and relativity cannot all be true at the same time. If you can FTL-travel/communicate (they are the same really), then you can come up with a scenario in which an observer can see an event happening, and then see the cause of that event after it happened.

Extending that logic, if the observer can also move at superluminal speeds, he could prevent the cause of the event after seeing the event happen, leading to a paradox.

comment 4y ago · link · parent

Not really, I love bash. I also love perl and vimscript btw. :D

comment 4y ago · link · parent

It's certainly possible, but here comes the fun; How read/maintain/extend-able is the solution? How well does it handle errors, assist the user? Add checking if all the programs are installed and useful error messages into the mix. Then the API does a tiny change and now we need a `jq` between curl and graphviz, and maybe we'd need an option for that case as well, and so on, and so on, ...

Bash scripts have a nasty tendency to grow, sometimes in ways that are disproportional to the bit of extra functionality that is suddenly required. Very quickly, a small quick'n dirty solution can blow up to a compost-heap ... no less dirty, but now instead of a clean-wipe, I'd need a shovel to get through it.

I think my handle speaks for itself as to how much I like bash. But I have had the pleasure of getting handed over bash scripts, hundreds of lines long, with the error description being "it no longer works, could you have a look at it? and the original author both unreachable and apparently having string feelings against comments.

And in many of these cases, it took me less time to code a clean solution in Python or Go, than it took me to grok what the hell that script was actually doing.

comment 4y ago · link · parent

Now do that again, but this time the regular expression is controlled by 2 command line params, one which gives it the substitution, the other one is a boolean switch that tells it whether to ignore case. And the script has to give a good error if the substitution isn't a valid regular expression. It should also give me a helptext for its command line options if I ask it with `-h, --h`.

In python I can use `opt/argparse`, and use the error output from `re.compile` to do this.

Of course this is also possible in bash, but how easy is it to code in comparison, and how maintainable is the result?

comment 4y ago · link · parent

> What is the Shell paradigm? I would argue that it's line-oriented pipelines.

Which python can do realitively well, by using the `subprocess` module.

Here is an example including a https://porkmail.org/era/unix/award (useless use of cat) finding all title lines in README.md and uppercasing them with `tr`

    import subprocess as sp
    cat = sp.Popen(
        ["cat", "README.md"],
        stdout=sp.PIPE,
    )
    grep = sp.Popen(
        ["grep", "#"],
        stdin=cat.stdout,
        stdout=sp.PIPE,
    )
    tr = sp.Popen(
        ["tr", "[:lower:]", "[:upper:]"],
        stdin=grep.stdout,
        stderr=sp.PIPE,
        stdout=sp.PIPE,
    )
    out, err = tr.communicate()
    print(out.decode("utf-8"), err.decode("utf-8"))
Is this more complicated than doing it in bash? Certainly. But on the other side of that coin its alot easier in python to do a complex regular expression (maybe depending on a command line argument) on one of those, using the result in an HTTP request via the `requests` module, packing the results into a digram rendered in PNG and sending it via email.

Yes, that is a convoluted example, but it illustrates the point I am trying to make. Everything outlined could probably done in a bash script, but I am pretty certain it would be much harder, and much more difficult to maintain, than doing this in python.

Bash is absolutely fine up to a point. And with enough effort, bash can do extremely complex things. But as soon as things get more complex than standard unix tools, I rather give up on the comfort of having specialiced syntax for pipes and filehandles, and write a few more lines handling those, if that means that I can do the more complex stuff easily using the rich module ecosystem of Python.

comment 4y ago · link · parent

Considering that the US, and the EU, both have top universities in the tech field, and are both attractive places for skilled people to work in, I cannot fathom how availability of expertise would be a problem.

comment 4y ago · link · parent

> its highly nonstandard syntax

Other than the missing dash/double-dash, what exactly is "highly nonstandard" about `dd`?

"f" has been a shortcut for "stream" for decades

    fprintf
the `arg=value` syntax is common to many command line tools

    grep --color=auto
; and i/o are literally the abbreviations for, well, Input/Output. So we have "input-stream=" and "output-stream=". How is that "highly nonstandard"? Because the dashes are missing?

> But otherwise, try to stick to more standard Unix tools.

`dd` is literally part of POSIX, it doesn't get more standard than that;

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/d...

comment 4y ago · link · parent

> and it’s trapped inside a small rectangular flat screen

Why is that a problem when we are talking about flat diagrams, spreadsheets or text?

> You claim that you have used VR extensively, but I highly doubt it based on your comments.

It's precisely because I have used it extensively that I make these comments. Presence and the ability to project content into a virtual 3D space that is experienced by direct interaction is a great technology if it is presenting content that benefits from this representation.

Interactive movies benefit from this. Virtual Walks through great landscapes or museums do. Virtual Art exhibits do.

Games do, perhaps more than any other area. I have literally spent hours in "Tales from the galaxys edge" just walking around the Cantina playing repulsor-dart or sitting with friends around a fire in "A Townships Tale", exactly because this is an immersive experience where the presentation through this technology has tangible benefits over experiencing it, as you say, on "a small rectangular flat screen".

And I can absolutely see this technology have a great impact in non-entertainment areas; Controlling robots in dangerous work environments. Helping maintenance personal with difficult tasks through AR devices. Training of personnel. Architecture comes to mind, designing complex machinery, 3D design in general.

But spreadsheets? Flow diagrams? Source code editing? Wearing a headset to sit through meetings? How do these applications benefit from this mode of representation?

1
323334
57