153 karma · joined October 27, 2011
The compromise currently being made here is your security.
"-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 00Nobody 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.
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.
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...
mp4 the media container is https://en.wikipedia.org/wiki/MPEG-4_Part_14
MPEG-2 part 4 is some conformance testing specification.
What business would you start that takes more than 2 years to validate but takes basically no funding?
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.
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:
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.
* 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.
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.send(request)
response = s.recv(1024)
s.close()
Is that correct use of TCP? It seems to rely on response not being fragmented.As DOM query:
document.getElementsByClassName("title")[0].parentElement.getElementsByTagName("a")[1].href
This will break:* When title element no longer has "title" class.
* When title is no longer a sibling of link.
* When link is no longer 2nd link of its parent.
As regular expression:
document.documentElement.innerHTML.match('td class="title">.*a href="([^"]*)"')[1]
This will break:* On any white space change.
* On any new attributes on td or a.
* When ' is used instead of "
* When href includes escaped "
* In most cases when DOM query will break.
Many of those can happen without any server-side changes. It will sometimes works sometimes won't - making it hard to test.
There are cases when regular expression will break less often than DOM but DOM is easier to reason about, more predictable and has less corner cases.
This framework just makes it a little bit shorter to type as it automatically generates some boilerplate code.
C programmers do that with pre-processor. C++ programmers do that with templates and pre-processor. Java programmers do that with annotations.