Hacker Newsnew | past | comments | ask | show | jobs | submit | kev946's commentslogin

Is it okay for push and pop to have noexcept when copy assignment of T could throw?


I'm not sure C++ provides a more satisfying answer here than "don't use this with a T that throws in copy." (And also, why would you want that?)


I was just wondering, because the functions are noexcept in OP's code


Would recommend the Pikuma 3D graphics course


that is also my suggestion as theres absolutely nothing like it! really well explained, good review of the gfx maths, and both teacher and students inside the platform are really approachable as well.


I find buffer useful for its conversion functions to/from different encodings, e.g., `Buffer.from(data, 'hex')` or `Buffer.toString('base64')`. Is there a good way to do this with `Uint8Array`?


People are working on bringing Base64/Hex conversion to JavaScript: https://github.com/tc39/proposal-arraybuffer-base64

I also provide a package to make the transition easier: https://github.com/sindresorhus/uint8array-extras (Feel free to copy-paste the code if you don't want another dependency)


Thanks for all the utility belts you've provided to the ecosystem.

It's insane to me that something as simple as concatenating an array needs a library, but as I've shown upthread, Uint8Arrays are way too complicated to work with.


You can use ‘atob’ and ‘btoa’ functions for some of that.


Those functions are fundamentally broken: https://developer.mozilla.org/en-US/docs/Glossary/Base64#jav...

See the whole section on converting arbitrary binary data and the complex ways to do it.


Although those functions operate on "binary strings", not Uint8Arrays, and there is no especially clean way that vanilla JS exposes to convert between the two that I am aware of.


Polyfill Buffer.


I would prefer not install any dependency if possible, I don't see a necessity of installing a polyfill just to not use the built in one because it's node specific.


Does this mean that WPF apps can be build on Linux and run on Windows?


No. It means anyone can now try to port it.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: