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

Then you don't need django, flask and fast API already does all that withing a single file.

What makes django useful is the admin, auth, session and so on that are all built around the ORM.

comment 2y ago · link · parent

Yes but how do you go about defining an ORM model without an app init class?

comment 2y ago · link · parent

I love this trend, every time they fail, it costs them a lot of money, and then I make bank after a few years of destruction because they look for a safe bet.

Then the cycle restarts.

comment 2y ago · link · parent

It's embedded in the browser now.

comment 2y ago · link · parent

Assembly lines are dirty, full of parasites and with broken lights all the time.

We can create live deep fakes or detect complex objects in live feeds of random webcams.

We certainly can correct a few shadows and distortions on a flat piece of paper we formatted, showing a basic symbol we designed and printed, pushed against a sensor we control, on a device we can light and shape the way we want.

NFC fails as well, you can fold the ticket just and it will break the antena.

Of course if it's a reusable ticket on a rigid medium, it won't happen. But neither for QRCode.

comment 2y ago · link · parent

In 1994, no less.

I don't think people realize how limited the hardware was at the time.

They think because their phone is slow at scanning QR codes, that's how it must be. But the phone is not a dedicated device for QRCode scanning.

It's like someone saying they get blurry pics of cars on the highway so clearly speed limits are not possible to check automatically.

comment 2y ago · link · parent

> weird printed shape up at just the right angle in good lighting conditions

None of that matter. QR code can be read on any angle because of the 3 position detection patterns it comes with, by design.

Lighting conditions are not a problem on tickets (which is what the article is about) because you can illuminate the paper from the camera.

QRCode were fast on assembly lines two decades ago. They were invented in the nineties, at a time where we had slow processors and shitty cameras.

comment 2y ago · link · parent

The article talks about tickets with chips in it, which means you could provide the same ticket with qr code, only cheaper and less polluting.

No variance.

People can then use nfc with their phone, which doesn't have the pollution problem.

comment 2y ago · link · parent

I can't see big technical limitations resulting in slow QRCode scanning. We manage to detect fast cars going 120mph to fine them, we can read fingerprints instantly through a screen. We can take pictures of galaxies light years away.

30 years ago you could kill ducks with the NES guns instantly and it worked by detecting pixels.

I'm sure we can figure out how to analyze black squares and turn them into a number under 50ms.

comment 2y ago · link · parent

I would use redbean, from the same author, and use HTML.

comment 2y ago · link · parent

With cpan it's the same, you need to install deps somehow.

You don't need it if it's just a python script with stdlib, just like with raw perl.

comment 2y ago · link · parent

You don't need the file to be named "hello.py". You can name it just "hello", with the right shebang it will work fine.

comment 2y ago · link · parent

Even if you don't want to limit yourself to the stdlib, you can still use a zipapp : https://docs.python.org/3/library/zipapp.html

comment 2y ago · link · parent

In fact, that's true for Python if you use a zipapp and no c extension: https://docs.python.org/3/library/zipapp.html

You can happily copy the zip of your scripts and all deps in the server.

You still do have to mind your versions, as always with python.

comment 2y ago · link · parent

I would say the problem is rather that companies are becoming too big to cares. Meta has been fined several times, in total for more than 2 billions. Amazon ? 746 millions. Tik tok? 345 millions. And yet it's a small price to pay for them

comment 2y ago · link · parent

Sure, you can also blame condoms for increasing the safety of people cheating on their spouses.

comment 2y ago · link · parent

It's a social filter:

- it brings the attention of people liking the tech

- it associates the tool with the values that come with the language and community

- it's a shortcut for explaining things you know most people will assume about the stack

comment 2y ago · link · parent

They are in Europe, and heavily criticized on HN everytime they regulate.

I love GDPR, yet so many complain about it for cookie banners, which are not even what the law requires: There Is No Cookie Banner Law (https://www.bitecode.dev/p/there-is-no-eu-cookie-banner-law)

comment 2y ago · link · parent

I grew out of Richard Stallman, but it's starting to grow back on me.

comment 2y ago · link · parent

Yes it is going to be very unpopular, because this law is the equivalent of curing diabetes by breaking someone's legs and injecting aids.

Sure, diabetes is awful.

But the remedy can't be worse than the disease.

comment 2y ago · link · parent

Unfortunately no, the tab doesn't sit there and do nothing.

Mobile browsers will do all sorts of optimization, such as interrupting the network, slowing down the vm, putting it to sleep, caching and uncaching things without letting you know, and without a predictable pattern.

If you use raw JS, you can deal with all kinds of errors manually, put in place recovery strategies, bust caches, etc.

With HTMX, you just get sluggish behavior, or no behavior at all in your page, and you don't know why.

Also like another person said, you expect your state to be the same, like the scrolling placement, but chrome might decide that no, you get a page refresh there, or you are somewhere else in the page on next switch.

In this particular app, I have a raw JS counter, which is updated on the client to make it snappy, and by htmx to keep it up to date with other modifications. But the counter will be off randomly because Chrome messes with it. So I had to manually put many rules to know it's out of sync, and request the sync at the right moment. But the sync may not happen because Chromes decided so. So I should try several times, with exponential backoff, differentiates the different reasons of failures and update the DOM manually while handling various interactions with other components.

At this stage, you are basically coding a lot in JS instead of getting the state from the server in HTML, so having VueJS + VueRouter + Pinia is going to be easier to manage, and you'll get more interactivity and optimistic updates on top.

It's not worth it. Right tool for the right job and all that.

It's mostly on mobile though. On Desktop, the HTMX app behaves perfectly.

comment 2y ago · link · parent

HTMX doc is good as a reference, but not as a tutorial.

This book is the missing tutorial, and it's been very useful to me. It even lead to the "A little taste of HTMX" series (https://www.bitecode.dev/p/a-little-taste-of-htmx-part-1).

After a year of using HTMX, I really like it and would encourage everybody to give it a try.

It's nice for:

- internal tools

- midly dynamic websites

It's not great for any web page you stay a long time on mobile on, though. I made a web app with it, and on my phone, you can't handle the fact the browser plays against you if you stay a long time with a tab open and goes in and out of the app. You really need a lot of control in JS for that.

Also: don't try to avoid JS using it. It's a mistake many people do, and that's not how you get the best out of it.

I regularly sparkle a little vanilla js or alpine in my htmx websites to make them nicer. And in some cases, I even have one lone page that loads a full vue/react because that particular section needs to be way more dynamic. It's not an XOR. You have now a whole spectrum of how dynamic and how much work you want to put in.

Sometimes, I don't write JS at all, but it's not a requirement.

comment 2y ago · link · parent

The biggest hurdle is the preconceptions we have about meditation, and the cultural image we carry.

People will try to "be calm", "be zen", they will attempt to "empty their mind". They will look for something special. They will not understand the implications of frustration, impatience, discomfort...

It's very hard by yourself because you bring with you a lot of ideas from a world that doesn't meditate, but certainly has a lot of things they want to claim about meditation no matter how little experience with it they have.

And you won't know when you got in a direction that will not work for you

comment 2y ago · link · parent

I would advise to not start on your own and seek a teacher. A book is not a great medium to learn it.

comment 2y ago · link · parent

Yes, but you get more money out a single Apple customer than from 5 android users, and that's the problem of this alternative.

It's about money, not technical capabilities.

comment 2y ago · link · parent

Just yesterday people downvoted me on HN for suggesting ChatGPT had the best ability to deduct things, because, according to down voters, it didn't have any.

But the "dumb parrot" narrative that was quite fitting on GPT2, and maybe still useful for understanding the foundation of the tech in GPT3, is now just a demonstration of ignorance.

We don't know what they are really doing. Nobody working outside of openai knows.

But if you use it long enough, it will be obvious we have passed the fancy completion phase, there is a little logic in there. Not a lot, but it makes all the results much better already.

And definitely much better than the competition.

comment 2y ago · link · parent

A meter precision is fine for what most people use GPS for. If the device is as precise as they say, you won't add much imprecision to the original calibration, so you will be in the right tunnel at the right time.

comment 2y ago · link · parent

Not to mention wireless networks like the ones for the airtag or the wifi endpoints mapping google has could be adapted to share positions of "right here, right now" anonymously.

Which means that if only one device knows where it is, you can calibrate, and if several know, you can even correct for mistakes.

If the system is precise enough, you only need to calibrate once in a while. Being at home/office, on the local wifi, once, could be enough.

Besides, nobody wants the GPS to go, but it's a nice alternative that can't be jammed by enemy forces and can be used for hiking, diving, etc.

comment 2y ago · link · parent

Indeed, I'm French.

The thing is, if you say something stupid, people forget about it. If you write it down, it stays.

But often I write like I speak, not thinking about the consequences.

1
313233
184