What is the difference between a symbolic link and a hard link?

Question: Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs from a symbolic one.
Comment: I find this link very useful to understand it. http://askubuntu.com/questions/108771/what-is-the-difference-between-a-hard-link-and-a-symbolic-link
Comment: about 'do not understand the use of a hard link', it can be used in build systems which do lot of copying of binaries. Creating hard link instead of actual copy speeds things up. MSBuild 4.0 supports this.
Comment: [unix.stackexchange has a good list of bullet points](http://unix.stackexchange.com/questions/9575/what-is-the-difference-between-symbolic-and-hard-links)... very helpful because it lays out all the constraints very concisely and is easy to skim. (lots of these bullet points cover edge cases/caveats that are only mentioned in the comments of this question... or aren't mentioned at all)
Comment: https://www.youtube.com/watch?v=lW_V8oFxQgA
Comment: In addition to the answers here that explained the differences, I searched for when to use hard links vs symbolic links, and the answer to that also helped answer the difference.: https://stackoverflow.com/a/58320774/2133723
Answer: Underneath the file system, files are represented by inodes. (Or is it multiple inodes?  Not sure.)
A file in the file system is basically a link to an inode.
A hard link, then, just creates another file with a link to the same underlying inode.
When you delete a file, it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.
A symbolic link is a link to another name in the file system.
Once a hard link has been made the link is to the inode. Deleting, renaming, or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.
Comment: You might want to add the useful feature that symbolic links can cross filesystems, hard links cannot (they must refer to a file on the same filesystem).
Comment: There is a good visual explanation in an [article on Linux Gazette](http://linuxgazette.net/105/pitcher.html)
Comment: I'm sure the i-nodes depend on the particular variant of the OS; however, I believe it is usually a single i-node.  The i-node has info about the file and info about where the data is stored on disk.  Large files will have indirect pointers to additional tables.
Comment: @Zen: You have one root. But you can mount filesystems anywhere in the tree. Each partition has its own filesystem and you can even mount filesystems from other machines with nfs etc...
Comment: @zen: I don't like your DNS example as it adds too many other layers of indirection and depends how you interpret these layers. Personally I see all DNS as examples of soft links (if I change www.c.com from 10.10.10.10 to 10.10.10.11 it can still serve a file but it is not the same as the original file. A hard link is a link to the inode and thus explicitly the data. No matter what you do with the file the file always points at the same inode and thus the same data.
Comment: @ThunderWiring: A symbolic link (soft link) is a link from one file name to another file name. When you open a symbolic link the file system follows the chain of links until it reaches a real file. Then it uses the real file to access the underlying iNode data. The command `readlink -f ` will follow a symbolic chain to the real file.
Comment: I also wrote a blog on that after some reading and experiments http://csharpbsharp.tumblr.com/
Comment: One more thing to add is that a link (or hard link) can not cross even partitions on the same disk. So, a link must be local to the file system. A soft link (or symbolic link), on the other hand, can cross any boundary (i.e. partition, disk) as long as it is local to the machine.
Comment: What does span file system mean? Doesn't I  can only own 1 file system under my Linux machine?
Comment: @zen: You can unmount/remount a file system any time it is not being used. For the root partition this is a bit tricky but it can be done (not recomended). To do it for the root it is usually best to boot of a rescuse CD first modify the mounts and re-boot. But you should ask this kind of question on super user.
Comment: IOW, the first link to a file is*not* the file. If you create a file with `touch foo`, and then create a second link with `ln foo bar`, and then delete the original link with `rm foo`, you have *not* deleted the "original file" because "foo" is *not* the file.  `foo` is just the first hard link to the file.
Comment: @LokiAstari. This morning I coincidentally used `df -h` and saw `Filesystems` and `Mounted on` column, suddenly I understand what's multiple filesystem. My `/` is mounted on `/dev/xvda2`, I guess I can't remount it to other disk blocks unless at the installation period of Linux?
Comment: And for my understanding, hard-link is another link pointed to the source of the previous file refers to, Like `www.a.com` and `www.b.com` both refers to `test.html`. And soft-link just point to a path, no matter what it is inside. Like `www.c.com` always redirect users to `www.a.com`,  no matter how the content varies in `www.a.com`. Is my understanding accurate?
Comment: Could you clarify what's the meaning of "..link to another name in the file system"? How can the name help accessing the intended inode?
Comment: Why can directories not be used as the source file for hard links?
Comment: See  book for detail explanation of inode.
Comment: That Linux Gazette article mentioned in the comment above is **incredibly helpful**.  Thanks, @Rodrigue !
Comment: Perhaps this is mere pedantry, but I think the statement "deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode" is misleading.  Deleting the original link to the file will not have an affect on other links to the file, but deleting the file absolutely has an impact on all links to it.  It's not typically possible to delete the file without removing all links from the file system, but (for example), if you took a large magnet and deleted the data from all of the blocks of the file, all links would be affected.
Comment: @WilliamPursell: Would changing: `deleting renaming or moving the original file` to `deleting renaming or moving the original 'file system' file` satisfy your pedantry? I personally think I cover this two lines above with: `When you delete a file it removes one link to the underlying inode.` but I am happy to update the wording if you want to give me some specific pointers on better wording.
Comment: I think a better wording would be `deleting, renaming, or moving the original link to the file`.
Comment: @WilliamPursell I see were you are coming from. But a user of the file system does not look at it like a link (a link implies a symbolic link from the perspective of the file system). From there perspective they are working with files. Just because underneath the File System is another system that actually stores the file. How about `deleting, renaming, or moving the original file (hard link to the inode)` I have to ware my pedant hat too.
Comment: You haven't said what a "name" is. I believe you mean "file" according to the explanation you gave for hard links. Upvoting the answer below as it makes things clearer using a diagram
Answer: As the saying goes, a picture is worth a thousand words. Here is how I visualize it:

Here is how we get to that picture:

Create a name myfile.txt in the file system that points to a new inode (which contains the metadata for the file and points to the blocks of data that contain its contents, i.e. the text "Hello, World!":
$ echo 'Hello, World!' > myfile.txt

Create a hard link my-hard-link to the file myfile.txt, which means "create a file that should point to the same inode that myfile.txt points to":
$ ln myfile.txt my-hard-link

Create a soft link my-soft-link to the file myfile.txt, which means "create a file that should point to the file myfile.txt":
$ ln -s myfile.txt my-soft-link

Look what will now happen if myfile.txt is deleted (or moved): my-hard-link still points to the same contents, and is thus unaffected, whereas my-soft-link now points to nothing. Other answers discuss the pros/cons of each.
Comment: Maybe I'm slow, but your picture just cleared up 20 years of mystery in about 2 seconds.
Comment: @user463035818 Yes, I made that visualization myself in Keynote. The author of that article just copied the image. Also, that article was published in 2017, whereas my answer was published in 2015.
Comment: Most useful answer, I'm mad this is buried so deeply in this post. I would give you a hundred internet points but sadly I can only give you one.
Comment: @ThunderWiring By "point", I mean whatever the link references. In the case of a hard link, it references an inode directly (i.e. the same inode that is referenced by `myfile.txt`). For the soft link, it's reference is not the inode (which contains the data), but rather it's reference is the file system path to `myfile.txt` (e.g. `/home/Documents/myfile.txt`)
Comment: Probably the best explanation man...and and this answer should be as accepted answer.
Comment: I've been trying to formalize this for some time so I can explain it to a colleague. This is the clearest answer that illustrates the first one. Thank you :-)
Comment: The illustration in this answer combined with the description in the accepted answer   helped me.
Comment: Could you explain how a file can point to another file? How can this be interpreted in terms of Inodes for both files?
Comment: "Here is how I visualize it:"  Is it really your visualization? Just asking, because I found the exact same picture [here](https://medium.com/@krisbredemeier/the-difference-between-hard-links-and-soft-or-symbolic-links-780149244f7d)
Comment: i didnt want to accuse you, its just easier to comment and get feedback here than on a blog. I am quite allergic to "just copying" stuff so i wanted to know who was first (could have compared the dates, but wasnt clever enough ;)
Comment: actually i dont care about legal issues, but i feel fooled when reading something that (implicitly) claims that its original work
Comment: Could someone expand this picture for how directories relate to the entries on this graph?
Answer: Some examples that might help.
Create two files with data in them:
$ printf Cat > foo
$ printf Dog > bar

Create a hard and soft (aka symbolic) link:
$ ln foo foo-hard
$ ln -s bar bar-soft

List directory contents in long format by increasing size:
ls -lrS
lrwxr-xr-x   1 user  staff        3  3 Apr 15:25 bar-soft -> bar
-rw-r--r--   2 user  staff        4  3 Apr 15:25 foo-hard
-rw-r--r--   2 user  staff        4  3 Apr 15:25 foo
-rw-r--r--   1 user  staff        4  3 Apr 15:25 bar

This tell us that

1st column: the file mode for the soft and hard links differ

soft link: lrwxr-xr-x

filetype: l = symbolic link
owner permissions: rwx = readable, writable, executable
group permissions: r-x = readable, not writable, executable
other permissions: r-x = readable, not writable, executable

hard link: -rw-r--r--

filetype: - = regular file
owner permissions: rw- = readable, writable, not executable
group permissions: r-- = readable, not writable, not executable
other permissions: r-- = readable, not writable, not executable

2nd column: number of links is higher for the hard linked files

5th column: the size of the soft link is smaller, because it's a reference as opposed to a copy

last column: the symbolic link shows the linked-to file via ->

Changing the filename of foo does not affect foo-hard:
$ mv foo foo-new
$ cat foo-hard
Cat

Changing the contents of foo is reflected in foo-hard:
$ printf Dog >> foo
$ cat foo-hard
CatDog

Hard links like foo-hard point to the inode, the contents, of the file.
This is not the case for soft links like bar-soft:
$ mv bar bar-new
$ ls bar-soft
bar-soft
$ cat bar-soft
cat: bar-soft: No such file or directory

The contents of the file could not be found because the soft link points to the name, that was changed, and not to the contents.
Likewise, If foo is deleted, foo-hard still holds the contents; if bar is deleted, bar-soft is just a link to a non-existing file.
Comment: does this imply that a "file" and a "hard link" are the same, both pointing to an inode? on deleting file or hard link, the contents still exist as long as one is still pointing to the inode right?
Comment: @DmitriZaitsev True, but it will be less readable for beginners IMO.
Comment: I think this is best-understandable answer with respect to many answers I've read. A sample is better than bunch of explanation text.
Comment: @DanFromGermany Correct. The content is reachable as long as at least one hard link (i.e., file) is pointing at it.
Comment: `touch blah1; touch blah2` can be shortened to `touch blah1 blah2`
Comment: You can also run `ls -lia` to see the actual inode# associated with each file.
Comment: @Bibhas Copying a file duplicates the entire inode hierarchy of the original file.
Answer: Hard links are useful when the original file is getting moved around.  For example, moving a file from /bin to /usr/bin or to /usr/local/bin.  Any symlink to the file in /bin would be broken by this, but a hardlink, being a link directly to the inode for the file, wouldn't care.
Hard links may take less disk space as they only take up a directory entry, whereas a symlink needs its own inode to store the name it points to.
Hard links also take less time to resolve - symlinks can point to other symlinks that are in symlinked directories.  And some of these could be on NFS or other high-latency file systems, and so could result in network traffic to resolve.  Hard links, being always on the same file system, are always resolved in a single look-up, and never involve network latency (if it's a hardlink on an NFS filesystem, the NFS server would do the resolution, and it would be invisible to the client system).  Sometimes this is important.  Not for me, but I can imagine high-performance systems where this might be important.
I also think things like mmap(2) and even open(2) use the same functionality as hardlinks to keep a file's inode active so that even if the file gets unlink(2)ed, the inode remains to allow the process continued access, and only once the process closes it does the file really go away.  This allows for much safer temporary files (if you can get the open and unlink to happen atomically, which there may be a POSIX API for that I'm not remembering, then you really have a safe temporary file) where you can read/write your data without anyone being able to access it.  Well, that was true before /proc gave everyone the ability to look at your file descriptors, but that's another story.
Speaking of which, recovering a file that is open in process A, but unlinked on the file system revolves around using hardlinks to recreate the inode links so the file doesn't go away when the process which has it open closes it or goes away.
Answer: Soft Link:
soft or symbolic is more of a short cut to the original file....if you delete the original the shortcut fails and if you only delete the short cut nothing happens to the original.
Soft link Syntax: ln -s   Pathof_Target_file  link
Output : link -> ./Target_file
Proof: readlink  link
Also in ls  -l  link output you will see the first letter in lrwxrwxrwx as l which is indication that the file is a soft link.
Deleting the link: unlink  link
Note: If you wish, your softlink can work even after moving it somewhere else from the current dir. Make sure you give absolute path and not relative path while creating a soft link. i.e.(starting from /root/user/Target_file and not ./Target_file)
Hard Link:
Hard link is more of a mirror copy or multiple paths to the same file. Do something to file1 and it appears in file 2.
Deleting one still keeps the other ok.
The inode(or file) is only deleted when all the (hard)links or all the paths to the (same file)inode has been deleted.
Once a hard link has been made the link has the inode of the original file. Deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
Hard Link syntax: ln   Target_file   link
Output: A file with name link will be created with the same inode number as of Targetfile.
Proof: ls -i   link   Target_file  (check their inodes)
Deleting the link: rm  -f  link (Delete the link just like a normal file)
Note: Symbolic links can span file systems as they are simply the name of another file. Whereas hard links are only valid within the same File System.
Symbolic links have some features hard links are missing:

Hard link point to the file content. while Soft link points to the
file name.
while size of hard link is the size of the content while soft link is
having the file name size.
Hard links share the same inode. Soft links do not.
Hard links can't cross file systems. Soft links do.
you know immediately where a symbolic link points to while with hard
links, you need to explore the whole file system to find files
sharing the same inode.
# find / -inum 517333

/home/bobbin/sync.sh
/root/synchro

hard-links cannot point to directories.

The hard links have two limitations:

The directories cannot be hard linked. Linux does not permit this to maintain the acyclic tree structure of directories.
A hard link cannot be created across filesystems. Both the files must be on the same filesystems, because different filesystems have different independent inode tables (two files on different filesystems, but with same inode number will be different).
Comment: "while size of hard link is the size of the content while soft link is having the file name size." Just to clarify, making another hard link does only affect the free space by a few bytes.
Answer: A simple way to see the difference between a hard link and a symbolic link is through a simple example. A hard link to a file will point to the place where the file is stored, or the inode of that file. A symbolic link will point to the actual file itself.
So if we have a file called "a" and create a hard link "b" and a symbolic link "c" which all refer to file "a" :
echo "111" > a
ln a b
ln -s a c

The output of "a", "b", and "c" will be :
cat a --> 111
cat b --> 111
cat c --> 111

Now let's remove file "a" and see what happens to the output of "a", "b", and "c":
rm a
cat a --> No such file or directory
cat b --> 111
cat c --> No such file or directory

So what happened?
Because file "c" points to file "a" itself, if file "a" is deleted then file "c" will have nothing to point to, in fact it is also deleted.
However, file "b" points to the place of storage, or the inode, of file "a". So if file "a" is deleted then it will no longer point to the inode, but because file "b" does, the inode will continue to store whatever contents belonged to "a" until no more hard links point to it anymore.
Comment: It might be helpful to point that, a file is a very abstract object and has with all abstract things, the real intent of high level implementations can fall short of proper explanation without risking blowing off abstractions.
Comment: Is hardlink slower than symbolic link? Since hardlink work like copying
Answer: Symbolic links link to a path name. This can be anywhere in a system's file tree, and doesn't even have to exist when the link is created. The target path can be relative or absolute.
Hard links are additional pointers to an inode, meaning they can exist only on the same volume as the target. Additional hard links to a file are indistinguishable from the "original" name used to reference a file.
Comment: Also, when you remove the file you link to, a symbolic link gets broken, a hard link remains valid, because it "keeps" the file in the file system.
Answer: I would point you to Wikipedia:

Symbolic link
Hard link

A few points:

Symlinks, unlike hard links, can cross filesystems (most of the time).
Symlinks can point to directories.
Hard links point to a file and enable you to refer to the same file with more than one name.
As long as there is at least one link, the data is still available.
Comment: You are pointing to a link to an article... does that make you a symbolic link?
Comment: In theory (and in some cases even in practice) hard links can point to directories as well (in fact "." is a hard link to the current directory and ".." is a hard link to the parent directory). But they can be dangerous, so most UNIXes don't allow them (or require you to take special steps to take it). Apple uses them for their time machine implementation for example: http://earthlingsoft.net/ssp/blog/2008/03/x5_time_machine
Comment: @JoachimSauer Do you think that the new Apple file system will eliminate the need for Time Machine to use hard links to directories?
Comment: I found wikipedia's explanation significantly shorter and more concrete than explanations in best-rated answers.
Answer:
Hard link Vs Soft link can be easily explained by this image.
Comment: I  guess your soft link pic is not right. Point: the inode of soft link should not point to the inode of original file. Cause if you rename the original file , the related soft link is dead
Comment: @percy507 yes you are right - but I still find it a very nice and intuitive explanation. Just imagine that the arrow between inodes isn't there...
Answer: Hard links are very useful when doing incremental backups. See rsnapshot, for example. The idea is to do copy using hard links:

copy backup number n to n + 1
copy backup n - 1 to n
...
copy backup 0 to backup 1
update backup 0 with any changed files.

The new backup will not take up any extra space apart from any changes you've made, since all the incremental backups will point to the same set of inodes for files which haven't changed.
Answer: From MSDN,
Symbolic link

A symbolic link is a file-system object that points to another file system object. The object being pointed to is called the target.
Symbolic links are transparent to users; the links appear as normal
  files or directories, and can be acted upon by the user or application
  in exactly the same manner.
Symbolic links are designed to aid in migration and application
  compatibility with UNIX operating systems. Microsoft has implemented
  its symbolic links to function just like UNIX links.
Symbolic links can either be absolute or relative links. Absolute
  links are links that specify each portion of the path name; relative
  links are determined relative to where relative–link specifiers are in
  a specified path

An example of Absolute Symbolic Link
X: "C:\alpha\beta\absLink\gamma\file"
Link: "absLink" maps to "\\machineB\share"
Modified Path: "\\machineB\share\gamma\file"

An example of Relative Symbolic Links
X: C:\alpha\beta\link\gamma\file
Link: "link" maps to "..\..\theta"
Modified Path: "C:\alpha\beta\..\..\theta\gamma\file"
Final Path: "C:\theta\gamma\file"

Hard link

A hard link is the file system representation of a file by which
  more than one path references a single file in the same volume.

To create a hard link in windows, navigate to where link is to be created and enter this command:
mklink /H Link_name target_path

Note that you can delete hard links any order, regardless of the order in which they were created. Also, hard links can not be created when

references are in different local drives
references include network drive. In other words, one of the references is a network drive
hard link to be created is in the same path as the target

Junction
NTFS supports another link type called junction. MSDN defines it as follows:

A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories, and a junction can link directories located on different local volumes on the same computer. Otherwise, junctions operate identically to hard links.

The bolded parts in hard link section and junction section show the basic difference between the two.
Command to create a junction in windows, navigate to where link is to be created and then enter:
mklink /J link_name target_path

Answer: This answers is for Web Developers :
Hard Link: like pointing different domain names to the same host
* abc.com and def.com -> points to the IP 18.104.22.168
* abc.com and def.com -> files in linux
* IP -> inode in linux
* By deleting the domain abc.com users still access your website through def.com or vice versa
* Mutation through abc.com will affect def.com and vice verca

Sym Link : redirecting one domain to another domain
* accessing abc.com will redirect to def.com as you've accessed def.com directly
* removing the def.com domain will break the link abc.com

Answer: Simply , Hard link : is just add new name to a file, that's mean , a file can have many name in the same time, all name are equal to each other, no one preferred, Hard link is not mean to copy the all contents of file and make new file is not that, it just create an alternative name to be known..
Symbolic link (symlink) : is a file pointer to another file, if the symbolic link points to an existing file which is later deleted, the symbolic link continues to point to the same file name even though the name no longer names any file.
Answer: Also:

Read performance of hard links is better than symbolic links (micro-performance)
Symbolic links can be copied, version-controlled, ..etc. In another words, they are an actual file. On the other end, a hard link is something at a slightly lower level and you will find that compared to symbolic links, there are less tools that provide means for working with the hard links as hard links and not as normal files
Answer: What you think of as an ordinary "file" is actually two separate things: The data of a file, and a directory entry. When you create a hard link for a file, you actually create a second directory entry which refers to the same data. Both directory entries have the exact same functionality; each one can be used to open the file to read it. So you don't really have "a file plus a hard link", you have "file data with two directory entries". What you think of as deleting a file actually deletes a directory entry, and when the last directory entry for the data is deleted, then the data itself is deleted as well. For ordinary files that have only one directory entry, deleting the directory entry will delete the data as always. (While a file is opened, the OS creates a temporary link to the file, so even when you delete all directory entries, the data stays but disappears as soon as you close the file).
As an example, create a file A.txt, a hard link B.txt, and delete A.txt. When you created A.txt, some data was created, and a directory entry A.txt. When you created the hard link, another directory entry B.txt was created, pointing to the exact same data. When you delete A.txt, you still have all the data and a single directory entry B.txt, exactly as if you had create a file B.txt in the first place.
A soft link is just an (almost) ordinary file, except that it doesn't contain data, but the path of another directory entry. If you delete the file that the soft link refers to, then the soft link will contain a path that doesn't point to a directory entry anymore; it is broken. If you delete the soft link, it's like deleting any other file, the file it points to is unaffected.
Answer: A directory entry is link a structrue:
struct dentry{
    ino_t ino;
    char  name[256];
}

the ino is the number of inode, the name is the file name, inode structure maybe like:
struct inode{
      link_t nlink;
      ...
}

for example you creat a file /1, the directory entry maybe like:
struct dentry{
     ino_t ino; /* such as 15 */
     char  name[256]; /* "1" */
}

the inode struct maybe like:
   struct inode{ /* inode number 15 */
         link_t nlink; /* nlink = 1 */
         ...
    }

then you create a hard link(may be /100), the directory entry maybe like:
  struct dentry{
     ino_t ino; /* 15 */
     char  name[256]; /* 100 */
  }

the inode struct maybe like:
   struct inode{ /* inode numebr 15 */
         link_t nlink; /* nlink = 2 */
         ...
    }

then you create a symbolic link(may be /200) to file 1, the directory entry maybe like:
  struct dentry{
        ino_t ino; /* such as 16 */
        char  name[256]; /* "200" */
  }

the inode struct maybe like:
   struct inode{ /* inode number 15 */
         link_t nlink; /* nlink = 2 */
         ...
    }

   struct inode{ /* inode number 16 */
         link_t nlink; /* nlink = 1 */
         ...
    } /* the data of inode 16 maybe /1 or 1 */

Answer: My two cents on usage:
Soft links may be used to shorten long path names, i.e.:
ln -s /long/folder/name/on/long/path/file.txt /short/file.txt

Changes made to /short/file.txt will be applied on the original file.
Hard links may be used to move around big files:
$ ls -lh /myapp/dev/
total 10G
-rw-r--r-- 2 root root 10G May 22 12:09 application.bin

ln /myapp/dev/application.bin /myapp/prd/application.bin
Instant copy to different folder, and original file (on /myapp/dev) may be moved or deleted, without touching the file on /myapp/prd
Answer: Adding to all the above answers, the difference in finding the hardlink and softlink file can be understood as below:
I have a file f6 in my current directory, as well as a directory named t2.
File named f1 and ./t2/f2 are symbolic links to f6.
File named f7 and ./t2/f8 are hard links of f6.
To find soft as well as hard link we can use:
$ find -L . -samefile f6

> ./f1
> ./f6
> ./f7
> ./t2/f2
> ./t2/f8

To find only hardlink we can use:
$ find . -xdev -samefile f6

> ./f6
> ./f7
> ./t2/f8

Since hardlinks can be created on the same file system, we can search all the hardlinks without -L option used (with -xdev option) in the same file-system/mount-point. It saves the unnecessary search into different mount points.
So searching the hardlink is somewhat faster then searching the softlinks(Please rectify if I am wrong or not clear).
Answer: Symbolic links give another name to a file, in a way similar to hard links. But a file can be deleted even if there are remaining symbolic links.
Comment: No. The symlink is not "another name for the same file", it is a file in its own right, linking to the target file.
Answer: I just found an easy way to understand hard links in a common scenario, software install.
One day I downloaded a software to folder Downloads for install. After I did sudo make install, some executables were cped to local bin folder. Here, cp creates hard link. I was happy with the software but soon realized that Downloads isn't a good place in the long run. So I mved the software folder to  source directory. Well, I can still run the software as before without worrying about any target link things, like in Windows. This means hard link finds inode directly and other files around.
Answer: IN this answer when i say a file i mean the location in memory
All the data that is saved is stored in memory using a data structure called inodes Every inode has a inodenumber.The inode number is used to access the inode.All the hard links to a file may have different names but share the same inode number.Since all the hard links have the same inodenumber(which inturn access the same inode),all of them point to the same physical memory.
A symbolic link is a special kind of file.Since it is also a file it will have a file name and an inode number.As said above the inode number acceses an inode which points to data.Now what makes a symbolic link special is that the inodenumbers in symbolic links  access those inodes which point to "a path" to another file.More specifically the inode number in symbolic link acceses those inodes who point to another hard link.
when we are moving,copying,deleting a file in GUI we are playing with the hardlinks of the file not the physical memory.when we delete a file we are deleting the hardlink of the file. we are not wiping out the physical memory.If all the hardlinks to file are deleted then it will not be possible to access the data stored although it may still be present in memory
Answer: hard link is unix like it is old one use in unix and then linux but symbolick link is new in linux.
hard link inode is same as original file inode. But symbolik link inode is different from original file inode.
Hard link file size in byte is same as original file size in byte. But symbolik link file size in byte is not as the original file size in byte. symbolick link file size is smaller then original file size.
Hard link is a mirror copy of original file . symbolick link or softlink is like shortcut in windows.
If you delete original file, hard link will remain its file and you can see hard link file content . In symbolick link, if you delete original file its symbolic link will broken and symbolick link still remain but it can not show symbolick link content.
Symbolick link is new and it is have many feature but hard link is old one thats why it is have less feature.
lets make some hard and symbolick link using terminal :
echo "why so serious" > file.txt
hard link:
ln file.txt file_hard
symbolick link:
ln -s file.txt file_sym
lets see there content with inode :
ls -li
Answer: I just found an easy way to understand hard links in a common scenario, software install.
One day I downloaded a software to folder Downloads for install. After I did sudo make install, some executables were cped to local bin folder. Here, cp creates hard link. I was happy with the software but soon realized that Downloads isn't a good place in the long run. So I mved the software folder to source directory. Well, I can still run the software as before without worrying about any target link things, like in Windows. This means hard link finds inode directly and other files around.
Comment: This answer is literally copied word for word from @themefield's answer from 2017.


Do jetliners carry radar that can detect other aircraft?

Question: If not, why not? For example, if a civilian jetliner is flying at night over the Ocean, or a remote area with no airports/ground radar stations, and another airplane is also heading towards it on a collision course, shouldn't the pilot be able to spot the oncoming airplane on its airborne radar to perform evasive maneuvers? My understanding is that military aircraft have such airborne radar, which I believe is called ACAS, so they need not depend on ATC/ground stations for collision avoidance.
Comment: Air Traffic Control is responsible for preventing collisions. In areas where there s no ATC, pilots position reports, traffic advisories, and TCAS do a good job preventing collisions. Airborne Weather Radar actually will pick up another aircraft, but it can't be relied on for accurate positioning.
Answer: Radar that can detect, resolve and track small targets as opposed to large areas of water (raindrops) has to be a lot more powerful and sophisticated, especially in ye olden tymes of the 50s and 60s when weather radar was becoming a thing and the search for a practical collision avoidance system was underway.
When the effort that eventually became TCAS got started in the late 50s following several notable midairs, on-board target detection was one of the early proposals but was rejected by the industry as too expensive and time consuming to develop (where to put the more powerful system with its larger antenna for starters).
Once TCAS was perfected, made possible by the development of Mode C altitude reporting by transponders, you got 95% of the benefit (because only non-Mode C-transponder light planes were still a risk - a very minor factor overall once Mode C was pushed out to GA aircraft) without a crazy expensive addition of on-board target detection and tracking radar PLUS a weather radar.
Answer:
Cessna Citation I weather radar.

SOCATA TBM 900, weather radar housed in the pod on the left wing
Weather radars are tiny compared to fire control radars. I believe this is because they do not need to collect as much info about their target as fire control radars. Further, they do not need to produce beams as narrow or as fast-moving as FCR's. Keep in mind that raindrops move much slower than aircraft, thus a weather radar does not need to track a flanking (moving sideways relative to the observer) target at 500 knots.

Zaslon AESA radar of the MiG-31, 1.4 meters in diameter.
FCR's consume significant electrical power and they require constant attention from their operator to be  directed to a certain part of the sky and be effectively used.
With TCAS/Mode C transponders onboard most aircraft, there is simply no reason to put an FCR on an airliner or any civilian aircraft for that matter. Most airliners don't even have a large enough radome to put an FCR in.
Answer: No, TCAS does not rely on ground based radar stations and it works perfectly well at night over the ocean. Each aircraft broadcasts messages, which include altitude, and listens for messages from other aircraft. If TCAS receives messages from another aircraft nearby that operates at the same altitude, it warns the pilots and advises them to climb or descend.
Unlike radar, TCAS only works if both aircraft are equipped with it.
Comment: TCAS *is* a form of radar. Also, the last sentence of this answer is incorrect - TCAS does not require both aircraft to be equipped with it. It's sufficient for one of the aircraft to have TCAS and the other to have a Mode C or Mode S transponder.
Comment: The question isn't about TCAS even though it has that tag. It simply asks if commercial aircraft have radar that can detect other planes.
Comment: @CareyGregory that is correct. Perhaps I should remove that TCAS tag.


How do I suppress "Yellow Text" from Exchange Set-Mailbox, when -WarningAction doesn't seem to work?

Question: I am doing a bulk import, setting or updating attribute6 on 1,000 users in AD.
I'm using the following Exchange commandlet to accomplish this:
<code> [PS] C:\>set-mailbox -Identity  firstname.lastname@example.com   -CustomAttribute6  firstname.lastname@example.com    -WarningAction:SilentlyContinue -ErrorAction SilentlyContinue
</code>
The above command is repeated 1000 times and is auto generated.
My problem is that I want to generate a list of errors that I can feed back upstream to resolve errors such as:

Missing user
Ambiguous user
Failure in setting attribute.

What I want to eliminate is the following text:

WARNING: The command completed successfully but no settings of 'company.com/Enterprise/Users/last, first' have been
  modified.

What I've tried was setting the following <code>-WarningAction:SilentlyContinue -ErrorAction SilentlyContinue</code>
It seems that either the exchange commandlets don't support this, or perhaps because Exchange Powershell commandlets use "remoting" with stubs may be complicating the error handling.
Answer: You can try setting the warning action before running the command:
<code>$oldWarningPreference = $WarningPreference
$WarningPreference = 'SilentlyContinue'
set-mailbox -Identity  firstname.lastname@example.com -CustomAttribute6 email@example.com -ErrorAction SilentlyContinue
$WarningPreference = $oldWarningPreference
</code>
Answer: Restart your shell session, your command should work as you expect. You could try -ErrorAction 0 and -WarningAction 0 but these are just aliases.
Comment: I attempted this in a new Powershell session.  It did not work.
Comment: this should work.. are you using `new-pssession/import-session` to establish connectivity?


meta-analysis in R REML estimator

Question: Does the REML estimator (default) in the R metafor package provides inverse-variance weighting?
Comment: Are you asking (a) if it is *possible* to do inverse-variance weighting with REML in the `metafor` package or (b) does the REML estimator do this by default?
Comment: first b, if not a + how
Comment: What code are you using to run your model? `rma(...)`?
Comment: For future questions about R code which often get closed here you might like to try the recently established mailing list for R meta-analysis queries stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis You do need to register before posting
Answer: The documentation for the metafor package lays out how it does the weighting for both fixed- and random-effects models. Random-effects models will use weights that are—in part—calculated using the inverse of the variance. However, it also includes an estimate of $\tau^2$ in the denominator (added to the variance). This is specified on page six of the documentation I linked to above. There are various types of estimation methods you can use, and they don't involve changing how weights are determined. Different types of weighting (metafor lets you define your own weights, if you want) can be used with different types of estimation.

meta-analysis in R REML estimator


LM317 Dropout Voltage

Question: The LM317 Data Sheet doesn't appear to specify a dropout voltage in the table of electrical characteristics. 1.2V - 1.3V sounds about right for the dropout voltage; is "reference voltage" an alternate name for it?
Comment: No the reference voltage is entirely separate from the dropout voltage. See Table 7.3 second line (Input-Output Differential Voltage) for the dropout voltage : recommended minimum=3.0V.
Comment: Wow that's way more than I was expecting!
Comment: Just curious, what did you expect then? It's designed in 1976, definitely not a modern low-dropout regulator. Normally linear regulators have about 2 to 3 volts dropout.
Comment: I was also dumbfounded to find that TI omitted the dropout voltage in the specs. I find it to be misinformation.
Answer:
is "reference voltage" an alternate name for it?

No. The reference voltage is a different operating parameter.
Table 7.3 in the datasheet you point to gives the actual value on the second line, calling it "Input-to-output differential voltage", giving it a minimum value of 3.0V. That is to say, you should always give an LM317 at least 3V more than you've set for its output voltage.
Now, while that is a safe value for all allowable LM317 operating conditions, the actual picture is far more nuanced:

That chart comes from National Semiconductor's version of the LM317 data sheet. That's a good reference in this case because they are the originators of the LM317 design, and they published their design's schematic, so we may safely assume that regulators from other manufacturers presuming to use "317" in their part number operate in essentially the same way. (And if not, they shouldn't be using that part number!)
You may look at that chart and say, "Aha! My regulator's load is only 500 mA, so the actual dropout in my case is about 1.7V." And that is true, as far as it goes. Just beware that by designing your system to run with exactly 1.7V across the regulator, you are throwing away all design margin. If someone takes your regulator outside in winter, it will be in a dropout condition, because as the chart shows, dropout rises at lower temperatures. Not quite to 3.0V, but well above 2.0V at any rate.
Answer: The LM317 can be thought of as a non-inverting operational amplifier with:

it's output supplying the current to the base of a series pass transistor
its non-inverting input connected to +Vsupply through a bandgap voltage reference such that the (+) input is always 1.25-1.3 V less than the positive supply
the inverting input is the adjust pin and there needs to be a constant current created by a resistor of a constant value connecting the output pin and the adjust pin
the output pin is the series pass transistor's emitter and that supplies both the output current and the current flowing to the adjust node where there must be a 1.25 V voltage drop so that the op-amp's (+) and (-) inputs are both 1.25 V less than the positive Vin power supply to the op-amp and series pass transistor
the series pass transistor is actually a Darlington transistor meaning there must be 2x0.7 V between the output pin on top of the 1.25 V outside the device

It says to give it 3 V of "headroom" because 1.25 + 0.7 + 0.7 = 2.65 V.

LM317 Dropout Voltage


What are the advantages/disadvantages for distributing multi stage tasks via JMS or JavaSpaces?

Question: When trying to distribute work that requires a multiple stage processing pipeline what are the communication, synchronization and throughput costs limitations in JMS vs JavaSpaces?
Answer: If you want SEDA, sending messages from stage to stage, then JMS implementations are typically much faster and more scalable, since MOMs are designed to not require locks so they can be highly asynchronous and concurrent. With JMS you can setup a consumer on startup and the message broker will typically push messages to your application ASAP so that there are many in-memory objects available at any time to be processed as soon as your application can process them - avoiding any network round trips or locking etc. See for example how prefetch works with ActiveMQ
Using JavaSpaces for messaging tends to be less efficient as they are generally implemented using a more database-centric approach of using locks with read/writes to entries etc. So you tend to query for objects then process them with JavaSpaces which tends to be a bit more chatty and less efficient for messaging.
The big win of the JavaSpaces approach though is if you want shared state; you can use a JavaSpace as a kinda database. Though maybe if you really want a database, you could use a  relational database with JMS; but JavaSpace folks like to use a single system for shared state and messaging.
FWIW there's often no silver bullit with middleware; sometimes in memory SEDA is all you need, sometimes JMS, sometimes a relational database, sometimes files in a directory. It totally depends on your requirements, scalability, throughput, reliability and so forth. I tend to recommend to folks to hide middleware APIs from their code so that they can switch  to whatever middleware they want easily via a simple one line config change such as with using Apache Camel
Answer: JMS is API, not product. It cannot have any "communication, synchronization and throughput costs". Specific implementation of JMS (Weblogic, JBoss, Tibco, ...) can.
There are no synchronization functions in JMS, btw -- queue is queue, you cannot make one message (in one queue) wait for another message (in another queue).
Answer: One other point to consider, JMS queues don't provide the ability to block based on size so a pure SEDA implementaion has a hard time working with pure JMS queues as it relies on the queues 'filling up' and applying back pressure on upstream stages.


Manually set track listen count in Banshee?

Question: How can I manually edit the track play count for a track for Banshee?
Answer:
From the Ubuntu Software Centre install the SQLite Data Browser
sudo apt-get install sqlitebrowser

Navigate to ~/.config/banshee-1 in the file browser (press Ctrl+H to toggle the viewing of hidden . files)
Right click on banshee.db and click on Open With Other Application. From here open the Use a custom command box and enter sqlitebrowser
From within the SQLite Data Browser then click on the Browse Data tab, and then click on the CoreTracks 'table'.
From here scroll horizontally so you can see the track names. Once you've found a track scroll even further to the right until you find the PlayCount header. Double click on the current playcount, enter a new one, and press Apply Changes

Note: Banshee's developers have expressed some interest in implementing this from within Banshee, if you remind them they might jump into action...

Linked Q&A:

Manually Sync Play Counts in Ubuntu
Answer: If you're importing your music library for the first time, it is useful to set PlayCount to 1 for all the files. This way if you add any music, you will find it in the automatically generated playlist "Unheard".
To do this, click on the Execute SQL tab and paste the following code:
UPDATE CoreTracks SET PlayCount=1;

Then click on Execute query and you're done.


How compare item works in magento 2

Question: In Magento 2.4.4, I saw entries in catalog_compare_item as visitor_id = 0 and customer_id = NULL,
How visitor id is updating in the table?
Answer: In Magento 2.4.4, the visitor_id in the catalog_compare_item table is set based on the value stored in the visitor cookie.
Whenever a visitor comes to the website, Magento sets a visitor cookie with a unique ID. This visitor ID is used to associate all of the visitor's activity on the website, such as product views, add to cart, etc. If the visitor adds a product to their compare list, Magento uses the same visitor ID to store the comparison data in the catalog_compare_item table.
If the visitor_id in the catalog_compare_item table is 0, it means that Magento was not able to retrieve the visitor ID from the visitor cookie. This can happen if the visitor has disabled cookies or if there was some issue in setting or reading the cookie. Similarly, if the customer_id is NULL, it means that the visitor is not logged in as a customer.
Answer: When a visitor adds a product to the compare list, the system generates a unique visitor_id for that visitor if one does not already exist. This visitor_id is stored in the catalog_compare_item table along with the product information.
The visitor_id is generated by the Magento\Framework\Stdlib\Cookie\PhpCookieManager class, which sets a cookie named mage-cache-sessid to the visitor's browser. This cookie is used to store the visitor_id and is set to expire when the visitor closes their browser.
When a visitor adds a product to the compare list, the system checks if the mage-cache-sessid cookie is already set. If it is, the system retrieves the visitor_id from the cookie and associates the compare list item with that visitor_id. If the cookie is not set, the system generates a new visitor_id, sets the mage-cache-sessid cookie, and associates the compare list item with the new visitor_id.
So, if you see entries in the catalog_compare_item table with visitor_id = 0 and customer_id = NULL, it means that the compare list item was added by a visitor who did not have a mage-cache-sessid cookie set. Hence, a new visitor_id was generated for them. Additionally, the visitor was not logged in as a customer at the time of adding the product, so the customer_id field is empty.

How compare item works in magento 2


Use Google Calendar API to Access Specific Account's Calendar in Android

Question: I was wondering if there was a way to access a specific calendar's data using the Google Calendar API in Android as opposed to the user's data. The app I am writing would have users add events/see if certain time slots were available on one calendar. So far I have not found any examples of how to accomplish this.
Answer: I got started with the
calendar sample app for Google API .
I hope it helps you.


BACnet broadcasts with 2 subnets on one VLAN

Question: I have a building automation network configuration with mechanical equipment on subnet 10.233.138.0/24 and electrical equipment on subnet 10.233.136.0/23.  BACnet uses broadcasts for certain functions (discovery) which are typically blocked by an IP router, therefore BBMDs (bacnet broadcast mgt devices) are set up on each subnet to handle the broadcasts by sending a unicast between the BBMDs.  If both of these subnets are configured to be on the same VLAN, will broadcast reach the other subnet without the need of BBMDs?
Comment: Applications using broadcast are becoming obsolete because companies are refusing to use such applications, and IPv6 does not even have broadcast so such applications cannot be ported to IPv6. For a few decades now, we use multicast instead of broadcast, and multicast can be routed.
Answer: No.  The BBMDs need to be on each subnet that you have devices on.


How can I change admin port?

Question: When trying to run an application it doesn't, log says port 8000 already occupied checked netstat and the pid is system (system listening on port 8000) can't exactly kill that process. My only option is to change the port for the admin.
Answer: You can do this with the <code>--admin_port=8001</code> argument. See the docs for others: https://developers.google.com/appengine/docs/python/tools/devserver#Python_Command-line_arguments

How can I change admin port?


The Essence of Generation Functions and Coefficient Extraction

Question: Given the roles generating functions and coefficient extraction play in solving recurrence relations, they are clearly analogous to the Laplace Transform and Inverse Laplace Transform.  A hypothesis would then be that generating functions transform a problem from the time domain to the frequency domain, and coefficient extraction transforms a problem from the frequency domain to the time domain.  However, the integrand of a Laplace Transform multiplies the input function by a decaying exponential, whereas the "inside" of a generating function multiplies the input function by a growing polynomial.  The shift between exponential and polynomial is common when switching between ODEs and recurrence relations; the eigenvalues of the same characteristic polynomial go in the exponent for linear ODEs and in the base for linear recurrence relations, but this takes place without sign change.  The shifting VS growing distinction between Laplace Transforms and generating functions remains unexpected.  Thus a generating function behaves more like the Inverse Laplace Transform in this respect, leaving coefficient extraction to perhaps play the role of the Laplace Transform.  What shifts in domain are taking place when generating functions and when coefficient extraction are applied?
Answer: What you call a "polynomial" is actually a discrete Laplace transform ( or a $z$ transform) if viewed correctly. Consider:
$\sum a_n x^n=\sum a_n  e^{n\log x}$
define $\log x =s$ and you get a discrete Laplace transform
$\sum a_n x^n=\sum a_n  e^{ns}$


What can be unlocked in GTA Online from single player?

Question: Seems like there are at least a couple of things that can be unlocked online if you finish single player. Where is the whole list?
Comment: Can you be more specific on what these couple things are?  I don't remember singleplayer unlocking anything in Online
Answer: There is nothing like this that exists in GTA Online.
The only thing you could potentially be thinking about is the GTA Online Story Mode, which takes your GTA Online character through a scripted Story Mode in which you will interact with the characters from the Single Player Story.
Besides this and some other characters doing a crossover between Single Player and Online, they do not affect each other in any way.
Source (for GTA Online Story Mode)

GTA Online includes its own Story Mode. Taking place months before the events of GTA 5 single-player, the story takes the player's Character through series of Missions and encounters with GTA 5 characters.
Answer: Completing the first or second mission does unlock heists for online, I was wondering myself if that was all though!


How I can embed Google Docs in my website?

Question: How I can embed Google Docs in my website to use it like an editor?
Comment: Don't think you can do what your asking but a quick google search led me to http://www.webodf.org/ might be close to what you want.
Answer: Yes. Code to embed:
Loading…

Don't forget to add
embedded=true

to the url.
(e.g. Loading…)
Answer: You can use the Google Documents List API

The Google Documents List API allows
  client applications to
  programmatically access and manipulate
  user data stored with Google
  Documents.
Comment: but don't want to access data stored in google doc,i want to use the editor which is use in google document in my website
Answer: If you just want to use the editing components (bold, italic, etc. such as the ones above this answer form) then a good option is to use TinyMCE. It's free, cross-browser compatible and available here: http://tinymce.moxiecode.com/ .
It's made in javascipt (a jQuery version is available), and what it does is wrap words (or characters) in html friendly tags, such as  for bold,  for italic etc. When you want to change colours or the like the selection will be put in a  tag, so will not break your paragraph flow.
The total selection of options is very large, but can be customised to your wishes. I personally recommend it, as its the best way to allow clients to edit content and save it in the database correctly.
Answer: In my humble opinion, that is not possible. Usually google will announce an API if they want other developers to just use their editors. What you are asking is quite interesting - you want the google docs editor to open a file (not necessarily in google drive), and then to edit it and save it after user is done editing. You also want the feature of collaborative editing (I suppose) where several people can edit the same document.
But to make these things available to coders to embed in their websites, google has to entirely remove their authentication system from their editor and also the support for google drive and a lot of other stuff. Google will simple not do that because I believe it will be a negative impact on their business.
I will refer you here to some links which will help you find a good editor for yourself:
(For editing code): http://en.wikipedia.org/wiki/Comparison_of_JavaScript-based_source_code_editors
(For editing normal text): http://www.webdesignerdepot.com/2008/12/20-excellent-free-rich-text-editors/
But none of them will have the collaborative editing like google docs. I know, I am disappointed too. I too was searching for a text editor of such nature and couldn't find one.


Make graph of perf4j on the basis of request and maintain every day request performance

Question: I want to make graph of perf4j on the basis of request and not on the basis of timeslice as shown when graph drawn for perf4j. How can the graph be drawn and maintained for current and past requests without using timeslice?
Thank You
Answer: Start by looking at org.perf4j.LogParser. See the code to the GoogleChartGenerator and implement your own google chart graph.
You can use the Google Chart Editor to help you create the correct graph URL, and the great documentation at The Google Chart API website.


FTP fopen() error 550—not a plain file

Question: Well, this is a problem I have never seen before.
I am trying to stream an FTP file using PHP's fopen() and feof() in order to copy it from one server to my own. This works fine when using normal http:// URLs. However, when using the ftp:// protocol, I'm receiving the following error:
fopen(ftp://.../streaming/planted2.mp4) [0function.fopen0]: failed to open stream: FTP server reports 550 /streaming/planted2.mp4: not a plain file.

Bear in mind that I have confirmed the URL is correct.
If I pop it into my browser's search bar, it always loads correctly.
Following this error, any attempt to use feof() or fread() on the wrapper results in an error complaining that the respective function expects a resource, but that instead a boolean is being provided. This would not be the case if fopen() was not failing.
As the files are quite large (several gigabytes at times) streaming is mandatory. Also, due to the configuration of the server, I need a way to loop through each chunk in order to buffer some output. If I don't, the server holds up. It's a weird configuration on Rackspace's behalf. That's why I'm using feof().
So, without further ado, my question is this: What does the 550 error mean, and what is a "plain file"? If it is a problem with the configuration of the server I am attempting to download from, what are my options, given my limitations?
EDIT
I have determined this is a server issue. However, the problem is still unresolved.
I contacted my boss and our server administrator, and the server guy told me to test this out on a different Windows-based server instead of the Linux-based one I was playing with. My script works with the Windows server, so I have confirmed my script is not in error.
Unfortunately, my boss still wants me to figure out the problem, and find out why it's not working on the Linux box. I have absolutely no idea why, and don't know where to look. Any hints would be greatly appreciated!
Comment: I contacted my boss and our server administrator, and the server guy told me to test this out on a different Windows-based server instead of the Linux-based one I was playing with. My script works with the Windows server, so I have confirmed my script is not in error.
Comment: My boss still wants me to figure out the problem, and find out why it's not working on the Linux box. I have absolutely no idea why, and don't know where to look. Any hints would be greatly appreciated!
Answer: I've just come across this issue when trying to get a file from a sco unix server.
Server File Location: /home/user/data/myfile.csv
I can put the below into any browser and it gets the file.
ftp://user:password@host/data/myfile.csv

However if I run the below, I get the same error as you
$f = fopen("ftp://user:password@host/data/myfile.csv", "r");

However, if I put the full path into fopen - it works fine.
$f = fopen("ftp://user:password@host/home/user/data/myfile.csv", "r");

I'm not sure if this will fix it for you, but works for me.

FTP fopen() error 550—not a plain file


How do you identify a mosquito's sex without letting it bite you?

Question: Are there any reliable indicators?
Comment: I'm voting to close this question as off-topic because OP has shown no research effort
Comment: male and female mosquitoes are morphologically different. You seem to have shown no effort at all. Have you even checked the wikipedia page on mosquitoes? -1
Answer: Males and females mosquitoes are morphologically quite different.
The majority of individuals you see are females. The males are not attracted to humans and so we see them less often.
The main obvious difference is the size of the antenna. When you see the large feather-like antennas of a male, you'll have no doubt; it is a male. The male also tend to be smaller than the female but given the inter-species variation in size I wouldn't use this criterion to tell the gender especially the antenna criterion is so obvious.

You can find many more pictures if you just google mosquito male female.
Why do males have these large antennas?
The male's large antennas are for sensing the females. There is a very important sexual selection among male mosquitos for accessing a mate. Female beat their wing at another frequency than males and they therefore produce different sounds when flying. So males compete on their ability to hear and recognize female. Females are attracted to CO2 and warm bodies but males are incredibly attracted to the sound of the female. During my Bachelor degree I once played a 440Hz harmonic to male Anopheles gambiae. It is surprising how quickly they respond to this sound and fly toward the speaker.


shutdown at specific date

Question: I know that you can schedule a shutdown for a specific time via shutdown -h 21:45 and that you shouldn't use crontabs for such things because of their repetitive nature. How can I schedule a shutdown for a specific date like 31st of August at 20:00pm?
Answer: The at command is for scheduling one off future executions.
e.g.
% at 8pm Aug 31
at> echo hello
at> <EOT>
job 161 at Sat Aug 31 20:00:00 2019

(the "<EOT>" was produced by pressing control-D)
% atq
161     Sat Aug 31 20:00:00 2019 a sweh

You can put your shutdown command here.
Comment: Yes! I had forgotten about `at` when I posted - `at` is definitely meant for this in general, although in a company the accepted method may be `at` or `cron`, depending on conventions related to configuration management/deployment.
Comment: It is not exactly equivalent, note.    https://unix.stackexchange.com/q/465322/5132
Comment: `at` is also able to take commands from a pipe: `echo "echo yup > $(tty)" | at now`.
Answer: While at is the obvious way to do this, I think it will survive shutdowns, so if the machine reboots before the scheduled shutdown, it might shutdown again at the scheduled time. Therefore, using bash and GNU date we can use a delayed shutdown.
/sbin/shutdown +$((  ( $( date -d "30 may 2019 13:15" +%s ) - $( date +%s ) ) / 60 + 1 ))
NB: This is only accurate to one minute. It works by converting the scheduled time, and now to seconds since the UNIX epoch, calculating the difference, converting to minutes, and then using this as the delay to shutdown. It won't work correctly if the scheduled time is in the past.
Answer: Recent Ubuntu versions use systemd and when the conventional atd and associated at scheduler for one-off commands is either not installed or not running a one-off command can be scheduled with systemd-run  which is somewhat easier than manually generating a systemd timer:
 systemd-run --on-calendar="2019-08-31 20:00:00 CET" /sbin/shutdown now

Comment: The irony is that starting an entire service to do this is _almost_ superfluous. systemd's shutdown mechanism itself supports arbitrary points in time.  Its command-line tool simply does not provide the ability to access this, because it is not up to par with the command line of the BSD `shutdown`.  As I wrote in another answer, you who want this could try persuading the systemd people to make their `shutdown` tool more capable, with syntax of decades' standing, rather than going around the houses with `systemd-run`.
Comment: I get Invalid calendar spec: 2019-08-31 20:00:00 CET
Answer: You use a better shutdown command.
The van Smoorenburg, Upstart, and systemd shutdown commands do not allow a date specification.  But the BSD shutdown command takes a date value in its specification of when to shut down, in the form yymmddhhmm.  This has been the case ever since 4BSD, and remains so with FreeBSD and OpenBSD.  NetBSD extended it to ccyymmddhhmm.
Because the nosh toolset is also usable on the BSDs, I gave my shutdown command the same capability, extending it to CCYYMMDDHHMM per NetBSD.  And because the nosh toolset is also usable on Linux, that gives Linux a shutdown command that takes dates.
It of course works with the nosh system-manager.  It also works with some other systems.  It sends signals to process #1 to enact stuff and the same signals are understood by some other system managers, such as systemd, which can also be shut down using it.
You could use it, or a tool like it; or you could try to persuade the authors of other Linux shutdown programs to extend their tools to also be as capable as the BSD shutdown.
Further reading

Jonathan de Boyne Pollard (2018). shutdown.  nosh toolset manual pages.  Softwares.
Jonathan de Boyne Pollard (2018). system-manager.  nosh toolset manual pages.  Softwares.
shutdown.  System Manager's Manual.  NetBSD Manual pages. 2011-11-04.
shutdown.  FreeBSD System Managers' Manual.  2018-01-01.
shutdown.  OpenBSD Manual pages.  2015-01-21.
https://unix.stackexchange.com/a/465337/5132
Answer: To run the job only this year:
0 20 31 8 * test $(/bin/date +\%Y) = "2019" && /sbin/shutdown now

To run the job every year:
0 20 31 8 * /sbin/shutdown now

Answer: There may be an option to input the year to the shutdown command, but cron can be used to run commands only once at a specific point in time. For your example, try
0 0 31 8 ? 2019  shutdown

Beware: the above is not standard cron syntax.
Comment: 1. This doesn't say 20:00 pm, it says midnight.  2. I have never seen a cronjob with SIX fields for the timing.  What cron implementation are you referencing?
Comment: There isn't a `year` field in the `crontab` schedule
Comment: I realized afterwards this syntax is not "standard cron", so I agree, it should not be taken at face value. OP seems to imply there is a performance penalty associated with using cron, so in my Answer, I sought to clarify - there isn't any inherently inefficient about cron's implementation that makes unsuitable for one-off task. Is this what you think as well?

shutdown at specific date


Manually installing Koma script to MikTex

Question: I'm having some problems with LaTex. I recently installed it to my computer, but do not have admin rights so did a local install to my user. I first installed MikTex, then installed TexMaker. I tried making a pdf from a .tex file I have saved from a scipt I made on my other computer. I got the following error: LaTex Error: File 'scrartcl.cls' no found. I looked into this and saw that this is from not having Koma-Script installed. So I went to https://www.ctan.org/pkg/koma-script?lang=en to download the .zip file an unzipped it. I looked the README and INSTALL files, which say "MiKTeX users can easily install the current release of KOMA-Script using the self extracting archive for windows also known as MiKTeX installation file.  See http://www.komascript.de/current for more information. But if you want to install another release, you have to read the installation instructions below." I went to that page which led to https://komascript.de/node/2047. This page says to download a MD5 file that I then downloaded. I then opened MikTex Package Manager and found the Koma-script and tried to install it but got the error that "~/koma-script" is not a package repository. What am I doing wrong? I'm on Windows 10 if that affects anything
Comment: Why do you want to install manually instead of using the package manager of miktex?
Comment: I am using the package manager. Sorry, I will edit that. I meant manually install as in downloading the files then using the package manager as opposed to the package manager or TexMaker installing them from the web.
Comment: The zip-file is not a miktex package. You will need a file from here https://ctan.org/tex-archive/systems/win32/miktex/tm/packages if you want to install with the package manager. And you will need the two miktex-zz-files.
Answer: Create a local repository on your hard disk and download the files you're interested in, plus the following files: pr.ini, miktex-zzdb1-2.9.tar.lzma, miktex-zzdb2-2.9.tar.lzma and files.csv.lzma. Then launch MPM, menu Repository -> Change Package Repository… and select Packages shall be installed from a directory:
]1


Why did China's general have to share his phone number and repeat what Louise told him?

Question: In the movie Arrival, why did China's general have to share his phone number and repeat what Louise told him because he knows she knew them anyways!
Answer: OK… this is tough to explain… bear with me.
At the time he gave her the number and phrase, she didn't already know them.
As soon as he told her… she had always known them.
He had to tell her 'now' in order for her to have known it back 'then'.
No matter what time she acquired the info, at some point in her life/time-line someone had to tell her. Because of the non-linearity of time for her after her interaction with the heptapods, she would then have always known/will know it.
Make sense now? or then?
Comment: To put it another way: Even though you can experience time non-linearly, you still can't know the futures that do not happen, only the one that does
Comment: She is experiencing all of the time of her life simultaneously. Any new information is information that all of her time-selves know simultaneously. Yet, she can not necessarily change the past. Maybe because the time-selves in the alternate universe where she did not know the non-linear nature of time continue on their timeline not knowing the information. Nor, can she know events that have not happened. Perplexing. It is almost like her time-steams diverge the moment she grasps the true nature of time.


Information density, Bekenstein Bound, and length contraction

Question: Is it possible to observe a region of space that has information density greater than what the Bekenstein Bound  will allow when length contraction is involved? I.e. An object travels through the region of space close enough to the speed of light relative to the observer to appear more information dense than what the limit would permit. Or does it only make sense to calculate the Bekenstein Bound based off of an object's rest frame?
Answer: Bekenstein bound says the entropy is bounded above by a quantity that is proportional to the total mass-energy. If an object is moving relative to you, it's mass-energy will increase thus increasing the upper bound allowed for the entropy.
Also see this - Can a black hole form due to Lorentz contraction?


Is an undergraduate physics degree the same everywhere in terms of coursework?

Question: Is a degree in physics the same everywhere in terms of what is being taught or are there differences from one institution to the other ?
Comment: Why would you expect every school to require the same curriculum?
Answer: There are not only differences between institutions, but also within institutions. For example, at MIT "The Physics Department offers two different programs leading to a Bachelor of Science in Physics, giving students the opportunity to tailor their study of physics to their individual career goals. The focused option is an ideal preparation for those students who plan to go on to graduate school in physics or a related field, while the flexible option provides a strong background in physics for those whose career paths may not include graduate work in the discipline." while at UPenn there are 6 tracks.
Comment: That, is not good ... gulp! (unless you are @MIT)
Answer: In the UK, undergraduate physics degrees have to be accredited by the Institue of Physics to ensure they all teach the same material at the same standard. Of course, there will be deviations and differences between courses, particularly in specialist modules or research-based components of the degree.
This may vary depending on the strengths and weaknesses of the department in question-- for example, in my undergraduate degree I did a lot of solar and stellar physics (at least 3 different modules across my 2nd and 3rd years) because that was a strong research group in the department. However, I did the bare minimum of particle physics because no one in the department had expertise in that area and therefore there was only one module on it in the first year of my degree.
While this answer focuses on the UK, I expect the same is broadly true in other countries, except perhaps those which do not have a particularly high quality or standardised higher education system.
Physics as a subject is generally easily standardisable, as many concepts build upon previous knowledge (e.g. going from classical to quantum mechanics) and therefore all physics degrees will follow broadly the same structure. Contrast this with history, for example, where one could specialise in the Cold War period from almost the beginning of a degree, without needing to know and understand the intricate details of everything that has happened in human history from the Neolithic period onwards.
Comment: "except perhaps those which do not have a particularly high quality or standardised higher education system." — Countries lacking a standardized higher education system of course includes the US.
Answer: There're a lot of similarities, and also differences. My experience is that some topics are core and every program covers them, while others depend on whether the department has people familiar with the field and / or are electives. Examples of the former:

Newton's Laws, vectors, conservation of momentum, moments of inertia
Laws of thermodynamics, definition of temperature and entropy
Basic particle physics (the kind that can be memorized, e.g. "how many quarks are there?")
Schrodinger's equation, commutators, expectation values
Maxwell's equations, vector calculus
Angular momentum in quantum mechanics

Examples of the latter:

Relativity (bit of a shame, but it is a hard topic)
Astrophysics
Cosmology
Quantum optics and information
Advanced classical mechanics (Poisson brackets, Lagrangian mechanics)
Electrodynamics
Particle physics (the kind that requires calculations)
Biophysics


maybe lost funds

Question: Sometime in Q4 2017 I sent my MIOTA to the wallet. I verified then that the funds had arrived. Now I am logging in and the balance says 0. I am having a hard time interpreting the transaction history. Can someone take a look?
My address is
LKQGBV9MCMPVJTTEJMPSAZNRFGMIWJSNSRQVLXTHSXEQQO9FGYCVAEPZBI9EWQUVOFVYCBFVZNUJPTXIDLCDUNBPRD
Answer: If you haven't used an online seed generator, most likely your funds are safe. Are there any outgoing Txs in the history of your wallet?
Two days ago, there was a snapshot. Log into your wallet with your seed, then go to the receive section and generate new addresses. Keep on generating receive addresses until your balance is restored.
Also have a look at this well written post by Ralf Rottmann (IF Board of Directors) to get a good understanding of what a snapshot is and what it does. Here: https://medium.com/@ralf/prepare-for-the-january-28-2018-iota-snapshot-10f565b371ab
If this doesn't help, keep us updated here.
Answer: If you are certain that your seed has not been compromised, then either there was a snapshot or you may just be connected to an unsynced node. The last snapshot was on April 29th, 2018, so if you haven't accessed your wallet since then, then please read this post for necessary steps to take with the most current version of the light wallet to recover your balance. Please note that everyone had to go through this. In the case of a bad node, you may also look up a node in this list of healthy nodes to connect to. You'll need to be connected to a healthy node regardless of your situation.

maybe lost funds


What I can do in LUKS when I'm asked for password?

Question: When I start PC it asks for my password to boot in system. 1) But I cannot use CAPSLOCK when I use CAPSLOCK the light on my keyboard is not lighting.
2) Does SHIFT button work ?
3) Can I delete a character if it's typed wrong ?
Answer: Yes, you can use SHIFT to enter uppercase characters.
To delete a character, just use the BACKSPACE key, then enter the correct character.


Rendering in GPU and CPU in different instances at once

Question: I am currently rendering an animation in cycles and I have another animation to render after it is finished. I am rendering the current animation with my GPU and was wondering if I could render the other animation using my CPU in another instance. Would this be efficient? Thank you.
Comment: Give it a try and see what happens. Keep in mind that even when rendering on GPU, some of the processing is done in the CPU regardless...
Comment: Possible duplicate of: https://blender.stackexchange.com/questions/3232/cycles-hybrid-rendering
Answer: Yes, mixing CUP and GPU rendering on two instances should be faster if you have enough memory to fit two instances of the rendering job. Just make sure you set the CPU rendering instance to a lower priority (using the task manager on Windows, or nice with Linux) so that it doesn't take any CPU resources away from the GPU instance. Otherwise the GPU instance might be starved for instruction from the CPU and cause a slowdown.
With Blender 2.79a, a built-in mixed CPU/GPU rendering mode is also available. Just need to enable it from the User Preferences:
Answer: It appears that the feature didn't make it in the official 2.79a release, though.


How does a program know what to read in a pipeline?

Question: How does the unix command line program know what file to read?
For example:
 cat someFile | foo

How does the program foo know which file to read, and which process is responsible for opening and reading the file from disk?
Comment: `foo` does not read a file. `cat` reads the file, then passes the content of the file through a pipe, to `foo`. `foo` just reads the stuff coming out of the pipe. Therefore `foo` can not know what file it came from.
Answer: foo does not know what file to read, it (presumably) just reads from its standard input stream.  This data stream is connected by the shell to the standard output stream of the cat command.  This "administrational plumbing" is done by the shell as it starts the two processes (they would run concurrently).
In the example in the question, it is cat that will open the file for reading, read it and pass the data on its standard output.
You might as well ask "How does cat know where to write the result?"  The answer is that it writes to its standard output stream, connected by the shell to the standard input stream of the foo command.  Likewise, the standard output stream of the foo command is connected to the terminal by the shell since there are no further pipes or redirections for this command.

The pipeline that you show,
cat someFile | foo

is functionally identical to
foo <somefile

Here I've deleted cat since it's not really needed.  The shell will connect the standard input stream of foo to the given file, so the effect will be the same (foo would be able to read the contents of somefile from its standard input stream).
In this last command, foo still does not know that it reads data coming from a file called somefile.  It also does not know it's no longer reading from the output of cat.  It just reads its standard input stream as before.
It is now the shell that will open the file somefile for reading, but the shell will not read anything from the file, just hook the standard input stream up with the opened file for foo to read from.

Note that we don't know what the foo command does, whether it actually does anything with its standard input stream, or whether it expects a filename to read from on its command line.  This sort of information would be available in the manual of the foo program.
In the case where foo actually needs to be told to read from a specific file by giving it a pathname on the command line, you may use
foo somefile

Now foo would be responsible for both opening and reading from the file.
If the file has to be processed in some way (assuming "cat" is a more complicated process that actually modifies the data read from somefile):
cat somefile >newfile
foo newfile
rm newfile

I.e., process the file and save the result in a new temporary file, then pass the name of the temporary file to foo. Then remove the temporary file.
Or, with a shell that understands process substitutions (like bash):
foo <( cat somefile )

Here, the shell would arrange for the output of cat somefile to be written to a temporary file (or named pipe, it does not really matter), and the pathname of that data would be inserted in place of the process substitution <( ... ).  foo would then open that as its file to read from.
In this final example, cat would open the original file and read from it while foo would open whatever pathname the shell gives it (where the output of cat is found) and read from it.
Answer: In cat someFile | foo there are three elements:

cat someFile
the pipe |
foo

And now what's going on:

cat knows it should read someFile, because that's how it was called, and so the sell tells it the details. Namely, someFile is a parameter here and all parameters are passed on to the called app.
The pipe is what makes shell fork subshells and start processes in them, as well as arrange the subshells and processes, setting inter alia their input and output. That's how foo gets the input from cat.
foo is called the same as cat before. But after step two (which in fact is step 1 in the shell) the input to foo comes from cat. That's how the pipeline was called.
Answer: You wrote two commands: cat someFile and foo. First command has to read someFile and writes it to standard output which is redirected to pipe. The next command reads the data from its standard input to which is redirected to the output from the pipe.
Standard input, standard output and standard error output are the basic linux terms and redirection and pipe are the most powerfull principle to flow the data between the programs. Pleas, look for these terms to understand the basics linux command line.


How to determine number of isomorphic classes of simple graph with n vertices, each with degree m?

Question: For HW, I need to find the number of isomorphic classes of a simple graph with 7 vertices, each with degree two. I know I could brute-force it by finding all edge sets that fulfill that criteria, but there must be a more efficient way. So, it there a formula that determines number of isomorphic classes of a simple graph with homogenous degree sequence? If my terminology is off, I appreciate your correction.
Comment: These are generally called "regular graphs". I doubt there is any general formula for the number of $m$-regular graphs with $n$ vertices, even for fixed $m$ such as 3. Educated brute force is probably the way to go for your homework problem. See https://oeis.org/A002851 for 3-regular graphs.
Answer: Hint: A 2-regular graph is a disjoint union of cycles. From there it should be fairly easy to see there are only 2 simple 2-regular graphs on 7 vertices.
Comment: I don't get this answer?
What do you mean by disjoint union of cycles
Comment: A two-regular graph on $7$ vertices is either $C_{7}$ or $C_{3} \cup C_{4}$. Notice the $C_{3}$ and $C_{4}$ are disjoint, or disconnected.


Why are the center tank pumps deactivated when slats are extended on the A320?

Question: Why are the center tank pumps deactivated when slats are extended on the A320? I researched about this and all I can see is hints. They say it is because of regulations or certifications.
Comment: "they" who? where did you read about this?
Comment: I read it at aviation forums my friend, they say it's some kind of certifications. I also read part 23 but it is not directly stated.
Answer: You're right. But it's not because of the slats. It's because of what the plane is doing when the slats are being used.
The slat position is used in some system logic because it's indicative of a takeoff and approach. For example, on the MD-11 the engine ignition is automatically put into continuous mode when the slats are operated, because that's indicative of slow speed.
The same for the A320, slats extended means a takeoff / climb is about to commence, or the plane is on approach with a potential go-around.
Those conditions require high fuel pressure.
The center tank has 2 pumps, while each wing tank has 2 pumps. If a center tank pump fails, it will be 1 pump supplying 2 engines, compared to 2 pumps for each engine (or 1 for each in a rare double pump failure—one in each wing).
If a pump fails, there is no automatic command that can be sent to the sequence valves to change the sequence, or to engage the crossfeed valves.*
Usually the center pumps overpower the wing pumps, but what is omitted from that explanation is that there are sequence valves. If one center pump fails, the pressure may remain high enough to keep the valves closed on the good side, but not high enough to supply two engines during high demand.
Also note there is no suction (gravity) feeding from the center tank. I attached an A320 fuel schematic below, number 13 is the sequence valve.

RE: Why does not this apply to all aircraft?
The 737 Classic faced issues (see footnote). Other types have more than 2 pumps for the center tank, and/or have more powerful pumps. Another option is to use the center tank to fill the other tanks (like on the MD-11).
The 747-1/200 also required using the wing tanks during takeoff, see this answer by @Terry.
A speculation on my part, is that it was cheaper to certify the plane like that, or problems were found and that was the cheapest solution.

A fuel tank that is not designed to feed the engines under all flight conditions need
  be tested only for the flight regime for which it is designed to do so (e.g., cruise conditions).
(FAA Flight Test Guide For Certification
  Of Transport Category Airplanes)

* A fuel imbalance may quickly develop when each engine is consuming +70 kg of fuel per minute (an issue that affects the 737 Classic).

On the classics, when departing with less than 1,000kg of fuel in the centre tank, an imbalance may occur during the climb. This is because the RH centre tank pump will stop feeding due to the body angle so number 2 engine fuel is drawn from main tank 2, while engine 1 is still drawing fuel from the centre tank. When this "runs dry" the scavenge pump will also transfer any remaining centre tank fuel into main tank 1, thereby exacerbating the imbalance.

(A320 FCOM)
Comment: TIL: airplane wings are actually complex rpg dungeons o.o
Comment: @StarWeaver - when I was somewhat younger, I wrote a D&D dungeon crawl based around a map produced by sketching over a diagram of fittings in a toilet cistern... any system of plumbing or wiring of sufficient complexity can be an RPG dungeon. :)
Comment: Nice info! But what is the reason why all aircraft is that? What is the basis?
Comment: @MNKY - if you mean, "Why does not this apply to all aircraft?", then I've added relevant information.
Answer: I believe it's an interpretation of an airworthiness requirement in 14 CFR 25.953:

Each fuel system must meet the requirements of § 25.903(b) by -
(a) Allowing the supply of fuel to each engine through a system independent of each part of the system supplying fuel to any other engine;

where 25.903(b) reads:

(b)Engine isolation. The powerplants must be arranged and isolated from each other to allow operation, in at least one configuration, so that the failure or malfunction of any engine, or of any system that can affect the engine, will not -
(1) Prevent the continued safe operation of the remaining engines; or
(2) Require immediate action by any crewmember for continued safe operation.

When the center tank is feeding the fuel on the (typical) A319/A320 feeds directly into the fuel manifold, acting as a single tank outlet for both engines (see also 14 CFR 23.953). Additionally, takeoff with crossfeed open is prohibited for the same reason.
The A321, newer A319/A320, and other designs like Boeings, feed fuel from the center into a wing tank first, avoiding this requirement. Indeed, if you have an A321 or the A319/A320 with the new system, the limitation is deleted.
It would not be for purposes of high fuel pressure, since when center tank feeding, all pumps run, just the center tank pumps overpower the wing tank pumps.
Comment: The 737 has similar sequencing valves built into the fuel pumps, the wing pump pressure relief is set lower than the center tank pumps. So there is no difference with the A319/A320. (By the way, the A321 has a center tank by default, you may be thinking of the additional center tank)
Answer: The center tank pumps transfer fuel directly into the engines. When the slats are extended, the pumps are disabled to ensure that the wing tanks feed the engines rather than the center tank. The reason for this is to account for a possible tank pump failure. The tank pumps are electrically powered so there is a tiny bit of a chance of an electrical failure which can take the power off them. Unlike the center tanks the wing tanks can be used to gravity feed the engines.
With gravity fuel feeding active, the aircraft engines can still be supplied with fuel with no push from the tank pumps. The aircraft computers use the slat extension as a cue that the aircraft is preparing for a take off. Without gravity feeding, multiple tank pump failures can mess up fuel flow into the engine. This is the last thing you want to happen close to the ground. The center tank pumps are disabled for this reason. To allow for gravity fuel feeding by the wing tanks.
When the A321 came out Airbus made its fuel system simpler by replacing the center tank pumps with jet pumps (works with motive fuel) and put two transfer valves in the center tanks. So, in the A321 the fuel is pumped from center tank into the wing tanks which then transfer fuel into the engines. So, the engines are always supplied by the wing tanks which takes away the need for the previously mentioned logic. The post 2014 A320 models have the A321 system in place. Thus, it does not apply to them either.

A320 fuel tanks pre mod and post mod.
Answer: Its to provide an independent fuel supply to each engines. If both engines are fed from the Centre and its contaminated then both engines fail. If both are being fed from their respective wings then the supplies are independent, that's all.
Comment: Welcome to Aviation.SE! Could you provide more details? This doesn't seem to add much to the existing answers.


How many miners are necessary for correct private blockchain work?

Question: Can we calculate the number of miners,that we will need in private blockchain in advance and how?
for POW algorithm
Comment: What do you mean "in advance"? I would think at least one, but to protect against him going offline the actual number should probably be higher. That depends entirely on your preferences.
Comment: what do you mean by correct?? you mean secure?
Comment: @Badr Bellaj  I mean secure,faster mining and fault tolerance.
Answer: 1 miner is all it takes on a private blockchain, as the difficulty of mining a block is adjusted so that the average sits between 10 - 19 seconds, as described in "How does the Ethereum Homestead difficulty adjustment algorithm work?".
If you are worried blocks will be mined too slowly, you can change the initial mining difficulty on your private chain as described here:

You can set the genesis block difficulty in your private network using the init parameter, but the difficulty will eventually be adjusted according to the algorithm described above.


Formula to find out the resistance per meter of a specific gauge of wire if I already know the resistance of a different gauge of wire per meter?

Question: So if I know a 30 gauge wire's resistance at 1 meter, how can I figure out the resistance of a 29 gauge wire at 1 meter long of the same material? Or 5 gauge, or any other gauge? I need a formula, not a chart. Working with multiple materials, and I know the resistance of them at different gauges, but need to find out how to get the resistance per meter of varying gauge sizes using math.
Answer: The equation to find resistance in a wire is: R=(p*L)/A
Where p = Resistivity of material, L = length of wire and A = area of cross section
Assuming DC, and that the cross section is uniform.
Answer: Resistance of a constant cross-section of material from end-to-end is \$\frac{ \rho L}{A}\$
Where:
\$\rho\$ is the resistivity of the material (can be considered a scalar constant at a given temperature for a given homogenous anisotropic material)
L  is the length of the material from end-to-end
A is the cross-sectional area of the piece of material.
The cross-sectional area of a cylindrical wire is simply \$\pi r^2\$ where r is the radius of the wire, so you can see that the resistance is inversely proportional to the radius squared.
The relationship between AWG (American Wire Gauge) and area can be described by a formula (from Wikipedia)
\$A_n = 0.012668~\mathrm{mm}^2 \times 92 ^ \frac{36-n}{19.5}\$
Where n is the wire gauge.
By combining those formulas you can get your requested results.
Answer: If A is the wire gauge (American), and the resistance of 1 meter of wire equals R, then
R = .01 (10 ^ ((A - 15)/10)) for copper.
In other words, the resistance of 15 ga wire is .01 ohms/ meter, and increasing the the gauge by 10 multiplies the resistance by a factor of 10.
Answer: Looking carefully at the AWG tables, you will find the relations between gage. For example
-The ratio of any diameter to the diameter of the sixth greater gage number is equal to 2.0050
-The ratio of any diameter  to the  next smaller is constant number
-The difference between any two successive diameters is a constant ratio times the  next smaller difference between two successive diameter.
-….and much more.
What is related to your question is that the resistance, mass, and cross section vary with the square of the diameter, hence by the use of the square of the ratio of one diameter to the next, or 1.2610, it is possible to deduce the resistance, mass, or cross section of any size from the next. It is easy to remember the 1.25.
The approximate factors for finding values for the next three sizes after any given size, are 1.25, 1.6, and 2.0. Furthermore, every 10 gage numbers, the resistance and mass per unit length and the cross section are approximately multiplied or divided by 10.
For resistance a very simple approximate formula may be remembered for computing data for any size of wire.

ohms per 1,000 feet at 20 degr.Celc. Where n is the AWG gage number.
The same you can do for mass and cross section.
Answer: check this example :
The resistance of 1 meter length of 18 gauge copper wire is 1k ohm. The resistance of one metre length of 24 gauge copper wire will be :
(A) k / 2 ohm
(B) 18 / 24 kohm
(C) k ohm
(D) more than k ohm.
the answer will be (c) , WHY ?
YOU can apply this formula according to the info. that you have on condition that you have same materal of wire
$$ \frac{gauge_x }{ resistance_x} = \frac{gauge_y }{ resistance_y}$$
and you can use it if the unknown is the gauge