When is it necessary to reboot an Ubuntu system?

Question: Under what circumstances is a reboot of an Ubuntu system necessary? I often read in answers that after changes in the system the system is to be restarted, but is that absolutely necessary?
Answer:
After kernel panic;
After partitioning or filesystem modifications (more specifically, resizing root partition; I'd recommend to avoid resizing the hard drive from which you boot in general, regardless of partition; if you are resizing something external, like SD card or USB, no reboots necessary );
After kernel upgrade and security patches (although that [might not always be necessary];
After system became unresponsive for whatever reason, and you've no option but to use magic SYSRQ keys or hard reset
After making changes to some dconf schemas , depending on the way application may have been developed. Related answer
Your CPU is overheating (you don't wanna keep on roasting those cores, do you ?)
Comment: Yes, but then rebooting is something you do anyways. If you partition something the system doesn't depend on (data partition, thumb drive, SD card, external HDD, file container, whatever), you don't need to reboot. I didn't reboot when I made a new partition table for 2 devices 2 hours ago.
Comment: With the partitioning thing, sometimes gparted etc says 'can't inform the kernel plz restart'
Comment: Why would you need to reboot Ubuntu after partitioning?
Comment: @UTF-8 Typically, it's recommended to partition an unmounted filesystem to prevent data loss. So, if you were to partition your hard drive, you'd need to insert live USB/DVD and reboot; when you done partitioning, reboot back to hard-drive.
Comment: @UTF-8 I guess I should have been more specific in my answer. Will get that fixed in a second :)
Comment: You don't need to reboot after resizing the root partition.
Comment: "Your CPU is overheating (you don't wanna keep on roasting those cores, do you ?)" I do not see it as "necessary" to reboot if you are stress testing a cpu ;) There are always exceptions. I still claim that after a new install it is necessary. All others are optional (and yes also advisable!) but not necessary.
Comment: @Rinzwind I am drawing this example from experience: about two - three weeks ago my CPU was overheating, got close to 95 degrees Celsius  at one point. I minimized the number of processes, but it still wasn't helping. So I had to bring my system down, add thermal paste to the CPU, and start my laptop again.  I'd say reboot is always necessary when you have no software solution to an issue.  Linux kernel is famous for uptime, but at the end of the day it's still just a kernel, not a perpetual motion machine. And we have to consider hardware,too
Comment: Why if I have changed dconf schemas? Is this really a reason?
Comment: @A.B. It depends mainly on the application. I have never had to, since I have never changed dconf schemas that much, but it is possible that in some system applications, you will need to reboot to see changes.
Answer: There are generally two situations where a reboot is usually necessary:

The kernel is upgraded.
libc (rather, glibc) is upgraded.

There is a mechanism for reloading the kernel without restarting (How can I upgrade my server's kernel without rebooting?). With glibc, the biggest problem is init. It is possible to restart init (see Restarting init without restarting the system).
For the average user, neither is recommended, and restarting is necessary.
Apparently, there exists a third case:

dbus has been upgraded. dbus-daemon is apparently incapable of restarting (from what I can understand of the discussion on this LWN article). And since a lot of things rely on DBus...
Answer: Actually, it depends what you're trying to accomplish:

If you do an apt-get dist-upgrade and a new kernel comes in, and you want to activate it, you need a reboot.
If a new version of FireFox comes in, you obviously don't.

And in between those two extremes are 50 shades of grey:

;-)
Comment: Indeed 50 shades :)
Comment: This 50 Shades response is awesome!  :)
Comment: I created an account on this SE simply to upvote this answer... And yes, for the 50 shades of grey.
Answer: I can't think of any situations of where a reboot is absolutely necessary.
Really, you can leave Ubuntu running indefinitely. It might get malware (because kernel and libc updates aren't applied) and it might panic or crash out... But what are avoiding those actually going to do for you?
Given the complexities of life, it might be more necessary to ignore the constant demands of computers, and sustain yourself in other ways. Like breathing, eating, loving... living.
But even then, are they absolutely necessary? Is your existence on this plane within the absolute definition of necessity? I honestly don't know. Bit of a weird question to ask.

To the two big-fat-joke-spoilers who downvoted this post and those that follow,
This question was incomplete, or at least open-ended. When you throw around words like necessary, you need to give a context.
Many answers already assumed the OP meant highly desirable (in a technical sense), so posted answers that fit contexts like necessary to avoid being hacked or necessary if your computer crashes. They're good answers. Adding another wasn't really warranted.
But they say assumptions are the mother of all muck ups (or something like that anyway) so I peeled it back to absolute necessity. If you insist on using an old copy of 10.10, Time and Space will carry rolling on, as are their wonts.
You'll note I'm not recommending that position.
Comment: +1 and a broad smile for preferring eating over rebooting! :D
Comment: Malware? Come on, kernel updates and libc updates have nothing to do here. Okay, maybe kernel could play a part, but it all depends on the internet, and also, Linux has a much less risk of getting infected. Ubuntu has auto-updates too. Linux is super stable too, but I agree that there is a risk. Otherwise, Kudos.
Answer: I actually had a situation earlier today that proves this. Sometimes, there are residual things left over in the system after a change is made. For example, I had a user that was not able to access /dev/dsp despite having been added to the appropriate groups. There was a lock placed on it by the first user that accessed it. However, even after killing that user, the lock was still in place and the second user could not access it. However, after a reboot, both users were able to simultaneously use /dev/dsp without any conflict. Doing a reboot releases any residual things that could prevent changes from properly taking effect.
Comment: Ok, the restart brought the desired effect, but was it really necessary.
Comment: Yes, because killing the `oss` process that I was working with has been shown to leave it in a somewhat inconsistent state where it does not always work afterwards.
Answer: The question should really be closed as primarily opinion based.
The fact is, it depends on what was updated, how exposed your system is to the open Internet, and what system services you have/need running.
Simply installing new versions of a package does not result in the related services and applications being restarted. For example, if you are running Firefox while you install an updated package for it, then you will be notified within the browser when you switch back to it, that it needs to be restarted, after the update was installed. Likewise, the kernel itself needs to be "restarted" when updates are applied for it. Because the kernel is the lowest level above the hardware, you do need to reboot the system, for the new kernel to be loaded. For other services, they can be restarted without rebooting. An update to Unity or underlying libraries used by the services of the environment, will need you to log out and back in, to restart them. For system services, it may be possible to manually restart them after an update is applied, but doing so automatically could be very disruptive if you are trying to use the system.
The only way to know absolutely certain if a certain action is necessary, is to know what the changes are, and what your risk is for not performing that action. Security fixes obviously require more abrupt action than simple changes to other things, that you may never directly encounter. The more directly your computer is connected to the Internet, the more risk there is, as well. You'll have to consider all the variables, and make a decision whether to reboot now, or later, when you install updates.
Answer:
When is it necessary to reboot an Ubuntu system?

A running machine and strictly when doing an update/upgrade? Probably never (but do read on). The Linux system is set up in such a way that after you updated the system where it would require a reboot to activate the new features (ie. read the kernel got changed; changes to apache, mysql only require a restart of the service) you can always keep working with the current state the system is on.
Now if you want these new features active the easiest method of doing so is rebooting. But for all we care you keep working on this machine and reboot it the next weekend or the weekend after that. Or next christmas. Is it smart? Maybe not. But there is nobody stopping you from doing so. The system is smart enough to not accept the next update if the server has not rebooted yet.
To me the only reasons where a reboot is necessary is after first install or when doing maintenance where single user is required (think things like partitioning, fixing hard disk errors) or when some idiot ran the famous fork bomb (though that one could be fixed from the system itself).
For all other reboots to occur is at the grace of the administrator. And I can not call that "necessary".
Answer: First of all, I appreciate this question because it will always be current.
The other answers are correct and very detailed - that is why I go short.
There are scenarios where a reboot is necessary, like after installing a new kernel.
There are scenarios where it is recommended, like after the install of a new desktop.
In most scenarios, like after installing or upgrading software rebooting is not necessary.
Whenever you are in doubt I recommend to perform a restart, so you are on the safe side.
Comment: Agreed. It's always better to stay on the safe side
Comment: *"There are scenarios where it is recommended, like after the install of a new desktop."* Wouldn't logging out and back in be sufficient for that case?
Comment: @EliahKagan Yes, generally it of course **should** be sufficient to logout and back in when you install a new desktop environment, but I have seen many cases where something went wrong and that's why I said, it's **recommended**. :)
Answer: Install the package debian-goodies:
sudo apt-get install debian-goodies

and run the command
sudo checkrestart

You will see a list of services and now you have the choice:

Restart each service

or

Reboot your system

$ checkrestart
Found 20 processes using old versions of upgraded files
(15 distinct programs)
(14 distinct packages)

Of these, 12 seem to contain init scripts which can be used to restart them:
The following packages seem to have init scripts that could be used to restart them:
gpm:
        3044    /usr/sbin/gpm
rpcbind:
        2208    /sbin/rpcbind
bind9:
        8463    /usr/sbin/named
openssh-server:
        22124   /usr/sbin/sshd
ntp:
        4078    /usr/sbin/ntpd
tftpd-hpa:
        3417    /usr/sbin/in.tftpd
uptimed:
        2704    /usr/sbin/uptimed
cron:
        3019    /usr/sbin/cron
postfix:
        22145   /usr/lib/postfix/qmgr
        8892    /usr/lib/postfix/master
hddtemp:
        3174    /usr/sbin/hddtemp
autofs:
        2792    /usr/sbin/automount
openbsd-inetd:
        3254    /usr/sbin/inetd

These are the init scripts:
service gpm restart
service rpcbind restart
service bind9 restart
service ssh restart
service ntp restart
service tftpd-hpa restart
service uptimed restart
service cron restart
service postfix restart
service hddtemp restart
service autofs restart
service openbsd-inetd restart

These processes do not seem to have an associated init script to restart them:
isc-dhcp-client:
       3775    /sbin/dhclient


Fusesource - how to encode/decode base64 within a route

Question: Trying to encode/decode base64 within an XML document that is handled within a route in Fusesource ESB.
We are using Blueprint.xml to try to encode/decode, but cannot find a way to do this.
We need our ruote to convert XML data to base64 string to hit an external webservice that requires some binary. We also need to extract some binary coming back from the webservice response and change this into .pdf (or a string first).
Answer: Fuse ESB / Apache Camel offers a number of data formats for encoding/decoding
http://camel.apache.org/data-format.html
Though we don't have a Base64 out of the box. So I have logged a ticket to add such a format in a future release: https://issues.apache.org/jira/browse/CAMEL-5807
You can build a custom data format, or use the message translator EIP pattern with a Java bean and do a bit of java code to do the encoding/decoding yourself. http://camel.apache.org/message-translator.html
There is a camel-fop component for outputting to PDF: http://camel.apache.org/fop.html


Replace single-pole switch with 3-way and add additional 3-way switch. Non-conventional solution needed

Question: I have a single pole switch with 4 lights, that I want to replace with a 3-way switch. Power currently runs to the switch.  I don't have a way (without drilling a lot of holes, which is really not an option) to run 14/3 wire to the desired location for the 2nd switch.  Is it possible to add the other 3-way switch to the end of the light run without rewiring all the lights with 14/3. What would that wiring scenario look like?  If not feasible, what are my other options?
Comment: Are smartswitches of some flavor an option here?
Answer: Smart Switches to the Rescue
There are a lot of different smart switches available as solutions. The methods I know of to handle "3 way" switching with smart switches are:

Piggyback on existing 3-way wiring

This works well if you have existing 3-way switches but want additional features such as multi-location dimming or remote control. Does not help you

Piggyback on regular wiring

Some smart switches can use regular wiring in a more flexible way by sending signals over the wiring instead of simply switching between wires. That might help you here, if you can run a cable from the other end of the lights (which it sounds like you may be able to do), this may be an option.

Wireless

Note that this does not necessarily mean WiFi. There are a number of different wireless systems available. A typical smart switch system that includes WiFi capability may have the WiFi part connected only to one "main" switch with the other switches "talking" to the main switch via a different protocol. So security is a concern but you may not actually need to connect your switches to a potentially vulnerable WiFi network in order to get wireless capability.
The big advantage of the 2nd switch being wireless is no wires to run, at all!. The disadvantage, of course, is the need to change a battery periodically. But modern devices are incredibly low power and your particular situation sounds ideal for this solution.
There are plenty of choices. One example (I have no connection to the company in any way) is Lutron Caseta. According to the FAQ page, the Pico remotes are designed to last 10 years on a single battery.
Be careful though - make sure anything you get is UL Listed (or equivalent). While the remotes are harmless, the "main" switch will be hooked up to 120V (US) or 240V (elsewhere) and you don't want to take chances on "substandard" items.
Comment: This is the only answer...  And OP, "CSA" and "ETL" are equivaent to UL.  However, CE is the mark of garbage.
Answer: "Steam" switches
Let's see how practical this will be with old style 3-ways. Diagram out how each of the lamps and  switches will be connected with cables.  No triangles are allowed - you must do a "tree" topology.  And note where power comes in.
Now along those cable paths, let's draw some lines.

two yellow lines between the two 3-way switches.  These will be travelers.
a "white" (let's use blue) line amongst all these points: Power source, every lamp, and one of the 3-way switches.  This is neutral.
a "red" connecting to every lamp and one of the 3-way switches. This is switched-hot.
a "black" connecting power source to the other 3-way switch.  This is always-hot.
Plus grounds connecting everything.

All of these wires must be in the same cable.  If you need 5 wires, you are not allowed to use a /3 and a /2.
Now, in some segments, you will have 4 or 5 wires includng ground.  Cables with that many wires can be had, but they're pricey.
The perfect situation is when one 3-way switch is an endpoint spur off the other 3-way switch.  At that point, the cabling is very practical.   So you can have it logically wired like that, but physically the /3 cable from switch 1 travels via all the lights - it just doesn't stop and enter their junction boxes.
As you can see, this is a mess of drywall and sawdust.
Smart switches
As Manassehkatz and ThreePhaseEel are advising.  One smart switch replaces a plain switch, and the other one is a wireless remote.  This is the only sensible answer.


Storing a Yes / No radio button into a MySQL database

Question: I've seen a Yes/No form radio buttons value be stored/saved in a couple different ways. I wonder which way is better and why? This is for a PHP/MySQL application with a typical Yes/No question as part of a form.
1.) Store it as 1, 0 or null. 1 being Yes, 0 being No and null being not answered.
2.) Store it as Yes, No, null. Assume a language conversion can be made.
3.) Use 1, 2 and null so as to better distinct the values.
Thanks, Jeff
Edit: I also must mention that most of the issues have been arising due to jQuery/JavaScript and the comparisons and $() bindings.
Answer: Use TINYINT(1). Allow NULL if you wish for the "not answered" option. You can also use BOOLEAN as it's just an alias for the aforementioned datatype. This way of storing boolean data is recommended by MySQL.
More details: Which MySQL data type to use for storing boolean values
Answer: Since MySQL has a BOOLEAN type, but it's simply an alias of TINYINT. I recommend against it because the equal sign in PHP == would not distinguish 0 from the lack of value. You'd always need to use triple equal === and it would be easy to make mistakes.
As for your options:

This seems the natural choice with PHP, but then you've to be careful to distinguish 0 from the lack of value, so I wouldn't recommend it.
I would not recommend this one.
Possible, but the assignment to 1 and 2 is somewhat arbitrary and might be difficult to remember and read in code.

What I usually do, is use "Y", "N" and NULL if needed, in a CHAR(1) field, it reads well in code and doesn't create problems.
Comment: @Codemonkey updated my answer with your suggestion and why I would not use MySQL BOOLEAN.
Answer: I would go with the 0/1/null for No/Yes/Blank. 0 is always used as false and 1 for true.
Answer: I don't know if it helps, but in my system I use 1 as yes, 0 as no and just NO value as null - or if I have to specify I set a default value in the structure.
I think this system is more flexible, you can always manipulate with this data, for example if you don't want to display 0/1 values you can set something like
if(table.field == 1)
    echo yes;
else
    echo no;

Also comparing this value to any other database value is easier.
Answer: as numbers are processed faster (while searching, sorting,..) by mysql,
it takes less space in ur case,
and also there are only 3 values (1, 0 nul
l)
 and in binary format ,1 and 0 have just one significant bit (0000000, & 0000001), the speed, in case of any comparisons, while traversing these columns, should remain higher and queries will take less time.
so i think u can go for first option.
Answer: I think that's what ENUM type is for. You can set your storage field type like this:
ENUM('no','yes')

and allow NULL as default value. If the answer is 'no' - the field value will actually be 0 (the index of 'no') and 1 if the answer is 'yes'. And you will have a nice representation of the column - 'yes' and 'no' instead of 1 and 0. Though the values will be actially stored as 0 and 1. I think its an advantage of using TINYINT.
Comment: After some digging though I found this http://stackoverflow.com/questions/4297149/enumyes-no-vs-tinyint-which-one-to-use. So it seems I am wrong. Voting up for tinyint.


How to ensure continuity of AI model logic?

Question: I am aware that this question might be vague but I must try anyways.
I am looking for a method or an algorithm or even just some keywords (to conduct further research) of how to deal with phenomenon of making sure that model logic will be correctly tracking changes in analysed camera feed based on CV models' results that are not always 100% correct and there might be some other minor disruptions to the image.
It will be easiest to explain with the example: I have an app that will analyse camera feed of a parking situation in online mode to have the best possible view of the situation what cars are in and where, which of them left and when, which came in to what spot etc.
I plan to use series of computer vision models such as object detection, CNN for detected objects classification, some OCR and so on. But the problem with this approach is that each model even if trained very well sooner or later will run into some problems like an object that was recognised one frame before is not recognised in current frame or OCR will confuse "5" and "S" and the resulting string will not be the same so the model can assume there is different car in the same place on one frame.
Even though these errors will appear for example at 0.5% frames, this will still confuse the logic of the model a lot, if the logic will assume that the detection/classification results are always correct and disregard potential models' mistakes.
Another example can be something that will cover part of the camera view for a quick moment and that will result in misdetection some of the objects on few more frames. So ideally the remedy to that problem should have some sort of memory and validation mechanism that will compare older and newer frames whether change in detected objects was legit or it came back to previous state after some short period of time.
Is there any theory or methodology or just some good practices of dealing with such issues or it has to be analysed and mitigated on individual basis?
Answer: That is where object tracking comes in to solve those problems, an example would be the SORT or Deep SORT algorithms. They use IOU to match bounding boxes from one frame to the next and use Kalman filter to predict the next position in case the object was not detected in that frame, you can add a voting system to select the most voted object class (very useful for the OCR) to increase the model accuracy, that way you can get a .9999 accuracy even if your model by itself is not very accurate.


How does the OS know that a command needs sudo?

Question:
When you run an executable, sometimes the OS will deny your
permission to.   For example running make install with the prefix
being a system path will need sudo, while  with the prefix being a
non-system path will not be asked for sudo. How does the OS decide
that running an executable would require more privilege than a user
has, even before the program does something?
Sometimes, running a program will not be denied permission, but the
program will be able to do more things if it is run with sudo. For
example, when running du on some system directory, only with
sudo it will be able to access some directory. Why does the OS not
deny permission of running such a program, or friendly notify more privilege is preferred, before the program can run?
Is it true that  whenever sudo works, su will also work, and
whenever su works, sudo will also work? or with su, a user can do
more than with sudo? How does the OS decide when sudo works, and
when su is needed?
Comment: Has this question been answered for you, or would you like more information?
Answer: For the purposes you have described, the OS doesn't decide whether you need sudo to initially run the program. Instead, after the program starts running and then tries to do something that is not permitted by the current user (such as writing a file to /usr/bin to install a new command), the OS prevents the file access. The action to take on this condition is up to the program; make stops running but du will proceed to the next file/directory after printing a message.
The su and sudo commands are two different ways of running a program with root privileges. They may differ in minor details such as the contents of the environment when starting the new program, depending on options used. The OS does not need to decide when one or the other might work.
Answer:
Sometimes the "Permission denied" message is due to filesystem permissions denying you write access, for example. The executable/tool simply checks if it the filesystem grants you enough permissions to do what you're about to do and throws an error if it's denied by the filesystem. Other times, the tool itself will check your user ID before allowing you to continue using it.
When you run a program with sudo you are running it under some other user's name. If that user is "able to do more things" than your user and the sudo configuration allows you to do these things on the other user's behalf then yes, sudo will allow you to do more things. This is not necessary, though. If you just tack sudo on at the beginning of the command line, you're actually sudoing as root, so typically you're able to do more things than a mere mortal.
Most definitely not. To use sudo you need to supply your own user password and then you're allowed to do some things on the target user's behalf. To use su, you need the target user's password and if you have it, you become that target user as far as the system is concerned and can do anything that user can do.

See also

Why is the 'sudo' password different than the 'su root' password
Comment: @Tim Actually it = "access mode of file has no _write_ bit set for the user". And yes, this can of course be remedied by `chmod` provided you're either the owner of the file or `root`.
Comment: @JosephR. Not obvious. `chmod 400 hello && /lib64/ld-linux-x86-64.so.2 ./hello` produces a nice "Hello, World!" output.
Comment: Thanks. Is " filesystem permissions denying you write access" = "access mode  of the file has no execution bit set for the user, which can be set by chmod"?
Comment: Does whether sudo is needed, completely and solely depend on  whether the execution bit is not set for the user? See http://unix.stackexchange.com/q/147052/674
Comment: @Tim Obviously you need the execute bit to be able to run the executable in the first place.
Comment: @DougO'Neal I would say that _your_ way is the non-obvious one. But then I guess "obvious" is in the eye of the beholder.
Answer: su and sudo are privileged programs.  su changes (after successful authentication) the real and effective user and group id to that of the user you su to.  Thus, su is similar to login.  Note that su can be used to change to any user, not just root.  sudo also changes the real and effective user and group ids.  Up to this point su and sudo are similar (but unrelated), beyond that they are very different.
With su, you need to know the target's password, and once you authenticated, you can do whatever you want as that user.  The use of su can be restricted by setting SU_WHEEL_ONLY in /etc/login.defs.  If it is set, only users in the group wheel may use su, otherwise it is not restricted.  Apart from that, su is all or nothing.
sudo is completely different with respect to that.  With sudo you can define quite complex policies in /etc/sudoers on what the sudoer (the user who calls sudo) is allowed to do.  For instance, you can define policies where certain users may run only certain programs with certain privileges, while other users may run other programs with other privileges.
One of the striking features of sudo is that you can configure it such that a user has to authenticate himself with his own password (instead of that of the target).  Thus, sudo has grown very popular amongst admins, for it allows to authorize users to do only defined privileged operations without dealing out the superuser password, plus you get some degree of accountability.
Answer: tl;dr Access is determined by the user who is running application, and sudo runs applications as different user.
Full version:

How does the OS know that a command needs sudo?

It doesn't know. UNIX manages permissions not on application level but on filesystem level: permissions are granted for users to access specific files. Applications then are run on behalf of user - each running process has user associated with it. That user is used to determine permissions for that application. Sudo works by running applications on behalf of other user (with permissions associated with that another user), namely root, the superuser.
As for your examples:

If user has write access to particular directory, they can make install into that directory. Otherwise they may have root do it - by using sudo.
If you cannot access files in a directory, du running for you cannot access it either. root can access virtually every file, so sudo du (du run on behalf of root) can access them too.

Is it true that whenever sudo works, su will also work, and whenever su works, sudo will also work?

Yes and no. Yes, if program is actually run, it should behave the same under both sudo and su. However, sudo provides allows for more fine-grained control of who may run what by set of rules stored in /etc/sudoers file. su is more simple - if you know target user's password, you can run programs on behalf of that user.
Last note: how application handles denial of access (wherher it aborts or ignores or warns user) is up to application.
Answer: No one has a ✓ yet, so I put together an answer that has everything I could think of.
1   When you run an executable, sometimes the OS will deny your permission to. For example running make install with the prefix being a system path will need sudo, while with the prefix being a non-system path will not be asked for sudo. How does the OS decide that running an executable would require more privilege than a user has, even before the program does something?
No it is not done when an executable is started. It is done when the executable tries to do something.
The Os will check file-system permissions, and capabilities (these are not covered by file-system permissions, and include reduce nice level, mknode, some low-level network stuff, kill other's processes, reboot, set time etc.). If you do not have the permissions then you can not do it. Root has full set of capabilities, including CAP_DAC_OVERRIDE (ignore file permission).
2  Sometimes, running a program will not be denied permission, but the program will be able to do more things if it is run with sudo. For example, when running du on some system directory, only with sudo it will be able to access some directory. Why does the OS not deny permission of running such a program, or friendly notify more privilege is preferred, before the program can run?
The OS can not know what the program will do. So it is up to the program to check permissions before it starts, and to decide what to do. It does not have to do this though.
Note: on android there is a manifest, in this the application declares what privileges it may use. The OS will kill any application that tries to use a privilege that it does not declare, and the OS does not always guarantee that a privilege can be honoured. e.g. network access may not be available.
2   Is it true that whenever sudo works, su will also work, and whenever su works, sudo will also work? or with su, a user can do more than with sudo? How does the OS decide when sudo works, and when su is needed?
sudo and su do roughly the samething. Some differences is environment variable handling and other such security issue avoidance. However they are both tools to allow you to become another user, and both have a default user of root.
su was the original tool, it requires you to enter the password of the user/group that you are changing to.
sudo is newer and requires, by default, for you to enter your own password, but can be configured to accept the password of the user/group that you are switching to, or no password at all. It also allows a lot of configuration, of what commands it will work with, for who, and how it will authenticate with this program for this user on this machine. There is also sudoedit this is part of sudo and can be used to allow editing as a different user and avoid the security issue of sub-shelling out of an editor (calling exec from the editor to run an arbitrary process with escalated privileges).


Where did the helpful comments to my question go?

Question: My question was marked as [duplicate] by several users, and there were some helpful comments, and I've edited it to help clarify what I need to understand beyond the answer to the related question. However now the original comments are not visible to me. Are they gone? Thanks!
Comment: They look pretty gone. Unfortunately AFAIK comments are one of the few things which can be permanently and irrevocably deleted on SE..
Comment: OK, thanks. They appear to have been automatically deleted when I edited the question, at least I didn't do any explicit deleting that I'm aware of.
Comment: That's odd.. AFAIK only the author and moderators can delete comments. Not sure what is going on here..
Comment: I have edited the question. When I log in, I can see my edits. When I am not logged in, it shows only the related question which is proposed to be the answer, and not my revised question with edits/clarification. I do not know what OTHER people see. Are my edits visible to others when they are logged in? If not, it seems like following the directions to edit the question does not actually do anything useful. Thanks!
Answer: These were removed automatically by Community (a background process) since both links were the same as the post marked as a duplicate so nothing missed.


What's the voice leading error?

Question:
I am looking for a voice leading error or chord construction error in this example but can't seem to find one. Any pointers would be great!
Answer: The error is a so-called "hidden fifth", or, "direct fifth". Your outer voices are moving into a perfect consonance by similar motion. Even in strict voice-leading this is often allowed except in cases like this where the soprano voice leaps, rather than steps, into the consonance. This sheet is a pretty good guide for voice-leading if you're in a theory class, but keep in mind that strict voice-leading presupposes a specific set of goals. Exercises like this are great practice, but when you're actually writing music you get to set your goals for yourself, and that's half the fun of it! :—)
Comment: OK, now we have two conflicting answers.  Which is correct, or are both of them?
Comment: @CarlWitthoft This is the correct answer.
Comment: Yep.  I've always found the prohibition of hidden fifths to be pretty picky, because it doesn't really seem to reduce the independence of the voices to me, but in strict voice leading it is indeed a no-no.  But of course, as wskerpan says, if you are writing music, you will not be thrown in jail for using hidden fifths.

What’s the voice leading error?


Count and number how many times the same conditions have me

Question: I'm trying to see if there is any way to count in Google Sheets how many times conditions in other columns are met. Please see image below. In the example, there are 3 conditions (Car, Color, Status) and they will all be counted as the first case if no conditions are repeated in previous rows. If the same conditions are met in a previous row, the count will go up in one. In the example, only only in the case of Mercedes, red, new is repeated twice, so in the second time it happens, the result will show 2 in the second time.
Comment: Welcome to [Web Applications Stack Exchange](https://webapps.stackexchange.com/tour).
Answer: Assuming that the header "Car" shown in your image is in A1 and that your formula and results would be in D:D, clear Column D and place the following formula in D1:
=ArrayFormula({"Header of Choice";IF(A2:A="",,COUNTIFS(A2:A&B2:B&C2:C,A2:A&B2:B&C2:C,ROW(A2:A),"<="&ROW(A2:A)))})
This formula will produce the header (which you can change inside the formula as you like) and all results for the column.
COUNTIFS will count for concatenated matches of everything in Columns A, B and C, counting only as far as the current row.
Answer: Use countifs() with three conditions, like this:
=countifs(
  A$2:A2, A2,
  B$2:B2, B2,
  C$2:C2, C2
)


Are there any applications for distributed revision control (DVCS) if I'm not a programmer?

Question: The terms DVCS and Git seem to be thrown around a lot.  Are there any applications for this technology if I'm not a programmer, but just a regular "superuser"?
Comment: Are you particularly curious about *distributed* version control or version control in general?
Comment: I'm really curious if there's a particular advantage of using a DVCS over just a VCS for your average user.  From the answers already provided, it sounds like the uses of a VCS are well covered.
Answer: Author Cory Doctorow got some geek friends to write FlashBake to commit his work every 15 minutes along with some other information.

I was prompted to do this after discussions with several digital archivists who complained that, prior to the computerized era, writers produced a series complete drafts on the way to publications, complete with erasures, annotations, and so on.

His blog post about FlashBake talks much more about the motivation, usefulness and details.
Comment: That sounds pretty convenient!
Answer: Bazaar is an excellent DVCS that is very user friendly for novices. It'd be very helpful if you were doing something that involved tracking changes to text (writing a book?)
Answer: I personally use a git repo to keep track of change i'm making in my /etc, or in other folder with some important informations.
I would say that a VCS (distributed or not) is useful to keep track on changes on items, not necessarily source codes.
Answer: Our company is putting a version control system for our Power Point presentations. We work in professional education, and the sheer number of Power Point presentations and other marketing material that is floating around between two or three people is staggering.
We're going to use a VCS to eliminate the clutter, and if someone inside the company wants a copy? Just browse to the VCS and grab the latest revision.
We're probably going to go with VisualSVN, since it's one of the easier ways for us to setup a 'set it and forget it' VCS for our LAN.
Comment: Hmm, is it the same old "no automated merging" story as it has been, or can we now merge our .pptx files member-by-member (them being zips of XML and all now)?
Comment: Actually, we haven't had the time to implement this solution yet, so I can't answer that question - previously I only used it for web files (php, js, etc).
Answer: mmm my wife was using git with her friends for doing a collaborative work, so they could be "fusioning" their work at the end of each journey
Answer: Good version control systems are specifically for programmers, although they are optimised for plain text files.  I recommend SVN using Tortoise if you are on Windows.
Answer: Bazaar is definitely the most user friendly of the distributed RCSs I've tried.
If you're on Windows, File Hamster is a commercial app aimed to be RCS (with distributed for enterprise IIUC) for non-programmers:
http://www.filehamster.com/index.php?page=users
I used to use it to track changes to illustrations (UI is great, developers are very friendly and nice), but I switched over to Bazaar.
There is also versomatic for non-programmers, but it isn't distributed AFAIK:
http://www.acertant.com/web/versomatic/default.htm
Answer: Dropbox is in many cases a better solution than a VCS for a "superuser" who wants some of the benefits of a VCS but who isn't a programmer looking for source code control.
Dropbox ( http://www.dropbox.com ) is not, strictly speaking, a version control system.  It does use git behind the scenes, however, and offers most of the version control features a non-programmer user would want for file storage:

Abstracts away the hard-to-understand parts of versioning system; for the most part users don't need to know or care what happens behind the scenes.
Changes made to a file on one computer are immediately pushed out to other computers attached to your dropbox account.
On free dropbox accounts all changes within last 30 days are preserved and can be rolled back.  On $10/month account previous versions are preserved indefinitely, no cutoff.

The main downside to Dropbox is that the free service offers "only" 2GB.  That's still quite a lot, depending on your intended use.
As I said, Dropbox is not a true version control system, certainly not something that would suffice for programmers who want source code version control.  It may be a better option for non-programmer power users who want to have some of the advantages of version control, though.
Answer: Mercurial works fine for non-programming tasks. Keep back versions of pretty much any documents you work on. It's not as efficient dealing with binary files as with text, but for small scale environments it's probably still fine. Get TortoiseHg for simple installation and ease of use.
What kind of files are you looking to manage, and is it just for you or for a group of people? The answers to those questions are key to deciding on the right system to use.
Answer: I actually tend to use RCS (not distributed, I know) for my school papers. Mostly because I'm lazy and it's so easy to put a file under RCS in Emacs, and I'm afraid to write without version control -- what if I decide I didn't want to delete that paragraph after all?
If I was going to write something big enough that I would want my text in multiple files, I would definitely use a DVCS for that, probably Bazaar.
As for reasons to use a DVCS rather than a plain-old VCS,

It's easier to collaborate with others
It's also easier to edit your stuff in multiple places -- no need for a central server or carefully copying around the latest version of some fragile "repository" directory. (This is really a special case of the previous one -- self-collaboration!)
It's generally easier to create a repository in the first place
Answer: There are multiple efforts for using e.g. GitHub for collaborative work in publishing, including academic collaboration but also various other coauthoring scenarios.
Traditional publishing toolchains have been dominated by proprietary file formats and editing tools, but there was always a strong undercurrent of purely text-based publishing tools (Troff, LaTeX, etc) which are very nicely suited for source code version control systems, and actually bring some nice benefits (the ability to comment on sections without having the comments intrude on the final published result, programmatically producing some parts of the content, etc).
Here is one example: https://github.com/PeerJ/paper-now but there are many others for academic publishing.  I believe I have seen something for less formal publishing (journalism collaboration? volunteer work?) but I can't find a link right now.
GitHub itself of course is centralized, but once you understand the concept, there is nothing really stopping you from going fully DVCS.


Magento2: How can I get all orders from database tables

Question: I want to get all orders record from database.
How many tables I have to dump for . Kindly enlist the tables names here
Answer: You have to dump for these tables for all orders records:

sales_invoice
sales_invoice_comment
sales_invoice_grid
sales_invoice_item
sales_invoiced_aggregated
sales_invoiced_aggregated_order
sales_order
sales_order_address
sales_order_aggregated_created
sales_order_aggregated_updated
sales_order_grid
sales_order_item
sales_order_payment
sales_order_status
sales_order_status_history
sales_order_status_state
sales_order_tax
sales_order_tax_item
sales_shipment_item
sales_shipping_aggregated
sales_shipping_aggregated_order

mysqldump -u root -p  sales_invoice sales_invoice_comment
  sales_invoice_grid sales_invoice_item sales_invoiced_aggregated
  sales_invoiced_aggregated_order sales_order sales_order_address
  sales_order_aggregated_created sales_order_aggregated_updated
  sales_order_grid sales_order_item sales_order_payment
  sales_order_status sales_order_status_history sales_order_status_state
  sales_order_tax sales_order_tax_item sales_shipment_item
  sales_shipping_aggregated sales_shipping_aggregated_order > orders.sql
Answer: We can get the all order details by this SQL query -
mysqldump -u root -p database_name
sales_bestsellers_aggregated_daily
sales_bestsellers_aggregated_monthly
sales_bestsellers_aggregated_yearly
sales_creditmemo
sales_creditmemo_comment
sales_creditmemo_grid
sales_creditmemo_item
sales_invoice
sales_invoiced_aggregated
sales_invoiced_aggregated_order
sales_invoice_comment
sales_invoice_grid
sales_invoice_item
sales_order
sales_order_address
sales_order_aggregated_created
sales_order_aggregated_updated
sales_order_grid
sales_order_gst
sales_order_item
sales_order_item_gst
sales_order_payment
sales_order_status
sales_order_status_history
sales_order_status_label
sales_order_status_state
sales_order_tax
sales_order_tax_item
sales_payment_transaction
sales_refunded_aggregated
sales_refunded_aggregated_order
sales_sequence_meta
sales_sequence_profile
sales_shipment
sales_shipment_comment
sales_shipment_grid
sales_shipment_item
sales_shipment_track
sales_shipping_aggregated
sales_shipping_aggregated_order > orderData.sql

I hope this will helps you to get only export the order details
Answer: You have to include the following tables,
these are basically the tables storing and handling the orders data:

sales_order  //responsible for all orders
  sales_order_item //responsible for all order items associated to the order
Comment: just two tables have all orders data?
Comment: `sales_order_grid` is just the same with all the data in sale_order
Answer: Below are tables related to order in Magento:

sales_order;
sales_order_address;
sales_order_aggregated_created;
sales_order_aggregated_updated;
sales_order_grid;
sales_order_item;
sales_order_payment;
sales_order_status_history;
sales_order_tax;
sales_order_tax_item;
Answer: If you are looking to remove all test orders / data your best to run the below which will do this.
SET FOREIGN_KEY_CHECKS=0;

# Clean order history
TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;

# Clean order infos
TRUNCATE TABLE `sales_creditmemo`;
TRUNCATE TABLE `sales_creditmemo_comment`;
TRUNCATE TABLE `sales_creditmemo_grid`;
TRUNCATE TABLE `sales_creditmemo_item`;
TRUNCATE TABLE `sales_invoice`;
TRUNCATE TABLE `sales_invoiced_aggregated`;
TRUNCATE TABLE `sales_invoiced_aggregated_order`;
TRUNCATE TABLE `sales_invoice_comment`;
TRUNCATE TABLE `sales_invoice_grid`;
TRUNCATE TABLE `sales_invoice_item`;
TRUNCATE TABLE `sales_order`;
TRUNCATE TABLE `sales_order_address`;
TRUNCATE TABLE `sales_order_aggregated_created`;
TRUNCATE TABLE `sales_order_aggregated_updated`;
TRUNCATE TABLE `sales_order_grid`;
TRUNCATE TABLE `sales_order_item`;
TRUNCATE TABLE `sales_order_payment`;
TRUNCATE TABLE `sales_order_status_history`;
TRUNCATE TABLE `sales_order_tax`;
TRUNCATE TABLE `sales_order_tax_item`;
TRUNCATE TABLE `sales_payment_transaction`;
TRUNCATE TABLE `sales_refunded_aggregated`;
TRUNCATE TABLE `sales_refunded_aggregated_order`;
TRUNCATE TABLE `sales_shipment`;
TRUNCATE TABLE `sales_shipment_comment`;
TRUNCATE TABLE `sales_shipment_grid`;
TRUNCATE TABLE `sales_shipment_item`;
TRUNCATE TABLE `sales_shipment_track`;
TRUNCATE TABLE `sales_shipping_aggregated`;
TRUNCATE TABLE `sales_shipping_aggregated_order`;

# Clean cart infos
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;

# Reset indexes (if you want your orders number start back to 1
TRUNCATE TABLE sequence_invoice_1;
TRUNCATE TABLE sequence_order_1;
TRUNCATE TABLE sequence_shipment_1;
TRUNCATE TABLE sequence_creditmemo_1;

SET FOREIGN_KEY_CHECKS=1;

Answer: sales_order stores main order data
Answer: You can get the all the order related tables using below query
mysqldump -u root -p database_name sales_bestsellers_aggregated_daily sales_bestsellers_aggregated_monthly sales_bestsellers_aggregated_yearly sales_creditmemo sales_creditmemo_comment sales_creditmemo_grid sales_creditmemo_item sales_invoice sales_invoice_comment sales_invoice_grid sales_invoice_item sales_invoiced_aggregated sales_invoiced_aggregated_order sales_order sales_order_address sales_order_aggregated_created sales_order_aggregated_updated sales_order_grid sales_order_item sales_order_payment sales_order_status sales_order_status_history sales_order_status_label sales_order_status_state sales_order_tax sales_order_tax_item sales_payment_transaction sales_refunded_aggregated sales_refunded_aggregated_order sales_sequence_meta sales_sequence_profile sales_shipment sales_shipment_comment sales_shipment_grid sales_shipment_item sales_shipment_track sales_shipping_aggregated sales_shipping_aggregated_order > OrderData.sql


How old is Hedwig?

Question: We all know how old Harry is, but what about Hedwig?
Comment: In the films, Gizmo the owl started the film series at the age of eight. His flying stand-ins (Eek and Ook) were much younger, if memory serves.
Answer: It is not stated in canon.
When Hagrid buys her for Harry, she's already an adult, so at least a year old. Maybe older, as she is stated to be a trained post owl.
Snowy owls reach sexual maturity at one year old and typically live to about 10 years old in the wild and up to 28 years in captivity, so that leaves quite a range of possibilities.
As Valorum said in the comments, the owl appearing in the movie is an eight-year-old male (the females have much heavier, almost black barring all over the back and wings).

How old is Hedwig?


Volume SDF attribute to shaders

Question: I'm trying to create a realistic nebula scene with procedurally generated structures. I want to use the SDF data from generated volume in shader editor to combine with other mask and textures. I managed to get the positive and negative SDF values but only in geometry form. I need them to be an attribute (like density) so they can be used in shading.
Procedural nebuala (base structure)
The positive SDF in geometry context. I need this data in attribute context as density to be used in shader to combine with masks and textures
The density value generating the original procedural nebuala structure is also useless since it can't be manipulated beyond a certain limit.
I tried creating sdf's using geometry proximity more but it outputs a value of 0-1 inside and outside the mesh which is not what I need (shown below)
Here black line represents the boundary and gradient going inside and outside the mesh with no way to isolate the two gradients

Edit:

If you fill Your volume with enough random points you should be able to isolate the "two gradients"

Thanks. This seem to be generating the desired results and can be imported in shader tab. However there seems to be another problem, perhaps I should have mentioned it before. The data generated needs to be used in a cube volumetric object to control haze "around" structure. The current method doesn't allow usage of this data in a cubic geometry since it is different from the source generating the SDF, a transfer attribute or "sample at index" also won't work here. Essentially the destination for this data is a volume box, with various textures controlling haze including this positive distance data to control haze around the object. (Examples attached below)

A research paper describing the method under practice

The desired result. Using the sdf data (indicated by blue attribute node) in combination with a height mask and a voronoi pattern in a box shaped object
As you can see I'm trying to import the positive distance from the mesh into the shader of a cube to be used with other textures and patterns to make a final "haze effect" around the object.
Answer: Using Raycast May be working for you?

Edit:
If the result you expect is something like this:

PS : Attributes don't work with volume shader...
Comment: Amazing thank you

Volume SDF attribute to shaders


Radio buttons on Rails

Question: Similar to this question: Checkboxes on Rails
What's the correct way of making radio buttons that are related to a certain question in Ruby on Rails? At the moment I have:

    Theme:

<%= radio_button_tag 'theme', 'plain', true %> Plain

<%= radio_button_tag 'theme', 'desert' %> Desert

<%= radio_button_tag 'theme', 'green' %> Green

<%= radio_button_tag 'theme', 'corporate' %> Corporate

<%= radio_button_tag 'theme', 'funky' %> Funky

I also want to be able to automatically check the previously selected items (if this form was re-loaded). How would I load the params into the default value of these?
Answer: As in this previous post, with a slight twist:

    Theme:
    <% [ 'plain', 'desert', 'green', 'corporate', 'funky' ].each do |theme| %>

<%= radio_button_tag 'theme', theme, @theme == theme %>
      <%= theme.humanize %>
    <% end %>

Where
@theme = params[:theme]

Comment: You could simplify `[ 'plain', 'desert', 'green', 'corporate', 'funky' ]` to `%w(plain desert green corporate funky)`
Answer: Same as V's, but has associated labels with each radio button. Clicking the label checks the radio button.

Theme:

  <% [ 'plain', 'desert', 'green', 'corporate', 'funky' ].each do |theme| %>

<%= radio_button_tag 'theme', theme, @theme == theme %>
    <%= label_tag "theme_#{theme}", theme.humanize %>
  <% end %>

Comment: Using `label_tag` helps improve the UX :)
Answer: Using Haml, getting rid of needless br tags, and nesting inputs within label so that they may be selected without matching labels to ids. Also using form_for. I would consider this to be following best practices.
= form_for current_user do |form|
  .form_row
    %label Theme:
    - [ 'plain', 'desert', 'green', 'corporate', 'funky' ].each do |theme|
      %label
        = form.radio_button(:theme, theme)
        = theme.humanize

Answer: I would suggest having a look at formtastic
It makes radio button and check box collections vastly easier and more concise. Your code would look like so:
    <% semantic_form_for @widget, :html => {:class => 'my_style'} do |f| %>
<%= f.input :theme, :as => :radio, :label => "Theme:",
:collection =>  [ 'plain', 'desert', 'green', 'corporate', 'funky' ] %>
<% end %>

Formtastic is largely unobtrusive and can be mixed and matched with the "classic" form builders. You can also override the formtastic css class for the form as I did above with
:html => {:class => 'my_style'}
Have a look at the pertinent Railscasts.
Update: I've recently moved to Simple Form which has similar syntax to formtastic but is more lightweight and especially leaves the styling to your own css.
Answer: Hmm, from the docs I don't see how you can set the ID on the radio buttons... the label's for attribute tries to link to the ID on the radio.
rails docs for radio_button_tag
That said, from the doc, that first param is the "name"... which if that is what it is creating, should group them alltogether.  If not, maybe its a bug?
Hmm, wonder if these have been fixed:
http://dev.rubyonrails.org/ticket/2879
http://dev.rubyonrails.org/ticket/3353

Radio buttons on Rails


Which kind of machine learning algorithm is Hidden Markov Model?

Question: I have used Hidden Markov Model algorithm for automated speech recognition in a signal processing class. Now going through Machine learning literature i see that  algorithms are classified as "Classification" , "Clustering" or "Regression".
Which bucket does HMM fall into? I did not come across hidden markov models listed in the literature.
Answer: I would be tempted to reply "none", or "both classification and clustering".
Why "none"? Because HMMs are not in the same bag as support vector machines or k-means.
Support vector machines or k-means are specifically designed to solve a problem (classification in the first case, clustering in the second), and are indeed just an optimization procedure to maximize an "expected goodness of classification" or "goodness of clustering" criterion. The beauty lies in the choice of the criterion and optimization procedure. HMM are not an algorithm per se. They are a specific kind of probability distribution over sequences of vectors - for which we know good parameter estimation and marginal distribution computation algorithms. But asking whether they are in the "clustering" or "classification" family is as ridiculous as asking whether the Gaussian distribution is supervised or unsupervised learning.
Why "both classification and clustering"? Because of the following: Being probability distributions, HMM can be used for classification in a bayesian framework; and being model with hidden states, some latent clustering of the training data can be recovered from their parameters. More precisely:
HMM can be used for classification. This is a straightforward application of the bayesian classification framework, with the HMM being used as the probabilistic model describing your data. For example, you have a large database of utterances of digits ("one", "two", etc) and want to build a system capable of classifying an unknown utterance. For each class in your training data ("one", "two", you estimate the parameters of a HMM model describing the training sequences in this class - and you end up with 10 models. Then, to perform recognition, you compute the 10 likelihood scores (which indicate how likely the sequence you want to recognize has been generated by the model), and the model with the highest score gives you the digit. In the Rabiner tutorial on HMMs, the training stage is "Problem 3", the classification stage is "Problem 2".
HMM can be used in an unsupervised fashion too, to achieve something akin to clustering. Given a sequence, you can train a $k$-state HMM on it, and at the end of the training process, run the Viterbi algorithm on your sequence to get the most likely state associated with each input vector (or just pull this from the $\gamma$ during the training process). This gives you a clustering of your input sequence into $k$ classes, but unlike what you would have obtained by running your data through k-means, your clustering is homogeneous on the time axis. For example, you can extract the color histograms of each frame of a video sequence, run this process on this sequence, and you'll end up with a break-down of the video into homogeneous temporal segments corresponding to scenes (the unpractical bit is that you have to set up the number of scenes $k$ in advance). This technique is commonly used in automatic, unsupervised, structure analysis of video or music.
Answer: First, let's look at the three options:

Classification : Identifying which class of a set of pre-defined classes the data belongs to.
Clustering : Learning the set of classes the data belongs to.
Regression : Finding a relationship between on variable and one or more others.

The description of the HMM on Wikipedia has the following table:

so the number of states (classes) is fixed.
That means that the algorithm does not try to figure out the number of classes (states) are --- so it's not open-ended clustering (where the number of states is unknown).
However, as @nikie points out, the HMM will do clustering.
There is not really an independent variable (as exists in the regression context) --- so it's not regression.
So my answer is that the HMM is a classification and a clustering algorithm, I do not believe it is a regression.
Comment: How do you get from "the number of classes if fixed" to "so the algorithm does not try to figure out that the classes are"? The number of classes for k-means clustering is fixed, too, but it's clearly a clustering algorithm.
Comment: I suppose I'm used to the open-ended clustering rather than fixed.  Will update answer. Thanks!


Upgrade to High Sierra

Question: I currently run MacOS 10.12.4 Sierra on a mid-2011 iMac.  I want to upgrade to 10.13 High Sierra.  On the App Store, the only option (after Sept 24) is 10.14 Mojave.  Where should I go to get High Sierra?  If I go to https://support.apple.com/en_AU/downloads/macos,  there are many different download options, but they all are updates, such as 10.13.6.
Answer: macOS High Sierra Download Link
That link should permit you to download the full macOS High Sierra installer from the App Store.

Upgrade to High Sierra


Does the dimensionality of phase space go up as the universe expands?

Question: Ever since Hubble, it is well known that the universe is expanding from a Big Bang. The size of the universe had gone up by many many orders of magnitude as space expanded. If the dimensionality of the quantum phase space is finite because of spatial cutoffs at the Planck scale, does it go up as space expanded? If yes, how can this be squared with unitarity? If no, would this lead to what Tegmark called the Big Snap where something has got to give sometime. What is that something which gives?
Answer: This is a deep mystery in quantum gravity, and it is discussed at length by Banks, and Susskind, among others, in connection with conjectural ds-CFT constructions. This is the central difficulty in describing expanding universes in string theory.
The quantum mechanical number of bits that a cosmological horizon can include seems heuristically to be limited by the area in Planck units. As the universe exapands, this area goes up, so the phase space itself seems to be getting bigger. This is very difficult to conceive, and it seems to be a true paradox, because quantum mechanical evolution can't make the state space bigger.
One way out was suggested by Susskind--- that deSitter space is unstable, and the correct degrees of freedom live on the space it eventually decays into. There is no agreed upon answer, and solving this problem likely requires a good new idea.
Comment: it does struck as something extremely odd *(at least for fellows like myself which have some familiarity with GR and QFT but only a bunch of misconceptions and hearsay about string theory)* that you have this theory that 1) is equal to GR in the classical limit 2)encapsulates absurdly many different vacua, but as it turns out, 3)does not know nothing besides static non-expanding cosmologies
Comment: Could I ask for what happens classically? For instance, I know that in general it is possible to put a symplectic structure on space of solutions, even in the presence of an isolated horizon. Do the ideas (e.g. conserved Louiville form) make sense cosmologically?
Comment: @lurscher: I agree that this is a big problem, but it is unbelievable enough that there is a solution for the non-cosmological AdS quantum gravity. It is not quite correct that string theory doesn't work in the expanding backgrounds, one should say that the techniques for defining the theory don't extend to these backgrounds. It is certain that there is a way to do it, which is not known yet, perhaps requiring a deep physical insight. I speculated on this endlessly, but never got anything solid and new.
Comment: @genneth: that's a _really_ good question, perhaps you can ask it on theoreticalphysics.stackexchange? It might be answerable in 2+1 dimensions more easily, but I am not sure if you can get an expanding horizon, I was thinking of t'Hooft's version of conincal defect dynamics.
Comment: @RonMaimon: [done](http://theoreticalphysics.stackexchange.com/questions/256/sympletic-structure-of-general-relativity)
Answer: I have a feeling the dimensionality of the quantum state space is not conserved in an expanding universe. All our evidence for unitarity comes from experiments conducted at length and time scales far smaller than cosmological timescales. I really don't see any fundamental reason why we should assume unitarity applies to quantum cosmology. We have no right to extrapolate our experimental results to cosmological scales with no good reason. Even if unitarity is not a fundamental feature of our universe, at really short time scales, cosmologically speaking, unitarity might emerge as an approximation just as classical mechanics emerges when the action exceeds Planck's constant, or nonrelativistic mechanics emerges at speeds far less than the speed of light.
As an added bonus, the second law of thermodynamics has a trivial explanation and is no longer a mystery. The big bang was not a highly improbable configuration placed on a knife's edge as Penrose would have you believe. The second law is what comes naturally when the size of phase space goes up.
Comment: In the course of the evolution according to the second law of thermodynamics towards a state of higher entropy, the number of relevant variables needed to describe the state of the system decreases but the irrelevant variables (or degrees of freedom) do NOT vanish; so why should unitarity break down? I must confess that althoug I like parts of Roger Penrose`s "Road to Reality" I strongly disagree with his mamboo-jamboo about the "interpretation of quantum mechanics" ...
Answer: When the universe expands, the "new" modes that arise can be traced to transplanckian -- i.e. shorter than Planck length -- wavelength modes. What was once transplanckian now becomes redshifted adiabatically to subplanckian wavelengths. I stress adiabatically because this doesn't apply to the nonadiabatic Planck epoch. Of course, many physicists object to the existence of transplanckian modes. Supposedly, the Planck scale acts as an ultraviolet scale cut-off. Anyway, looking at the Wheeler-De Witt constraints, it can be shown the transplanckian modes aren't independent of the subplanckian modes. This ought to sidestep the problem.


Momentum operator expression

Question: In the course of calculating
$$\langle x|\hat{p}|\psi\rangle$$
I have a step which is:
$$ \langle x|\frac{\hbar}{i}\frac{d}{dx}|\psi\rangle=\frac{\hbar}{i}\frac{d}{dx}\langle x|\psi\rangle.$$
What is the mathematical justification for that step?
I am "intuitively" thinking that $-i\hbar d/dx$ and $ \langle x|$ "commute", but on second thought, that doesn't seem reasonable, since a bra and an operator are not even in the same vector space.
Comment: [Closely related](https://physics.stackexchange.com/a/76317/66086).
Answer: That is not the point really. The momentum operator is defined to be the operator which acts on the position basis as
$$\langle x |P |\psi\rangle = -i\hbar \dfrac{d}{dx}\langle x|\psi\rangle.$$
This is a definition. Recall that given one state $|\phi\rangle$ on the Hilbert space of the system, it is completely defined if you give its projections onto a complet set (be it discrete or continuous). To see this notice that if you know that
$$\langle x|\phi\rangle=\phi(x)$$
for a given $\phi(x)$, then using the completeness relation
$$\mathbf{1}=\int_{\mathbb{R}}|x\rangle \langle x| dx$$
you obtain that
$$|\phi\rangle = \mathbf{1}|\phi\rangle=\int_{\mathbb{R}}|x\rangle \langle x|\phi\rangle dx = \int_{\mathbb{R}} \phi(x)|x\rangle dx.$$
Now let $|\psi\rangle$ be one state, you want to define what is $P|\psi\rangle$. Whatever that is, it is another state. So it suffices to specify its projection onto the position basis, and that is exactly the expression above.
On the other hand: why is it reasonable that
$$\langle x|P|\psi\rangle = -i\hbar \dfrac{d}{dx}\langle x|\psi\rangle$$
is another, and considerably more interesting question.
This is essentialy the idea of quantization. Basically when you have a classical system you have one Hamiltonian description which includes one Poisson bracket $\{,\}$.
If $q,p$ is one pair of canonically conjugate variables (position and momentum) then the relation $$\{q,p\}=1$$ holds, and it is telling that $p$ is the generator of translations in $q$.
In order to preserve this in the quantum theory and still have that the quantized $P$ is the generator of the quantized $Q$ we need that
$$\{,\}\mapsto -\dfrac{i}{\hbar}[,].$$
Notice that this means $[Q,P]=i\hbar$, which is the way, in the language of quantum mechanics, of saying that $P$ generates translations in $Q$. This is roughly speaking one possible way to motivate the quantization prescription which should in some sense "deform" the Poisson bracket to the commutator. Another way to motivate this is to notice that $[Q,P]=i\hbar$ is equivalent to Heisenberg's uncertainty principle.
Notice that $[Q,P]=i\hbar$ is one algebraic relation between the operators. This is interesting because you can shift the point of view: instead of first thinking about states (in QM the Hilbert space) and then of the observables (the operators), we can talk about the observables of the system in one abstract way.
This means you need to talk about the so-called $\ast$-algebras. This is the abstract version of the algebra of operators in a Hilbert space. On the other hand, if you have one $\ast$-algebra you can talk about representations of this algebra, which in turn are the way that set with its algebraic operations can be realized as actual operators in some Hilbert space.
Thus if you have one classical algebra of observables with some Poisson bracket, you can talk about quantization as finding one quantum algebra of observables, the $\ast$-algebra, where we have the commutation relations holding as the quantized Poisson bracket.
The relation $[Q,P]=i\hbar$ is called the canonical commutation relation and roughly speaking if one builds the (abstract) algebra on which $[Q,P]=i\hbar$ holds, then there by Stone-Von Neumann's theorem there is precisely one and only one representation of this algebra up to unitary equivalence. This representation is the one on which the Hilbert space is $L^2(\mathbb{R})$ the space of square integrable complex functions, $Q$ acts on $L^2(\mathbb{R})$ as $Q\psi(q)=q\psi(q)$ and $P$ acts on $L^2(\mathbb{R})$ as
$$P\psi(q)=-i\hbar \dfrac{\partial \psi}{\partial q}.$$
This is the so-called Schrödinger's representation. This justifies the usual approach on which one assumes one abstract Hilbert space $\mathscr{H}$ together with operators $Q,P$ satisfying $[Q,P]$ and a basis $|q\rangle$ such that $Q|q\rangle = q|q\rangle$ and $P$ acts as we have discused. Notice that mapping $|\psi\rangle \mapsto \psi$ where $\psi(q)=\langle q|\psi\rangle$ identifies $\mathscr{H}$ with the Schödinger representation.
In summary: $[Q,P]=i\hbar$ is equivalent to existing a representation on which $Q$ acts as multiplication and $P$ as the derivative and in turn requiring $[Q,P]=i\hbar$ is what we mean by quantizing a system with classical $\{q,p\}=1$.
Comment: Thanks. Can you elaborate on your last point?
Comment: @Frank, I have edited the question. See if that helps.
Comment: Perfect - thanks a lot for the addition highlighting the *-algebras and the centrality of representation theory and the Stone-Von Neumann theorem. That greatly expands on the questions and enhances the discussion.

Momentum operator expression


Instrument sound levels for a small venue

Question: Is there any decibel level to set instruments to in doing a small venue for about 100 people? Our bass and guitars are through the amps. The singers, keyboard and acoustic guitar through a PS system. No monitors.
Comment: The actual decibel level readings will vary considerably depending where they are taken in a room, for example a couple of metres in front of the stage will be very different from the back of the room. There's also the furnishings and floor, windows with/out curtains which all contribute to no absolute decibel level reading capable of being found. If people on the dancefloor are shouting at each other, it's maybe too loud!
Answer: The appropriate volume levels will often vary according to the venue and the type environment and the type music and the audience. Also there are many things to take into consideration to provide optimal sound distribution to the majority of the audience.
For example, if you are playing to a 100 person venue and there is a dance floor and the 100 people are there to dance, and you are playing dance music, then you would want the overall volume relatively loud.
On the other hand if you were playing at a 100 seat restaurant, and you were playing jazz instrumentals as background music, you want to keep volume levels low so as not to drown out conversation.
The acoustical environment can vary greatly and affect the perceived volume.  An acoustically live venue with tile floors and a metal ceiling often necessitate the lowest volume you can get and still keep your instruments and vocals balanced in the mix.  A carpeted venue with and acoustical tile ceiling will call for a higher volume setting on your PA and amps. Outdoor venues  require a completely different approach as none of the sound is reflected.
One thing to keep in mind is that you are trying to achieve the appropriate volume level for the venue and the setting while at the same time, making adjustments so that electric guitars, bass, drums (if any), acoustic guitars, keys and vocals are appropriately balanced in the mix from where the audience will be sitting.
Remember that low frequency sound such as that coming from the Bass Cabinet will be multi-directional and will be heard throughout the room regardless of where the speaker is pointed.  Higher frequencies are more directional and it's important to angle the speakers so the sound will reach the ears of the audience.  That means if you are on a high stage and the audience is seated, you might want to tilt the mains on the PA down slightly.  Conversely if you are playing in a venue with stadium seating where the audience is looking down at the stage, you may need to angle the mains up.
The height of the main PA speakers can be adjusted if placed on speaker stands and you want to consider how high they should be for the situation.  If there will be folks dancing close to the speakers and other folks listening in the back of the room, you will want to raise the speakers slightly above the heads of the dancers so their bodies don't absorb all the sound and prevent it from reaching the audience in the back and also you don't blow out their ear drums.
If your audience is seated, you might try keeping the speakers slightly lower.
TTW was wise to suggest having a person check the levels from around the room.  I try to get set up enough ahead of time to do a sound check with one of the other band members who is more experienced than the average non-musician, stand at different parts of the venue in places we expect the audience to be and we bring up the volume of each instrument one at a time and then pull down the volume of any that are too loud in the overall mix when multiple instruments are playing.
When I play with my band - the first song is announced as a "sound check" song and we recruit a few folks we know to listen from various parts of the venue and give us feedback on the overall volume as well as the mix.  They might say things such as "not enough acoustic guitar, vocals a tad muddy, lead guitar not cutting through, Bass too loud, more cowbell".
During breaks I always visit with members of the audience and ask them how the mix and volume sound.  If I get a consensus that it's too loud, or not loud enough, the appropriate adjustments will be made prior to the next set.
I personally prefer to use stage monitors if the room is not too acoustically live. I can't afford an in ear monitoring system which might be more versatile.  By using monitors on stage for the musicians, I can place them in such a way so that all the band members can hear what they need to hear and I can place the PA speakers for optimal sound distribution to the audience.  If the musicians and vocalists have to hear the mix through the PA mains, you might have to position them so that the musicians can hear the music they are playing with or singing to (or hear themselves) all while avoiding feedback.  Placing the PA mains so they double as monitors without feedback from the mics will often preclude positioning them for optimal sound distribution to the audience.  But in some venues, it is best not to use monitors and you don't need them.
Ultimately, your objective is to deliver an enjoyable experience for the audience. In order to do that, you must be sure that as much of the audience as possible hears as much of the music as is appropriate for the situation - and that the mix is balanced so they hear the music the way the band intended to convey it.  But it's also important that the band deliver the best performance they are capable of and the performance will suffer if the musicians can't hear what they need to hear at the volume they need to hear it at.
To summarize - each situation may call for different overall volume levels and the acoustic properties and characteristics of the venue itself will dictate what methods must be employed to achieve the appropriate sound levels for the particular audience and situation.
Comment: Superb answer! You've covered all points - agree with monitors (and side fill) often aren't necessary. There's a similar question somewhere about the volume on stage compared with that in the auditorium that has interesting answers.+1.
Comment: There's another school of thought - if you set up stage monitors so that all the performers are happy, you may be able to leave the main PA at home!   I exaggerate, but not much.
Comment: @LaurencePayne  Is that school of thought based on the theory that the audience doesn't care about the sound half as much as the musicians?
Comment: More that they'll often be happy with it a whole LOT quieter than the musicians like!
Comment: @LaurencePayne Good point!
Answer: I've played from very large to very small venues. The only way I could set volumes reliably (for solo or ensembles) was to have someone walk around and tell us how things sound. Of course, as the venue fills with people, lots of sound energy is absorbed by clothing (and hair and ear drums ...) so some adjustments may be called for. Groupies and band spouses can be useful.
When setting up, the old stereo rule of thumb is useful. A speaker (or instrument or singer) suspended in air generates a level of loudness X; the same speaker on a floor or the middle of a wall (or ceiling) generates approximately 2X loudness; in a dihedral (wall to floor or two walls meeting) one gets 4X and in a corner about 8X. If you are playing from a corner, the music will be much louder than first expected. Klipsh used to use this in high end speakers (maybe they still do.)
Comment: +1 for  to have someone walk around and tell us how things sound. So many gigs are spoiled by really bad subjective balance.
Comment: Did a gig last night in a marquee - which I never like doing. Thanks for the formulae for sound levels. We were in a corner, and although the crowd seemed to like it, all I could hear is mush, and loud mush at that. I am wondering what can be done in marquees, as the sound is never good. A band member suggested monitors, but after using them for years, often they produce even more sound (noise?) on stage, so to a degree are counter-productive. In fact, I've stopped using them. Might pose a question about sound in marquees...
Comment: That rule of thumb only applies to frequencies low enough that they radiate from all sides of the enclosure. Putting enclosures in corners heavily emphasizes the bass frequencies since the highs done radiate from the back and then get bounce out by the walls. I would say you can't expect to get these boosts at frequencies above 500 Hz for the vast majority of enclosures, and usually the cutoff will be lower than that.
Answer: There are some omitted important factors that go into answering this question for yourself:

Audience
Venue
Genre
Purpose

You want the level to reflect what the audience expects. Teenagers dancing will expect and tolerate louder music than retirees eating brunch.
You want to respect the venue. Bar owners and managers will get annoyed if their bartenders can't hear drink orders over the sound of your band. Venues are also responsible for complying with noise ordinances.
Different genres create different audience and venue expectations. You will probably annoy both of the above categories if you try to play folk-rock at a heavy metal volume or vice-versa.
What the music is being played for also interacts with the above factors. If you're playing at a bar, the ultimate intention for your music is that it will attract more customers to buy more beer. You want it to be loud enough to excite the drinkers and make them dance and get thirsty, but not so loud that bartenders can't work. If you're a worship band, then making sure the people in the back can hear and sing along with the music without deafening the devoted in the front is your balancing act.
So we can't answer your question but it's an important question for you to answer. A dB meter is one of my important live sound tools. You can get one for not too much and use it to calibrate your ears and expectations. In general, you don't want any part of the room to be louder than 120 dB since that can cause pain and rapid permanent hearing loss. I like to get my hard rock bar mixes to be between 100 and 110 dB at mix position and under 100 at the bar, if possible (usually bars are far from the stage in the better laid out bars).


GWT : two DOM events on same div, priority and how to deactivate the second event when the first is called?

Question: I've got a Widget which have two Dom mouseDown handlers :
First, I code with GWT but I think the problem is probably Javascript related.
One of this handler registration is defined in a class named Resizable which allows my widget to be resizable.
The second handler registration is defined in a class named Draggable which allows my widget to be draggable.
So, in each constructor of these two classes (giving the widget in argument), I've got :
widget.addDomHandler(this, MouseDownEvent.getType());

I want to prioritize my dom event to force the Resizable handler to be called first and only after the Draggable handler. How can I achieve it ?
Moreover, I want to stop the event if the resizable handler is called.
I tried the event.stopPropagation() function but it seems that the event can only be stopped for parents and not for a similar event on the same widget.
How can I stop this event to avoid the draggable handler to be called if my widget is resizable ?
I precise that these two classes are completely independant as my widget can be Resizable but not Draggable, draggable and not resizable or both. So if I can, I want to avoid code intersection between these two classes.
Thanks
Answer: Did you try event.cancel() instead of event.stopPropagation()? That might help!


Performing Transaction based on previous Transactions in Authorize.NET CIM

Question: I am new to Authorize.NET. Is reference transaction possible in authorize.net. For example: User A comes and enters the Credit Card details for first time, he does the payment. Now for the second time onwards when he does the payment the details of the previous transaction has to be used (i.e. he will not be entering the details again, the first payment details has to be used by default) and payment has to be done. Is there any such option available in Authorize.NET CIM service.
I am using Authorize.NET SDK from https://github.com/AuthorizeNet/sdk-dotnet
This provides me the functions for CIM, but not sure how to use above mentioned scenario. Using PayFlow Pro we can successfully do it (Reference Transaction Concept), Does CIM of authorize.NET provides this feature using CIM.
I am able to authorize the credit card and based on the response("AuthorizationCode") I did capture. Now after that from the capture response parameters I tried to do another transaction. But failed and got the error message : This transaction has been submitted already.
Answer: What you are asking for is exactly what CIM does. CIM allows you to create a customer payment profile which stores the customer's credit card details on the Authorize.Net server and returns you an ID to reference it. Whenever that customer wishes to make future payments you simply reference that ID to make the payment. The customer does not need to provide you with any additional information.
The error message you are receiving indicates you are not using CIM but AIM (Advanced Integration Method). That is different and unrelated to CIM. To use CIM you must use the CIM API.
Answer: This answer is specific to the authorize.net .Net SDK, using C#.
You should locally store the CIM profileID (unique identifier to the customer profile) and the CIM paymentprofileID(s) (unique identifier(s) for each payment card added to the customer profile). So your customer/user records should have a way to store these two integers.
The documentation from authorize.net for how to use CIM within their .Net SDK, is abysmal at best. I tried to get support from them and they constantly said that the SDK doesn't support CIM, which isn't true because all the methods to use it are there. I'll provide a few lines of code which should point you in the right direction for making use of this powerful tool.
Everything is assuming you are writing code in a class file that is "using AuthorizeNet", and that you have the latest DLLs from authorize.net.
First, the AuthorizeNet class has an "Address" type. This stores address info for either a CIM profile or CIM payment profile. Here's a simple method I built to build an Address object:
private static Address getAddressObject(string fname, string lname, string address, string city, string state, string zip, string phone)
        {
            var a = new Address();
            a.First = fname;
            a.Last = lname;
            a.Street = address;
            a.City = city;
            a.State = state;
            a.Zip = zip;
            a.Phone = phone;
            return a;
        }

Use that method to build one or multiple address objects (shipping, billing, credit card specific, etc), and have them ready for when you interact with the gateway.
Now, create a CustomerGateway object
CustomerGateway cg = new CustomerGateway(loginInfo[0], loginInfo[1], ServiceMode.Live);

Now create an empty Customer object
Customer cust;

At this point, you have two choices:
Look to see if the CIM profile exists by using your locally stored CIMprofileid:
cust = cg.GetCustomer(rdr["CIMprofileID"].ToString());

-or-
Create a new CIMprofile
cust = cg.CreateCustomer(email, description);

Once you have cust set, you can get the CIM profileID from cust.ProfileID
Now, to create a new CIM payment profile using cg.AddCreditCard(). There are 3 overloads for this, #2 adds CVV number, and #3 has the ability to drop in the Address object for AVS. If you do string paymentprofileid = cg.AddCreditCard(), paymentprofileid becomes the number you should store for that credit card, so that you can charge it again in the future. While you can look these up, the card number that CIM returns is formatted as 'XXXX1234', so it can become difficult to match up at a later time.
Once you have these values You can use documented methods to charge a CIM profile card. Best of luck!
Comment: Thank you for the wonderful explanations Kudos!!.. I got the point you are trying to convey.


how to burn macOS installer to a bootable DVD

Question: I have downloaded
/Applications/Install macOS High Sierra.app
I'd like to burn an .iso file I can install in VirtualBox on a newer mac that runs Catalina.
Thanks
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Answer: You do not use an .iso to install High Sierra. You use a .vdi instead.

I have had problems using any of the version 7 Virtual Box releases when the host is Catalina. This answer was tested using VirtualBox version 6.1.44 on 2013 iMac with macOS Catalina version 10.15.7 installed.

The steps to create the .vdi are given below. Here I assume your Install macOS High Sierra application is complete. In other words, the size of the application should be about 5.24 GB.

Set the variable SIZE to be the size of the disk images to be created, which will contain the High Sierra installer files. Here a value of 16 GiB was chosen. Since both disk images will be dynamically allocated, the actual physical space occupied by each disk image file will be about 5 to 6 GB.
SIZE="$((2**34))"

Create a new dynamically allocated disk image containing a JHFS+ formatted volume named MyVolume. The image will be stored in the file named HighSierraInstaller.sparseimage.
hdiutil create -size $SIZE -fs jhfs+ -volname MyVolume -type SPARSE -attach HighSierraInstaller

Set the variable ID to the identifier assign to the attached image. This identifier can be set manually after observing the output from the previous step or can be set by entering the commands given below.
ID="$(diskutil info MyVolume | grep -i "Part of Whole")"
ID="${ID##* }"

Write the High Sierra installer files to the volume named MyVolume. The volume name will change to Install macOS High Sierra.
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

(This step is optional.) VirtualBox has been known to boot to an UEFI shell instead of from the Install macOS High Sierra volume. Adding the following startup.nsh file will cause an UEFI shell to automatically execute the macOS High Sierra installer boot file.
echo -E '\System\Library\CoreServices\boot.efi' >'/Volumes/Install macOS High Sierra/startup.nsh'

Unmount the volume named Install macOS High Sierra.
diskutil unmountdisk $ID

Create the dynamically allocated disk image file HighSierraInstaller.vdi. This file is compatible with VirtualBox.
dd if=/dev/r$ID bs=1m | VBoxManage convertfromraw stdin HighSierraInstaller.vdi $SIZE

The "Oracle® VirtualBox® User Manual Version 7.0.12" states the following:

Note: For compatibility with earlier versions of Oracle VM VirtualBox, you can use
the VBoxManage convertdd command instead of the VBoxManage convertfromraw
command.

Eject the disk image containing the volume named Install macOS High Sierra.
hdiutil detach $ID

Remove the original disk image file HighSierraInstaller.sparseimage.
rm HighSierraInstaller.sparseimage

When finished, edit the VirtualBox settings for the High Sierra virtual machine. Add HighSierraInstaller.vdi as a second hard disk. The image below shows the second disk added to the virtual machine named "High Sierra".

I would also recommend setting the number processors to at least 2 CPUs, as shown below.

Next, start the virtual machine and install High Sierra. Do not forget to use the Disk Utility to initialize the first drive. If you encounter a display similar to the image shown below, then select the Cancel button to proceed with the installation.

After you are finished installing High Sierra, you can edit the settings and remove the second drive.
Answer: Normally Apple will not let you run older than macOS shipped with a Mac.
Command softwareupdate in Terminal tells you what macOS version(s) can be downloaded and installed on your Mac:
softwareupdate --list-full-installers

Source: How to Download Full MacOS Installers from Command Line
Comment: The command `softwareupdate --list-full-installers` does not work with Catalina.
Comment: Often you can run versions of OS X/macOS in a virtual machine as a guest even when the same version will not run on the host Mac. Apple allows Mountain Lion (10.8) through Catalina (10.15) to run on my 2013 iMac. However, I can run Snow Leopard (10.6) through Monterey (12) in various virtual machines as guests.
Comment: OP isn't asking how to download, but [correctly or incorrectly] how to burn to DVD. This doesn't attempt to answer that question, nor even challenge its assumption.


Kernel parameter quiet versus loglevel=4 and debug versus loglevel=7

Question: Besides the possibility of userspace applications that care which one you use reading /proc/cmdline, what is the difference between using the kernel parameter quiet, versus loglevel=4, and the parameter debug, versus loglevel=7? Is there any?
Answer: Nope, they're absolutely the same.  The following is a quote from Linux Kernel in a Nutshell by Greg Kroah-Hartman

debug
Enable kernel debugging.
Cause the kernel log level to be set to the debug level, so that all
  debug messages will be printed to the console at boot time.

quiet
Disable all log messages.
Set the default kernel log level to KERN_WARNING (4), which
  suppresses all messages during boot except extremely serious ones.
  (Log levels are defined under the loglevel parameter.)
Answer: I don't see any messages with quiet or loglevel=0. I do see a (innocuous) message of failure with a value between 1-3 for loglevel. I see even more messages with values higher than that. It seems quiet is the same as loglevel=0, and debug is the same as loglevel=7.


Is this sentence 100% correct? "Are you going to be in the library at lunch today? "

Question: All I'm trying to ask is whether or not my friend is going to be available in the library at the time of lunch(12:00).  Even though I'm bilingual/multilingual in three different languages including English, lately some aspects of the language has been confusing to me as I'm learning a new language.
Comment: I'd use lunchtime rather than lunch (but that might just be habit).
Comment: I'm trying subtly to point out that your text is (a) ungrammatical (some aspects ... has) and (b), if as intended, contradictory ('I'm ... multilingual in three different languages including English ... ... [but] I'm learning a new language (which can only be English)'.
Answer: Since you are referring to a specific time when you say lunch, I would say "...during lunch?".
Comment: That seems more relevant. How would you go about asking the same question with your peers, in a very casual manner?
Comment: I would say your sentence is very casual as it is.
Comment: Does there exist a very formal version which is significantly distinct from this one?
Comment: I think you are overthinking this. Although, there could be dozens of different ways to ask this question, the idea is very straight forward. So, it cannot be and should not be made more complicated.
Answer: 'At lunch' meaning 'at lunchtime' is a usage I was familiar with in grammar school 50 years ago. It's isoformal with 'at break', 'at hometime', 'at Christmas'. And while it could have the locative sense, it defaulted to the temporal (but context was / is important. With some sentences with obvious locatives [Will you be in the library / refectory / cafe ...], the temporal sense is almost forced.

I'll see you at break / lunch / hometime.
We must get together at Christmas.

But contrast

I'll be at lunch in the pub. [non-temporal]
I'll be in the pub at lunch. [most likely temporal, sans other
  context]

'At' really demands a punctive (non-durative) prepositional object, and 'Christmas', 'lunch', and (more reasonably! ... 15 minutes, as I recall) 'break', and  'hometime', are treated as such here.
Though 'at Christmas' shows that broadening of the punctive into the notionally punctive is often quite acceptable (the duration of 'Christmas' being a movable feast :)), I'd say 'at lunchtime' is more natural sounding than 'at lunch' nowadays. 'During lunchtime' is also perfectly acceptable, but hints at 'at some time during lunchtime'.
Comment: I looked up *isoformal*. While it seems to have extensive usage in chemistry, its usage in linguistics seems non-existent. But it's a great word, and understandable in its linguistic context.
Comment: I've used it here before (and addressed queries like yours). I bet OED has the broad definition, 'having the same form'. / In a way it's a weasel-word. _Are we talking surface structure, or **deep structure** number 37?_ I mean here 'strings 'at X' where X is a noun perhaps metonymically referencing a period, but where the period is being treated as notionally punctive rather than (as it actually is) durative'. _Isoformal._ Saves a lot of wear on the fingers.
Answer: I guess there may be a small ambiguity - it could be (unlikely) construed as asking if the person will be lunching at the library. If you want to make it more precise, you could say 'Are you going to be in the library at lunchtime?'
Of course, this is assuming that both you and your interlocutor understand 'lunchtime' to be noon - there could be confusion if your lunchtime is different from theirs!
Answer: It sounds like "the lunch is being served in the library today..."
"Are you going to be in the library today during lunch time?"could be a better option.