« First « Previous Comments 30 - 69 of 95 Next » Last » Search these comments
I believe this solution can be made with a single calculation, with 3 edge cases
richwicks says
I believe this solution can be made with a single calculation, with 3 edge cases
Perhaps your problem is different than the LeetCode one, but I don't think so.
Here's my understanding of a simplified version of the problem you had...
Suppose, for simplicity, the 0th CPU was the special one. If you give it 8 jobs then the whole set of CPUs get 8, 7, 6, 5, etc. jobs. The catch is that every CPU after the 7th needs to get 1 job (the minimum number of jobs) — not 0, -1, -2, -3, etc. So the distribution of jobs is non-linear and so the solution is not a polynomial. When the binary search "guesses" an answer, it can verify in constant time, so the algorithm runs in log(n) time. That might be "sloppy," but if the count of CPUs and count of jobs each fit in a 64-bit integer, logarithmic time will be nearly instantaneous on the worst possible input.
Have them learn a very low level language like assembly (useless) to understand what the machine does.
If you were starting from scratch, what would you use to create a commercial website?
Don't invest time in a re-write unless you will gain some significant improvements for your clients, increase your reach, something tangible that improves your bottom line. Worst case you have some massive security issues or you have spaghetti code you have to keep adding to that will make your site impossible to update, then you might have to consider it just for maintenance, but hopefully you've laid a better foundation than that
If the data model is good, and the enterprise is happy with it. Then the best and quickest way to do a rewrite is to use Code Generating SQL against the tables. I can stub out a whole Enterprise suite in under a week. Then only need to write the business logic layer and the client Scripts.
Always do a rewrite. Normally by time you are called to bring a Customer's software to the next level. The previous developer had already coded the project into a hard corner. And the new business requirements would be impossible to factor in without creating a buggy broken system.
met the same trap, because you understood, what it was doing, how that process got added on after the fact. And you understand what it does and why it's important.. You can then figure how to gracefully make that process. You can make some of your most elegant impressive code you ever did. And in many ways, you owe it to the previous guy, and the problem he was faced with. That you then built on and made it work.
Most migrations and updated enterprise rewrite development lead, do not understand that process today.
BTW: C++ has improved VASTLY since I last used it. It no longer sucks!
richwicks says
BTW: C++ has improved VASTLY since I last used it. It no longer sucks!
Funny you should say that. The current C++ redistributable somehow omits the msvcr100.dll which causes a graphics program I loaded yesterday to not run. Once I figured that out it was just a copy and paste from a computer that still had that dll.
I am never going to work under Windows again, ever.
richwicks says
I am never going to work under Windows again, ever.
I hear you, but the software I like will not run on Linux, and Apple is just a pricey way to do the same thing.
If you were starting from scratch, what would you use to create a commercial website?
You have to learn many high level languages, and a few lower level languages. You don't have to learn higher level languages well, it just introduces you to many concepts which you can implement elsewhere. The concept of a class in C++, brilliant idea, but it's trivial to implement that in C. You're just passing around a pointer to a C structure to every function. There, that is basically C++. C++ used to be nothing more than a preprocessor for C - it took in the C++ code, and through a bunch of macros and conversions, made a C file, and compiled that.
The hardest part for any Enterprise software, is getting it to the point to where it is now.
Student is already registered to take assembly language in Fall 2023. Thank you for the recommendation.
I found your comment quite insightful. Yes, we've added many things after the fact because these add-ons were not envisioned at the time. Mission creep has to stop at some point also.
How can a sophomore in computer science learn Enterprise software?
A common mistake for mission creep is what I call "the Fred exception"
Nothing wrong with the Fred exception if you charge for it, and make it clear any additional work needed for the Fred exception will be treated to a separate bill. That way you avoid endless customized maintenance for free.
Nothing wrong with the Fred exception if you charge for it, and make it clear any additional work needed for the Fred exception will be treated to a separate bill. That way you avoid endless customized maintenance for free. And I mean to the level that when you do a major refactor, if Fred's shit doesn't work anymore, you invite Fred back into the core product fold, or Fred pays again...
I used node.js to rewrite patrick.net a few years ago, and I'm very happy with it. Clearly I'm no visual artist
As much as possible, give your users the ability to customize things on their end.
My goal when I start work at a company. Is to write code that someone that isn't a programmer can manage with the tools I made them.
This idea that it will replace skilled workers, is bullshit. It's nowhere near that.
So they asked me if they could use the test project I sent them as the foundation to build their software.
I would tell the kid to put himself out there.
Tenpoundbass says
I would tell the kid to put himself out there.
Thank you very much. He appreciates this recommendation.
It's great for a STARTING point, but worthless at new solutions.
« First « Previous Comments 30 - 69 of 95 Next » Last » Search these comments
People seem to INSIST on using cloud storage, which removes your ability of privacy, so I'm going to write a strong encryption program using the NaCL librarary;
https://nacl.cr.yp.to/
The goal here is that the resulting encrypted data is impossible to recover without getting the original key. Keys are changed regularly, and being able to brute force one block will give the attacker no advantage in cracking the next block.
Also, it will be computationally expensive to attempt to crack even with specialized hardware. This increases energy consumption and slows down the encryption and decryption, but also will make brute force attacks 1000's of times slower.