Modern instruction prefetch units keep a cache of return targets. (I don't know for sure, but if I were a CPU designer, which I'm not, I experiment with flushing it when a likely context switch has occurred, e.g. loading the TR or modifying CR3.) The IPU is going to assume that you're returning from whence you came until it discovers otherwise. This will almost certainly be a cache hit, but at that point a large part of the pipeline will have to be flushed.
You could design a CPU that treats this case better, but you have to ask if it's worth going to the trouble.
I don't know who modded you a troll, but perhaps for extra clue, you might want to say "I'm GZippy Longstocking!" next time.
But you're absolutely right: this attack only works because the plaintext is highly redundant. Remove the redundancy and the attack won't work.
Still, usually leaves a header lying around, and even if there isn't, most real encryption protocols provide some mechanism to be able to tell if you're decrypting real data or not without processing very much of the stream. As soon as you have that, you have an attack vector.
So while PGP (with single DES) is not vulnerable to this precise attack, it's vulnerable to an attack that's very close to it. If it takes six days instead of three, big deal.
No. The course of action that NFN_NLN is arguing against is doing nothing apart from bitching about it on slashdot.
If you're determined to do nothing to fix an admitted serious problem, the very least that you can do is stop bothering the people who actually are trying to do something about it.
I tend to fly on Australian domestic airlines, given where I live. I could find no airline which allows pets other than service dogs in the cabin. Just in case you want to check, I spotchecked Qantas, Virgin, Tiger and Jetstar. (The more "budget" airlines won't even take animals in the cargo hold.)
- Ad-supported software is free as in free beer (i.e. no monetary cost). - Software under a GPL-like licence is free as in free speech (i.e. not enslaved). - Software under a BSD-like licence is free as in free time (i.e. no strings attached).
In fact, even this is slightly inaccurate, since the BSD does require you to retain the copyright notice. Either way, the GPL use of "free" is perfectly legitimate: Freedom comes with responsibility.
I have no problem with reference counting, just reference counted strings. Reference counted strings mandates a performance tradeoff for you, which almost always turns out to be the wrong one in practice. If you need reference counting, you can implement it yourself.
I don't mind reference counting as a design tool, because it usually buys you most of the benefit of garbage collection with less effort than the other manual alternatives. The benefit is that with more manual resource management, you end up having to structure your program around object lifetimes, which for many structure hacking-type applications, puts a limit on what algorithms you can use.
You're right about the PHP "almost as fast as C" crowd. For completeness, I should point out that the performance impact of PHP versus C is often not as simple as people think.
PHP applications which are very thin layers of glue spend an appreciable amount of their time in library code and so are effectively C applications with a scripting layer on top.
The performance of applications in C often degrade over time as they are maintained, and whether or not it gets fixed is often a management issue.
But the type of application we're talking about here, where the business logic is complex, could certainly benefit from some compilation. Remember, Facebook even hack their kernels so they can serve a thumbnail image with only two disk seeks instead of three. If you're that concerned about latency, PHP seems like an odd choice for anything time-critical.
As for the benchmarks, I benchmarked it personally to prove to all the windows weenies that the STL had no place in what we were trying to do, which was a server running on bsd unix - my c99 code was a MINIMUM of 4 times faster than the same code using the stl and c++.
I believe your benchmarks, though I would be curious to know about the relative code size and maintainability between the C99 version and the C++/STL version. I'm also curious to know exactly where all that extra time is being spent.
I believe it because specialised code always wins out over generic code, at the cost of maintainability. It's no different from the PHP vs C++ tradeoff mentioned in TFA. PHP loses you a lot of performance while gaining a lot of "R" in your RAD.
But still, using STL over custom containers does not automatically result in a 4× performance hit for most applications. The benefit of a standard, generic collection of containers is that you can use it quickly, and rewrite it if and only if profiling determines that it's causing a performance problem.
And having said that, there are, of course, a few known performance problems in many STL/standard library implementations, such as reference counted strings.
Nor was Jordan or Syria. These entities grew out of secret agreements between the UK, France and Russia in 1916, and later went through various League of Nations redraftings.
Like most large geopolitical problems in the world, everything here is essentially due to the meddling of superpowers and botched decolonisations.
A lot of the problems we are having to deal with now, I have to deal with now, are a consequence of our colonial past. [...] The Balfour Declaration and the contradictory assurances which were being given to Palestinians in private at the same time as they were being given to the Israelis - again, an interesting history for us but not an entirely honourable one. -- British Foreign Secretary Jack Straw, 2002
You can get a handle on most conflicts in the world by keeping one important fact in mind: There is no such thing as "the good guys". No person, no nation, no government, no interest group has pure motives.
Barring a double dissolution (the constitutional trigger for which has occurred, but the PM has said it will not happen), you probably won't have a chance to vote him out before late 2010/early 2011.
In addition to writing to your MP, if you are a member of the IIA, you might want to write to them urging them to lobby the government to ensure that ISP-level filtering will be offered on an optional basis and will not unduly burden small ISPs.
Does the Danish legal system have a concept similar to estoppel? Under a British-derived legal system, by not prosecuting Henrik Anderson, the authorities give everyone who follows him a legal defence.
Gandhi didn't make a bit while of salt to put on his lunch while nobody was watching. Rosa Parks didn't sit at the front of the black section of the bus by accident, completely unaware that she'd be asked to move when the white section filled up. John Gilmore didn't turn up at the airport with no ID because he'd forgotten to bring it.
If you have reason to believe your life may be in danger, by all means break a bad law in secret. But really, most of us have no excuse for such cowardice. Real civil disobedience is breaking a bad law and facing the consequences with your eyes open. Good on you, Henrik Anderson.
It is shorter, but it doesn't make any attempt to run in linear time on already sorted lists, which is something that most industrial strength sort algorithms do.
I make no claims that my code is industrial strength (I didn't even check to see if it compiles), but it's a better approach than HBC's library code took in 2002.
EmptyDataDeclarations allows for data types without a constructor... but to be perfectly honest I haven't quite figured out what practical benefit they have:). I'm sure there is a reason, but I don't think it's as trivial or obvious as you make out.
class File {
File(const string& name, open_read_t);// Open for reading.
File(const string& name, open_read_write_t);// Open for writing. };
The tag structs are not used to carry data; their only purpose for existing is to disambiguate the two constructors.
Similarly, in the STL, tag structs are also used to mark iterator categories, to make sure that when you could use more than one algorithm for a container, the most appropriate one is selected.
This is essentially what empty data declarations are for in Haskell, except that by having no constructors, you can guarantee that they will never be instantiated. The most common use is in conjunction with phantom types.
Right, quicksort is almost always the wrong answer if you're sorting linked lists, as you are here.
But consider a more complex algorithm, such as bottom-up polyphase merge sort. (WARNING: Untested code follows.)
sort = mergePhase . generateRuns
generateRuns [] = [] generateRuns (x:xs) = split xs x x (x:)
where
split [] _ _ _ k = k []
split (x:xs) minx maxx k
| x >= maxx = split xs minx x (k . (x:))
| x < minx = split xs x maxx ((x:) . k)
| otherwise = k [] : split xs x x (x:)
merge [] ys = ys merge xs [] = xs merge (x:xs) (y:ys)
| x <= y = x : merge xs (y:ys)
| otherwise = y : merge (x:xs) ys
It's a bit longer, but it's surprisingly fast and robust considering how little code is here. Especially interesting is the way that lazy evaluation works here; what looks like multiple passes are interleaved to preserve locality in a way that would require a lot more code in a conventional language. Also note the use of difference lists in the run generation phase; many languages would require extra reference/pointer hackery to achieve this.
Technical nit: Australian toilets work on a different principle. They actually don't swirl at all.
Modern instruction prefetch units keep a cache of return targets. (I don't know for sure, but if I were a CPU designer, which I'm not, I experiment with flushing it when a likely context switch has occurred, e.g. loading the TR or modifying CR3.) The IPU is going to assume that you're returning from whence you came until it discovers otherwise. This will almost certainly be a cache hit, but at that point a large part of the pipeline will have to be flushed.
You could design a CPU that treats this case better, but you have to ask if it's worth going to the trouble.
There are only a couple of votes between no export and export. If Australia wants to buy them, the US will sell them.
It would cause the biggest pipeline stall you've ever seen.
I don't know who modded you a troll, but perhaps for extra clue, you might want to say "I'm GZippy Longstocking!" next time.
But you're absolutely right: this attack only works because the plaintext is highly redundant. Remove the redundancy and the attack won't work.
Still, usually leaves a header lying around, and even if there isn't, most real encryption protocols provide some mechanism to be able to tell if you're decrypting real data or not without processing very much of the stream. As soon as you have that, you have an attack vector.
So while PGP (with single DES) is not vulnerable to this precise attack, it's vulnerable to an attack that's very close to it. If it takes six days instead of three, big deal.
I bet he didn't factor DRM into the equation. Even if we find a radio signal, it's not guaranteed that the key server will still be up.
I expect slashdotters to know their Japanese words. But you have a point; it's not like sudoku appears a lot in tentacle rape hentai.
No. The course of action that NFN_NLN is arguing against is doing nothing apart from bitching about it on slashdot.
If you're determined to do nothing to fix an admitted serious problem, the very least that you can do is stop bothering the people who actually are trying to do something about it.
It seems really wrong for DNF not to be in development. Long may it remain so!
In my case, Australia. If I'm reading the regulations correctly, a specific exemption for police and emergency vehicles was only added in 1999.
I tend to fly on Australian domestic airlines, given where I live. I could find no airline which allows pets other than service dogs in the cabin. Just in case you want to check, I spotchecked Qantas, Virgin, Tiger and Jetstar. (The more "budget" airlines won't even take animals in the cargo hold.)
On all the airlines I fly, dogs and cats are not allowed in the cabin, with the obvious exception for disability assistance dogs.
What I want to know is: Why aren't we training air stewards on how to use an epipen?
Major nitpick: How it's handled depends on the jurisdiction.
In many places, there is no exemption for breaking the road rules, but the authorities are legally not allowed to prosecute.
Sigh. Not this again.
Here's the deal:
- Ad-supported software is free as in free beer (i.e. no monetary cost).
- Software under a GPL-like licence is free as in free speech (i.e. not enslaved).
- Software under a BSD-like licence is free as in free time (i.e. no strings attached).
In fact, even this is slightly inaccurate, since the BSD does require you to retain the copyright notice. Either way, the GPL use of "free" is perfectly legitimate: Freedom comes with responsibility.
I have no problem with reference counting, just reference counted strings. Reference counted strings mandates a performance tradeoff for you, which almost always turns out to be the wrong one in practice. If you need reference counting, you can implement it yourself.
I don't mind reference counting as a design tool, because it usually buys you most of the benefit of garbage collection with less effort than the other manual alternatives. The benefit is that with more manual resource management, you end up having to structure your program around object lifetimes, which for many structure hacking-type applications, puts a limit on what algorithms you can use.
You're right about the PHP "almost as fast as C" crowd. For completeness, I should point out that the performance impact of PHP versus C is often not as simple as people think.
PHP applications which are very thin layers of glue spend an appreciable amount of their time in library code and so are effectively C applications with a scripting layer on top.
The performance of applications in C often degrade over time as they are maintained, and whether or not it gets fixed is often a management issue.
But the type of application we're talking about here, where the business logic is complex, could certainly benefit from some compilation. Remember, Facebook even hack their kernels so they can serve a thumbnail image with only two disk seeks instead of three. If you're that concerned about latency, PHP seems like an odd choice for anything time-critical.
Quite. You're not supposed to inherit from STL classes, unless you REALLY know what you're doing.
I believe your benchmarks, though I would be curious to know about the relative code size and maintainability between the C99 version and the C++/STL version. I'm also curious to know exactly where all that extra time is being spent.
I believe it because specialised code always wins out over generic code, at the cost of maintainability. It's no different from the PHP vs C++ tradeoff mentioned in TFA. PHP loses you a lot of performance while gaining a lot of "R" in your RAD.
But still, using STL over custom containers does not automatically result in a 4× performance hit for most applications. The benefit of a standard, generic collection of containers is that you can use it quickly, and rewrite it if and only if profiling determines that it's causing a performance problem.
And having said that, there are, of course, a few known performance problems in many STL/standard library implementations, such as reference counted strings.
Nor was Jordan or Syria. These entities grew out of secret agreements between the UK, France and Russia in 1916, and later went through various League of Nations redraftings.
Like most large geopolitical problems in the world, everything here is essentially due to the meddling of superpowers and botched decolonisations.
You can get a handle on most conflicts in the world by keeping one important fact in mind: There is no such thing as "the good guys". No person, no nation, no government, no interest group has pure motives.
Barring a double dissolution (the constitutional trigger for which has occurred, but the PM has said it will not happen), you probably won't have a chance to vote him out before late 2010/early 2011.
In addition to writing to your MP, if you are a member of the IIA, you might want to write to them urging them to lobby the government to ensure that ISP-level filtering will be offered on an optional basis and will not unduly burden small ISPs.
Does the Danish legal system have a concept similar to estoppel? Under a British-derived legal system, by not prosecuting Henrik Anderson, the authorities give everyone who follows him a legal defence.
Gandhi didn't make a bit while of salt to put on his lunch while nobody was watching. Rosa Parks didn't sit at the front of the black section of the bus by accident, completely unaware that she'd be asked to move when the white section filled up. John Gilmore didn't turn up at the airport with no ID because he'd forgotten to bring it.
If you have reason to believe your life may be in danger, by all means break a bad law in secret. But really, most of us have no excuse for such cowardice. Real civil disobedience is breaking a bad law and facing the consequences with your eyes open. Good on you, Henrik Anderson.
It is shorter, but it doesn't make any attempt to run in linear time on already sorted lists, which is something that most industrial strength sort algorithms do.
I make no claims that my code is industrial strength (I didn't even check to see if it compiles), but it's a better approach than HBC's library code took in 2002.
Well that's one way to ensure that Python retains lambdas, map and filter.
EmptyDataDeclarations allows for data types without a constructor... but to be perfectly honest I haven't quite figured out what practical benefit they have :). I'm sure there is a reason, but I don't think it's as trivial or obvious as you make out.
Consider the tag struct idiom in C++:
struct open_read_t {};
struct open_read_write_t {};
class File { // Open for reading. // Open for writing.
File(const string& name, open_read_t);
File(const string& name, open_read_write_t);
};
The tag structs are not used to carry data; their only purpose for existing is to disambiguate the two constructors.
Similarly, in the STL, tag structs are also used to mark iterator categories, to make sure that when you could use more than one algorithm for a container, the most appropriate one is selected.
This is essentially what empty data declarations are for in Haskell, except that by having no constructors, you can guarantee that they will never be instantiated. The most common use is in conjunction with phantom types.
Right, quicksort is almost always the wrong answer if you're sorting linked lists, as you are here.
But consider a more complex algorithm, such as bottom-up polyphase merge sort. (WARNING: Untested code follows.)
sort = mergePhase . generateRuns
generateRuns [] = []
generateRuns (x:xs) = split xs x x (x:)
where
split [] _ _ _ k = k []
split (x:xs) minx maxx k
| x >= maxx = split xs minx x (k . (x:))
| x < minx = split xs x maxx ((x:) . k)
| otherwise = k [] : split xs x x (x:)
mergePhase [] = []
mergePhase [xs] = xs
mergePhase xss = mergePhase (mergePass xss)
where
mergePass (xs1 : xs2 : xss) = merge xs1 xs2 : mergePass xss
mergePass xss = xss
merge [] ys = ys
merge xs [] = xs
merge (x:xs) (y:ys)
| x <= y = x : merge xs (y:ys)
| otherwise = y : merge (x:xs) ys
It's a bit longer, but it's surprisingly fast and robust considering how little code is here. Especially interesting is the way that lazy evaluation works here; what looks like multiple passes are interleaved to preserve locality in a way that would require a lot more code in a conventional language. Also note the use of difference lists in the run generation phase; many languages would require extra reference/pointer hackery to achieve this.