True, this is what OSGi does. What I wanted to emphasize that the Singleton pattern hides how the "globality" (or other scope) is enforced, therefore it is more flexible than global variables. Also it works in other languages where the classloader trick is not applicable.
Well... Ok. We are talking about the same then -- with different interpretations of the term "Framework". I never argue about definitions:)
Intrusive libraries could really suck, I agree. But in fact it's the nice libraries that taught me how to avoid these problems when designing my own API.
Well, using libraries is a great learning experience. Sometimes you can learn a lot about a problem if you implement the solution yourself. But your coding style will improve most when you see how others implement the same. It helps you to be more open minded.
Of course one has to be extremely careful whether to use a library at all, and which one to pick.
"Now, math has been a while ago for me, but I cannot remember it being THAT easy."
The whole problem of modern mathematics is exactly this. It is not organized in an efficient manner. Programmers are not algorithm writers. Programmers are organizers -- and this is very important to understand. If one of my programmers would produce code that is that badly documented, that badly organized as mathematicians -- I would fire him.
And this is the main misunderstanding that TFA has. Writing algorithms is just a minor part of our job.
Why is he modded troll? Please stop using moderation as expressing your disagreement. In general, you should spend mod points to mod up people, not to mod down -- except spammers, hatespeech, etc.
Expect the frameworks that are specially designed to NOT intrude in your model. Just look at most of the POJO frameworks nowadays. No need to implement specific interfaces, no need to derive from base classes.
Also many frameworks I used are already modularized -- they are "cut into aspects" -- exactly what you want.
They are only "global variables" when they are JVM (or whatever) scoped. The problem with simple global variables that they are always global scoped, but with the Singleton pattern you can have thread, session, or other scopes as well.
"Why can 0 and 1 not both be valid prefix codes? They don't have any common initial sequence. Indeed, if you apply Huffman coding (which AFAIK produces a prefix code) to just two symbols, you get exactly that."
This is OK, but we are talking about strings over {0,1}* which are all different messages and should be encoded with different prefix codes - you cannot use Huffman coding here as it is used to generate codewords for a finite input alphabet. In our case the problem is that the Turing machine has an infinite input tape that contains arbitrary 1/0 symbols after the actual input string. We have to be able to decode the end of the input and discard the rest of the tape. If "0" and "1" are both valid input strings then we have to stop decoding after reading the first bit -- because it is a valid input and we do not know if you meant "1" or "101" as input, as both may be valid. To be able to decode longer sequences you need to use a different encoding, like using n "1" symbols and then a "0" indicating that n input bits will follow. Another possibility is to use a special pattern, like "0000" to indicate the end of the string and using escape sequences to encode "0000" in the original input.
The only problem is that "1" and "0" cannot be both valid prefix codes, so etiher you have an explicit terminator symbol and then you have
1$ and 0$
in this case you can have a Turing machine that have a special instruction, namely the empty string "$" that generates "1$", but then you clearly cannot compress the string "0$" as it needs at least one character that discriminates it from the empty one -- like any "x$".
If we talk about prefix codes where there is no terminator then you cannot have both "1" and "0" as legal input, but you can generalize the previous argument to that case.
"Doesn't the compressibility depend on the compression algorithm?"
Yes it does. A sequence S is considered compressable if there is an algorithm A (given as an input for a Universal Turing Machine) with input I so that the length of A concat I is less than the length of S.
"Are there sequences where you can prove that no compression algorithm will compress this special sequence (versus just checking that none of the known compression algorithms does)?"
No, compressability is generally undecidable. However at least half of the strings of length L _must_ be incompressible (I talk about prefix codes here, so we do not have a terminator symbol).
"A space-optimized x86 implementation will need a different number of bytes than a space-optimized Alpha version. So what is the "correct size" of the algorithm?"
As the emulation of a Turing machine U1 by another Turing machine U2 takes only C (finite) bits to implement, many strings that are compressable (especially the long ones) by U1 will be compressable by U2 as well. Of course for short strings this C difference may prohibit U2 from compressing the string.
"If you weren't a seven-digit n00b, you might have understood how the slashdot moderation system worked:)"
Is not "seven-digit n00b" a little bit discriminating? Is it not discrimination by the ordering of Slasdot IDs (registration order)? Anyway, I accept that I have to earn reputation first to have equals rights here (just as young people should accept).
"you might have understood how the slashdot moderation system worked"
Well, probably I do not understand it yet. But I got a really bad taste from it. I have a Bad Karma now, although it was my third comment or so. Even if some people do not agree with my comment (like you) I do not see the reason to mod as Flamebait. But no problem, I will get my Karma back. Such is life.
"Fact is there's nothing natural about 18, or 22, or any other age the presently enfranchised settle on. We should stop pretending."
So newborn infants should have the same rights as adults (getting a loan, smoking, having sex, etc. -- my version of strawman arg). Interesting. Yes, the number is arbitrary. Just as your lower Slashdot ID.
This is impossible. If we take the usual definition of random strings, namely incompressibility, then it is quite easy to prove impossibility. If you have an algorithm that can produce random strings of arbitrary length -- like you proposed --, than it is possible to produce a random string that is itself longer than the description of the algorithm that produced it. This is by definition means that your string is compressible, which contradicts its randomness.
It depends. In an algorithmic sense you can talk about "random" sequences. They are the ones that are uncompressable. They also pass every effective test of randomness. Of course this is a different definition than "random process".
Strawman argument. It is quite natural to have less rights as a young man, as far as it really protects you and does not violate your privacy. But please do not equate discrimination against youth with racism. They are completely different. Now mod me down again.
Um, Halting Problem?
True, this is what OSGi does. What I wanted to emphasize that the Singleton pattern hides how the "globality" (or other scope) is enforced, therefore it is more flexible than global variables. Also it works in other languages where the classloader trick is not applicable.
Well... Ok. We are talking about the same then -- with different interpretations of the term "Framework". I never argue about definitions :)
Intrusive libraries could really suck, I agree. But in fact it's the nice libraries that taught me how to avoid these problems when designing my own API.
One serious problem with subscriptions and paywalls is that they effectively prevent linking content -- the most important feature of the web.
Well, using libraries is a great learning experience. Sometimes you can learn a lot about a problem if you implement the solution yourself. But your coding style will improve most when you see how others implement the same. It helps you to be more open minded.
Of course one has to be extremely careful whether to use a library at all, and which one to pick.
"Now, math has been a while ago for me, but I cannot remember it being THAT easy."
The whole problem of modern mathematics is exactly this. It is not organized in an efficient manner. Programmers are not algorithm writers. Programmers are organizers -- and this is very important to understand. If one of my programmers would produce code that is that badly documented, that badly organized as mathematicians -- I would fire him.
And this is the main misunderstanding that TFA has. Writing algorithms is just a minor part of our job.
Why is he modded troll? Please stop using moderation as expressing your disagreement. In general, you should spend mod points to mod up people, not to mod down -- except spammers, hatespeech, etc.
Expect the frameworks that are specially designed to NOT intrude in your model. Just look at most of the POJO frameworks nowadays. No need to implement specific interfaces, no need to derive from base classes.
Also many frameworks I used are already modularized -- they are "cut into aspects" -- exactly what you want.
They are only "global variables" when they are JVM (or whatever) scoped. The problem with simple global variables that they are always global scoped, but with the Singleton pattern you can have thread, session, or other scopes as well.
"transmute lead into gold in a cost-effective manner"
Rob a bank with a gun?
...but I tell you only when you tell us what do you want to achieve.
"Why can 0 and 1 not both be valid prefix codes? They don't have any common initial sequence. Indeed, if you apply Huffman coding (which AFAIK produces a prefix code) to just two symbols, you get exactly that."
This is OK, but we are talking about strings over {0,1}* which are all different messages and should be encoded with different prefix codes - you cannot use Huffman coding here as it is used to generate codewords for a finite input alphabet. In our case the problem is that the Turing machine has an infinite input tape that contains arbitrary 1/0 symbols after the actual input string. We have to be able to decode the end of the input and discard the rest of the tape. If "0" and "1" are both valid input strings then we have to stop decoding after reading the first bit -- because it is a valid input and we do not know if you meant "1" or "101" as input, as both may be valid. To be able to decode longer sequences you need to use a different encoding, like using n "1" symbols and then a "0" indicating that n input bits will follow. Another possibility is to use a special pattern, like "0000" to indicate the end of the string and using escape sequences to encode "0000" in the original input.
In fact you are almost right :)
The only problem is that "1" and "0" cannot be both valid prefix codes, so etiher you have an explicit terminator symbol and then you have
1$ and 0$
in this case you can have a Turing machine that have a special instruction, namely the empty string "$" that generates "1$", but then you clearly cannot compress the string "0$" as it needs at least one character that discriminates it from the empty one -- like any "x$".
If we talk about prefix codes where there is no terminator then you cannot have both "1" and "0" as legal input, but you can generalize the previous argument to that case.
"Doesn't the compressibility depend on the compression algorithm?"
Yes it does. A sequence S is considered compressable if there is an algorithm A (given as an input for a Universal Turing Machine) with input I so that the length of A concat I is less than the length of S.
"Are there sequences where you can prove that no compression algorithm will compress this special sequence (versus just checking that none of the known compression algorithms does)?"
No, compressability is generally undecidable. However at least half of the strings of length L _must_ be incompressible (I talk about prefix codes here, so we do not have a terminator symbol).
"A space-optimized x86 implementation will need a different number of bytes than a space-optimized Alpha version. So what is the "correct size" of the algorithm?"
As the emulation of a Turing machine U1 by another Turing machine U2 takes only C (finite) bits to implement, many strings that are compressable (especially the long ones) by U1 will be compressable by U2 as well. Of course for short strings this C difference may prohibit U2 from compressing the string.
"If you weren't a seven-digit n00b, you might have understood how the slashdot moderation system worked :)"
Is not "seven-digit n00b" a little bit discriminating? Is it not discrimination by the ordering of Slasdot IDs (registration order)? Anyway, I accept that I have to earn reputation first to have equals rights here (just as young people should accept).
"you might have understood how the slashdot moderation system worked"
Well, probably I do not understand it yet. But I got a really bad taste from it. I have a Bad Karma now, although it was my third comment or so. Even if some people do not agree with my comment (like you) I do not see the reason to mod as Flamebait. But no problem, I will get my Karma back. Such is life.
"Fact is there's nothing natural about 18, or 22, or any other age the presently enfranchised settle on. We should stop pretending."
So newborn infants should have the same rights as adults (getting a loan, smoking, having sex, etc. -- my version of strawman arg). Interesting. Yes, the number is arbitrary. Just as your lower Slashdot ID.
Btw "discrimination"!="negative discrimination".
This is impossible. If we take the usual definition of random strings, namely incompressibility, then it is quite easy to prove impossibility. If you have an algorithm that can produce random strings of arbitrary length -- like you proposed --, than it is possible to produce a random string that is itself longer than the description of the algorithm that produced it. This is by definition means that your string is compressible, which contradicts its randomness.
It depends. In an algorithmic sense you can talk about "random" sequences. They are the ones that are uncompressable. They also pass every effective test of randomness. Of course this is a different definition than "random process".
Strawman argument. It is quite natural to have less rights as a young man, as far as it really protects you and does not violate your privacy. But please do not equate discrimination against youth with racism. They are completely different. Now mod me down again.
This is a truly random comment:
aaaaaaaaaaaaaa
Some people here compare discrimination against youth with discrimination against old people or different races.
They are not the same:
- you cannot change your race
- you cannot get younger
However you _inevitably_ grow older.