banthar | 11 months ago | on: Frankenstein's `__init__`
banthar's comments
banthar | 1 year ago | on: I Like and Use Global Variables
banthar | 2 years ago | on: So Google's Gemini Doesn't Like Python Programming and Sanskrit?
banthar | 2 years ago | on: Flatpak is not the future (2021)
The compromise currently being made here is your security.
banthar | 2 years ago | on: GCC always assumes aligned pointer accesses (2020)
"-Wcast-align=strict" will work in this but not all cases - that's why we have UBSAN:
$ gcc -fsanitize=undefined test.c
$ ./a.out
test.c:6:6: runtime error: store to misaligned address 0x55e4007adeb1 for type 'int', which requires 4 byte alignment
0x55e4007adeb1: note: pointer points here
00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00banthar | 2 years ago | on: Intent to approve PEP 703: making the GIL optional
banthar | 5 years ago | on: String length functions for single emoji characters evaluate to greater than 1
Nobody ever cares about unicode codepoints. You either want the number of bytes or the width of the string on screen.
UTF-32 codepoints waste space and give you neither.
banthar | 5 years ago | on: OO in Python is mostly pointless
url_layout.format()
resp.raise_for_status()
resp.json()
session.add()
All those calls are dynamically dispatched - the essence of object oriented programming. This is what allows you to not worry about:
* which string implementation `url_layout` uses
* which HTTP protocol, encryption, authentication, chunking `resp` uses
* what database is connected to `session`You cannot avoid using objects - that's how all modern operating systems work.
Using classes without the need to call them polimorphically just as a nice namespace for methods is a separate issue.
banthar | 5 years ago | on: Deprecating scp
banthar | 5 years ago | on: Deprecating scp
banthar | 5 years ago | on: Prefer Fakes over Mocks
banthar | 5 years ago | on: Microsoft Put Off Fixing Zero Day for 2 Years
banthar | 5 years ago | on: What programmers need to know about encodings and charsets (2011)
If you start guessing the encoding, at best it won't work in some cases, at worst you are introducing security vulnerabilities. You can try, but there is just no way to do it right.
http://michaelthelin.se/security/2014/06/08/web-security-cro...
banthar | 6 years ago | on: JSMpeg – Decode It Like It's 1999
mp4 the media container is https://en.wikipedia.org/wiki/MPEG-4_Part_14
MPEG-2 part 4 is some conformance testing specification.
banthar | 7 years ago | on: Did Finland’s basic income experiment work? [video]
banthar | 7 years ago | on: Did Finland’s basic income experiment work? [video]
What business would you start that takes more than 2 years to validate but takes basically no funding?
banthar | 7 years ago | on: 9999999999999999.0 – 9999999999999998.0
The dangerous bit is, that just extracting a variable from constant expressions might change the result slightly. That should not be a problem, unless you are depending on exact values.
banthar | 7 years ago | on: HTTP-over-QUIC will officially become HTTP/3
It's standard only on paper. There is only one significant user space implementation (usrsctp). It's used both by Chrome and Firefox. I don't think it has much use outside of that. And, I don't think other browsers implement data channels (which require SCTP).
Browser implementations will probably never have to interact with kernel implementations (which are not really used outside of telecoms). There is really no reason to make them talk the same protocol. It's likely better to use two different protocols tuned to those specific uses:
https://tools.ietf.org/html/draft-joseph-quic-comparison-qui...
They will probably replace SCTP with QUIC also in WebRTC:
banthar | 8 years ago | on: How the JVM compares strings on x86 using pcmpestri
I don't fully understand the use case for extracting codepoints from strings, but they could have just added Java-like: codePoints and keep returning code units from old methods. This is CPU and memory efficient and 100% backwards compatible.
I think the problem is the same could have been done in Python 2 (with UTF-8) that would mean less reasons for Python 3.
banthar | 8 years ago | on: How the JVM compares strings on x86 using pcmpestri
* filenames
* identifiers
* config files
* text protocols
* host names, email addresses
* embedded scripts (including SQL and OpenGL shaders)
* command line interfaces
* translations for languages using Latin alphabets
I don't think 2/3 size reduction for some languages will offset the cost in all the other places.