9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions
comment 4y ago · link · parent
I noticed that modern CPUs are optimized for legacy monolith OS kernels like Linux or Windows. But having a large, multimegabyte kernel is a bad idea from a security standpoint. A single mistake or intentional error in some rarely used component (like a temperature sensor driver) can get attacker full access to the system. Again, an error in any part of the monolith kernel can cause system failure. And Linux kernel doesn't even use static analysis to find bugs! It is obvious that using microkernels could solve many of the issues above.
But microkernels tend to have poor performance. One of the reasons for this could be high context switch latency. CPUs with high context switch latency are only good for legacy OSes and not ready for better future kernels. Therefore, either we will find a way to make context switches fast or we will have to stay with large, insecure kernels full of vulnerabilities.
So I was thinking what could be done here. For example, one thing that could be improved is to get rid of address space switch. It causes flushes of various caches and it hurts performance. Instead, we could always use the single mapping from virtual to physical addresses, but allocate each process different virtual address range. To implement this, we could add two registers, which would hold minumum and maximum accessible virtual addresses. It should be easy to check the address against them to prevent speculative out of bounds memory accesses.
By the way, 32-bit x86 architecture had segments, that could be used to divide single address space between processes.
Another thing that can take time is saving/restoring registers on context switch. One way to solve the problem could be to use multiple banks (say, 64 banks) of registers that can be quickly switched, another way would be to zero out registers on return from kernel and let processes save them if they need it.
Or am I wrong somewhere and fast context switches cannot be implemented this way?
comment 4y ago · link · parent
Also I don't like "(un)natural scrolling", a feature when the content is scrolled in the wrong direction.
Gnome seems to be optimized for high resolution (expensive) displays. On a normal laptop display, everything (buttons, window headers, input fields) seems too large.
Also, Gnome needs better discoverability for its features. For example, on first launch there is an empty desktop and it is not clear that you need to press Windows key to access launch screen.
comment 4y ago · link · parent
If the user is from country A, there is high probability that they use language of country A. Regarding word count, you don't need to know it. First, try to calculate hashes of all one-word messages. Then, all hashes of two-word messages. And so on.
Google also can collect statistics on which words and word combinations are used more often (for example, from gmail messages) and use this to accelerate bruteforce.
> And for the other examples, you’re somehow assuming a fully precalculated rainbow table of all possible such PII. Seriously…?
Let's take phone numbers as an example. Russian phone number starts with +7 which is followed by 10 random digits. Therefore, there can be maximum of 10^10 = 10 billions numbers. This answer [1] states that a GPU can calculate up to 10 billion MD5 or SHA1 hashes per second. Therefore, recovering a phone number from a hash would take approximately one second on a typical consumer hardware.
Note that one could build a custom CPU optimized for calculating hashes and get higher throughput.
Regarding credit card numbers, there is larger search space: you have to guess 15 digits (16th digit is a checksum). But it is not like there are 10^15 credit cards in the world. This search space can be significantly reduced, for example, by filtering by BIN (first 6 digits that identify the issuer bank).
This is why hashing short identifiers (like phone number or card number) doesn't make much sense and such hash can be easily reversed.
comment 4y ago · link · parent
comment 4y ago · link · parent
Also, some messages use a template, for example, a message from an online store like "Your order number XXXXX is ready for pickup" or a message from a bank saying "Your PIN code is XXXX". In this case, all you need to guess is a number.
comment 4y ago · link · parent
This allows to restore the message if it is short. Let's say a typical user knows 2×10^4 words and the message contains 3 words. If each word can be chosen with equal probability independently of others then one can guess the message content after an average of 4×10^12 attempts. And of course, one can check all the hashes at the same time.
So the hash function is effectively reversible for short pieces of data, like phone numbers, DOB, card numbers, emails and so on.
comment 4y ago · link · parent
I am not sure if it could be viable business model though. People who use open source got used that it is free and are unlikely to pay.
comment 4y ago · link · parent
This way the problem can be solved without any IDs and credit cards.
Also I don't understand why age verification is needed for Google Play. Isn't adult content already banned there?
comment 4y ago · link · parent
Currently I am using KDiff3. It is a little buggy and doesn't have a nice UI but it is the best open source merging tool that I am aware of. It allows choosing lines from original file, from A, B and manual editing.
I noticed that certain popular and highly praised commercial IDE also provides only 3-panel interface for merging. This makes resolving conflicts more difficult and prone to errors.
comment 4y ago · link · parent
Let me explain. While Latin alphabet has only 26 letters, many languages have more of them. For example, Russian alphabet has 33 letters. Therefore, to fit these letters there must be 7 more keys. But we also need two keys to switch layouts - so in total there should be 9 extra keys.
Sadly, manufacturers (including Apple that claims to "think different", but in this case thinks exactly the same as PC vendors) don't want to add even a single key, instead they put extra letters onto keys with symbols, so you have to switch layouts to type those symbols. Furthermore, several characters like period or comma are located on different keys in different layouts. Guess, how easy it becomes to make a mistake.
Switching layouts is inconvenient. Instead of having two dedicated keys for switching to each language, OS vendors add single switching combination like Shift + Alt (Windows) or Cmd + Space (Mac). Also, on keyboard itself there is no indication that these keys can switch layout.
One could argue that it is difficult to find more space on laptops. Well, I think that this can be solved somehow. For example, one could add an extra row. But it is absolutely possible on desktop PC keyboards, and yet nobody is doing this.
comment 4y ago · link · parent
For example, let's say CPU A has 32 cores each capable to perform 1B instructions and costs $1000, and CPU B has 4 cores with same speed, but costs $100. Let's say typical task for a machine is browsing social network sites. If this task uses only 4 cores and a user can browse same number of web pages per unit time then effectively both A and B have the same performance, but CPU A has 10 times worse typical performance per dollar.
A metric in this case should be not the count of executed instructions, but for example, a count of web pages viewed by user per unit time, or share of time spent actually viewing pages (and not waiting for them to load).
Of course, you can make similar metrics for other uses - for example, a time taken by illustrator to draw a picture, or count of written lines of code per unit time for a programmer. All divided by hardware cost.
That's the type of comparison I would like to see. Would Apple be winning in such fair and realistic benchmark is an open question. I doubt that.
comment 4y ago · link · parent
> Microsoft is slowly moving away from MSI in favor of Windows 10 Apps (AppX) as a new deployment model
First, MSI has better OS support than AppX, second, many users are still using Windows 7 and won't be able to use AppX. MSI is not some 30-years old deprecated standard.
comment 4y ago · link · parent
Let's say I am visiting a properly made website and it takes 10% of CPU to render. Even if browser devs make their browser twice faster, it will only save 5% of CPU time - and that would be completely unnoticeable. You might ask, what about modern websites, built with D*t compiled to webassembly, GPU acceleration, reactive frameworks, material design and capable to load the multi-core CPU at 100%? I am not using such sites so I don't care.
Now let's look at memory usage. Optimizing for speed usually causes increased memory consumption, and this increases the chance of invoking swapping. If the system starts swapping, it becomes orders of magnitude slower. No speed optimizations will matter in this case.
Therefore if you are targeting wide audience, and not only mac users, then you should be optimizing for memory usage. If the browser could use two times less memory while using twice amount of CPU time that would be perfect. Just think how many laptops with 2 or 4 Gb of RAM would become usable again.
3447.
Do Russians Want War? A Poll(dorussianswantwar.com ↗)
1 points · by codedokode · 4y ago · discuss
comment 4y ago · link · parent
Am I wrong here? It looks like nobody really cared about Syrian people and that's what's similar in US and Russia foreign policy. Wars are usually waged for land or for power, not to protect someone's liberties.
You are right though that America recently didn't annex land; but they did so earlier, see history of Panama Canal Zone for example [1]:
> In March 1902 Colombia set its terms for such a treaty: Colombia was to be sovereign over the canal, which would be policed by Colombians paid for by the United States. The host nation would receive a larger percentage of the tolls than provided for in earlier draft treaties.
> The draft terms were quickly rejected by American officials.
> A Frenchman who had worked on his nation's canal efforts, Philippe Bunau-Varilla, represented Panamanian insurgents; he met with Roosevelt and with Secretary of State John Hay, who saw to it that his principals received covert support. When the revolution came in November 1903, the United States intervened to protect the rebels, who succeeded in taking over the province, declaring it independent as the Republic of Panama.
> negotiated a treaty, giving the United States a zone 20 miles (32 km) wide and full authority to pass laws to govern that zone.
The same trick that US, USSR and Russia have repeated multiple times since: support the opposition against the government; get something valuable (like land or permission to build military bases) in return. Repeat if the opposition you have helped stops being grateful.