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 5y ago · link · parent

What's more, tv shows are also often adapted from comics or books in a way that satisfy the advertisers.

Take lockes and keys on netflix. The original comics is very violent. The murdered rape the kids mother, and when he escapes jail, he pays his ride by sucking dicks. He has horrible scars because the big brother trashed him with a brick in a blood frenzy that is visually rehashed as a memory regularly in the first tome. Bode sister hurt herself and his little bro while hidding because she is holding so hard.

None of that made it into the tv show despite the fact it makes the story better: the characters make more sense, their reactions are congruent with their tragedy.

comment 5y ago · link · parent

How do you deal with browser tiny storage limitations for each domain?

comment 5y ago · link · parent

That's what anaconda is.

comment 5y ago · link · parent

And now we have a portable format to embed cross platform an entire interractive book with zero knowledge needed from the reader.

comment 5y ago · link · parent

Django (2005) to DRF (2011) is a better take as the products a linked and packed with features, many versions in the making.

comment 5y ago · link · parent

Except militaries. Also, firefighters and nurses seem to do fake strikes, protesting but doing their job anyway.

comment 5y ago · link · parent

Even then DRF and FastAPI offer an order of magnitude more features for free, and battle tested.

comment 5y ago · link · parent

Yes.

comment 5y ago · link · parent

Telegram + dynamist

Every time I have an idea, I send a message to myself using telegram: there is actually a widget just for that in android.

It's awesome cause you can type, take a a picture or a video, dictate... And it syncs across devices, giving you access anywhere to a timeline of your thoughts.

Then when I got time I pop the stack and sort in as projects into the wonderful dynamist. It works offline, on Linux and mobile, syncs, allows notes and nested todo.

comment 5y ago · link · parent

Is Total Cookie Protection a Mozilla Intellectual Property ?

In short, should I say we are talking about TCP/IP ?

comment 5y ago · link · parent

I think it's moving in the right direction in countries with national parks. I certainly can see that in France we still have working taxonomists, and that they even band to create FOSS for managing their work (TaxHub, Geonature 2, Geonature Citizen, etc).

comment 5y ago · link · parent

Thanks for this tutorial, it covers a lot.

comment 5y ago · link · parent

I'm not counting the research I did prior the 5 days to actually understand deb packaging, only the 5 days trying to package something.

comment 5y ago · link · parent

Oh, but bash is definitively part of the problem.

I'm pretty proficient in bash myself, and error handling, debugging, decoupling and refactoring in bash are all horrible. It's just not design for being good at a script with more than a couple of lines. The fact we do use it for such purpose does not make it good at it.

The fact it has no namespace, the lack of decent data structures and the very limited functions also all leads to making it a poor foundation to build a lib on. Hence deb packages don't have any kind of framework for basic things: you are on your own.

comment 5y ago · link · parent

Oh, sure.

But that's beyond the point that if what they really desire is contribution, which they have been claiming for years, they should make it less painful to package software for the plateform, which we have been claiming for years.

comment 5y ago · link · parent

:D

Stdin. New phone, forgot to disable autocorrect.

comment 5y ago · link · parent

Not in the browser or in many stalin.

comment 5y ago · link · parent

Packaging for debian anything non trivial is damn too hard.

It took me 5 days to figure out how to package a complete web app with params, upgrades, post install transpiling, db init, etc.

And I haven't put that on a private repo yet, it's yet another annoying thing to do.

Nothing is well documented, doc is old and confusing, the tooling is archaic and wants to inflict pain (debconf anyone ?), the life cycle of a Deb package is atrocious to get right.

And you have to do all that in raw bash scripts. Not there are no alternatives, any scripting language is potentially usable, but the support is poor enough to deter you from them.

It's not I don't want to contribute to the ecosystem, but I won't invest the colossal effort and exercice in frustration to overcome the barrier to entry. My packages don't even need to go to the official repo, just let me do my things in peace.

Make a python lib that let you describe a package, hook on life cycle events to run code, with clear documented recipes et where to put what types of files, and let me run that to generate the Deb. Event web pack is easier to use for God sake.

I'm not even touching the process of packaging something to be included in debian repositories here, which is another beat entirely.

Quit the smug act, debian packagers. You don't know better.

You do know better on how to design a distro and protect the official repository. Great. I praised you for that for decades.

But you know nothing about making your users life easy. You just don't. So ask them, and fix that, or don't complain about no contrib. This is not news, we raised our voices for years.

I contribute all the time to Foss in code and doc, I donate in mass. We ARE willing to help. And we do.

It's not us. It's you.

comment 5y ago · link · parent

If some scientist comes to you and state "we proved that people can get hurt ridding bikes", it's fair to point out that there is little surprise about the formal proof of something so many people empirically experiment in their daily life.

comment 5y ago · link · parent

It also has some nice properties:

- because you have all your queries written in the same place, when you create a db migration, you know where to look for code to update, and can even perform some automatically.

- sql queries could be turned into a stored procedure with a simple marking, without changing any code.

Of course the downside is that dynamically exploring data is not as easy as with an ORM.

comment 5y ago · link · parent

I concur, I had 140 btc 10 years ago. Sold it all when it reached $800, which I though was peak.

I doubt the guy who sold the 5000 btc pizzas still have them.

comment 5y ago · link · parent

The beauty of the Django ecosystem, is that you have packages for everything: djangopackages.org

E.G: https://github.com/Arisophy/django-compositepk-model

comment 5y ago · link · parent

I always though it would be a nice alternative to an ORM: having a tool that take a marshmallow/pydantic/whatever model, optionally passing it additional db specific options, then it generates a bunch of sql files you can call with aiosql. The whole things would then let you optionally get the result wrapped in a model if you need to, with ORM like helpers for common CRUD things.

That would have the benefit of the standardized api of an ORM and the flexibility of SQL, without the coupling.

comment 5y ago · link · parent

> list(map(lambda n...

List comprehensions are much better for this. Functional doesn't mean you have to use a function call. If you can use the paradigm with literal syntax, just do so.

comment 5y ago · link · parent

Yes but getting a good ranking at a useless benchmark if not very meaningful. It's cool, but I wouldn't use it to make any serious decision.

comment 5y ago · link · parent

The ecosystem.

You got loads of libraries built around flask, and a lot of doc and tutorials, not to mention how much battle tested it is.

Those can matter much more than hypothetical perfs in a synthetic benchmark.

comment 5y ago · link · parent

While I do keep my eyes on FastAPI, even in this case I would recommend Django to a beginner, solely because of the amazing Django Rest Framework.

Not only it makes creating an API from ORM models quick and easy (although the documentation doesn't let you believe so), but it also let you do custom views seaminglessly, including goodies such as standardized permissions, authentication and pagination with several levels of granularity. Having that being able to be integrated with all the rest of the Django ecosystem transparently (your website, a wagtail CRM, etc.) is really sweet.

But the biggest advantage for a beginner is again that it will prevent them from having to make decisions they are likely to get wrong. Especially on the serialization, format, identifier policy and homogeneity of the API: people crafting that by hand often make a big mess and don't even know about it.

comment 5y ago · link · parent

I used the Django ORM for surprisingly complex applications

I created a video streaming website, with 600k visitor days, that features tagging, categories, related vidéos, user upload, encoding queue, search with auto-completion and so on. It relies heavily on the ORM.

Django migration system and db model generation also make it a very nice tool for data export/migration/exploration.

The ORM provides a nice API, but above all, a standardized one, which lead the Django ecosystem to become so reach because of the assumptions the libraries could do, making you very productive.

Now, one has to remember:

- you can, and should by pass the ORM if you need it, writing raw SQL. Django let you do that.

- plenty of things can end up be in a cache, using varnish, redis, etc. Plus a lot of things should be done in task queues anyway, not in the django views. So the cost of the ORM is rarely an issue.

- complex data tables are sometimes better presented using SQL views, making the ORM model simple.

As usual with coding, it's a matter of gain and cost, and the right answer is "it depends". But you can go very far, and very comfortably with this tools, as long as you don't fight against its nature.

So yes, definitely use Django with the ORM. I am not advocating to use Django + SQLA, but rather contrast Django with Flask + SQLA.

comment 5y ago · link · parent

There is absolutely a lack of a decent SQLA tutorial for IRL code.

The doc is very formal, and if you want to make a website, a quick script or a data migration, you are left on your own to find the proper setup.

comment 5y ago · link · parent

> Beware and use Django until you’re sure you AND your team know what you’re doing.

That's one of my pet peeve in the Python world: people thinks Flask is for beginners and Django for advanced users. The Flask API is simple, the hello world is 5 lines. By the time you render your first Django ViewModel, you have read and tried out the full Flask doc.

So it's easy to say, "I'll start with Flask, and check out this Django thing later".

But in reality, it's exactly the opposite. Flask requires you to know a lot of things and make a lot of decisions, not to mention select/write additional libraries for features Django packs.

So if you use Flask for anything non trivial, you should show your trade or you are going to mess up, big time.

If you are a beginner, you should always start with Django. Yes, it's more work up front, but it will give you an idea of how important concepts work, plug in to each others, and can be organized in a code base.

Django is not perfect, and its ORM is really far from SQLAlachemy, but it's good enough for a loads of thing. And it will be mostly secure and extensible by default.

1
149150151
184