300 karma · joined October 25, 2018
Facebook, Reddit and Hacker News is still up, but thats about it
For machine learning you have the pytorch C++ API: https://pytorch.org/cppdocs/
Go : Make the language simple, make achieving a simple thing complex.
C : The machine is complex, be careful what you do if you overflow into the inner workings.
There are types of classes that are hidden and cannot be re-instantiated.
To me, those are modules and the main execution environment.
Whenever i've been caught out when coding its always one or both of these things, so i always wrap these in a class otherwise when it comes to reusing something multiple times you're caught short.
So, i always use classes for base functionality.
But i don't throw them around like sugar candy.
But an index file of 64-bit offsets could easily be seeked to read the value of the offset based upon the first 2 or even 4 byte offset.
Though with 4 bytes, that becomes a 4 gigabyte index file! But that would probably be much faster as you only do one seek in one file, then another seek to the main file, then search a much shorter distance to the result!
If the system has enough ram, the operating system will cache the files anyway and will be pretty fast i think.
(can you tell my first job involved writing ad-hoc database systems?)
I had a side project compromised through some supplementary php files that came with a javascript library. Luckily, i didn't have any users on it.
Keep everything up to date, including your server software, composer, javascript libraries etc.
Make sure you run a clamav on linux, it will catch any intrusion writing scammy files and rename them.
All passwords unique and made using a password generator. That way, if you are compromised it is only one password not the keys to everything.
Don't keep non-user stuff with predictable uri (like /admin/ /phpmyadmin/ etc.)
One-way backups.. Allow your backup server behind a firewall to login to your site and do hourly backups of all the data.
Disallow access to any files beginning with dot in your webserver configuration. I'm pretty sure nginx does this by default.
That will encode any data structure properly for output into JavaScript.
"Waa, that was so archaic the way we used to do things!"
Btw, that code is using std::unordered_map which is notoriously slow compared to an ordinary std::map for a small amount of elements. And the unordered map of register names each with a pair, why? Why not use std::vector for fast lookup?
The crux of what i'm saying isn't anything new, Bjarne Stroustrup admits that C++ is mainly a high-level abstraction language. There is some new things, but really, the things that are new like << etc. are operator overloads which are just more abstractions.
I would rather use C++ because i would have the option to use abstractions like std::map, std::string, std::vector, std::any etc. as they would save a lot of time and code complexity.
IMHO the worst thing about using C/C++ is getting other libraries to play with your project well even if you are using cmake or vcpkg, its not enough. You have to have solid knowledge of each operating system class to get everything working nicely over the long-term.
We want a simpler world, but create complex software to do that. All we are doing is moving the complexity under the rug somewhere else. The complexity is still there, warts and all.
Doing something mundane over a large surface area (quantity being the hard vector) is better than solving a really difficult problem that has little reach in terms of real-world value.
The complexity in my own startup is its multi-layered nature, solving multiple problems for multiple levels of ability. I'm still aware of the fail aspect, but one layer will succeed. I know this. I have a 10 year challenge, but sooner is better. I know for a fact what i'm doing isn't being done out in the wild apart from a couple of sporadic os projects badly implemented and a couple of small commercial ventures that kind-of work. On different products on different levels.
If you're going to put your eggs into one basket, make it the basket of n dimensions.