What language/platform would you recommend for CPU-bound application?

Question: I'm developing non-interactive cpu-bound application which does only computations, almost no IO. Currently it works too long and while I'm working on improving the algorithm, I also think if it can give any benefit to change language or platform. Currently it is C++ (no OOP so it is almost C) on windows compiled with Intel C++ compiler. Can switching to ASM help and how much? Can switching to Linux and GCC help?
Answer: Just to be thorough: the first thing to do is to gather profile data and the second thing to do is consider your algorithms. I'm sure you know that, but they've got to be #included into any performance-programming discussion.
To be direct about your question "Can switching to ASM help?" the answer is "If you don't know the answer to that, then probably not." Unless you're very familiar with the CPU architecture and its ins and outs, it's unlikely that you'll do a significantly better job than a good optimizing C/C++ compiler on your code.
The next point to make is that significant speed-ups in your code (aside from algorithmic improvements) will almost certainly come from parallelism, not linear increases. Desktop machines can now throw 4 or 8 cores at a task, which has much more performance potential than a slightly better code generator. Since you're comfortable with C/C++, OpenMP is pretty much a no-brainer; it's very easy to use to parallelize your loops (obviously, you have to watch loop-carried dependencies, but it's definitely "the simplest parallelism that could possibly work").
Having said all that, code generation quality does vary between C/C++ compilers. The Intel C++ compiler is well-regarded for its optimization quality and has full support not just for OpenMP but for other technologies such as the Threading Building Blocks.
Moving into the question of what programming languages might be even better than C++, the answer would be "programming languages that actively promote / facilitate concepts of parallelism and concurrent programming." Erlang is the belle of the ball in that regard, and is a "hot" language right now and most people interested in performance programming are paying at least some attention to it, so if you want to improve your skills in that area, you might want to check it out.
Comment: I would add what my teacher used to tell us at uni: 1) optimise the algorithm 2) optimise for the use of one core 3) finally look for multithreading

Point 2 means specifically leveraging the SIMD units and the superscalar aspect of the core.

And memory access is often critical. If your CPU is just cache missing all day long then basically it is just doing no work.
Answer: It's always algorithm, rarely language.  Here's my clue: "while I'm working on improving the algorithm".
Tweaking may not be enough.
Consider radical changes to the algorithm.  You've got to eliminate processing, not make the processing go faster.  The culprit is often "search" -- looping through data looking for something.  Find ways to eliminate search.  If you can't eliminate it, replace linear search with some kind of tree search or a hash map of some kind.
Comment: Yes.  It's always algorithm.  And some languages can express things others cannot.  Some can express things easier than other languages.  Some tasks are easier in C++, some are harder.
Comment: @Aaron: on a technical level, almost all languages are the same -- they're all Turing Complete.  However, some things are more convenient in one language.   Algorithms are always independent of language.
Comment: @Uri: Most algorithm issues trade off memory vs. time.  If you want less time, you often have to use more memory.  Cache is never an issue.  Paging problems, however, mean an unwise balance between time and memory.  Not a hardware problem.  An algorithm problem.
Comment: @Joe Pineda:  Sorry, a bad algorithm will never run well on amy processor.  The right algorithm may run better on Intel than Sparc, but the wrong algorithm will be horrible everywhere.
Comment: An anecdote: I once found a *terrible* query in a stored procedure. Refactored it until the execution plan was considerably shorter. Tested and found it, in production, *slower* than previous version. Why? Turned out SQL S. was running the older in parallel, couldn't do so with the new.
Comment: @Joe Pineda: Profiling is good.  Tweaking is a waste of time.  Discarding a bad algorithm and replacing it with a good algorithm is essential.  Hardware isn't irrelevant.  It's not as important as fundamental algorithm-dsta structure design.
Comment: I disagree. It's algorithm and hardware. Even after you ground down the algorithm to to the bare minimum, you may be paying huge CPU overheads if you don't play with the way things are organized (e.g., caching and paging)
Comment: Completely wrong. It's indeed algorithm plus hardware. Processors have caching, pipeline and branching issues which mean the same algorithm may perform slower than another one on a chip, and yet you may get opposite results on another microprocessor.
Comment: Samples: Jeff Atwood once noted gzip runs way slower on Athlons than on Core Duos, even though "GZip is simply Deflate plus a checksum and header/footer". On the Mersenne Prime Search mail-list, it's been noted Prime95's Lucas-Lehmer runs better on Pentium than on AMD due to branch penalty.
Comment: What I mean is you can have 2 functionaly equivalent *good* algorithms yet one may run faster on a processor than the other, the inverse on other proc. If you're CPU-bound you need to **profile** - algorithm analysis alone is no replacement for this, nor sufficient, never.
Answer: Switching to ASM is not going to help much, unless you're very good at it and/or have a specific critical path routine which you know you can do better. As several people have remarked, modern compilers are just better in most cases at taking advantages of caching/etc. than anyone can do by hand.
I'd suggest:

Try a different compiler, and/or different optimization options
Run a code coverage/analysis utility, and figure out where the critical paths are, and work on optimizing those in the code

C++ should be able to give you very near the best possible performance from the code, so I wouldn't recommend switching the language. Depending on the app, you may be able to get better performance on multi code/processor systems using multiple thread, as another suggestion.
Answer: While just switching to asm won't give any benefits, since the Intel C++ Compiler is likely better at optimizing than you, you can try one of the following options:

Try a compiler that will parallelize your code, like the VectorC compiler.
Try to switch to asm with heavy use of MMX, 3DNow!, SSE or whatever fits your needs (and your CPU). This will give more of a benefit than pure asm.
You can also try GPGPU, i.e. execute large parts of your algorithm on a GPU instead of a CPU. Depending on your algorithm, it can be dramatically faster.

Edit: I also second the profile approach. I recommend AQTime, which supports the Intel C++ compiler.
Answer: Personally I'd look at languages which allow you to take advantage of parallelism most easily, unless it's a thoroughly non-parallelisable situation. Being able to bolt on some extra cores and get (if possible!) near-linear improvement may well be a lot more cost-effective than squeezing the extra few percent of efficiency out.
When it comes to parallelisation, I believe functional languages are often regarded as the best way to go, or you could look at OpenMP for C/C++. (Personally, as a managed language guy, I'd be looking at libraries for Java/.NET, but I quite understand that not everyone has the same preferences!)
Comment: Yes, and specifically, I'd look at Clojure.  It's a JVM language built by somebody who seems obsessive about parallelism, so it takes a lot from functional languages (like immutable data structures).
Answer: Try Fortran 77 - when it comes to computations still nothing beats the granddaddy of programming languages. Also, try it with OpenMP to take advantage of multiple cores.
Comment: It's hard to believe but it's true.  (I'm a hardcore C++ programmer by the way.)  The main reason is the tighter aliasing rules in Fortran -- in C/C++, the compiler has no guarantee that a pointer is the only pointer pointing at a given piece of data, which makes certain optimisations impossible.
Answer: Hand optimizing your ASM code compared to what C++ can do for you is rarely cost effective.
If you've done anything you can to the algorithm from a traditional algorithmic view, and you've also eliminated excesses, then you may either be SOL, or you can consider optimizing your program from a hardware point of view.
For example, any time you follow a pointer around the heap you are paying a huge cost due to cache misses, possibly paging, etc., which all affect branching predictions. Most programmers (even C gurus) tend to look at the CPU from the functional standpoint rather than what happens behind the scenes. Sometimes reorganizing memory, for example by "flattening" or manually allocating memory to fit on the same page can obtain ENORMOUS speedups. I managed to get 2X speedups on graph traversals just by flattening my structures.
These are not things that your compiler will do for you since they are based on your high-level understanding of the program.
Answer: As lobrien said, you haven't given us any information to tell you if hand-optimized ASM code would help... which means the answer is probably, "not yet."
Have you run your code with a profiler?
Do you know if the code is slow because of memory constraints or processor constraints?
Are you using all your available cores?
Have you identified any algorithms you're using that aren't O(1)? Can you get them to O(1)? If not, why not?
If you've done all that, how much control do you have over the environment your program is running in? (presumably a lot if you're thinking of switching operating systems) Can you disable other processes, give your process highest priority, etc? What about just finding a machine with a faster processor, more cores, or more memory (depending on what you're constrained on)
And on and on.
If you've already done all that and more, it's certainly possible you'll get to a point where you think, "I wonder if these few lines of code right here could be optimized better than the assembly that I'm looking at in the debugger right now?" And at that point you can ask specifically.
Good luck! You're solving a problem that's fun to solve.
Answer: Sometimes you can find libraries that have optimized implementations of the algorithms you care about. Often times they will have done the multithreading for you.
For example switching from LINPACK to LAPACK got us a 10x speed increase in LU factorization/solve with a good BLAS library.
Answer: First, figure out if you can change the algorithm, as S.Lott suggested.
Assuming the algorithm choice is correct, you might look a the memory access patterns, if you have a lot of data you are processing.  For a lot of number crunching applications these days, they're bound by the memory bus, not by the ALU(s).  I recently optimized some code that was of the form:

// Assume N is a big number
for (int i=0; i<N; i++) {
  myArray[i] = dosomething(i);
}
for (int i=0; i<N; i++) {
  myArray[i] = somethingElse(myArray[i]);
}
...

and converted it to look like:

for (int i=0; i<N; i++) {
  double tmp = dosomething(i);
  tmp = somethingElse(tmp);
  ...
  myArray[i] = tmp;
}
...

In this particular case, this yielded about a 2x speedup.
Answer: As Oregonghost already hinted - The VectorC compiler might help. It does not really parallelize the code though, instead you can use it to leverage on extended command sets like mmx or sse. I used it for the most time-critical parts in a software rendering engine and it resulted in a speedup of about 150%-200% on most processors.
Answer: For an alternative approach, you could look into Distributed Computing which sounds like it could suit your needs.
Answer: If you're sticking with C++ on the intel compiler, take a look at the compiler intrinsics (full reference here).  I know that VC++ has similar functionality, and I'm sure you can do the same thing with gcc.  These can let you take full advantage of the parallelism built into your CPU.  You can use the MMX, SSE and SSE2 instructions to improve performance to a degree.  Like others have said, you're probably best looking at the algorithm first.
Answer: I suggest you rethink your algorithm, or maybe even better, your approach. On the other hand maybe what you are trying to calculate just takes a lot of computing time. Have you considered to make it distributed so it can run in a cluster of some sort? If you want to focus on pure code optimization by introducing Assembler for your inner loops then often that can be very beneficial (if you know what you're doing).
Answer: The 2 obvious answers to "CPU-bound" are:
1. Use more CPU (core)s
2. Use something else.
Using 2 threads instead of 1 will cut the time spent by up to 50%. In comparision, C++ to ASM rarely gives you 5% (and for novice ASM programmers, it's often -5%!). Some problems scale well, and may benefit from 8 or 16 cores. That kind of hardware is still pretty mainstream, so see if your problems fall in that category.
The other solution is to throw more specialized hardware at the task. This could be the vector unit of your CPU - considering Windows=x86/x64, that's going to be a flavor of SSE. Another kind of vector hardware is the modern GPU. The GPU also has its own memory bus, which is quite speedy.
Answer: For modern processors, learning ASM will take you a long time. Further, with all the different versions of SSE around, your code will end up very processor dependant.
I do quite a lot of CPU-bound work, and have found that the difference between intel's C++ compiler and g++ usually isn't that big (at most 15% or so), and there is no measurable difference between Mac OS X, Windows and Linux.
You are going to have to optimise your code and improve your algorithm by hand. There is no "magic fairy dust" which can make existing code that much faster I'm afraid.
If you haven't yet, and you care about performance, you MUST run your code through a good profiler (personally, I like kcachegrind & valgrind on Linux, or Shark on Mac OS X. I don't know what is good for windows I'm afraid).
Based on my past experience, there is a very good chance you'll find some method is taking 95% of your CPU time, and some simple change or addition of caching will make a massive improvement to your performance. On a similar note, if some method is only taking 1% of your CPU time, no amount of optimising is going to gain you anything.
Answer: First get the lead out. Then if it's as fast as it can possibly be without going to ASM, so be it. But thinking you have to go to ASM assumes you know what's making it slow, and I'll bet a donut that you're guessing.
Answer: If you feel you have optimized your code to a point there is no improvement, increase your CPU's.  This can be done on different platforms.  One I develop with is Appistry.  A few links:
http://www.appistry.com/resource-library/index.html
and you can download the product free from here:
http://www.appistry.com/developers/
I work for Appistry and we have done many installations for tasks that were cpu bound by spreading work out over 10's or 100's of machines.
Hope this helps,
-Brett
Answer: Probable small help:
Optimization of 64-bit programs
AMD64 (EM64T) architecture
Debugging and optimization of multi-thread OpenMP-programs
Introduction into the problems of developing parallel programs
Development of Resource-intensive Applications in Visual C++
Answer: Linux
Switching to Linux can help, if you strip it down to only the parts you actually need.
Answer: CrowdProcess has about 2000 workers you can use to compute your algorithm. The API is extremely simple and we've been observing speedups close to the number of workers. Also you can write Javascript which should make you more productive than C++ or ASM.
So if you're in between C++ or ASM, I'd say you should first use all your CPU cores, then if it's not enough, CrowdProcess should be an interesting platform.
Disclaimer: I built CrowdProcess.
Answer: It is hard to produce ASM code that is faster than naive C or C++ code. In most cases if you do this job really well, you probably gain not much than few percents and getting like 10% speedup is considered great success but in most cases it is just impossible.
Compilers are capable of understanding how to compile efficiently. You should profile in order to figure out where to optimize.


Kernel vs Point density

Question: Can someone give me an example each where these two tools would be appropriate to use. I kind of understood what each of them does but can't seem to figure out examples where one would be more appropriate than the other. Both seem to show density just fine.
Answer: I believe it depends on what you want to analyze to determine which tool will suit your needs.  Both tools smooth out the information represented by a collection of points in a way that is pleasing visually.  The purpose of the point and Kernal Density tools is to attempt to construct a surface that perfectly reflects the likelihood of an event.  Point density calculates a magnitude per unit area from point features that fall within a neighborhood around each cell. KD calculates the density of features in a neighborhood around those features. i.e., finding density of houses, or crime reports influencing a city. Point density calculates a magnitude per unit area from point features. KD instead spreads the known quantity of the population for each point out from the point location. A kernal function is then used to fit a smoothly tapered surface to each point.
https://blogs.esri.com/esri/arcgis/2013/05/28/how-should-i-interpret-the-output-of-density-tools/

Kernel vs Point density


Who were the Bishops of Irkutsk after St. Innocent?

Question: The Irkutsk Orthodox diocese once administered a huge territory. Its founding bishop was St. Innocent, succeeded by Innocent (Nerunovich). Who else held the office before 1800?
Comment: Well, I don't know how reliable it is but if you go just to wiki page "Иркутская епархия" (Irkutsk diocese) https://ru.wikipedia.org/wiki/Иркутская_епархия you'll get the list (in russian) of all bishops ("Епископы") straight to the modern times.
Answer: According to Russian church records, four others held office before 1800:
Ignatij Smola held office September 8 - October 1, 1721
Innokrntij (Nerunovich) held office November 25, 1732 - July 26, 1747.
Sophonij (Kristalevsky) held office April 18, 1753 - March 30, 1771
Michael (Mitkevich) held office August 2, 1772 - August 1, 1789
Benjamin (Bagranskij) held office September 9, 1789 — June 8, 1814
By the way, the Russian Orthodox Church considers not Ignatij I but Varlaam Kossovsky to be the founder of this diocese.
Comment: I must insist that Wikipedia is not "church records". Sounds like your mother considers the Irkutsk and Nerchinsk vicariate of the Tobolsk archdiocese to be the antecedent of the Irkutsk diocese, which is reasonable.
Comment: @RobertColumbia online: ru.wikipedia.org/wiki/Иркутская_епархия
Comment: Where did you get these records? Are they online? Did a priest tell you the names?


Nazir benefiting from grapes/wine

Question: If somebody vows to be a Nazir, are they still allowed to benefit from wine and grapes? Like would they be able to sell wine and grapes to non Nazir people? Or is it like milk and meat or chametz on Passover where you are forbidden from benefiting, not just eating it. Sources appreciated please
Comment: https://www.sefaria.org/Nazir.37a.7?vhe=William_Davidson_Edition_-_Vocalized_Aramaic⟨=bi&with=Rashi&lang2=en
Comment: I haven't properly learnt the sugya so don't want to post it until I have further checked it out
Answer: A Nazir is allowed to benefit from wine, as the gemara (pesachim 21b-23a) says:

ופליגי דרבי אבהו דאמר רבי אבהו כל מקום שנאמר לא יאכל לא תאכל לא תאכלו אחד איסור אכילה ואחד איסור הנאה עד שיפרט לך הכתוב כדרך שפרט לך בנבילה... (23.) והרי נזיר דרחמנא אמר "מחרצנים ועד זג לא יאכלו ותנן "מערבין לנזיר ביין" אמר מר זוטרא שאני התם דאמר קרא "נזרו" שלו יהא
And this argued with Rabbi Abahu, as Rabbi Abahu says, anywhere that "it shall not be eaten", "you shall not eat" or "you (plu.) should not eat" is written, it means both a prohibition of eating and a prohibition of benefitting, until the passuk says outright, like by neveila... (23b) [the gemara questions Rabbi Abahu] but by a Nazir it says "they shall eat nothing from the seeds to the grape skin", yet we learned in a mishna "we make an eiruv (techumin) for a Nazir with wine"! Mar Zutra answers: there it is different, as the Passuk says "his Nazir-hood" - it shall be his. (Meaning, even though he isn't allowed to eat or drink the grape products, he is allowed to benefit from them, as they are still considered his, as the Passuk calls it his Nazir-hood)

So we see that a Nazir may derive benefit from grape products. However, it's slightly more complicated than that, as the Ramba'm (Nazir 5:10) writes:

מדברי סופרים שאסור לנזיר לעמוד במושב שותי יין ויתרחק ממנו הרבה שהרי מכשול לפניו. אמרו חכמים סביב לכרם לא יקרב
Mid'rabannan, it is prohibited for a Nazir to stand in a place of wine-drinkers, and he should distance himself from it a lot, as it is a stumbling block for him. Chachamim said that he should not walk in the vicinity of a vineyard

(This is based on a gemara in Avoda Zara 59)
So we see that a Nazir should not deal with wine or grapes in any form, even when they're not his own, as he may come to eat/ drink them. In short, a Nazir may get benefit from grape products, so long as he is not in the direct surroundings of the grapes. For example, he can't sell grapes, but he can have someone else sell grapes for him.

Nazir benefiting from grapes/wine


this /usr/bin/dpkg returned error || ubuntu-16.04, 64bit

Question: I am trying to install htop, but it was failed due to unmet dependencies.
Tried sudo apt-get -f install, but it did not either resolve the issue.
Tried sudo apt clean & sudo apt update, sudo apt upgrade, no luck.
Tried removing the dpkg as well, no luck.
Earlier it was displaying, Could not get lock /var/lib/dpkg/lock so that I have removed it and now it shows below error ain the installation.
Sub-process /usr/bin/dpkg returned an error code (1)

ik@ik-ThinkPad-T440p:~$ sudo apt install htop
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-image-extra-4.4.0-64-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ik@ik-ThinkPad-T440p:~$
ik@ik-ThinkPad-T440p:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  geoip-database-extra javascript-common libc-ares2 libjs-openlayers libnl-route-3-200 libqgsttools-p1 libqt5multimedia5-plugins libqt5multimediawidgets5 libsmi2ldbl libwireshark-data libwireshark6
  libwiretap5 libwsutil6 linux-headers-4.4.0-21 linux-headers-4.4.0-21-generic linux-headers-4.4.0-59 linux-headers-4.4.0-59-generic linux-image-4.4.0-21-generic linux-image-4.4.0-59-generic
  linux-image-extra-4.4.0-21-generic linux-image-extra-4.4.0-59-generic wireshark-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-4.4.0-64-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-64-generic
0 upgraded, 1 newly installed, 0 to remove and 89 not upgraded.
6 not fully installed or removed.
Need to get 21.8 MB of archives.
After this operation, 66.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.nayatel.com/ubuntu xenial-updates/main amd64 linux-image-4.4.0-64-generic amd64 4.4.0-64.85 [21.8 MB]
Fetched 21.8 MB in 1min 5s (335 kB/s)
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 326141 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-64-generic /boot/vmlinuz-4.4.0-64-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-64-generic /boot/vmlinuz-4.4.0-64-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

These are the output of the commands, please help me fix this.
p:~$ df -H
Filesystem      Size  Used Avail Use% Mounted on
udev            4.1G     0  4.1G   0% /dev
tmpfs           805M   19M  787M   3% /run
/dev/sda7       293G   14G  264G   5% /
tmpfs           4.1G  201M  3.9G   5% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
tmpfs           4.1G     0  4.1G   0% /sys/fs/cgroup
/dev/loop0       62M   62M     0 100% /snap/notes/4
/dev/loop3       79M   79M     0 100% /snap/core/1337
/dev/loop2       80M   80M     0 100% /snap/core/1264
/dev/loop1       80M   80M     0 100% /snap/core/1240
tmpfs           805M   62k  805M   1% /run/user/1000
Comment: What is the result of `sudo fuser -v /var/cache/debconf/config.dat`?
Comment: Aren't you running low space within `/boot` partition? Please add the output of `df -H` to your question.
Comment: Hello, there are are no results to this: sudo fuser -v /var/cache/debconf/config.dat , please let me know what else to do to get it fixed. I have also edited the result of df -H in my question.
Answer: resolved the issue at my own.
removed all the existing packages, with this below
Note: before doing this, please to close all the tabs and other sheets as we do not know which process is hurdling the resolution.
1st: sudo apt autoremove
then, sudo apt-get clean
then, sudo apt-get -f install
then, sudo apt-get update
then, sudo apt-get upgrade
And you are done with the fix.


Dirac notation for classic bits?

Question: I'm writing about Quantum Computing, and in my preliminary sections on classical computing, there are too many things going by the names 0 and 1. Would it be awful to denote the values of classical bits as $|0\rangle$ and $|1\rangle$? I realize that Dirac notation for classical bits might be overkill, but I'm finding it helpful to have specific notation that can't be confused with 0 probability and other such things.
Comment: This is just a notational thing, so its more or less up to you. I've seen authors use a round bracket $|1)$ to differentiate classical bits
Comment: Thanks, Danny. Can you point me to an author that uses a round bracket?
Comment: I have seen more of angle brackets |0> rather than |0)
Comment: depends on what you plan to do with it. A ket is a way to denote a vector. Is it convenient for you to describe your bits as vectors? Most likely not. Of course, you can use whatever notation you want, if it's for your own fruition it's up to you. You can decide that "$2$" means "$17$" if you want. But doing so is not standard in any way, and probably not a great idea if you want to understand and be understood by others
Comment: @sohamb172 Where have you seen angle brackets used for classical bits?
Answer: You could stick to the variable names $b$ for bit and $|q\rangle$ for qubit, and then if you have to refer to their values, you can specify $b=0$ or $b=1$, and for qubits $|q\rangle = \alpha|0\rangle + \beta|1\rangle$. The text Computational Complexity by Arora and Barak do this. But as mentioned in the comments, that's totally up to you :)
Answer: Sometimes in quantum communication or quantum information there is no notational distinction made between classical and quantum bits, with $|x\rangle$ (for $x \in \{0,1\}$) describing either a classical or quantum bit (see Debbie Leung's course notes, for example). There are even cases where this makes more sense than using different notations, for example when expressing a so-called "classical-quantum state":
\begin{align}
\rho = \sum_{x \in \Sigma} p(x) |x \rangle \langle x| \otimes \rho_x \tag{1}
\end{align}
where the first register acts to express $\rho$ as a distribution over quantum states $\rho_x$ conditioned on some classical random variable $x$ drawn from an alphabet $\Sigma$. In this case, while you could interpret $|x \rangle \langle x|$ as a quantum state, its really functioning like the label of a classical random variable, e.g. a classical bit if we set $\Sigma = \{0,1\}$. This holds more generally: linear combinations of "states" of the form $|x \rangle \langle x|$ for $x \in \Sigma$ result in diagonal density operators and can be described as classical objects.
This notation will probably become confusing if any quantum computation is involved where states evolve according to the action of unitaries or channels - in that case, you would need to carefully clarify which operations would be valid on which registers in your computation (e.g. we are not allowed generate/remove entanglement between the registers in (1) because we treat the first register as purely classical).
Answer: QWorld have come up with a really neat convention that I like in their QBronze lectures e.g. for the set of classical bits $1011$, they use the notation $\lceil1011\rfloor$. That way you can write out combinations of probabilistic bits e.g. $0.5\lceil1011\rfloor + 0.5\lceil1010\rfloor$ where the coefficients here are probabilities instead of amplitudes (because we're using classcial bits).

Dirac notation for classic bits?


When should and shouldn't one train to failure?

Question: I do daily home workouts with two sets per exercise. I perform both sets to failure. Moreover, once I've reached failure, I squeeze for several seconds before I give myself time to pant. What I like about training to failure is that mental comfort of knowing you did your best. It kind of saves you worries and doubt about whether you slack or not. And since I don't see a massive amount of gains (though, I certainly became stronger and more athletic), killing that kind of doubts is important for me. "Well, I couldn't lift/push/curl etc. any more", you say to yourself, and your internal doubt has no counterargument against that. Besides, as I understand it, doing relatively few reps to failure with progressive resistance is important when your focus is strength (as opposed to muscle endurance or speed, for example). I have a three-day cycle: an arm day (which is also a bit of a back day because of face pulls, thanks Jeff), an ab day, a leg day, and then all over again. I believe – though, feel free to disagree – two days of rest is optimal after such failure-based workouts. When should and shouldn't one train to failure? May training to failure be actually killing my gains?
Comment: @SergeyZolotarev Do you believe everything Jeff says without question? Because he's wrong far more than he's right.
Comment: Your question seems a bit confusing. You talk about strength and athletisism.
However you do 20 sets for arms and none for lats.
I fail to understand how 20 sets for arms is good for anything besides building huge arms.
Personally I have no interest in and no knowledge about this topic.
I think it would be more fruitful if you were more upfront about what you are trying to achieve.
For instance perhaps by using bodybuilding as a tag.
Comment: If you instead of just hanging were to pull yourself up you would train your grip, forearms, biceps, lats and abs simultaneously. After that you could do some isolation exercise(s) e.g. biceps curls to make sure the above muscles are exhausted.
Comment: 2 sets per exercise. Ca. twice a week. OK. But how many exercises per muscle group (e.g. legs) and typically how many reps per set? For instance if you only do 4 sets of bodyweight squats in total per week you should probably go to failure on every set. On the other hand if you do lunges, squats and jumping squats wearing a weight vest for a total of 12 sets a week you should probably not go to failure on every set. The latter approach will take more time but should generally give better results. I think you should aim for 10-20 sets per muscle group per week.
Comment: Face pulls are great but I think you should do more exercises for your back. For instance add in bent over one arm rows with a dumbell. Also do you do push-ups? They train your triceps and pecs as well as your abs. Ideally one should train all fundamental movement patterns: https://www.t-nation.com/training/the-6-foundational-movement-patterns/.
Comment: @Andy because it's an inferior tricep exercise. I used to do banded pushups but then tried barbell tricep extensions, the best tricep exercise according to Jeff Cavaliere, and my triceps were sore as hell for several days on end. Pushups don't train abs, they just interfere with your ab rest days. Since you've mentioned it, Jeff also said that bent over row is one of the worst exercises for your lats
Comment: OK let us assume that bent over rows is not a good exercise (I think that is wrong). Which exercises do you do for your lats? Afterall they are the largest muscle in the upper body. I think the big overall picture of your training may be wrong. Instead you may be focusing too much on tiny details.
Comment: @Andy I don't know where to fit any lat exercises, tbh. My arm days are huge as it is: ten exercises, that is 20 sets (as opposed to my usual convention of just two exercises and four sets). And it's hard to train lats without any arm overload at all (so I can't do lat exercises on arm rest days)
Comment: @Andy I do hip thrusts (last time it was 10 reps with three pulses at peak contraction per each rep), banded Bulgarian split squats (10 to 12 reps), banded abductions (I don't count them, I do those banded sidesteps that Jeff showed in one of his videos) and adductions (25 reps). As for the latter two exercises, I don't really train to failure and find it hard to imagine (just the range gradually gets shorter and shorter)
Comment: It's not 20 sets "for arms". It's two sets for fingers (it's more of conditioning than strength exercise), two sets for triceps, two sets for delts, two sets for biceps, two sets of face pulls, and the rest is for forearms and grip (palm upside, palm downside, lateral contractions, hanging). Everything is important here. I incorporated exercises very reluctantly, but at the end of the day I found no way around it (for example, I unsuccessfully tried to find out an exercise for all three delt heads with the help of this site, but then gave up and began doing face pulls)
Comment: @Andy well, I hang for just ten seconds or so. And it's a wardrobe, not a pullup bar. Either my grip is so weak or my forearms are so exhausted by that point, whatever the reason, I can't pull myself up hanging on a wardrobe (even if we ignore the issue of not having any room for legs which makes it kind of inconvenient). I used to do 13 wide-grip pullups when I had a regular pullup bar accessible
Comment: @ThomasMarkov well, he's a physical therapist, you have to heed what he says
Answer: My general training philosophy, one that I've picked up from a myriad of different authors and coaches, is that the only time you go to failure is during competition, otherwise there's a high risk of injury and depending on what your training looks like, you burn out really quickly.
Certain modalities of training may differ (I don't have that much experience with bodyweight training), but for things like back squats, deadlifts, kettlebell snatches, etc, I'd never go to failure (failure with kettlebell swings is likely to result in a very large dent in the wall or floor).
I much prefer frequent training sessions, and I don't like the idea that my training is going to leave me so sore it disrupts other things in my life. I've trained like that before, but found much more enjoyment and benefit from more frequent, properly programmed training sessions.
That all being said, I don't train for aesthetics and don't do the traditional "bro split" type training; my training is based around compound lifts 3 - 4 times a week primarily for strength.
Comment: I think you're on the right track here, thou guy I'd like to see the distinction between compound and isolation movements made more clear. In particular, going to failure on a compound lift like squat or DL incurs much greater metabolic fatigue than something like a leg extension or a reverse hyper. One could safely go to failure in a tricep push down every set for your whole training career without increasing your injury risk or adversely affecting your recovery, just because the amount of muscle involved is so small, it just doesn't cost much in terms of metabolic resources to go again.
Answer: Experiments have found that training to failure and training close to failure produces the same hypertrophy when the volume is the same. The strength however had increased more in the close to failure group.
This seems to indicate that the close to failure group had less fatigue and could have done more volume in which case they should have gained more hypertrophy than the to failure group.(1)
Further when doing compund movements such as the squat you can train further away from failure than when doing isolation exercises.(1)
So for isolation exercises you should have 2-3 Reps In Reserve (RIR) except for the last set where you go to failure. For isolation exercises with lighter weights in the context of bodybuilding pretty much every set should be to failure (2).
For compund movements you can have higher RIR. You can start with a high RIR (say 10) and decrease this as you work up to your top (heaviest) set where you have 1-3 RIR.
Finally there are probably individual differences. Many respond well to volume whereas some respond better to high intensity and training to failure.
(1) Why Training to Failure Might be Limiting Your Gains
(2) Why You have Little Biceps ( Intensity )
Comment: What are your key takeaways from those books?
Answer: Your exercise selection seems wrong if the goal is general health, strength and athletisism.
I saw a favourable review of an Athlean-x program(1). It contained a lot of compund movements that I liked: weighted chin-ups, overhead press, dips, step-ups and lunges.
However a big problem is that Jeff Cavaliere puts out a lot of clickbait in his youtube videos.
An even bigger problem seems to be you picking and matching exercises from Jeffs +1300 videos on youtube without any big picture understanding.
One solution could be that you shell out the money for one of his programs. Considering all his clickbait content; please do not do this.
The book Maximum Strength by Cressey is a lot cheaper and contains a program I suspect is very similar to Jeff's programs.
Alternatively you can start getting an overall understanding by reading below.
Exercise selection
There are 100s of strength training exercises,
so which should we use?
There are also about 600 muscles in the human body.
Clearly all are not equally important.
We should put more effort into training the bigger muscles than the small ones, but also try to train as many muscles as possible.
One way we could do this is by creating a list of muscles sorted by their size:

Quadriceps femoris
Gluteus maximus
Deltoid
Triceps Brachii
Iliopsoas
Pectoralis major
Biceps femoris
Latissimus Dorsi
Biceps Brachii
Sartorius¨

We could then try to pick one exercise per muscle. However this is impractical. First it will involve a lot of exercises and take a lot of time.
Second it may be difficult to isolate muscles. For instance both the biceps femoris and the sartorius as well as many other muscles flex the knee.
And that is the way it is with human motion. Most movements involve many muscles working together.
A more reasonable approach seems to be to pick the exercises that train the largest and most muscles first. That way we would only need to do a few exercises.
But how do we know which exercises this is?
Consider two exercises:
A 75 kg benchpress and a shoulder shrug with a 15kg dumbell in each hand.
Let us calculate the work (force x distance) done in each exercise.
Benchpress
75 kg x 9.81 m/s^2 x 1 m = 736 Nm.
Shoulder shrug
30kg x 9.81 m/s^2 x 0.1 m = 29 Nm.
And what is performing this work? Our muscles! And that is the way muscles get stronger; by performing (heavy) work.
So clearly we should pick the benchpress before the shoulder shrug.
But does that mean that we should not train the shoulder shrug? Not necessarily. We may find after having selected several other exercises that none of these train the same muscles as the shoulder shrug and therefore decide to add it to our selection.
One thing we have to take into consideration is that our selection of exercises should not overlap too much.
For instance we would find that benchpress, narrow bench press and paused bench press all involve a lot of muscle mass. However it is the same muscle mass.
Luckily someone has already solved the above problem for us.
There exist a sport where the sole intention is to decide who is strongest across the most muscle mass, and that sport is powerlifting.
And they have found that only 3 exercises: the deadlift, the squat and the benchpress test ca. 90% of the muscle mass in the body.
And the reason that these exercises are so great for testing strength also makes them great for building strength.
In addition to these there are two other exercises that involve a lot of muscle mass and complement the ones above: the pull-up and the overhead press.
So our strength training program should be centered around these 5 exercises or variants.
For instance instead of benchpress we can do dips or (weighted) push-ups.
Instead of back squat we can do goblet squat or front squat.
It is also a good idea to sometimes do some of the exercises unilaterally. This takes more time but on the other builds more stabilizer musculature.
For instance we can do sets of squats and finish with a few sets of lunges.
There may also be exercises that trains smaller muscles that are important for our wellbeing. In particular ones related to posture.
Personally I find facepulls and TRX y pulls to be vital for my posture and wellbeing.
We can also do a bit of direct ab work.
When we have finished doing the above important exercises we can do a few exercises for aesthetics. For instance for bigger arms we could choose to do a few sets of barbell curls and triceps pushdowns.
(1) I Paid $100 For An ATHLEAN X Program | WASTE OF MONEY??
Comment: For explosive punches let some of the push-ups be clapping push-ups. For carrying heavy weights; carry heavy weights aka farmer carries.
Comment: back hyperextension is a pull exercise.
Comment: Here are a few things to keep in mind
1) If you go to the gym two or three times a week, training everything at once seems to be a great idea. However, if you train daily, as I do (and, I believe, it works best for me), your muscles may not have time to recover
2) I don't go to the gym. I work out at home with barbells and resistance bands only
3) I don't want to be a powerlifter. I want to train specific muscles for specific purposes. For example, explosive extensions, I hope, will help me get explosive punches. Or, strong delts will help me be able to carry heavy weights
Comment: That said, I start to realize the importance of small muscles. That's part of the reason why I incorporated abductions and adductions into my leg routine
Comment: If you prefer to train every day I would suggest a Push Pull Legs split. So for instance you do push-ups and overhead presses on the first day, pull-ups, rows and facepulls on the second day and squats and lunges on the third. You can add some extra triceps work on the push day, some extra biceps work on the pull day and some extra ab work on the push and the legs day. You could also take a look at k boges everyday calisthenics routine.
Comment: Is back hyperextension a pull or push exercise?


Do airline pilots really put on an oxygen mask when alone in the cockpit above 25,000 ft?

Question: The FAA requires a pilot to put on the oxygen mask if the other pilot leaves cockpit when cruising above FL250. It also requires that one pilot always wears an oxygen mask when flying above FL410. Do airline pilots really do that and if so, do they do it only over American soil and then put off the mask, e.g. when flying over the ocean? How would it be controlled, other than by sounds heard by ATC? And do bizjet pilots have these requirements as well or do these count for the large airliners only?
Comment: [91.211](https://www.ecfr.gov/current/title-14/chapter-I/subchapter-F/part-91/subpart-C/section-91.211)  talks about a "quick donning" mask being available at FL350, required to be worn at FL410 or if solo on the controls at FL350. Where is FL250's mask requirement?
Comment: Yes, the requirement is that you can't fly above FL250 without having 10 minutes of oxygen **available** for everyone on board.  Pilots don't need to mask up until FL350, if alone, and only beyond FL410 with more than one pilot present.
Answer: Pilot flight crewmembers would be required to follow FAA regulations when operating an aircraft in sovereign airspace over the USA including US territorial waters.  After that, you're over international waters and required to comply with the regulations set by the international civil aeronautics organization (ICAO).  These do not conflict with US law, though they do not require you or another pilot flight crewmember to use supplemental O₂ at or above FL350.
That being said, while you may not be legally required to use supplement a oxygen above FL350, it is a very wise precaution to do so.  At FL400, Time of Useful Consciousness (TUC) is only 5-10 seconds.  In the event of a rapid decompression or similar emergency, the trauma or other effects of a serious catastrophe could quickly eat up all of your time of useful consciousness before you could get a mask on your face and start breathing oxygen again, posing a very serious risk to life and limb.  I would not be surprised if all the major international carrier SOPs require their pilot flight crewmembers to be using supplemental oxygen at all times while at their crew stations above FL400.
Comment: As far as I know, there's no such thing as "regulations set by ICAO." ICAO has its "Standards and Recommended Procedures," but these have no force of law anywhere unless actually enacted in regulations from the relevant local civil aviation authorities. Also, while FAA jurisdiction of non-U.S.-flagged aircraft does end at the end of U.S. airspace, its jurisdiction over U.S.-flagged aircraft is worldwide. Generally, aircraft must follow (at least most of) their flag country's regulations regardless of where they are in the world at any given time.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/133834/discussion-on-answer-by-carlo-felicione-do-airline-pilots-really-put-on-an-oxyge).
Comment: do you have a reference that specifies that over international waters rules like 14CFR 121.333 (relating to oxygen requirements for flight crew) do not apply and instead ICAO rules apply to U.S. Flag Carriers?
Answer: I can attest to seeing Fedex pilots do this back in the 1990's. The first time I saw them do it I was concerned and asked the FE if something was wrong and he told me about the regulation and that it was normal procedure.
Answer: I am a retired Canadian B767/B777 airline pilot and have flown over USA airspace many times. I have never put on an O2 mask while flying alone in the flight deck over FL250. None of my fellow crew members did either. Occasionally we might talk about the requirement, but we always justified our non-compliance because we had quick donning masks that were easy to use.
I have only flown at FL410 a few times and never flown higher than FL410.
I would be curious to hear from American pilots to see how faithfully these rules were followed.
See also:  Why are rules regarding the use of oxygen masks by commercial pilots often ignored?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/133835/discussion-on-answer-by-mike-sowsun-do-airline-pilots-really-put-on-an-oxygen-ma).
Answer: The short answer to your question: Yes, they do, or at least all the ones I know do..
A person worst enemy is the part-time idiot in his or her own head. There is no common profession in which this can prove more disastrous than in aviation. For this reason there is no common profession in which idiot proof systems of operation are applied more than in aviation. As a result in general, a professional pilots tendency to obey rules simply because they exist, is not compromised by their personal thoughts or opinions about the usefulness of these rules. A helpful tool in obtaining this attitude is the frequent exposure to very realistic emergency simulations, while under observation. In real emergencies, this results in an attitude and conduct similar to that in the simulations. Even if in certain extreme situations, following regulatory procedures may give a pilot little more than having something to do, they will still keep him from emotionally assessing his situation. It's this thing pilots have with rules.
That plus the fact that hypoxia is nothing to mess with. No mask will save you if you fail to notice it's time to put it on.


What voltage Vo does my LCD requrie?

Question: I have a Powertip "PC1602F B" LCD I bought a while ago for a project, and have long lost the design specifications for it. The datasheet is rather confusing, listing several different voltages. Do I need a negative voltage? What should the range of adjustment for contrast be? Is the voltage relative to Vdd? (which will probably be 3.3V.)
Comment: Try putting a say 10 k \$ \Omega \$ potentiometer between Vdd and GND and connect the center tap to the contrast and see on which position the contrast looks good. In general it should be between Vdd and Vss. Unfortunately this datasheet doesn't specify limits for that, but on such screens it's usually around Vdd+0.3 V. You don't need negative voltage for this screen from what I see. It definitely looks like any other 2x16 character screen (the standard name for the controller escapes me at this time).
Comment: Yes, that datasheet is a mess.  If this is a hobby project, experiment carefully.  If this is a real commercial project, ditch that LCD and get one that is properly specified.  In general, voltages are with respect to ground unless otherwise specified.  However, that datasheet leaves it unclear what exactly ground is.  It lists Vss, Vee, and a negative supply for the backlight.  It also seems to use different names for the pins as in the electrical specs section.  No thanks.
Comment: I'm looking for the contrast voltage. My LCD doesn't have a backlight. In particular, "LCD driving supply voltage", -0.3V to 13V has me confused; why such a large range?
Comment: The real confusion is that left most pin is 14 then count down to pin 1 as you move to the right followed by pin 16 then 15 . Go figure . Caution when creating pcb footprint as you may pop a fe boards.m
Answer: As Olin says, the datasheet is pretty terrible. The standard of display datasheets seems to be quite low in general IME.
It states Vss = GND, and Vdd - Vss max is 5.5V.
The LCD driving voltage looks to be internal so don't worry about that.
The Backlight doesn't need a negative supply, the A and K are for anode and cathode of the LED. It states either 40mA or 120mA for the BL current consumption, depending on the module type - in the mechanical specs table it specifies either no backlight, an EL backlight or LED backlight. I'd assume the edge and array in the electrical specs refer to the EL and LED respectively.
So if we assume your model is the EL, you need 40mA to drive it. You will need to confirm this and adjust the below workings as necessary if it's the 120mA version - if you don't have the info on the package it came in there is probably a code printed on the PCB somewhere. Either way it's safer to assume it's the lower current version to start with if not entirely sure.
You need to know the Vf of the LED, which is not clearly stated, but VB/L = 4.2V is given which is possible for a white LED.
You could measure the drop if you have a multimeter with diode setting available.
So, assuming the LED Vf is 4.2V, you are running the Vdd from 5V and need 40mA for your edge LED, you get (5V - 4.2V) / 0.04A = 20 ohm resistor needed between Vdd and A (K to ground)
For Vo I can't see anything at all, but I doubt it needs a negative voltage (unless they are unbeliveably sloppy - possible)
I would try setting up an e.g. 1k resistor from Vdd to top of 1k pot, with it's other end to Vss with it's wiper to Vo. IIRC usually the contrast for these LCDs is controlled over a pretty small range around 0 to 1V or so. This setup will give you from 0 to 2.5V, start with wiper to ground and adjust if necessary.
If you're feeling lucky you could just tie Vo to ground (through a smallish resistor if nervous) and see if it works.
In the past with a couple of non critical debugging type setups using any old LCD (usually no datasheet handy) I have just tied the Vo to ground and it worked fine - of course this may not be the case for your particular model but I'd be surprised if it was out of the 0 - 2.5V range.
Answer: Vss is ground, which by definition is 0V. Therefore, Vdd - Vss = Vdd - 0V = Vdd. Vdd must be greater than 2.7V and less than 5.5V.
I'm not sure about the back light voltage, but, that should get you started. If this is for a hobby project that should be sufficient. If you want the backlight then try to power it with an adjustable supply. I think if you keep it under 5V you will not damage the display, but, I am guessing from clues on the data sheet. If you do fry the thing then toss it and buy one that is specified better.

What voltage Vo does my LCD requrie?


How to test a search engine?

Question: My company has developed a search engine and handed over to the testing to test. I have no idea how to start. Its taking results from bing API
Comment: This isn't really enough for a full answer, but comparing to other search engines is probably a good start.
Answer: What are the functional requirements on the search machine? Same results as Bing? Certain adds?
What are the qualitative requirements? Response time? Layout?
As soon as you know what was to be developed, you know what to test with what test goals. Afterwards, you can think about how to test it.
Comment: we don't have a much functional requirement. Results will be same as Bing. Adds has not been added as of now. response time is 30 second for returning particular result. static layout
Comment: @user7699 You probably have functional requirements, they're just not enumerated. Someone somewhere wanted this thing to be built in order to serve a specific purpose; otherwise, a paper drawing of the Google homepage would suffice. Find out who they are, sit down with them, and ask them what they want. You'll probably hear things like "it works" and "it works quickly" -- there's two requirements already, that can be broken down further.
Comment: I would also not spend a lot of resources testing that the results match what you would get from Bing.  That is something that deserves some spot checking, and that's it.  Otherwise you will be getting into testing the Bing service, which you would hope Microsoft has already done sufficiently.  You are not technically testing a "Search Engine", you're testing the presentation of search results built on an existing already tested engine.
Comment: Result should match Bing therefore is an implicit functional requirement. Do a back-to-back test with Bings search results on representative search items. You could start with the most popular search phrases. But I've not really asked for your response time and layout, but gave you a hint how to approach the problem. Layout and response time have just been examples
Comment: Results relevance is just one of the aspects of search engine. Another is presentation of result, e.g., whether result snippets with highlighted query keywords summarize the result well. This is important, because based on this snippets user taking is making a decision whether or not check the suggested page.
Comment: @SamWoods Correct. Some values suffice to test the correct use of the API. Most of the rest is qualitative requirements on the verge of functionality
Answer: http://tools.seobook.com/general/spider-test/
Try above tool i think it will be useful for your testing process

How to test a search engine?


What type of audio output does this symbol represent?

Question: I have this picture. I want left, left ground, right and right ground output. Pin. But I can't understand it. Can somebody please help me. Thanks.
Comment: Google image search on a cropped image would have helped.
Answer: Looks like a female TRS connector: (Image from here)

So you would have left audio on the tip, right audio on the ring, and GBUF on the sleeve.  (I'm assuming GBUF is the common ground for the 2 audio channels, but your schematic doesn't show it.)
Comment: Alright. It's actually not complete schematic. That was helpful though. Thanks


topology (upper limit and lower limit)

Question: I have to show that upper limit topology and lower limit topology on $\mathbb{R}$ (Real line) are not comparable.
But suppose if we take $[a,b)$ and $(a-1,b]$, where $a-1 > a$, then isn't it showing that upper limit topology contains the lower limit topology. Same can be done with lower limit topology also.
Comment: $a-1>a\Rightarrow -1>0\Rightarrow 1<0\cdots$
Comment: It looks like you are trying to show that every open set in one topology contains an open set in another. To show that one topology is finer than the other you need to show that every open set in the latter is an open set of the former.
Comment: @Moya .. Please don't take $a-1$ and $a$ literally. They are just symbols.. Sorry for not mentioning it earlier.
Answer: Two topologies $\mathcal{T}_1$ and $\mathcal{T}_2$ on a set $X$ are incomparable iff there exists $A \subset X$ such that $A \in \mathcal{T}_1, A \notin \mathcal{T}_2$ (which shows that $\mathcal{T}_1 \subseteq \mathcal{T_2}$ does not hold) and there also exists some $B \subset X$ such that $B \in \mathcal{T}_2, B \notin \mathcal{T}_1$, which similarly disproves the other inclusion.
For the lower limit topology and the upper limit topology on the reals we can indeed take $A = [0,1)$, which is (basic) open in one, but not open in the other (as there is no set of the form $(a,b]$ that contains $0$ and is contained in $A$), and $B = (0,1]$, with a similar argument regarding $1$ instead of $0$.
Comment: @user262860 Yes, but none contains $0$. A set $O$ is open iff for *every* point $p$ in $O$, there is some basic open set of the form $(a,b]$ that contains $p$ and is contained in $O$. Which fails for $0$ only in the case of $[0,1)$.
Comment: Thanks.. Is there a reason that we are taking $a$ and $b$ to be as endpoints of both topologies? I mean for $[0,1)$ there are infinitely many sets like $(1/4,1/2]$ etc. which are entirely contained in $[0,1)$.

topology (upper limit and lower limit)


Wk* continuity and wk* sequential continuity on $S'$

Question: Let $S$ be the Schwartz space and $S'$ be its dual space. If a linear operator $T:S'\rightarrow S'$ is weakly* sequentially continuous, is it also weakly* continuous?
Answer: Yes. Since boundedness is determined by sequences, $T$ maps bounded (= equicontinuous) sets of $S'$ to bounded sets. Since the Schwartz space $S$ is a Frechet-Schwartz space (i.e., a projective limit of Banach spaces with compact linking maps), either by results of Grothendieck or a theorem of Laurent Schwartz, $S'$ endowed with the strong topology $\beta(S',S)$ (of uniform convergence on bounded subsets of $S$) is bornological and hence $T$ is continuous as a map on $(S',\beta(S',S))$. Then, the transposed $T^t$ is a continuous map on $S''=S$ (Frechet-Schwartz spaces are reflexive) and thus, $T=T^{tt}$ is weak$^*$-continuous on $S$.


Automatic missing package download on the Mac

Question: Is there a LaTeX distribution for the Mac which has or comes close to MiKTeX's ability to download missing packages automatically?
Answer: In MacTeX, TeX live is included which has tlmgr (the TeX live manager) to update and install packages (see the overview of what is included in MacTeX). There is also the TeX Live Utility, a Mac OS X graphical interface for tlmgr.
Regards,
Dominik.-
Comment: That's not quite the same as MiKTeX, though.
Answer: MikTeX can download packages on-the-fly due to custom additions to the source code used to build compilers such as pdftex.  The downside to this approach is that new compilers, a recent example is luatex, experience a delayed release until the work has been done to integrate the MikTeX additions that enable on-the-fly downloads.
Outside of the MikTeX distribution, I am aware of no set of TeX compilers that includes the ability to automatically download missing packages.  You could try compiling and installing the MikTeX Tools which is an attempt to port the MikTeX package manager, and versions of the TeX compilers that are integrated with it, to UNIX and Linux.
Sticking with MacTeX is probably still the best way to go for a complete, stable TeX distribution on OS X.  Since MacTeX is based on TeX live and not MikTeX, you won't have on-the-fly installation; but you will have the excellent tlmgr package manager domwass described in his answer.
Answer: I was having the same problem today so I wrote this bash function.
    installOnFly () {
    fn=${1-main}
    pdflatex $fn | tee /tmp/tmp.log
    ret=${PIPESTATUS[0]}
    while [[ $ret != 0 ]] ; do
        mspkg=$(grep "LaTeX Error: File \`.*' not found." /tmp/tmp.log | sed -e 's#! LaTeX Error: File `##g' -e "s#.sty' not found.##g")
        echo "********* Installing $mspkg  *******"
        sudo tlmgr install $mspkg
        echo "******* Recompile $fn *******"
        pdflatex $fn | tee /tmp/tmp.log
        ret=${PIPESTATUS[0]}
    done
    }

Benefit: significantly speeded up my workflow.
Limitation: This does not work when the style file and package name are not the same, or if there is a missing font, instead of a style file.


minecraft skin uploading problem

Question: OK, so I've spent the past 4-5 hours creating and trying to upload my custom skin to Minecraft but it won't work. in version 1.7.5 it works fine, but in the newest 1.10.2 version the skin switches from Steve to Alex. How can I fix this?
Comment: I'm pretty sure throwing it out the window won't solve any problems.
Comment: Do you mean your skin switches from the Steve *model* to the Alex one (the Alex model has skinnier arms)? Or was your skin the default Steve one, and now it's changed to Alex?
Comment: it switches back and forth from the Steve model and the Alex model
Answer: If you're talking about models, the answer is simple. When you upload your skin on the website, it asks you what model your skin is based off, like this:
Make sure that the drop down list is set to Steve.
Another reason that it might not be working is that minecraft doesn't recognise the net. I use needcoolshoes.com to make my skins and they work, so if all else fails, try it out!
I hope this answered your question!

minecraft skin uploading problem


Looking for a configurable pretty printer for C# code

Question: I work on a team with about 10 developers. Some of the developers have very exacting formatting needs. I would like to find a pretty printer that I could configure to these specifications and then add to the build processes. In this way no matter how badly other people mess up the format when it is pulled down from source control it will look acceptable.
Answer: The easiest solution is for the team lead to mandate a format and everyone use it.  The VS defaults are pretty good.
Jeff Atwood did that to us here on Stack Overflow and while I rebelled at first, I got over it :)  Makes everything much easier!
Comment: Do you guys use StyleCop to enforce the rules, or do it by hand?
Answer: Coding standards are definitely something we have. The coding formatting I am talking about is imposed by a grizzled architect that is, lets say, set in his ways and extremely particular. Lets just pretend that we can not address the human factor. I was looking for a way to circumvent the whole human processes.
The visual studio defaults sadly do not address line breaks very well. I am just making this line chopping style up but....
ServiceLocator.Logger.WriteDefault(string.format("{0}{1}"
                                                 ,foo
                                                 ,bar)
                                   ,Logging.SuperDuper);

another example of formatting visual studio is not too hot at....
if( foo
   && ( bar
       || baz
       || apples
       || oranges)
   && IsFoo()
   && IsBar() ){
   }

Visual studio does not play well at all will stuff like this. We are currently using ReSharper to allow for more granularity with formating but it sadly falls sort in many areas.
Don't get me wrong though coding standards are great. The goal of the pretty printer as part of the build process is to get 'perfect' looking code no matter how well people are paying attention or counting their spaces.
The edge cases around code formatting are very solvable since it is a well defined grammar.
As far as the VS defaults go I can only say: BSD style or die!
So all that brings me full circle back to: Is there a configurable pretty printer for C#? As much as lexical analysis and parsing fascinate I have about had my fill making a YAML C# tool chain.
Answer: Your issue was the primary intent for creating NArrange (beta).  It allows configurable reformatting of C# code and you can use one common configuration file to be shared by the entire team.  Since its focus is primarily on reordering members in classes and controlling regions, it is still lacking many necessary formatting options (especially formatting within member code lines).
The normal usage scenario is for each developer to run the tool prior to check-in.  I'm not aware of any one running it is part of their build process, but there is no reason why you couldn't, since it is a command-line tool.  One idea that I've contemplated is running NArrange on files as part of a pre-commit step.  If the original file contents being checked in don't match the NArrange formatted output on the source repository server, then the developer didn't reformat to the rules and a check-in error can be raised.
For more information, see my CodeProject article on Using NArrange to Organize C# Code.

Update 2023-02-25: NArrange appears to have moved to Github. The NArrange site (referenced above) is no longer available although there are copies in web.archive.org
Comment: I use NArrange daily. it's really good. It gets a bit confused now with the async keyword, but otherwise a great way to keep files in order.
Answer: I second Jarrod's answer. If you have 2 developers with conflicting coding preferences, then get the rest of the team to vote, and then get the boss to back the majority decision.
Additionally, the problem with trying to automatically apply a pretty printer like that, is that there will always be exceptional cases where your blanket coding standard is not the best or most readable solution, and you will lose out by squashing them with an automated tool.
Coding Standards are just that, standards. They don't call them Coding Laws or Coding Rules, and there's a good reason for that.


What is funny in Inflammable

Question: In one episode of Simpsons there is joke when fire catches because a foreign citizen read "inflammable" on a gas bottle, and said it is all right.
Comment: Hugely related and may even be a duplicate: http://english.stackexchange.com/questions/1578/why-are-not-infamous-and-inflammable-the-opposite-of-famous-and-flammable
Answer: The joke arises from the fact that "inflammable" and "flammable" are synonymous (that is, they have the same meaning.) Normally the prefix "in" makes the root word have the opposite meaning, as in: "justice/injustice", "sensitive/insensitive", "eligible/ineligible." etc.
Mistaking this inversion makes the non native English speaker think that the "inflammable" gas is the opposite of flammable, which is to say "not flammable." A mistake that could have unfortunate consequences.
Comment: It's the _in₂_- prefix that means _not_. The _in₁_- prefix means, um, _in_. So _inflame_ means 'burst into flame', and thus _inflammable_ means 'capable of bursting into flame'. There's lots of other _in₁_- words: _inform, intense, intent, injure, intern, income, ..._
Comment: This brings to mind a fondly remembered passage of Strunk and White - 'Flammable. An oddity, chiefly useful in saving lives. The common word meaning "combustible" is inflammable. But some people are thrown off by the in- and think inflammable means "not combustible." For this reason, trucks carrying gasoline or explosives are now marked FLAMMABLE. Unless you are operating such a truck and hence are concerned with the safety of children and illiterates, use inflammable.'

What is funny in Inflammable


Relationship between electronic current and electron momentum?

Question: I remembered when reading Laughlin's famous argument for quantum Hall, it implied the actual current should be proportional to the electron's mechanical momentum ($p-eA/c$) instead of $p$ itself. Why is it the case?
Answer: When one deals with quantum problems involving a gauge freedom, all physical observables must be gauge invariant. This seems simple, but this simple claim means that for an electron, the operator $p$ is not observable, as it is not gauge invariant.
The way to proceed is to say that actually, we have been measuring the operator $(p-eA/c)$ all along, and if we are in a situation where $A=0$ the 2 concepts merge. This also means that if we want to assign a velocity operator to the electron, we have to use $v_{op}=\frac{1}m (p-eA/c)$.
The next step is to define a current operator using $v_{op}$ by $j_{op}=\sum _{i}e\delta (x-x_i)v_{op}$, by analogy with the classical $j=\rho v$ . (actually there is an issue with  symmetrizing this for hermiticity).
I dont feel like I should tell the whole technicalities of the story, but the main idea that gauge invariance forces us to redefine concepts like velocity and current, and the replacement of the momentum by the canonical momentum in all of the equtions is the way to do so.


"conjugate symmetry" and the basic model of inner product space

Question: Why do we require "conjugate symmetry" in the definition of an "inner product" instead of "symmetry"? i.e. I don't understand the motivation of $<a,b>=\overline{<b,a>}$ in the definition of the inner product. I think $<a,b>=<b,a>$ is more natural.
I think the axiomatic definition of inner product on a vector space $V$ came from an elementary model. What is the model? I tried to think of the product between complex numbers, but it satisfies "symmetry" instead of "conjugate symmetry".
Comment: yes. for illustration, notice $|z|^2 = z\bar z \ne z^2$ for a complex (not real) number $z$.
Comment: otherwise, $\langle x, x \rangle$ will not be real in general, let alone non negative.
Comment: @user251257 So the product between complex numbers is not an inner product, but $z$ times $\bar{w}$ is an inner product?
Comment: @user251257 OK. Then I guess this is the basic model of inner product. But it seems that we don't use $z\bar{w}$ very often unless $z=w$
Comment: the standard inner product on $\mathbb C^n$ is defined by $\langle x, y \rangle = \sum_{i=1}^n x_i \bar y_i$!
Answer: An inner-product space may be defined over both real complex planes.
Remember for a real vector space $V$, the conjugates of vectors $\mathbf a,  \mathbf b$ in $V$ are just $\mathbf a, \mathbf b$ themselves. So if you are using $V$ to define your inner-product space conjugate symmetry is just symmetry $\langle \mathbf a,\mathbf b\rangle = \langle \mathbf b,\mathbf a\rangle$.
As for the complex portion, I think you are getting tripped up with Drac notation. Note that $\langle \mathbf a| = \mathbf a^*$  and $|a\rangle = \mathbf a$
As an example, define $\mathbf a = e^{-i2\phi}$ and $\mathbf b = e^{i\phi}$ then
$$\langle a|b\rangle =e^{i3\phi}$$
while
$$\langle b|a\rangle=e^{-i3\phi}$$


Why does magnetic force only act on moving charges?

Question: I don't understand why the magnetic force only acts on moving charges. When I have a permanent magnet and place another magnet inside its field, they clearly act as forces onto one another with them both being stationary. Also, I am clearly misunderstanding something.
Comment: With hindsight, this was the biggest clue in the 19th century that something was wrong with classical physics: this special force between moving charges means the force between charges changes when one transforms between different inertial frames using the Galilean transforms.  It's sorted out by the special-relativistic idea of using the Lorentz transforms instead of the Galilean transforms.
Comment: _"and place another magnet inside its field they clearly act a forces onto one other with them both being stationary"_ -> How exactly are you able to place something somewhere while at the same time not moving it at all?
Comment: @DanielHatton To your 'with hindsight' comment: If the magnetic force would manifest itself as an effect that is proportional to the *relative velocity* between two charges then Galilean transforms will be the correct transforms. As we know: the Faraday/Maxwell concept of a *field* is one of a state of stress of some medium, in the case of Maxwell's electromagnetism usually referred to as *Luminiferous Aether*. Magnetic effect is then described in terms of velocity with respect to this Aether. As we know: any experiment to obtain a value for that velocity produces a null result.
Comment: What led to believe that? Were you never, as a child, given a magnet to be used as either a toy or a scientific experiment?

Did that magnet not act on anything it came across, moving charges or not?
Comment: Yes I did that's why I didn't understand why it only acted on moving charges
Answer: This is basically just a matter of definition. The magnetic force is not something independent or complete on its own. Instead, it is the electromagnetic force that is the underlying concept. The electromagnetic force can be split into a portion that acts on stationary charges and a portion that acts on moving charges. We call the first portion the electric force and the second portion we call the magnetic force. But they are not independent. They exist together and it is just an essentially arbitrary division to split the overall electromagnetic force into an electric force and a magnetic force.
Regarding a permanent magnet: a permanent magnet is typically uncharged, so you would not consider a permanent magnet as though it were an electric charge. It would typically be better to consider a permanent magnet as an uncharged magnetic dipole. Inhomogeneous magnetic fields can exert forces on stationary magnetic dipoles. The formulas are not at all the same for magnetic dipoles as for electric charges.
Comment: Importantly: if one observer sees a pure electric or magnetic field, an observer moving with respect to the first sees a mixture. The division of "EM field" into "electric field" (force on particles you see at rest) and "magnetic field" (force on particles you see as moving) is *subjective*.
Comment: +1. Note that experimentally they are very different: you cannot measure a magnetic field with an electrostatic probe, nor can you measure an electric field with a magnetometer. Unless you move...
Comment: @MaximalIdeal I would need to get more information about what the claimant means by "incomplete". The Lorentz force law is a law for calculating the force on a classical point charge. So it is complete in the sense that it describes the complete force on a classical point charge. But it does not describe the force on classical charge distributions, macroscopic polarized or magnetized materials, or quantum mechanical particles. So if any of those are required for the sense of "complete" mentioned then indeed it would be incomplete.
Comment: Regarding the last paragraph, how would you respond to the (likely false) claim that this demonstrates that the Lorentz force law is incomplete? I had a [question](https://physics.stackexchange.com/q/704058) regarding this, but honestly I'm still not sure if I understand how to think about it.
Comment: @HTNW: Don't you mean "*relative*" rather than "*subjective*". That is a far better description of the relationship, as the phenomenon is quite *objective*.
Answer: At an effective classical level, the atoms in permanent magnets do contain moving electric charges at the microscopic level: the orbiting electrons. These moving charges correspond to microscopic electric currents, and the magnetic fields act on these microscopic currents.
This picture is certainly a simplification of the underlying quantum effects, but I think it's accurate enough to clear up your confusion.
Comment: The magnetic moment of a permanent magnet comes mostly from the spin of the electrons, with only a much smaller contribution from their orbital motion.
Answer: To be more precise, the magnetic force acts on currents. A moving particle implies a current, although not all currents correspond to a classical, visible movement. This is the case with the microscopic currents in permanent magnets.
Comment: your answer begs the question: in what sense is the magnetic moment of an electron related causally to a microscopic current?
Comment: @hyportnex I guess you mean the intrinsic magnetic moment. That magnetic moment too can be interpreted as the effect of the current density in the rest frame due to the multi-component nature of spinors. See, for instance https://aapt.scitation.org/doi/abs/10.1119/1.19421
Comment: @hyportnex it is not. The electron magnetic moment is intrinsic. Some atomic magnetic moments are tied to electrons orbitals where electrons do not classically move per se.
Answer: As mentioned in a comment to the question: in terms of relativistic physics there is a way to address your question.
In terms of pre-relativistic physics it is something that must be granted in order to formulate a theory of electromagnetism. Phrased differently: in terms of the physics prior to the introduction of relavistic physics the fact that magnetism is proportional to velocity has to be accepted as is.

There is a set of notes by Daniel V. Schroeder titled:
Magnetism, radiation, and relativity
Preliminary remark:
The electric field is extremely strong. It is far stronger than we would tend to expect, since in daily life we never experience that. The effects of the kind of static electric charge we can feel in daily life are minute because there is never more than the tiniest difference of charge.

In these set of notes by Daniel Schroeder the following is pointed out: a current flowing through a wire is a population of electrons that is moving with respect to the wire.
In terms of pre-relativistic theory of electricity and magnetism: the wire is neutral everywhere because the density of positive charges and negative charges is the same everywhere.
Now in terms of relativistic physics:
We take the wire as a whole as stationary reference. The population of free-to-move-around electrons in the wire then has (on average) a velocity with respect to that stationary reference. For that velocity there is a corresponding length contraction. So in that sense the wire and the electron population do not have the same charge density.
Schroeder shows that it is possible to account for magnetic effects with this difference in charge density.
That is counter-intuitive on several levels, of course. For one thing: it is always asserted that relativistic effects require relativistic velocities in order to be measurable at all.
The (average) velocity of the electron population is very, very small. The thing is: the Coulomb force is so mindbogglingly strong that magnetism can indeed be accounted for in this way.

(One thing that concerns me though is that in those Schroeder notes relativity of simultaneity is not discussed. I suspect the Schroeder notes present an oversimplification. The numbers check out, so Schroeder is doing something right, but we can't be sure of what it is that is done right.)
Answer: A magnetic field does have an influence on a stationary electric charge.

"when i have a permanent magnet and place another magnet inside its field they clearly act a forces onto one other with them both being stationary"

is exactly the case that is also true for an electron.
An electron is both an electric charge and a magnetic dipole. Any description of internal currents in the electron to create the magnetic dipole is superfluous. It is quite sufficient to consider the magnetic field of the electron to be just as fundamental as its electric field.
For a detailed description of why an electron moving through a magnetic field is deflected laterally (Lorentz force, Hall effect(s) ), see here.
Comment: One might ask why, given that all materials are full of electrons, not all materials are attracted to magnets.  It's because in most materials, the electrons are aligned randomly so that attraction and repulsion are equal.  Only in certain materials do they align with some order to set up an overall magnetic field that causes a net attraction or repulsion.
Comment: An electron moving is an electric current.  Calling it an internal current is confusing and misleading, but not superfluous.
Answer: After reading some of the other answers I think there is a simpler more fundamental explanation.
According to Field Theory, rather than considering the interactions between particles and field, we can consider the interactions between the fields associated to the particles.
Under this understanding, Classical gravitation $F = G \frac{m_1 m_2}{r^2}$ is the interaction between 2 objects, each with it's own gravitational field.  Similar Coulomb force $F = k\frac{q_1 q_2}{r^2}$ is the interaction between 2 charged particles, each with it's own electrical field.
Magnetic interactions are a bit more complicated, but we can also understand magnetism as interaction between objects that each have their own magnetic field.
Now to your question.
A static electric charge generates an electric field, but not a magnetic field, as per the relevant Maxwell equation. $\vec\nabla\cdot \vec E = \frac{\rho}{\epsilon_0}$.
A moving charge has a magnetic field, given by $\vec\nabla\times \vec B = \mu_0 ( \vec J + \epsilon_0 \frac{\partial \vec E}{\partial t})$. in which the current density $J = q\cdot \vec v$
Therefore a magnetic field does interact with a moving charge, because the moving charge also has a magnetic field, but not with a static charge, because the static charge does not have a magnetic field.
Answer: As a simple(ish) special case of the principle set out by @Cleonis, imagine two initially stationary charges, starting a short distance apart.  Under the Coulomb (electrostatic) force, they will accelerate apart (if they're like charges) or together (if they're opposite charges).
Now think about this same pair of charges from the point of view of an observer who is moving perpendicular to the displacement between the two charges, so that, to this observer, the charges appear to be initially moving parallel to each other and perpendicular to the spacing between them.
Because the displacement between the two charges is perpendicular to the frame-of-reference motion, it will not appear Fitzgerald-contracted.  However, there will be time dilation, so that to this observer, it will appear to take longer for the two charges to reach any given distance apart than it did to the stationary observer; i.e. the acceleration of the charges will appear to be smaller to the moving observer than to the stationary observer; i.e. (again) the force between the charges will appear to be smaller to the moving observer than to the stationary observer.  That is, an observer who encounters moving (in the same direction, perpendicular to the spacing between them) charges will think there is an extra force between them, acting in the opposite direction to the Coulomb force, compared with an observer who encounters stationary charges.  That extra force is what we call the magnetic force.


Do intermediate spaces imply the information about interpolation spaces couple?

Question: Let $X,Y,Z$ be Banach spaces such that $X,Y\hookrightarrow  Z$. We know that if $X\Subset Y$ (The symbol "$\hookrightarrow $" means continuous embedding), then  $(Z,X)_{\theta,p}\hookrightarrow  (Z,Y)_{\theta,p}$ for all $\theta\in (0,1)$ and
$p\in[1,\infty]$. How about the reverse results? Let us say, if $(Z,X)_{\theta,p}\hookrightarrow  (Z,Y)_{\theta,p}$  for some
$\theta\in (0,1)$ and $p\in (1,\infty)$, then what can we say about the inclusion relations about $X$ and $Y$? Can one show that $X\hookrightarrow  Y$. If not, is it possible to make it valid under some additional requirements?  References are appriciated.
Comment: I assume you meant "intermediate," not "immediate."
Comment: @MichaelRenardy Thank you. Yes, I were careless
Comment: For clarification: what do you intend with the symbol $\Subset$? For the actual question, you seem to assume a symmetric statement $(Z,X)_* = (Z,Y)_*$ and conclude an asymmetric one $X \Subset Y$. Is that intended? Finally, what if you take $X, Y, Z$ to be Lorentz spaces? Does that tell you something about what you want to know?
Comment: @WillieWong I have edited my question. It should be clear now.
Answer: In general, you cannot give a definite relation between $X$ and $Y$, at least as long as you do not require a strict inclusion between your interpolation spaces $(Z,X)_{\theta,p}$ and $(Z,Y)_{\theta,p}$ (then it could work, but I'm not sure how to prove it at the moment). This is essentially because there are quite fine scales of function spaces where interpolation acts too "rough" in the following sense:
Choose the Besov spaces $Z = B^0_{p,r}$, $X = B^s_{p,q_0}$ and $Y = B^s_{p,q_1}$, all defined on $\mathbb{R}^n$, for some $s > 0$ and $p,q_0,q_1,r \in (1,\infty)$. See Triebels book "Interpolation theory, function spaces, differential operators", Ch. 2.3 for the definitions if necessary; all my references will be from there. Then you have $X,Y \hookrightarrow Z$ (continuous embedding, Ch. 2.3.2 (3)) and even $$(Z,X)_{\theta,q} = (B^0_{p,r},B^s_{p,q_0})_{\theta,q} = B^{\theta s}_{p,q} = (B^0_{p,r},B^s_{p,q_1})_{\theta,q} = (Z,Y)_{\theta,q}$$
for $\theta \in (0,1)$ and $q \in (1,\infty)$, see Ch. 2.4.1 (3); note how the interpolation parameter $q$ "overrides" the scale parameters $r,q_0,q_1$. However, again by Ch. 2.3.2 (3), $$X \hookrightarrow Y \quad \text{if}~q_0 \leq q_1$$ and $$Y \hookrightarrow X \quad \text{if}~q_1 \leq q_0.$$
There is quite an analogous phenomenon for the Triebel-Lizorkin spaces (Ch. 2.4.2  (2), and also for the Lorentz spaces (Ch. 1.18 (16)) mentioned by Willie Wong in the comments.
PS: I think the the symbol "$\Subset$" usually stands for a compact inclusion.. :)
Comment: Thx. Also, I have changed the symbol to reduce confusion.


Is it an issue to have different addresses on two different W-9 form?

Question: Is it an issue to have different addresses (in two different states) on two different W-9 forms that were filled out around the same time, for overlapping jobs?
Answer: It's not an issue for the IRS, since the IRS does not get sent copies of the W-9.
The address that you put on the W-9 will probably be the address that they put on the W-2 that you get sent at the beginning of next year, which is sent to the IRS.  But this is also not really an issue for the IRS.  As long as your taxpayer identification number (social security number) is correct, the IRS will be happy, and the IRS will use whatever address you put on your tax return, not the address on your W-2s.
However, be aware that the address that you put on the W-9 will most likely be the address that your W-2 will be sent to.  If you won't be receiving mail in January/February next year at the address you give one of your employers, make sure you give them an updated address.
Comment: Thank you! I guess I probably have until March/tax season to get that mail, right?
Comment: @Jerome Your employers are supposed to send out your W-2 forms by January 31. (Although, you may not receive them until the first week of February, depending on the speed of the mail.)
Comment: thank you... but how long do I have to actually fill out those forms and send them back?
Comment: @Jerome You don't fill out the W-2, your employer fills it out and sends it to you.  Then you use the information on it for your tax return (form 1040), which is due on April 15.


Does the New Testament disregard the Old Testament?

Question: I'm a young and curious believer and I want to know what the link is between the Old Testament and The New Testament. Do the scriptures in the New Testament disregard the teachings of the Old Testament as they have no direct link?
Comment: does this: https://christianity.stackexchange.com/q/22752/22319 answer your question?
Comment: I do not know of a single book among the New Testament writings that is not deeply founded upon the entirety of the Old Testament writings. And I would expect that  anyone who studied the scriptures would immediately become aware of that fact.
Comment: You should take the [Tour of Christianity Stack Exchange](https://christianity.stackexchange.com/tour) to understand how this (and other SE sites) work. In particular, good questions generally should be asked in a more impersonal tone (e.g. without using "I" or "me"), and should include the results of research into the question that you've already done.
Comment: "Do the scriptures in the New Testament disregard the teachings of the Old Testament as they have no direct link ..." - There are hundreds of times the Old Testament is quoted in the New.
Comment: @Keepit100 There is an old adage that states or a statement expressing a general truth about understanding the Bible. "You interpret the New Testament in light of or in view of the Old Testament because the New Testament is the fulfillment of the Old Testament."
Answer: The clear answer is NO, since the New Testament relies on the Old Testament to show God's progressive revelation of Himself culminating in Jesus Christ.  Christianity teaches that Jesus is God incarnate.  Who is this God?  It's the God of Israel described in the Old Testament.  The same God, who delivered Israel from the slavery of Egypt around 15th to 12th century BC (The Exodus story), delivered the whole world from the slavery of sin and from the consequences of the Fall of Adam (explained in the New Testament) in the 1st century AD.
The New Testament also shows more clearly the character of the God of Israel as being faithful in his unconditional covenant with the people of Israel, and full of mercy and unfailing love.  The New Testament is the continuing saga of this love story, with the God of Israel himself coming into the world by being incarnated in Jesus Christ so we can literally see God with our own eyes (John 1:1-18), and more importantly, see this love exhibited in the flesh that was crucified on the cross for us.
If the New Testament were to stand alone without the Old Testament, it wouldn't make much sense on its own.  Or worse, it could be used to justify heresies such as Gnosticism, Marcionism, etc. Christians need both the Old and the New Testament books, and they were bound together since the earliest time in a single canon.  That's why in all printed Bibles the two sections are labelled with the names "Old" and "New" to signify the relationship: God's previous covenant mediated through Moses with the people of Israel (recorded in the Old Testament) was "replaced"/"added" with a better one through Jesus so that the Gentiles can be included in the New Covenant (as recorded in the New Testament).
NOTE on "replaced/"added": the exact status of the Mosaic covenant for the Jews is not 100% clear but that the Gentiles are included in the New Covenant is certain (cf. Rom 11) as the New Covenant (which was promised in the OT, cf. Jer 31:31-34) is not only for the Jews but for the Gentiles as well.  It was also very clear that Israel was planned to be "the light unto the nations" (cf. Isa 42:6, Isa 49:6, Isa 60:3), and therefore by the end of the OT (the book of Daniel was written in the 2nd century BC), the faithful remnant of Israel was waiting for God's "next move" to fulfill the role of Israel vis a vis the rest of the world ("the nations" = "rest of the world").  This "next move" is the New Covenant.
About the OT teachings, the relevance of some OT teachings for the New Covenant people of God is still a matter of debate, although the Ten Commandments and the Great Commandment, both revealed in the OT, are still binding for Christians today.  For more details on the debate, I refer you to books such as the 2010 book Five Views on Law and Gospel.
Answer: The very first book of the New Testament begins with:

The book of the generation of Jesus Christ, the son of David, the son of Abraham.

Without the Hebrew scriptures, this verse would make no sense at all.
Most Christians know that Jesus was the son of God, and the adopted son of Joseph, so who is this "David" person?
And in looking up who David was, one will find that David was actually the son of Jesse, so who is this "Abraham" person?
And what does "son of" mean if it doesn't really mean "son of"?
One can't properly understand even this first verse of the Greek scriptures without knowledge of Hebrew idioms.
And why were David and Abraham explicitly singled out?
What is so special about them?
(The Bible has been described as the story of one man's family, that man being Abraham (or perhaps of his grandson Jacob).
David was one of Abraham's descendants, and was the first King in a dynasty that was prophesied to end with the Messiah.)
If one doesn't know and understand the history contained in the Hebrew scriptures, most of what is presented in the Greek scriptures will either not make sense or be misunderstood.
Not only are the two sections of the Bible linked (the first contains prophecies of events in the second, and the second contains references to events in the first), neither one can be fully understood without the other.


Can anyone recommend a comprehensive site to find Building Shapefiles for Sydney and its suburbs?

Question: I am looking for a more comprehensive site for Building Shapefiles for Sydney and its surrounding suburbs which I can upload into QGIS. I have already downloaded the shapefiles from Geofabrik (https://download.geofabrik.de/australia-oceania.html) however there are chunks of areas missing (as seen from my attached image). Any help would be really appreciated.
Answer: PSMA's Geoscape service has building footprints covering all of Australia; https://geoscape.com.au/product/
Unfortunately it is not free and charges are usually based on the size of the area you're seeking. Given the map in your question above, I'm going to guess that it will be prohibitively expensive (but doesn't hurt to ask).
There's always the DIY option if you have some data science skills; Examples.
Comment: Thank you Aiden! I'll have a look through those sites to see what would be the best solution
Answer: Microsoft recently released building footprints for all of Australia. See their Github page here; https://github.com/microsoft/AustraliaBuildingFootprints
The licence is Microsoft's Open Database Commons, meaning you can use the data as you need but you must attribute them, see licence conditions here