Better HN
topnewbestaskshowjobs
Log inSign up

BiteCode_dev

24,628 karma · joined Oct 21, 2019 (7y ago) · 5,512 submissions

I write to save you time and effort when dealing with Python:

https://www.bitecode.dev/

Email: contact at bitecode.dev

Submissions

comment 6y ago · link · parent

Agreed.

In fact, anybody promoting cut, please give me the cut version of:

    echo -e "foo   bar   baz" | choose -1 -2
It should work on an arbitrary number of spaces, and fields.

The oneliner is going to be... interesting.

Now you can do it with awk using:

   echo -e "foo bar baz" | awk '{ print $NF " " $(NF-1)}'
But it's neither easy to type, nor to remember.

Choose is what cut should have been.

comment 6y ago · link · parent

- it supports regex separators. That's a great feature to me.

- the default separator is "\s", like python's split(). Just for that I will adopt it: not having to care about tabs/spaces/mixes is a much better experience.

- it has negative indexes, again like python. Getting the last field, or the last nth field, is something common enought. I don't want to rewrite the thing with a twisted double "rev" with proper index. And I don't want to have to google it.

- plus the syntax is just must easier to remember to me. When I use cut, I always try: "echo 'foo bar baz' | cut 2", just to realize that I need to pass '-f', then I do "cut -f 2", and get stump, and google it, to then remember I need to pass the delimiter explicitly even if it's a space.

- it works the same on windows. I dual boot.

Compare:

    echo -e "foo bar baz" | choose -1
To:

    echo -e "foo bar baz" | rev | cut -d ' ' -f 1 | rev
cut is, to me, the opposite of a friendly API.

Something so basic in the Unix world should have sane default.

Default are not sane if I have to google it once out of two.

comment 6y ago · link · parent

Yes but their goal seems to be API compatible, which I understand the point of, but is not useful to me.

comment 6y ago · link · parent

Good point, and I'm not a big fan of DSL. I think most of the time, we should make a better API.

But for regexes, it has been a success: they are rarely used, but when they are, you are glad you have them.

In fact you probably need to do both: re in Python is a library. A library that implements the regex DSL.

Maybe there is a way to create an API around numpy that translates a J/K/APL like DSL into numpy operations.

Just like regexes, this is not something you want to use often.

But I assume that, just like I don't want to describe a whole parser when I just need to match/split/extract text, people doing array processing probably don't want to describe every single steps for very common operations in some cases.

comment 6y ago · link · parent

Someone should make a bundle installer with this, bat, fdfind and ripgrep. I do enjoy those alternative to GNU, and install as many as I can: they are easier to use, usually faster, and just make more sense to my brain.

This pain is real: https://xkcd.com/1168/

comment 6y ago · link · parent

I heard those arguments when ag went out as an alternative to grep, and ffind as an alternative to find.

But now, I install their successors, ripgrep and fdfind, on all my machines. Including the windows ones.

comment 6y ago · link · parent

> I can't understand why you are mentioning awk. Cut or choose cannot be compared to awk, awk is a programming language.

Because 99% of awk IRL use is just as a fancier cut.

It's very rare someone even sets a variable using awk. If you do it, you are a statistical rarity.

> Also I don't think that it's so much easier to use than cut. On the other hand every *nix system has cut so if you make scripts with it they are portable.

I, for one, never remember the syntax for cut. If "choose" gets a deb, I'll use it: Python slicing is something familiar to me.

I don't care if cut is on every unix system: if I have the possibility to install things on the machine, then I'll just install what I need. I have a script for that. If I don't, I'll google/man/--help GNU commands as usual.

And as for writing shell scripts, I use Python anyway.

comment 6y ago · link · parent

We heard those arguments before, when IE6 was a thing.

It didn't go well.

But I guess we are doomed to repeat mistakes of the past.

comment 6y ago · link · parent

Sometimes I feel that, instead of APL/J/K being standalone languages, we should standardize a mini-language like we did with printf, date formatting or regexes, and embed it in all general purpose languages.

comment 6y ago · link · parent

Apt sucked when it started. Give it some time.

It's a complicated endavior, and it will need many iterations before becomming a decent solution. That's why we have to start ASAP.

comment 6y ago · link · parent

I would also have to pass the path as a first param. This was not meant to be correct, just teasy.

comment 6y ago · link · parent

So, you don't use open("w"), do you ? You use the non magic open(os.O_WRONLY) of course.

Because magic strings are bad.

comment 6y ago · link · parent

Happens to me all the time. Hard to convey tone using text only.

comment 6y ago · link · parent

Take zoom: in HN we heard a lot of complains for ethical reasons, but the biggest part of the user base doesn't care and are just happy with it.

On FOSS, you'll have complains about the software it self AND ethics from most of your users, because they are mostly technical, and contains way more idealists than the average user sample.

comment 6y ago · link · parent

When they moved from Unity to Gnome shell, you could read all over the OMGUbuntu comments that people actually liked Unity and wished they would keep it.

It's always the same, you hear people complaining the most.

Ubuntu has been a success because they took some risk.

The first one has been to make installing proprietary drivers easy. Something they got a lot of heat for.

And since they managed to become the most popular Linux distro ever, I think critics should maybe ask themselves why.

comment 6y ago · link · parent

Statistically, proprietary software is regular software.

But yeah, snaps is a great solution for that, espacially because getting a non FOSS software is not possible in official distro repos, and hosting your own repo is HARD.

And that's what's happening. I installed Telegram using a snap because of this.

comment 6y ago · link · parent

There is an opt out feature: diversity.

You can always use only the system package manager, or use a distro that doesn't use snap.

All those complaints feel so moot.

It's really hard to be in FOSS nowaday: you can't make a move without your users judging you all along the way, because a lot of them are idealists that expect a lot from you, yet don't think about the non tech saavy users.

It's way easier to make proprietary software: most of your users don't criticise any single decision you make, you don't have to justify yourself, you get much more users, and you make money out of it.

comment 6y ago · link · parent

Something can be both.

And we can enjoy the bright side of it, while not being naive.

comment 6y ago · link · parent

Arf, an emoji would have helped.

comment 6y ago · link · parent

I've been using Linux for 15 years as my daily OS, I love the package system, but this point of view is missing the point.

Those arguments are always from very tech saavy people.

They are a good exemple of purity over practicality, completly ignoring all the problems apt/yum have for the average user or dev publishing software.

If you are looking for reasons as why Linux on the destkop never happen, well, this is one of them.

comment 6y ago · link · parent

France, which shares lot of similarities with Belgium.

And franckly, this comments feels loaded with assumptions.

comment 6y ago · link · parent

I agree. I'm just speculating for fun here.

comment 6y ago · link · parent

It's assuming the police will do anything about it.

But the probability they even take the time to listen to the old man story is pretty slim.

comment 6y ago · link · parent

Indeed.

But the testing may have nothing to do with the pizza business itself.

Maybe it's a way to do hiring.

Maybe they test delivery gears.

Maybe they test the time it takes to delivery using said vehicule on one terrain.

Maybe they test the time it takes for some kind of product to be cold, or not tasteful anymore.

A serious test must be down for a long time, accross terrains and seasons.

And if you test a lot of thing, you will need a lot of deliveries for a long time.

comment 6y ago · link · parent

I'd assume eat and share what you can, and just waste the ingredients when you can't.

When you launder money, you loose some of it. It can't be helped. And criminal probably don't care about not being green.

comment 6y ago · link · parent

I don't know, the restaurants I suspect of laundering money around me don't bother faking customers. They are just empty most of the time.

Maybe they noticed that those adresses never cause problems (single old people) and are close enough to not be too annoying to deliver to?

Maybe they are just too lazy to do more, and it's enough for it to work?

Maybe they are using a lot more addresses but we don't get that information? But there is a limit to the addresses you can use, and you are supposed to have repeated customers.

Maybe there is something special about those adresses we don't know about?

comment 6y ago · link · parent

I have a friend of mine that has been beaten up badly, twice.

10 years ago by his neighbours, in front of a witness. He got his jaw broken.

5 years ago by a random guy in the street, in front of a security camera that caught the dude car's plate. He got his nose broken.

In both cases, the police at best did nothing, at worst tried to activaly prevent action (loosing the case file, not registering it, not passing it around, or asking my friend to not go further).

So I'm expecting that for an old guy receiving pizzas, they have zero incentive to even think about it.

comment 6y ago · link · parent

Several possibilities I can imagine:

- they don't handle ordering and delivery: those are outsourced, and so they don't get the address. Or they do manage ordering, but not delivery, and the ordering system has a bug.

- they benefit from those fake sales because they are laundering money through their restaurant

- they benefit from those fake sales because they have an insurance that pays for those

- they are using those addresses, that they know don't cause problems, to test something.

- they use the pizza delivery as an excuse to be here, and do something illegal (surveillance, delivering drugs, territorial presence, etc).

- it's a fake/exagerated article/testimony

comment 6y ago · link · parent

Maybe the shops are laundering money, and pretend they are loosing money with their "victims", while actually registering a sale to allow dirty money to come in.

This solves the problem you get when laundering money with a food joint: you need customers.

1
160161162
184