Separate reflection based on object index cycles

Question: It is possible to separate the reflected background , for example having 2 glossy objects A and B and a hdri image as background  to reflect. I want to have a blurred version of the hdri reflected on object A and a crisper version(or diferent hue) reflected on object B.
I am aware that using the light path node and substracting   glossy and singular ray   it is possible to split the reflection one object having the sharp Bsdf , but i need two glossy objects with roughness non zero each .
thank you
Answer: Starting with two objects with the same glossy material.
Give the objects different Pass Index.

Enable Object Index in the render layer

In the compsitor use an Id Mask node and select the pass index of your object and use that to mix the blurred image with the non blurred one:


Amount required for full sponsoring for a member applying UK visitors visa for 20 days from India

Question: I am planning to bring my family members to visit London for a vacation of 20 days. If I am taking full sponsorship including accommodation, food, and travelling, how much amount do I need to show for a person?
Comment: This is the wrong question. Instead, you need to ask _yourself_ if you actually have enough money to do what you propose.
Comment: They don't have a specific amount in mind, not even a reference amount. The UK is far too variegated to make a meaningful guideline. They look at the premise and itinerary and decide if it makes sense.  We hardly ever EVER see a refusal based on a cosponsor's financial capacity in the first instance. Ever.
Comment: Not sure why people have voted to close this as opinion-based when it's received a comprehensive, entirely objective answer.
Answer: With the permission of @GayotFow, as the editor of his currently-in-draft canonical, here is what you should understand about sponsorship. In this excerpt note the first statement: your sponsorship does not mean that the applicants don't have to show that they qualify for a visa, they do.

Sponsorship Issues
Refused applicants have often made the assumption that having a sponsor eliminates the need to demonstrate that they qualify. This is not true and, in many cases, needing a sponsor actually increases the onus on the applicant to demonstrate that they qualify.
How can this be? To understand this paradox, return to Paragraphs (a) and (c) again and note that neither of them is contingent on having access to money. Indeed, having access to money is covered in Paragraph (e):
must have sufficient funds to cover all reasonable costs in relation to their visit without working or accessing public funds. This includes the cost of the return or onward journey, any costs relating to dependants, and the cost of planned activities such as private medical treatment.
...which is rarely mentioned at all in most refusals! So it's not about the money and it doesn't matter how  wealthy the sponsor is or how much money they are willing to commit; the onus never leaves the applicant to demonstrate that they qualify. See UK visitor visa refused (multiple sponsors) for an example which says:
This refusal cites Paragraphs V 4.2 (a) and (c) of the rules... You can see that they did not challenge your daughter's capacity for sponsorship, they accepted her sponsorship without question. But having a credible sponsor does not alleviate the applicant's burden of meeting the rules.
The ECO is also entitled to be mindful of the sponsor's relationship to the applicant and why the sponsor is willing to undertake a large expenditure of no apparent benefit to them. This is especially true, for example, if the applicant has siblings who have never had sponsorship. When there is no history of a grandparent or parent sponsoring other family members and a single person is going to benefit, the motivation should be carefully explained.
Finally, attestations by the sponsor along the lines of "...my family very much respects UK law and would never overstay..." can damage the sponsor's credibility. Nobody is telepathic and telepathy is the only way such an attestation can be made. See Applied for Family Visit but refused under V4.2(a) and (c):
It doesn't cut any ice to assure them that you will return home after your visit, and assurances like that make for a particularly weak application anyway. Why should you return home?
This is stated more formally in My girlfriend was a refused a visa to visit me in the UK. What now?
A sponsor's responsibility is to demonstrate the capacity to maintain and accommodate the application. Nothing else. Your 'intentions' are irrelevant and attempting to assert them indicates that you do not understand what your role is and, by extension, that you do not understand the rules. This is a fair assumption on their part because, if your friend decided to go underground and disappeared inside the UK, there is nothing you could do to prevent it.


Dangers associated with sous-vide temperature and time

Question: What's the risk associated with leaving pork (vacuum sealed) in water at 35 °C (95 °F) for 12 hours? It's probably a common mistake with sous vide cooking, forgetting to turn the bath on.
Answer: Toss it. That's right in the middle of the danger zone, and hasn't been at a high enough temperature to impede bacterial growth. Not worth the risk.
Answer: The conditions you've described are ideal for growing a pretty vibrant culture of clostridium botulinum (botulism). Maybe you could distill some Botox serum out of it (please note that this is a flippant comment - don't try to make homegrown Botox), but please do not consider serving it as food to anyone.
Answer: Would you eat meat that has been sitting on your porch for a night?
To get a clear understanding of underlying problems, read this: http://www.douglasbaldwin.com/sous-vide.html


Upgrade 13.04 to 13.10

Question: After upgrading 13.04 to 13.10 I have no keyboard. Fresh install of 13.04 and the keyboard is back, Fresh install of 13.10 and no keyboard. The laptop is an older LW40 1.8 Ghz 2Gb ram. A usb keyboard works fine but defeats having the laptops portability.
Oddly Fedora 19 has the same impact on the keyboard.
Any suggestions appreciated.
Answer: I don't know the details of your problem but I just solved a 13.10 upgrade related keyboard issue by looking at this post:
Keyboard not working 100% after Ubuntu 13.10 upgrade
In this case the keyboard worked fine before login and in excel under wine but not in anything else.
This question also had a solution for a keyboard problem but it probably different than yours:
Why did 13.10 break my custom keyboard layout?

Upgrade 13.04 to 13.10


Vmware Fusion 5 Port Forwarding

Question: I have a service (a node.js express app) running on port 3000 in a CentOS 6.3 guest that I would like to access in a web browser on my Mac Mountain Lion host using VMware Fusion 5 Professional.  I am having trouble finding any information about how to do this.  I believe I would like to forward the port but I cannot find any information about this using either the GUI or by modifying configuration files.  In earlier versions it looks like you might have modified a file called nat.conf but that does not seem to apply to Fusion 5.  Has anyone successfully done this?  Thank you.
Comment: looking for the same info. Configuration files such as `/Library/Preferences/VMware\ Fusion/networking` are totally missing. Did you come up with something?
Answer: If you just want to connect to your guest from your host, you don't need to port forward anything.  Use port forwarding to connect to your guest from machines outside of your host.  In your case all you need to do is find the IP Address of your guest, then connect to it from your host.
If you do decide to set up port forwarding, you can use the instructions here: http://nileshk.com/2009/06/24/vmware-fusion-nat-dhcp-and-port-forwarding.html
Also:
http://socalledgeek.com/blog/2012/8/23/fixed-dhcp-ip-allocation-in-vmware-fusion
Make sure to put your static entries below the "DO NOT MODIFY" section of dhcpd.conf.
A couple of things I stumbled on were assigning an IP Address outside of the range of the DHCP scope (on the same subnet, don't forget that) and naming the host in the dhcpd.conf file exactly the same as your guest in VMWare (otherwise it does nothing).
You can restart the VMWare Host DHCP Service with the following commands so that you don't have to restart the app:
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

Vmware Fusion 5 Port Forwarding


Is it possible to convert rain drops to energy?

Question: Would it be possible to convert water drops into energy using a dynamo? A heating mechanism could then be used to transform the water back to a vapor to start the cycle again.
Comment: @ChrisH That sounds very much like him thinking about a perpetuum mobile
Comment: Also what's the point of the heater and turning them back into drops?
Comment: They actually carry very little energy. I've seen calculations and it's not worth it. Google should find some data for you
Comment: @JanDoggen it does. And that's why I just commented rather than working on an answer before knowing
Comment: I dunno, it's how the whole hydrological cycle works. You could use black surfaces to speed it up if you wanted to.
Answer: It's possible, but the best way to do it was devised over a century ago: hydro power. Let the high land collect and channel lots of rain, and then put a turbine on the channel.
The problem is that raindrops, as they fall, have very little energy - very little mass, and pretty low velocity too. Once they've fallen on high land, they've still got a lot of gravitational potential energy; and as they're channeled by the lay of the land, the combined mass becomes high, and there's enough velocity, to make the kinetic energy sufficiently high to justify investing in the infrastructure to harvest the energy.
Comment: More accurately "once they fall on high land and you collect a lot of them, the collection has a lot of energy". Hitting the ground doesn't add energy to the drop.
Comment: Comment only: Raindrops dissipate even more energy than one may expect when falling because they do not fall in the drop shapes that everyone shows in drawings but as wider and more flattened 'blobs' with greater frontal areas and so lower velocities.
Answer:
Would it be possible to convert water drops into energy using a dynamo? A heating mechanism could then be used to transform the water back to a vapor to start the cycle again.

Any rainfall can be used to supply energy but the energy available for typical volumes and "heads" is so small as to make the exercise not worthwhile.
An exception is if you are in an extremely rain-blessed environment with a large collection area and can channel the water so it falls in a controlled manner over a significant "head", or at good volume and flow rate but little 'head'. In the first case you end up with a microhydro system and in the second something more akin to a traditional waterwheel.
The problem is the available energy compared to available rain and typical energy needs (or desires). Below I'll start with 100% efficiency assumed.
Anywhere I say "=" or equals it usually means 'close enough to = that's it's not worth saying "about" all the time.
A litre of water weighs close enough to 1kg. A US gallon is close enough to 4 kg for this exercise. A litre of water falling through a 'head' of 1 meter (about 3 feet) acquires a kinetic energy content of about 10 Joule = 10 Watt seconds.
Watts seconds = litres x metres x 10 x efficiency
That is enough to light
a 10 Watt bulb for 1 second or
a 1 Watt bulb for one second or
a single small bright high efficiency white LED (at 50 milliwatts) for 200 seconds.
A single modern very high performance white LED run at 16mA x 3V = 50 milliWatts will produce about 10 lumens of light. That's enough to read a book by comfortably. Above we said that 1 litre.metre of water at 100% efficiency would operate this LED for 200 seconds. To light it for an hour requires 3600 seconds/200 = 18 litre metres at 100%.
If we have a 10 foot/3 metres fall from gutter to generator we need 18/3 = 6 litres per hour to do this at 100% efficiency. If roof area collecting water was 1000 square feet = 100 square metres we need only 6/100 mm/hour at 100% efficiency.
Real world efficiency overall of such a system is liable to be around 20% - over 50% may be possible with great care and much less than 20% is easy :-). At 20% we need 0.3mm/hour of rain to run our LED.
That's doable.
Alas, our real world desires soon catch up with use.
A mains LED bulb of 5 Watts is "small".
That's 5/.05 = 100 x larger than our LED
= 30mm/hour of rain or a bit over 1 inch.
You CAN get more than 1" per hour of rainfall  in some places just occasionally, but if you've ever seen it you'll remember :-).
If it takes extremely heavy rain on a 1000 square foot roof to light a single 5 Watt bulb, larger power levels will be unachievable by this means.
If you can manage a good flow rate (small stream or better) AND a good head then useful power can be provided.
1 US gallon per second x 30 foot head gives about 100 Watts output.
Not enough for heating but useful for light or maybe a small TV (but probably not both).
To supply say 10 kW to a home with a mix of cooking, heating, air conditioning, lighting, TV etc requires 10,000/10 = 1000 litre.metres of water flow.  If a dam has say 100 feet = 30 metres of head that's about 30+ litres = 8+ gallons per second x 100 foot head to power your home. Or more.
This DOES get supplied by falling raindrops and DOES get returned by solar heat in due course and is not a "perpetuum mobile" as someone suggested, as the sun is non sustainable, but the scale is utterly too vast for all but a very few individuals.
Comment: [This question about energy storage](http://sustainability.stackexchange.com/questions/5457/can-pumped-water-energy-storage-be-combined-with-rainwater-harvesting/5460#5460) goes into more detail on the amount of water/height required


Are there any ebook search engines?

Question: Are there any websites that work like ebook search engines, where you can perform a search over multiple stores and have the results sortable and/or filterable for file format, price, presence of DRM, and so on?
Comment: books.google.com?
Answer: The one I use is Luzme It queries several stores including Kobo, Amazon, B&N and in several countries.
It then for each book shows the price that it last saw for each source and country.
It is searchable by book name and author and series, although the series data is not complete as it comes from the stores.
You can set up a wishlist of books and emails can be sent when they change price.
This site does provide DRM status if the store makes that data available.
The format is not shown however Amazon sites provide Kindle format and others at least ePub - I would be interested in any exceptions
Comment: Luzme does provide DRM status when known. For example, http://luzme.com/author/Andrew+Hunt/book/The+Pragmatic+Programmer+%3A+From+Journeyman+to+Master. The problem is that most sites don't show the DRM status, even when it should be DRM-free. (Disclaimer: Luzme is my site)
Answer: Calibre is a downloadable (free, donations accepted) application that will allow you to search over multiple stores, for content. Using the get books function, to provide information like comparative pricing between retailers and DRM status of the work at different retailers.
Answer: Yes there are. The one I remember is Inkmesh.
You can filter by price, type (ebook, magazine, audiobook, etc.) device and language. Its database has large gaps though.
This site does not provide DRM status.
Answer: There is a decent search engine called Leatherbound ebook search engine. Like Inkmesh and Luzme it allows you to search for a book across multiple stores and price compare. Here is a sample search result (for an entertaining book I might add).
In addition, you can search for printed books, free ebooks, ebook under $5 and some advanced search options.
This site does not provide DRM status.
Answer: Amazon only enhanced search engines (I'll group these together since they don't quite fit the question, but are still worth a mention).

Jungle-Search is an interesting search engine. It's not limited to ebooks and is Amazon only (though you can choose from various Amazon stores, such as CAN/US/UK/GER/FRA). The purpose of this search engine is to allow you to more easily search by discount rates and price ranges.
Here is the how-to section (for US since most of our users are US; you can easily switch to another country at the top).

eReaderIQ allows you to search amazon, track books and add them to a watch list (being notified of price drops for books, authors etc.). It also has a history of pricing for ebooks. This is available for US/CAN/UK Amazon sites.
Comment: Why the two answers? You could just have edited your first one and extend it.
Comment: @Anthon: Because on many SE sites, questions that are asking for a site that does abc or a software program that does xyz people tend to complain when you put many answers in one (makes it harded to vote for good ones and down vote poor ones when they are mixed together). The only reason I grouped these two together is because they didn't were limited to Amazon only, which isn't quite what the question asked for. I figured people can downvote this one if they felt it wasn't fulfilling the requirements enough. My other answer hits more of the requirements and is probably a better choice.
Comment: The test I ran on Jungle Search, seem to go straight to Amazon so DRM would be identified on their site.
Comment: On eReaderQ it looks like 'Lending: Enabled' = DRM free but I did not validate that assumption.

Are there any ebook search engines?


Ubuntu 12.04: Cannot login to tty[1-6] except as root

Question: When I press [Ctrl+Alt+F<1-6>] it takes me to tty1 through tty6 respectively, no problem. But at the login prompt, if I try to login with my username and password, it just immediately takes me back to the same login prompt. The only way I can actually log in to the console is as root.
Here're the relevant lines from my /var/log/auth.log
Nov 2 21:03:04 bhh1988-H67MA-USB3-B3 login[3116]: pam_unix(login:session): session opened for user bhh1988 by LOGIN(uid=0)
Nov 2 21:03:04 bhh1988-H67MA-USB3-B3 login[3116]: pam_unix(login:session): session closed for user bhh1988
Nov 2 21:03:53 bhh1988-H67MA-USB3-B3 login[5546]: pam_unix(login:session): session opened for user root by bhh1988(uid=0)
Nov 2 21:03:53 bhh1988-H67MA-USB3-B3 login[8258]: ROOT LOGIN on '/dev/tty1'

You see that at 21:03:04 I try to login as bhh1988, but the session just opens and immediately closes. About 50 seconds later I tried logging in as root, which is successful. Interestingly it says that the session was opened by bhh1988 (my username) though.
I also checked out /var/log/syslog and /var/log/kern.log. At the time of the login failure, I see the line:
Nov 2 21:03:04 bhh1988-H67MA-USB3-B3 kernel: [ 1430.218803] init: tty1 main process ended, respawning

Any idea what's going on, or what else I can look at for more clues?
I am on Ubuntu 12.04
EDIT:
Here is my /etc/pam.d/login file:
#
# The PAM configuration file for the Shadow `login' service
#

# Enforce a minimal delay in case of failure (in microseconds).
# (Replaces the `FAIL_DELAY' setting from login.defs)
# Note that other modules may require another minimal delay. (for example,
# to disable any delay, you should add the nodelay option to pam_unix)
auth       optional   pam_faildelay.so  delay=3000000

# Outputs an issue file prior to each login prompt (Replaces the
# ISSUE_FILE option from login.defs). Uncomment for use
# auth       required   pam_issue.so issue=/etc/issue

# Disallows root logins except on tty's listed in /etc/securetty
# (Replaces the `CONSOLE' setting from login.defs)
#
# With the default control of this module:
#   [success=ok new_authtok_reqd=ok ignore=ignore user_unknown=bad default=die]
# root will not be prompted for a password on insecure lines.
# if an invalid username is entered, a password is prompted (but login
# will eventually be rejected)
#
# You can change it to a "requisite" module if you think root may mis-type
# her login and should not be prompted for a password in that case. But
# this will leave the system as vulnerable to user enumeration attacks.
#
# You can change it to a "required" module if you think it permits to
# guess valid user names of your system (invalid user names are considered
# as possibly being root on insecure lines), but root passwords may be
# communicated over insecure lines.
auth [success=ok new_authtok_reqd=ok ignore=ignore user_unknown=bad default=die] pam_securetty.so

# Disallows other than root logins when /etc/nologin exists
# (Replaces the `NOLOGINS_FILE' option from login.defs)
auth       requisite  pam_nologin.so

# SELinux needs to be the first session rule. This ensures that any
# lingering context has been cleared. Without out this it is possible
# that a module could execute code in the wrong domain.
# When the module is present, "required" would be sufficient (When SELinux
# is disabled, this returns success.)
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close

# This module parses environment configuration file(s)
# and also allows you to use an extended config
# file /etc/security/pam_env.conf.
#
# parsing /etc/environment needs "readenv=1"
session       required   pam_env.so readenv=1
# locale variables are also kept into /etc/default/locale in etch
# reading this file *in addition to /etc/environment* does not hurt
session       required   pam_env.so readenv=1 envfile=/etc/default/locale

# Standard Un*x authentication.
@include common-auth

# This allows certain extra groups to be granted to a user
# based on things like time of day, tty, service, and user.
# Please edit /etc/security/group.conf to fit your needs
# (Replaces the `CONSOLE_GROUPS' option in login.defs)
auth       optional   pam_group.so

# Uncomment and edit /etc/security/time.conf if you need to set
# time restrainst on logins.
# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
# as well as /etc/porttime)
# account    requisite  pam_time.so

# Uncomment and edit /etc/security/access.conf if you need to
# set access limits.
# (Replaces /etc/login.access file)
# account  required       pam_access.so

# Sets up user limits according to /etc/security/limits.conf
# (Replaces the use of /etc/limits in old login)
session    required   pam_limits.so

# Prints the last login info upon succesful login
# (Replaces the `LASTLOG_ENAB' option from login.defs)
session    optional   pam_lastlog.so

# Prints the motd upon succesful login
# (Replaces the `MOTD_FILE' option in login.defs)
session    optional   pam_motd.so

# Prints the status of the user's mailbox upon succesful login
# (Replaces the `MAIL_CHECK_ENAB' option from login.defs).
#
# This also defines the MAIL environment variable
# However, userdel also needs MAIL_DIR and MAIL_FILE variables
# in /etc/login.defs to make sure that removing a user
# also removes the user's mail spool file.
# See comments in /etc/login.defs
session    optional   pam_mail.so standard

# Standard Un*x account and session
@include common-account
@include common-session
@include common-password

# SELinux needs to intervene at login time to ensure that the process
# starts in the proper default security context. Only sessions which are
# intended to run in the user's context should be run after this.
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
# When the module is present, "required" would be sufficient (When SELinux
# is disabled, this returns success.)

The only obvious thing to look for to me from this login file is the part that says:
# Disallows other than root logins when /etc/nologin exists
# (Replaces the `NOLOGINS_FILE' option from login.defs)
auth       requisite  pam_nologin.so

But I don't have an /etc/nologin so that doesn't appear to me the culprit.
Comment: Can you provide the /etc/password line for bhh1988 (it doesnt actually contain the password - thats in /etc/shadow, but it shows the login shell.  I'm wondering what the shell is set to.  ALso, can you provide the output of /etc/pam,d/login - as this may be set (somehow) to only allow root logins.  Also see http://stackoverflow.com/questions/12550779/only-root-can-login-possible-reasons if you have been playing with vm.mmap_min_addr.
Comment: Thanks for helping. My shell in /etc/passwd is just /bin/bash
Comment: Sorry, I'm stumped !!!
Answer: I had similiar problem.
Try login bhh1988 from root console. It will show error message.
In my case I typed usermod -s bash auser but correct was usermod -s /bin/bash auser.


Where can I find a good Joseki database?

Question: I've been wondering about certain positions that arise often. To help me understand them, I would like to study the joseki moves. Since printed joseki dictionaries are out-dated very fast, I'd prefer an electronic database if possible.
Comment: (1 item per answer preferably)
Comment: Should this be CW?
Answer: Kogo's Joseki Dictionary
Kogo's Joseki Dictionary is certainly the best known resource in the west. It's an SGF file that contains a huge list of common and uncommon joseki moves including some comments, some even with the game where they occurred.
It is reliable in general, even though there are some mistakes (that are probably difficult to spot unless you're dan or even high dan level).
KJD is included in Eidogo online, so you don't need to download the SGF anymore.
Comment: This is what [Nick Sibicky](https://www.youtube.com/user/nicksibicky) is recommending.
Answer: Josekipedia
http://www.josekipedia.com/
This is a kind of wiki for joseki. This system has the big advantage of offering explanations, deviations from joseki and refutations,... But I don't know how complete or accurate it is.
Comment: (Disclaimer: I'm a top contributor at JP) The sourced variations are accurate, though their description is sometimes off. Nonsourced variations tend to be "reasonable", but not as reliable as, for instance, KJD. Recent variations show up almost instantly, though many of them as "question".
Answer: Daily Joseki
http://dailyjoseki.com/browse
This joseki database is condensed from a database of pro-games. One problem with this approach is that it doesn't contain any explanations or refutations.

It also offers some joseki memorization system, but I never tried it myself.
Comment: Nice idea, but seems to offer little practical value
Answer: Brugo
http://www.brugo.be/
Brugo is probably the only dictionary maintained by pros. It includes a few variations not seen anywhere else and tends to be very reliable (as far as I can confirm this).
There are a few tools (like a joseki quiz) rarely found anywhere else.
Answer: Nice one with discussion of the positions is here:
http://senseis.xmp.net/?Joseki
This page is referred to as a source by Josekipedia.com:
http://senseis.xmp.net/?GendaiJosekiJiten
But I am not actually sure what that is, if it is equal to http://senseis.xmp.net/?Joseki or not.
Comment: The Gendai is one of many sources for both senseis/joseki and josekipedia, but I would be very surprised if anyone actually input all of Gendai's content into either database. Further, those databases contain (tons of) information from elsewhere. So they are certainly not equivalent, but rather supplementary.
Answer: I use this one:
http://www.learngo.co.uk/Joseki.php?Sequence=4-4,6-4
This one is the best in the sense that you immediately see how the board will look like afterwards, so you can choose proper Joseki according to your current context. But some Josekis (like 5-3) are unfortunatelly missing there.
Comment: It looks very limited to me; looking at http://www.learngo.co.uk/Joseki.php?Sequence=4-4,6-3,8-3 , after ◯ enters at 3-3 I only see ⬤ blocking at 4-3 (between 3-3 and the kakari), while 3-4 is also a standard variation to close ◯ into the corner. While it is nice to see all intermediate stages, it does take an awful lot of screen space to present josekis like this.


How do I figure out why a tomcat6 webapps dir symbolic link works on one machine, but not another?

Question: I recently built an Ubuntu virtual machine for MarkLogic development.  The machine was then distributed to 4 other developers to provide a consistent dev platform.  Now I'm setting up another piece to the dev puzzle that consists of some java libraries and a JSP web application.  The project source lives in the developer user home directory (each machine has the same exact account).  I added a symbolic link into the /var/lib/tomcat6/webapps/ directory that points to the web application source root in the project directory.
/var/lib/tomcat6/webapps/jspapp -> /home/developer/dev/workspace/svn/Project/webapp/

(The actual JSP files live in the Project/webapp directory.)
This works fine on my instance of the VM.  I successfully replicated the setup to one other VM and it worked fine.  However, the rest of the VMs on which I replicate the setup don't work.  On the first 2 VMs, I get the web app's pages.  On the other VMs I get 404s.
The VMs were all cloned from a single original.  All of the web app project source is the same except for 1 configuration value (the local machine's IP address).  I created the symbolic link in the same way on each and verified that permissions/modes of the files and directories are the same.  I compared the tomcat installation directories and see no configuration differences between them.  The only file differences I do see are what appear to be the cache data of Catalina.  For all intents and purposes, the setups are identical.  Yet, clearly, something is not the same.
Does anyone have a suggestion as to how I can troubleshoot this problem?  I am rather new to the linux world and brand new to tomcat.
Update - I copied the contents of the linked directory into a real directory of the same name (after deleting the link) and it still doesn't work.  However, I can see a copy of /var/lib/tomcat6/webapps/ROOT/index.html that I put into the directory in question.  It's behaving almost like the JSP files are getting ignored.
Comment: have you checked the tomcat logs yet?
Comment: I checked the logs and I don't see anything related to this problem.  Perhaps I can increase the verbosity of the logs...
Comment: I found `/var/lib/tomcat6/conf/logging.properties` where I changed the logging level of `[Catalina].[localhost]` as well as uncommented 4 lines for `catalina.startup`, `catalina.session` & `catalina.core`. This seemed to have an affect. I get more log entries, but still nothing related to the error.
Answer: A quick checklist:

Check that allowLinking="true" was set in your Tomcat config: https://stackoverflow.com/questions/315093/configure-symlinks-for-single-directory-in-tomcat/315145#315145
Check that the user of the tomcat process has execute permission on every parent folder of the /home/developer/dev/workspace/svn/Project/webapp/ directory (i.e. /home, /home/developer, /home/developer/dev, /home/developer/dev/workspace, ...)


Legal status of telecommute work in Mexico (with a temporary resident status)

Question: Is it officially allowed for a resident alien in Mexico (temporary resident, not allowed to work for Mexican companies) to provide services as a remote worker to the companies outside Mexico? I've asked several several attorneys and checked several sources in the internet and they all give different answers.
Answer: When we applied for residency before moving to Mexico from New Zealand in 2016 we asked the consulate (during our interviews) about the need for work permits and explained that I wanted to work remotely for a NZ company. The Mexican consulate told me that was my only option, they had not approved me for a work permit under the Residente Temporal, so could not work for a Mexico company or be paid into a Mexico bank account. However they said they had no problem with my working remotely for a company outside of Mexico as long as I was paid into a bank account also outside of Mexico.
When we arrived in Mexico and had to finish the residency permit requirements the immigration officers here reiterated the same restrictions.
See also a similar question I asked here, and the follow up answer I added once we had settled - Remote international contract work - visa requirements
Comment: Thanks. May I ask if you also know what are the income tax regulations for this income?
Comment: @Khirange, You need to ask a lawyer about that. If you are a tax resident of Mexico the income is taxable, but "resident" for tax purposes isn't the same as "resident" for immigration purposes. If you have little or no Mexican income and can argue that your primary home and "vital center of interests" is elsewhere you might escape taxes, otherwise you'll owe them. A lawyer would have an informed opinion.
Comment: @Dennis, it's always better to get information from several sources, and lawyers here don't really know much about the situations like this. Escaping taxes isn't something what I'd like to do, as you just _have_ to pay income taxes somewhere, and if you don't you're probably going to have problems sooner or later.


Why did Robert E. Lee say that George McClellan was the best general he ever faced?

Question: In administration, preparation, and morale, he may have been excellent, but in starting campaigns he was ruinously cautious and in battles he was reluctant to sustain casualties.
In the the Peninsula campaign, Confederate General Joe Johnston said "Nobody but McClellan would have hesitated to attack".
In the subsequent retreat (necessitated by his hesitancy and mistakes), he conducted a skillful retreat, but wars aren't won by retreats.
Comment: When and where did Lee say this?  Can you provide some context?
Comment: I think it's clear that McClellan could have been an excellent general in a great many wars. The Civil War just wasn't one of them.
Comment: People's comments are often misunderstood or misremembered. Given  how the battles and campaigns went it is improbable that Lee respected McClellan as a commander more highly than some of the other Union generals Lee faced. In particular Ulysses 'Sam' Grant (to whom Lee surrendered and who, however hard Grant had fought during the war, offered quite mild and conciliatory surrender terms at the end. Also Gordon Meade, a friend of Lee's before the war, who Lee could not beat at Gettysburg and who as Grant's effective lieutenant afterwards may share some of his credit for victory.
Comment: Lee probably said it in the hopes that Lincoln would hire McClellan again for a 3rd time.  ;)   seriously though I am not familiar with that quote.  Btw, McClellan was the a very good general at preparing and building an army.
Comment: OK, I did search for answers to this question first, but must have phrased things differently since I just now found a few not-implausible answers or conjectures.
As to a source for the (purported) quote... https://studycivilwar.wordpress.com/2014/08/23/did-lee-say-this/ says that R.E. Lee Jr. mentioned in his book that he'd heard it second-hand.
Answer:
Question:
  Why did Robert E. Lee say that George McClellan was the best general he ever faced?

Short Answer
The quote was from a conversation Lee had with his cousin after the war and comes to us 3rd hand from someone who was not in the conversation.  It was recorded 30+ years removed from Lee's death.  So it's very possible Lee never made the statement.  It's also possible that Lee said it but that the intent of the statement was mistook.  Two old men,  one could imagine Lee makes the statement and both men erupt in laughter afterwards.  Robert E. Lee could have meant it as George McClellan was the best Union General because he did such a fine job of training and building up the Army of the Potomac after the First Battle of Manassas, something history commends him with having achieved.  Or Robert E. Lee could have meant it as McClellan was the best Union general because I understood him so completely and defeated him so consistently (Seven Day's Wars, .  Lee's favorite Union General?  The "best" Union General for Lee.  Beyond that Robert E. Lee is also credited with saying some kind words about General U.S. Grant.  Lee said Grant was the greatest General in History.  Not a direct quote but it captures the intention.  Lee also said "Grant was the premier Union General, who had exceeded all the other more noted names" in the civil war.
The entire quotes and conversation are given below.
Background
These words were attributed to Robert E. Lee(Jan 19, 1807 – Oct 12, 1870) 3rd hand, decades after his death.  They appear in the book written by Lee's son "Recollections and Letters of General Robert E. Lee" first published in 1904, on page 416.  Lee's son says his father was talking to his first cousin Cassius Lee(May 22, 1808 - Jan 23, 1890) in Arlington Virginia, after the war.  The conversation was related to the author, Robert E. Lee Jr.  by Cassius Lee's son, Mr. Cazenove Lee(May 30, 1850 - 26 Apr 1912) who was 15 years old when the civil war ended.
Here is the paragraph from the book.

Mr. Cassius Lee was my father's first cousin. They had been children together, schoolmates in boyhood, and lifelong friends and neighbours. He was my father's trusted adviser in all business matters, and in him he had the greatest confidence. Mr. Cazenove Lee, of Washington, D. C., his son, has kindly furnished me with some of his recollections of this visit, which I give in his own words:
  "It is greatly to be regretted that an accurate and full account of this visit was not preserved, for the conversations during those two or three days were most interesting and would have filled a volume. It was the review of a lifetime by two old men. It is believed that General Lee never talked after the war with as little reserve as on this occasion. Only my father and two of his boys were present. I can remember his telling my father of meeting Mr. Leary, their old teacher at the Alexandria Academy, during his late visit to the South, which recalled many incidents of their school life. They talked of the war, and he told of the delay of Jackson in getting on McClellan's flank, causing the fight at Mechanicsville, which fight he said was unexpected, but was necessary to prevent McClellan from entering Richmond, from the front of which most of the troops had been moved. He thought that if Jackson had been at Gettysburg he would have gained a victory, 'for' said he, 'Jackson would have held the heights which Ewell took on the first day.' He said that Ewell was a fine officer, but would never take the responsibility of exceeding his orders, and having been ordered to Gettysburg, he would not go farther and hold the heights beyond the town. I asked him which of the Federal generals he considered the greatest, and he answered most emphatically 'McClellan by all odds.' He was asked why he did not come to Washington after second Manassas.
  .
  "'Because,' he replied, 'my men had nothing to eat,' and pointing to Fort Wade, in the rear of our home, he said, 'I could not tell my men to take that fort when they had had nothing to eat for three days. I went to Maryland to feed my army.'

To add credibility to the quote.  After Stonewall Jackson died at Chancellorsville and before Lee's invasion of the North the second time; Lee reorganized his army into 3 corps.  The first under Longstreet.  The second under Ewell and the third under General AP Hill.  Hill and Ewell had previously been division commanders under Jackson.  So it makes sense that Lee would contrast Ewell's conduct to that of Jackson his greatest subordinate tactician.  Also elements of Ewell's command did capture the town of Gettysburg June 26, 1863 prior to the main battle.   Lee had issued orders that Ewell was to take the high ground outside the city called Cemetery Ridge, but added the words "if practicable".  Ewell did indeed survey the field and determined taking the ridge was not practicable and didn't attempt it.  That ridge was the defensive position which repulsed Picket's Charge, delimited the "high water mark of the Confederacy", and shattered Lee's army.
On the other hand, there were more than 30 forts defending Washington DC during the Civil War.  None of them were named Fort Wade.  The only Union civil war fort named Fort Wade I found was in NY.
Washington's Civil War Defenses and the Battle of Fort Stevens

Answer
It's hard to believe Lee's words were meant to suggest that McClellan was the best Union General of the war.
Perhaps Lee was complementing McClellan on his ability to train and discipline his army.  Something Lee would have appreciated.   After the first battle of bull run when the Union army broke and panicked in falling back on their Capital, McClellan had systematically rebuilt that army into a new greatly expanded fighting force.  Even McClellan's critics credit McClellan with doing a fine job of rebuilding the Army of the Potomac after their initial defeat.
Here is Lee's record against McClellan in 1862 before McClellan was relieved of his command by Lincoln.  Tactically McClellan actually won many of the engagements.  Strategically though McClellan was always retreating as the battles move from Richmond north across Virginia into Maryland.

June 26, Battle of Beaver Dam Creek, Virginia. Tactical Union Victory,  McClellan however retreats
June 27, Battle of Gaines Mill, Virginia, clear-cut Confederate tactical victory,  McClellan retreats.
June 27–28, Battle of Garnett's Farm and Golding's Farm, Virginia*. tactical Union victory, McClellan decides to give up on sieging Richmond and retreat.
June 29, Battle of Savage Station and Allen's Farm, Virginia*,  Stalemate -  McClellan retreats.
June 30, Battle of White Oak Swamp, Virginia.  Artillery Duel, Lee fails to send his infantry into the Frey and again McClellan retreats.
June 30, Battle of Glendale, Virginia. McClellan is not fighting for the life of his army.  Tactically it's inconclusive, but only because McClellan retreats and in doing so escapes.
July 1, Battle of Malvern Hill, Virginia. Tactical Union Victory,  due to Unions superior artillery and Confederates 3 frontal attacks into that artillery.  McClellan is absent from the battlefield and after the battle again retreats.
August 9, Battle of Cedar Mountain, Virginia. Confederate Victory Stonewall Jackson defeats Banks with a counter attack.
August 28–30, Second Battle of Bull Run Manassas, Virginia,  Confederate Victory.  Lee defeats Pope.  Afterwards Pope is released of his command.
September 12–15, Battle of Harpers Ferry, (West) Virginia,  Great Confederate Victory.  Largest Union Surrender of the War.  Jackson and Hill defeats Miles and White.
September 14, Battle of South Mountain, Maryland. Union Victory,  McClellan fails to follow up and destroy Lee's outnumbered forces before he can mass is troops.
September 17, Battle of Antietam / Sharpsburg - Tactically inconclusive; Union strategic victory, Lee turns south.

Lee had taken command of the Confederate forces when McClellan was a few miles outside of Richmond at the culmination of the Peninsula_Campaign.  Lee was outnumbered and McClellan had even more re-enforcements coming.  Lee set about evissorating McClellan command in the Seven Days Battles systematically marching him backwards until he was forced to withdraw.  This resulted in McClellan numerically superior forces being forced to shelter under the US Navy's guns for fear of Lee's numerically inferior forces.  Lee ultimately pushed McClellan all the way back to Washington DC.  In many battles between the two, Lee arguable never lost a battle.  The best McClellan ever did was the Battle of Antietam where McClellan with more than twice the men and advanced knowledge of Lee's battle plans was able to check Lee's initial invasion of the North and force him back south.  Still McClellan took most of the casualties at Antietam and history remembers it as more of a stalemate.  McClellan's best showing against Lee.  After Antietam McClellan would be relieved of his command by Lincoln.
Perhaps Lee was saying McClellan was "his" favorite Union General to fight against?  The best Union General in his view.  Like General Halsey saying in WWII, "the only good Jap is a dead Jap".  This makes sense as Lee really had his way with McClellan in nearly every battle. So perhaps what Lee really meant was McClellan was the best Union General, because Lee spanked him so completely and consistantly.
Lastly I'll say,  Lee was known to have had some very kind words for General Grant the man who not only defeated him in battle, but put Lee on the defensive and defeated him in the War.  Three things McClellan never achieved.

Source page 54
  Within a few weeks of General Grant's death, a person in conversation with General Lee refereed to General Grant as a military accident, who had no distinguishing merit, but had achieved success through a combination of fortunate circumstances."  Lee Replied: "Sir, your opinion is a very poor compliment to me.  We all thought Richmond protected, as it was, by our splendid fortifications and defended by our army of veterans, could not be taken.  Yet Grant turned his face to our capital and never turned it away until we had surrendered.  Now, I have carefully searched the military records of both ancient and modern history, and have never found Grant's superior as a general, I doubt if his superior can be found in all history."

I found this same story page 338, attributed to General James Grant Wilson.

Ron Chernow's,  GRANT page 517
  The Reverend George W. Pepper, a chaplain in Sherman's army said Lee named Grant as the premier Union General: "Both as a gentleman and as an organizer of victorious war, General Grant has excelled all your most noted soldiers"
Answer: SHORT ANSWER
Lee statement's on his Union opponents are either contradictory or have come to us second or third hand. Little can be attributed to Lee with certainty, and none of it reveals much. The rest may be true, or true in part, or simply fabricated. At various times, he is reported to have said that Generals McClellan, Grant, Meade and Sherman were the best.
If all that has been attributed to Lee is true, he would not be the first person to make contradictory statements. If we are to believe all the sources, Lee's opinion seems to have changed from effusive praise of Grant in 1865 to an almost equally enthusiastic endorsement of McClellan by 1870.
There are circumstances which suggest Lee may have changed his opinion for reasons (personal and political, see detailed answer) other than battlefield experience, and the same may be true to some extent concerning Grant's somewhat critical assessment of Lee. He may also have felt, as suggested in his correspondence, that there were other issues which were more important than who was the best general.

LEE ON UNION GENERALS
In roughly chronological order, Lee either wrote or is alleged to have said the following on Union generals:

McClellan, 5th June, 1862
Lee wrote to Jefferson Davis shortly before the Seven Days Battles. In this letter, Lee says:

McClellan will make this a battle of Posts. He will take position from
  position, under cover of his heavy guns & we cannot get at him without
  storming his works, which with our new troops is extremely hazardous.

Lee was clearly not unappreciative of McClellan's intent and recognized that it posed problems for his Confederate army, but this falls someway short of 'best general'.

McClellan, 5th November 1862
That Lee found McClellan predictable is evident in his reaction to hearing that McClellan had been removed from command by Lincoln. One of Lee's subordinates, Lt General James Longstreet noted Lee's response to this news:

General Lee, on receiving the news, said he regretted to part with
  McClellan, "for," he added, "we always understood each other so well.
  I fear they may continue to make these changes till they find someone
  whom I don't understand."

Grant, 24th July, 1864
In a letter dated 24th July 1864 from Lee to his son George Washington Custis Lee wrote:

Where are we to get sufficient troops to oppose Grant? He is bringing
  to him now the 19th Corps & will bring every man he can get. His
  talent & strategy consists in accumulating overwhelming numbers.

Lee's frustration is evident and should probably be seen in the context in which it was written; Lee was facing Grant's numerically superior forces in Virginia, supplies were running short, and Petersburg was under siege, while elsewhere confederate forces had failed to halt Sherman's advance on Atlanta.

Grant & Sherman, May 1865
This lengthy account is from a chaplain in Sherman's army, Captain George W. Pepper. Its reliability is questionable, not least because it quotes an almost effusive Lee at great length. It seems unlikely that Pepper could have remembered so much of what Lee said to directly and accurately quote him at such length, even if he had made notes immediately after the meeting (which he may well have done – Pepper kept notes during the campaign and published them). Pepper only published this account in 1899, more than 30 years his account of Sherman's campaigns. Ron Chernow, in Grant (2017) only cites Pepper on Grant, and without commenting on the credibility of this source (while casting doubt on McCormick below).
According to Pepper's account in Under Three Flags, he went to Lee's house accompanied by General John W. Geary and spoke at some length to Lee shortly after the surrender.

General Lee now adverted to the character of General Grant, of whom he
  spoke in the most friendly words and terms.... he possessed all the
  requisites and talents for the organization of armies.

A little further on in this account, Pepper asks Lee about Sherman. While critical of the 'scorched earth policies' during the march to the sea (Nov-Dec 1864), Pepper quotes Lee as saying

As a strategist and commander of men, Sherman has displayed the
  highest order of military genius.... he is, in my opinion, the most
  successful of the Federal officers who have played a prominent part in
  the history of the war.

Pepper then continues:

I asked him who was the greatest of the Federal generals.
"Indeed, sir, I have no hesitation in saying General Grant. Both as a
  gentleman and as an organizer of victorious war, General Grant has
  excelled all your most noted soldiers. He has exhibited more true
  courage, more real greatness of mind, more consummate prudence from
  the outset, and more heroic bravery, than anyone on your side."

Assuming that there is some truth in Pepper's account, we must still consider that Lee's thoughts on Grant may well have been favourable in large part because of the latter's lenient terms of surrender at Appomattox about a month earlier. Also, Lee may simply have been playing the perfect host, but it is nonetheless likely that Pepper's account has been embellished.

Grant, sometime between 1865 and 1870
This source (McCormick) has Lee reportedly saying:

I have carefully searched the military records of both ancient and
  modern history, and have never found Grant's superior as a general.

Source: William C. Davis, Crucible of Command: Ulysses S. Grant and Robert E. Lee--The War They Fought, the Peace They Forged (2015)
However, the authenticity of this has been disputed, and it's not hard to see why when one considers that

It originated in a brief article by S. D. McCormick,... (July 17,
  1897).... he described it as "another occurrence, which was currently
  reported among the students"; in other words a campus rumor [at
  Washington College, where Lee was President 1865-70), and one not set
  down by him until some thirty years later.

Source:  Davis

Meade, sometime between 1865 and 1870
On General Meade, who defeated Lee at the Battle of Gettysburg, there is this in:

a letter he supposedly wrote after the war [which] circulated in
  Washington. In it he declared that the Yankee with "the greatest
  ability" was Meade, and that "he feared Meade more than any man that
  he ever met upon the field of battle."

Source: Davis
The contents are plausible given what happened at Gettysburg, but the words "a letter he supposedly wrote...circulated in Washington" do not inspire confidence in this source. Lee's curt (especially for him) refusal to attend a Gettysburg reunion in August 1869 may be an indication of how painful for him the defeat he suffered there was.

McClellan, sometime before 24th January 1870
This is cited by Davis. He comments that it "may not be authentic". He relates that General Lee

reportedly told a cousin that the Federals' finest commander was
  McClellan. "Oh yes!" Lee reportedly exclaimed, "he was the ablest
  soldier they had."

Davis' source for this is given in the endnotes as:

J. F. Lee to Fitz-John Porter, January 24, 1870, "Knapsack," North &
  South, 5 ( July 2002), p.11.

Unfortunately, I haven't been able to access this source for a closer look but J. F. Lee may well be a relative of General Lee, John Fitzgerald Lee, a 1834 West Point graduate who was Judge Advocate of the Army 1849-62. Caught between loyalty to his Virginia relatives and his duties in Washington (pdf), he fell out of favour and resigned, retiring to his farm in Maryland.
The recipient of the letter (?) is more intriguing. In January 1863, Union Major General Fitz-John Porter was "found guilty of disobeying a lawful order" in a controversial court-martial. Porter was a McClellan loyalist and his conviction was widely seen as a political act; in convicting him, the court was condemning McClellan who had been removed from command shortly before the trial began. Before the Civil War, Porter had been post adjutant for Robert E. Lee at West Point, and Lee was one of the people he wrote to for assistance during his long attempt to clear his name. It may well have been Robert E. Lee who put Porter in touch with J. F. Lee who, having been Judge Advocate of the Army, would have been a useful contact when Porter sought to clear his name. After many years of high-level political wrangling (it's complicated), Porter was cleared and restored to the army in 1886.
Where does all this lead? Porter had connections to the Lee family and he had been professionally associated (at least) with Robert E. Lee. He was a McClellan loyalist, and feelings ran high over his conviction and on McClellan in general. It is plausible that Robert E. Lee said something highly favourable about McClellan, possibly because he felt the condemnation of McClellan had gone too far, or possibly as a kind of moral support for Porter, a victim because of his association with McClellan. On the other hand, if the General did not say it, it is plausible that he had at least spoken favourably of McClellan and J.F. Lee embellished it in his communication with Porter.

McClellan, July 1870
Davis notes that this source "may not be authentic". In Recollections and letters of General Robert E. Lee (1904), the General's son Capt. Lee cites Cazenove Lee, son of the General's cousin Cassius Lee 'in his own words', but some 35 years after the General's visit to his cousin Cassius' home in mid July 1870.

I asked him which of the Federal generals he considered the greatest,
  and he answered most emphatically 'McClellan by all odds.'

Lee could simply have been referring to McClellan's organizational ability and his popularity with his army which, as has already been noted several times in comments and by JMS in his answer, is generally not disputed.
On the other hand, Lee's apparent change of heart may have been down to political differences. Lee was much closer politically to McClellan than to Grant, and he was very much opposed to the radical republicans who supported Grant in the 1868 election.

Grant on Lee
This seems worth citing given what Grant wrote. Grant's opinion of Lee is from his own hand. In The Papers of Ulysses S. Grant: November 1, 1876-September 30, 1878, he wrote:

I never ranked Lee as high as some others of the army, that is to say,
  I never had as much anxiety when he was in my front as when Joe
  Johnston was in front.

Grant's opinion of Lee may have been coloured by (1) the latter's elevation to almost mythical status after the war, (2) Grant's friendship with Lee's subordinate James Longstreet who fell out with his superior at Gettysburg and later wrote critically about him, and (3) Grant's close friend Sherman's friendship with Joseph E. Johnston, another confederate general overshadowed by Lee.

CONCLUSION
In considering Lee's apparently contradictory statements and Grant's placing Johnston above Lee, it seems apt to quote Davis' concluding remarks on these two generals:

Lee routinely defeated McClellan, and believed he had to a degree
  beaten Meade in the drawn battle at Gettysburg. If McClellan was the
  Union's best, and Lee consistently bested him, then what did that say
  about Lee? Intending a book to demonstrate that Grant only prevailed
  by numbers, Lee would hardly accord him surpassing skill. There was no
  conceit in him, but there was pride, and if he really entertained
  these opinions, they compensated forgivably for his far heavier burden
  of defeat. As for Grant, the years of being portrayed as a lucky
  bumbler too powerful not to win had an effect in the end. Nothing in
  Johnston's wartime performance offered any justification for Grant
  claiming him as a feared adversary, but somehow in Grant's mind that
  deflected the endless comparisons of himself to Lee in which he came
  out second best.

Lee, in a letter to his cousin Cassius dated 6 June 1870, stated his intention to write about the war:

A history of the military events of the period would be also
  desirable, & I have had it in view to write one of the campaigns in
  Virginia in which I was more particularly engaged.

In the same letter he touches on the performance of individuals, though whether he is referring to Confederate or Union leaders, or both, is unclear:

The reputation of individuals is of minor importance to the opinion
  which posterity may form of the motives which governed the South in
  their late struggle for the maintenance of the principles of the
  Constitution.

(my emphasis)

Acknowledgement: JMS for his correction on Cassius Lee's relationship to Robert E. Lee

OTHER SOURCES
Charles B. Flood, Grant and Sherman: The Friendship that Won the Civil War (2005)
Mark Grimsley and Brooks D.Simpson (eds) The Collapse of the Confederacy (2001)
Comment: I like this answer. Very well argued.
Comment: Would the downvoter care to explain? I'm open to criticism and willing to improve this answer if I can.
Comment: I think both of your two Lee quotes are the same quote from two different sources. Cassius Lee was Lee's cousin and his son, not Lee's nephew, Cazenove Lee recalled a conversation his father had with Lee 30 year after Lee's death in a book written in 1904 by Lee's son REL Jr. Also, the June 5th Letter from Lee is not authoritative because Lee had never faced McClellan yet. Lee took command of the army of N. Va, only after Gen Joe Johnston was wounded June 1, 1862 at 7 pines..... Liked the Lee quote you gave after Antietam.
Comment: @JMS Thanks for your feedback, especially your correction re: Cassius Lee. On the Lee quotes, it had crossed my mind that they might be from the same original source but further investigation has, I think, disproved this.
Answer: It was probably in jest. McClellan was an extremely cautious general. He consistently overestimated his enemy. That made him act very slow, his nickname was the Virginia creeper. I can well understand why Lee would call him the best general he ever faced. Other generals would (possibly) defeat him.
Comment: McClellan was extremely cautious and calculating.    That was partially his appeal.   These traits served him well in the peninsular campaign against General Joseph E. Johnston where McClellan's careful cautious advances were matched by Johnson's careful cautious retreats;  resulting in McClellan's army being miles from the center of Richmond May 30, 1862.  They just didn't serve McClellan well against Lee who used these traits against him.
Comment: @JMS Exactly my point!
Answer: McClellan broke the back of Confederacy
Public and amateur historians like flashy victories, but war is actually cruel game of numbers and willpower. North had enormous advantage in numbers part of the game, both in number of available men (population) and industrial capacities, naval power and other logistical concerns. Only way South could win would be to break Northern will to fight, and to keep numbers game in check. In simpler terms, South needed lopsided victories, with casualties ratio favoring them, to keep Northern numbers advantage (ratio of available soldiers) steady. Then, when Northern public became tired of war and senseless slaughter, favorable peace for South could be achieved. On the other hand, if North and South have about equal exchange of casualties, North would soon have overwhelming advantage in ratio of available men.
Very few Northern generals, not to mention politicians, understood this reality. They were seeking to achieve complete dominance in the field and to end war quickly. This could be explained by the fact that both sides had very few officers with "strategic" military education and experience with commanding large armies. By "strategic" I mean education concerning strategic conduct of the war. On Union side one of such generals was Winfield Scott. Early in the war Scott came to unpopular conclusion that only way to bring down South is slow and unrelenting blockade (Anaconda Plan). Plan was at first rejected, but from what we know McClellan greatly respected Scott, and took under consideration some things that Scott said and wrote to him. This is not surprising, since McClellan was one of those few officers who had opportunity to study military logistic and strategy (for example he was observer in Crimean war).
Considering this, it was no surprise that McClellan waged a very careful war, trying to limit his casualties. When we look at the Peninsula Campaign, supposed Southern victory, strange thing appears : Confederate losses were actually higher then those of the Union ! Even at Antietam, casualty ratio was close to 1:1 . Finally at Gettysburg, where Union forces were led by another cautious general (Meade, personally selected by McClellan ), again we have casualty ratio of roughly 1:1 . It is clear to anyone that South simply could not continue to wage such war indefinitely, and that because of McClellan's caution in latter years of conflict North had such advantage in numbers. People often proclaim Grant as greatest Union general, but he simply enjoyed vast superiority and pressed on regardless of casualties. Grant's style is reminiscent of latter Soviet generals like Zukov in WW2. This style worked because generals like McClellan created that numbers advantage to him, and he could afford to loose more men then Lee, like for example in Battle of the Wilderness.
Much of criticism of McClellan comes from the fact that he was on loosing political side before and during the war. McClellan favored reconciliation with the South, and for him question of slavery was simply not worth of war and break up of US. His views are politically incorrect today, but in his time he had both substantial opposition and support. He was Democratic candidate in 1864 elections against incumbent president Lincoln, and he got 45% of popular vote which is not bad, considering that elections were held only in Northern states and that by that time war was definitely going on in Unions favor. Nevertheless, as we could see, he and his views were reasonably popular. But on the other hand, his political views were often held against him - he was accused both during the war and after it that he really didn't want to decisively defeat South .
Comment: @JMS Nope. McClellan didn't have "every advantage". He had small advantage in men , and actually believed that Confederates outnumber him. Confederates created local superiority by pulling their forces, and attempted to defeat him in detail . In that they failed and simply squandered men they could not replace latter. McClellan provoked them into war of attrition with loss ratio roughly 1:1, and they could not sustain that .
Comment: McClellan was a very popular general with his men.  He was also very successful general before Lee.  When Lee takes command McClellan has every advantage and his troops are milles outside the Confederate Capital.  Lee first faced McC in battle June 25th, 1962 at the beginning of the 7 days battles.  McClellan is relieved of his command Nov 5th 1862 with Lee having turned the tables on the Union and not only repulsed McC from Richmond by had invaded the North.  Lee Never tasted defeat by McC.   As for Grant always having the advantage of numbers against Lee,  true but so did McClellan.
Comment: @ rs.29. McClellen had 121,500 men in the largest amphibious landing of the war to begin the Peninsular Campaign.  When they landed April 5, 1862 they faced Magruder at Yorktown and his 10,000 men.   McClellan choose to wait.   There were only 60,000 men in the entire Confederate army of N. Va.   And still McC lost the initiative through overestimating the forces arrayed against him.   At Antietam, McClellan had 87,000 men to Lee's 38,000 men.  Home field advantage, and  McClellan also had Lee's battle orders; and still McClellan couldn't defeat Lee.
Comment: @JMS You are counting whole Army of Potomac (110-120 000 men) but not whole Army of Northern Virginia (around 100 000, at some points even larger) . McClellen proceeded cautiously, instead of listening to advice of people that demanded Napoleonic victories.  He very well knew that his army is green, and overall of lesser quality then Southern army. McClellen was professional officer, if he didn't act way he did likely outcome would be same as John Pope met with his false bravado (Second Battle of Bull Run) .
Comment: So you are refuting the source on odds at Yorktown?  Union 120,000 with another 50,000 coming overland from DC.  Against 10,000 confederates and McClellan waits a month and ultimately lets the confederates escape.  He could have won the war for the union by capturing Richmond in June of 1862, he was miles away with huge advantage but he delayed and lost the initiative.   I'll give you McClellan was tactically sound but strategically constantly retreating he was a disaster.
Comment: @JMS What sources ? My sources (https://en.wikipedia.org/wiki/Siege_of_Yorktown_%281862%29) tell a different story. Armies are not chess pieces, you cannot move 100 000 men without regarding logistic of such moves. Yes, McClellan could have taken Richmond, and with a bit of forced marching be in Mexico by autumn :)  In reality, both sides brought up reinforcements, Union Navy was held up by CSS Virginia, and defensive line was fairly strong. McClellan planned to storm it, but he never had sufficient advantage in numbers to do it.
Comment: [See Opposing Forces](https://en.wikipedia.org/wiki/Peninsula_Campaign#Initial_movements) However, at the time the Army of the Potomac arrived, only Magruder's 11,000 men faced them on the Peninsula.   120,000 for McClellan 11,000 in opposition on April 5 and he delayed in attacking for a month, and let the Confederate army at Yorktown escape.
Comment: @JMS Read the article about the siege. Army of the Potomac didn't arrive, it was never unified body. It was collection of various units dispersed trough countryside. McClellan had couple of divisions available and he did attack on  5th of April but could not break trough Warwick Line . He again tried to attack on 6th with same results. Then weather turned to worse, and reinforcements were coming steadily for both sides. Only on 30th Navy agreed to help, and Confederates decided to retreat . By that time both sides were in full strength.
Answer: McClellan was a "good" (skillful) general, just not a winning general.
McClellan, who graduated second in his class at West Point, was a fine "book" general. His weakness, compared to Grant's strength, was that he was not a natural "brawler." But Gentleman Bobby" Lee (also a high-ranked West Pointer) respected McClellan's "book" strengths more than Grant's brawling abilities.
McClellan's big weakness was his reluctance to fight. During the Seven Days' campaign (a fine defensive action), McClellan suffered 16,000 casualties and inflicted 20,000 on Lee. At Antietam, he inflicted 10,000 casualties on Lee (losing 12,000 with an army more than twice the size of Lee's), and turned back Lee's invasion of Maryland. In either case, McClellan could have won the war by turning around and dealing a hard "death blow" to Lee, and he failed to do so.
U.S. Grant, who won the war, had much lower "victory percentages," and much lower "kill ratios," than McClellan. The reason that Grant was a hero was because he realized that if he fought out the war using his inferior (to McClellan's) tactics, that Lee would run out of men before he did. Grant was perhaps the first general to realize that given the Union numerical advantage of 2 to 1, the North could win as long as they suffered fewer than two casualties for every Confederate casualty.
Using the above yardstick, Fredericksburg and the second battle of Bull Run should be reckoned as Union defeats, (Union losses were more than twice the Confederates'), but other "defeats," such as Chancellorsville were actually Union victories (12,000 Confederate casualties and the peerless Stonewall Jackson versus "only" 16,000 Union casualties, far less than 2 to 1). Ditto for most of Grant's battles, but just barely.
Battle for battle, McClellan was the better general. The difference was that Grant won the war and McClellan didn't, because Grant fought more battles.


What are the things that only Stories can do?

Question: I've once heard in a youtube channel that only games could do things such as: getting the player into a flux state (something like getting into a meditation while doing something) and when that happens, you have reflexes and movements that you did'nt even thought you have. Movies, on the other hand, has powerful visual and music appeal. I got myself wondering, "which are the things that only literature could do or do better at?"
Comment: Semi-serious answer: Be enjoyed without electricity?
Comment: Personal anecdote: A science fiction short story once completely reversed a political position that I held. It didn't argue with me about it, it just presented a different take on the ramifications of the policy and how it would affect different people differently. To me one difference between fiction and non fiction is that fiction has to invite you in and attract you - you never **have** to read it, so it necessarily has get you on its side for you to read it at all. Non-fiction can more easily be dismissed as someone else's opinion.
Comment: @ToddWilcox: "you never have to read [fiction]" — unless you are reading it for school. :-)
Comment: @NicHartley: I'm pretty sure to enjoy a painting, you don't need electricity either. And people also managed to enjoy music without electricity for most of history.
Comment: @celtschk Oh, that's true. I was thinking of the camping trips I've been on -- I always bring a few books, because there's nothing quite like reading something great by starlight. You... can't really bring paintings on camping trips, so that didn't occur to me.
Answer: I disagree with Amadeus on the matter of becoming the protagonist. I don't think that is what literature does or why readers turn to literature. I think there is always a narrative distance. We are always hearing a story told, and that is a different thing from doing something yourself. If I read about a character having a fight, for instance, it is not because I want to be in a fight. If I wanted to be in a fight, I would go dive bar and knock over a Harley. So in reading about a character having a fight, I am looking for a different kind of experience.
That experience, the experience of story, is a little hard to pin down, which is, I suppose, to say that it is a thing in itself, not a substitute for anything else. It is certainly a kind of experience, but it is also an experience at a distance from the dangers and inconveniences of real experiences. Is it just the safety that stories offer as opposed to reality? I don't think so.
In part, a story allows us to experience the lives of others. It allows women to experience the lives of men, men the lives of women, children the lives of adults and adults the live of children. It allows people of one race and culture to experience the lives of other races and cultures. (This applies as much to the author as to the reader, by the way, since the author must try to put on every member of their cast, young, old, rich, poor, male, female, etc. as they craft their story.) As social animals, we are very much interested in the lives of others and stories seem to be one of the main ways we are able to enter into those lives and thus perhaps understand them better and feel less alone.
But another function of stories is as an antidote to, or a comfort in the face or, or even as a rebuke to, the randomness of life. There is a moral order to stories that we do not necessarily find in the real world. Virtue is rewarded and vice punished. Heroic failure is given dignity and meaning. The thought that our lives are just accidents of fate is intolerable to us. Religions are essentially stories that make lives meaningful. (Which is not to say that one of them, at least, may not be a true story.) But even those who acknowledge no God use stories to create sense and order in their lives. Stories thus seem to fulfil not just a social need but an existential need in us as well.
I have discussed this in terms of stories rather than literature. Literature is a bit of a slippery term and not every story is regarded as literature nor every piece of literature as a story. But I think the answer to the question lies in stories, and in the fundamental needs that they meet for human beings: our need to understand the other, and our need to make sense of our lives.
EDIT: To address the secondary question of whether there is something prose (again I am avoiding the slippery word literature) can do that other media cannot. Prose can, as EM Forster points out in Aspects of the Novel, show that which cannot be seen on the surface. The show vs tell doctrine encourages us to show a character's thoughts and emotions through their actions, but Forster points out that not all thoughts or emotions show through action. There are things that people keep inside, and these are often the most important things about a person. Unlike other story media, prose can take us to places and show us things that can neither be seen nor heard.
Comment: *"A story allows us to experience the lives of others..."* That is the essence of my comment about "becoming" the protagonist, in a novel I believe you can have that experience at a depth not achievable in a movie, because in a movie, the audience has only images and dialogue. Both are **stories**, the OP's question boils down to (IMO) what can a reader experience in a novel that they cannot experience in a movie? The only thing I can think of, and obviously failed to explain, is a far greater intimacy and depth of what you call "experiencing the lives of others."
Comment: I will edit that part in my question to focus only on stories. When I made that question I was thinking more about descrption and writing itself.
Comment: I am thoroughly impressed by how deep this answer went. However, I'd also add that because stories rely so much on imagination it opens up the possibility for different people to relate to the same stories.
Comment: @Amadeus, that is a good point about what prose can to that film cannot. It is an important aspect of the question and I will edit to address it.
Answer: This is mostly an opinion based question. So IMO, only in literature can the audience convincingly "become" the protagonist with all of their internal thoughts and feelings, faith and belief.
I don't think film can convey this to the same extent as literature, especially (paradoxically) in the senses: A film can show you a majestic mountain vista, but dialogue is limited and cannot be very poetic. The film does not have to describe it, because it is showing it. But different people experience the same image or landscape differently, through the lens of their own life experiences.
Thus, they are not experiencing it through the lens of the protagonist's life experience, as they are in a novel. The same thing goes for other senses, like music, or luxury, or physical hardship, or even sex, and the film cannot punch the pause button so the hero can describe what she is feeling. The book does that naturally, through prose and exposition that reveal their true emotions and feelings.
Comment: @VolkerSiegel A completely different thing. That is not another person, just you pretending. Not a different personality, with different emotions. A novel creates a unique character with their own upbringing, experience, emotional makeup, etc, all typically different than that of any reader, and the reader knows how THAT person feels and thinks.
Comment: I would think computer games are much better at "convincingly "become" the protagonist".
Comment: Seeing through the lens of the POV, I would say. This is an interesting answer
Comment: @Amadeus I see. (But note that some computer games are a representation of a novel. For example, *Max Payne* tells a novel in part as actual text panels, and in part by the user navigating the protagonist in POV through a world that represents events by constraining the navigation of the protagonist to follow the story. I remember a nightmare scene where you can leave a room only through one way, where you run down a long featureless corridor. After a while, the corridor starts to feel strange - to the protagonist and the player...
Comment: @Amadeus ...the walls you run by start to increasingly wobble and the wall paper pattern becomes somehow blurry.  Then, while still just running down the corridor, the wall and ground slowly dissolve to black - while you, as slowly, start to hear your baby crying... but without any indication where it is. This scene scared me. It scared me very much. I do not remember that this happened before or after in about 40 years.)
Comment: At their best games are very good at immersion. And for that matter at telling stories in general. And of course even movies do not have to show everything, there are very intense and memorable scenes where you do not actually see anything, it is just your imagination filling in the blanks. So I do not think these are something games, television, or movies **cannot** do. They just do not benefit as much as a novel would and the effort would usually be more.
Answer: There is literally nothing that only one thing can do. There are people who orgasm when they are beaten. The claim that "only games can get the player into a state of flow" is the most vile nonsense I have ever heard. Maybe it is true for the person who said that, and I am very sorry for him. I can get in a flow by almost anything that I do, including doing the dishes.
The right book does everything for me, and the wrong book does nothing.
Comment: I'm pretty sure it's not vile. But possibly mistaken. People cane more ore less easy reach flow, and it may well possible that computer games are  effective for most people. Think of games where you navigate a vehicle in 3D space at fast pace to fight similar vehicles, in tunnels or buildings, needing to keep situational awareness. Situational awareness is actually the limiting factor of your performance. (Decent was the first example.)
Comment: "he claim that "only games can get the player into a state of flow" is the most vile nonsense I have ever heard." - You are probably mistaking what the author of that statement is trying to say. Competitive computer games are often games of reflexes and situational awareness, not unlike combat sports. You rarely achieve the same state of mind, the same alertness, when reading a book vs. being in a physical fight - be it in person at the gym or at home, over a virtual reality, against NPCs or other people.
Answer: I want to take a more simplistic approach to this question.
Games - unlike movies or reading - allow the user to provide input on a dynamic level.
Movies provide a solid realisation of the story.
Reading allows the reader's mind to define the story.
The key thing that reading a story allows above the others, is imaginative freedom. A book cannot give you something to react to like a game can, nor can it show you so directly like videos can, but neither of those can allow you to imagine the scene or exercise your brain in such a way.
There is crossover between all forms of media. But reading is vastly different to games or movies or radio shows because it is conjured in the mind, suggested by what is written on the page.
Comment: This is so true. I would add examples from [another question](https://writing.stackexchange.com/a/32973/6724): "Then the readers will imagine their own idea of what the most beautiful woman in the world looks like, and she will be that beautiful for each reader. It's really the only way to get a reader to really feel the beauty - they have to complete the picture in their minds."
Writing gives the readers freedom to define the environment, and to some extent, the story.
Answer: The lines blur. You concept of story can cover a bard like oral tradition, a parent reading a story to a child, an audio book that is a simple recitation of the story, a radio adaptation of a book with multiple actors and sound effects etc. A musical ballard has a strong story component. A book may be purely words, or may include pictures and maps.
The main advantage of a written story, from the creators point of view, is that the creative component can be done alone (or at least with less input from others than most other media). Flipping that, a reader gets a more direct relationship with the creator.
An illustration or similar artwork might also have the direct relationship, but is more focussed on one time and place, and has to rely on the audience to fill in a cause or consequences.

Edit to add.
Extending my answer, the one thing a story can do that other media cannot is an autobiography.
Answer: There are things and ideas that are impossible to display but can be told.

The Library is a sphere whose exact center is any hexagon and whose circumference is unattainable.
  - Borges in The Library of Babel

One might notice an analogy to universe in the quote above. Much of modern physics and maths are such that we can convey them in story form and manipulate in our minds but can't display.
There are ideas too general or arbitrary (all polynomials of degree n) to show them (we could only show an instance) but can be discussed in all generality in a story form.
There are also things that we can't perceive with our visual perception (4 and higher dimensional shapes) even if we accurately show 2 or 3 dimensional projections. Once again, we use stories to talk about these things.
Disclaimer: of course, anything that can be written, can also be told in an audio narration or in film by narrator. I am answering the "stories" question from title not the "literature" from the body of question as these things are not specific to story being written instead of told.
Comment: Words can force us to imagine things or to conceive something in our minds. I've heard that Lovecraft does that a lot in his descriptions of undescriptional things. Would be something like "That is not dead what can eternal lie. And with strange aeons even death may die."
Answer: I sat, immersed, on that balcony. Swamped by the stifling humidity of the mediterranean air, of a summer going stale, but drowning in the book in my hands.
I had taken the only door out of the apartment where we were arguing and tense save the front door; a miniature escape without leaving. And there I had opened the book to escape myself.
What I found, what I read, was no escape. On the pages was another like me, another hapless self-involved man, removed from me by 150 years and thousands of miles yet closer than I could bear.
Raskolnikov was me, and I was repulsed by both.
Literature is the purest form of narrative, and narrative is the nature of the self. No film ever met me at my self, nor murdered my indulgences with an axe.


locate vs find: usage, pros and cons of each other

Question: In Linux and Unix systems there are two common search commands: locate and find.
What are the pros and cons of each? When one have benefits over the other?
Comment: See e.g. http://superuser.com/questions/199472/what-is-the-different-between-locate-and-find-in-linux
Answer: locate(1) has only one big advantage over find(1): speed.
find(1), though, has many advantages over locate(1):

find(1) is primordial, going back to the very first version of AT&T Unix. You will even find it in cut-down embedded Linuxes via Busybox. It is all but universal.
locate(1) is much younger than find(1). The earliest ancestor of locate(1) didn't appear until 1983, and it wasn't widely available as "locate" until 1994, when it was adopted into GNU findutils and into 4.4BSD.
locate(1) is also nonstandard, thus it is not installed by default everywhere. Some POSIX type OSes don't even offer it as an option, and where it is available, the implementation may be lacking features you want because there is no independent standard specifying the minimum feature set that must be available.
There is a de facto standard, being BSD locate(1), but that is only because the other two main flavors of locate implement all of its options: -0, -c, -d, -i, -l, -m, -s, and -S. mlocate implements 6 additional options not in BSD locate: -b, -e, -P, -q, --regex and -w. GNU locate implements those six plus another four: -A, -D, -E, and -p. (I'm ignoring aliases and minor differences like -? vs -h vs --help.)
The BSDs and Mac OS X ship BSD locate.
Most Linuxes ship GNU locate, but Red Hat Linuxes and Arch ship mlocate instead. Debian doesn't install either in its base install, but offers both versions in its default package repositories; if both are installed at once, "locate" runs mlocate.
Oracle has been shipping mlocate in Solaris since 11.2, released in December 2014. Prior to that, locate was not installed by default on Solaris. (Presumably, this was done to reduce Solaris' command incompatibility with Oracle Linux, which is based on Red Hat Enterprise Linux, which also uses mlocate.)
IBM AIX still doesn't ship any version of locate, at least as of AIX 7.2, unless you install GNU findutils from the AIX Toolbox for Linux Applications.
HP-UX also appears to lack locate in the base system.
Older "real" Unixes generally did not include an implementation of locate.
find(1) has a powerful expression syntax, with many functions, Boolean operators, etc.
find(1) can select files by more than just name. It can select by:

age
size
owner
file type
timestamp
permissions
depth within the subtree...

When finding files by name, you can search using file globbing syntax in all versions of find(1), or in GNU or BSD versions, using regular expressions.
Current versions of locate(1) accept glob patterns as find does, but BSD locate doesn't do regexes at all. If you're like me and have to use a variety of machine types, you find yourself preferring grep filtering to developing a dependence on -r or --regex.
locate needs strong filtering more than find does because...
find(1) doesn't necessarily search the entire filesystem. You typically point it at a subdirectory, a parent containing all the files you want it to operate on. The typical behavior for a locate(1) implementation is to spew up all files matching your pattern, leaving it to grep filtering and such to cut its eruption down to size.
(Evil tip: locate / will probably get you a list of all files on the system!)
There are variants of locate(1) like slocate(1) which restrict output based on user permissions, but this is not the default version of locate in any major operating system.
find(1) can do things to files it finds, in addition to just finding them. The most powerful and widely supported such operator is -exec, but there are others. In recent GNU and BSD find implementations, for example, you have the -delete and -execdir operators.
find(1) runs in real time, so its output is always up to date.
Because locate(1) relies on a database updated hours or days in the past, its output can be outdated. (This is the stale cache problem.) This coin has two sides:

locate can name files that no longer exist.
GNU locate and mlocate have the -e flag to make it check for file existence before printing out the name of each file it discovered in the past, but this eats away some of the locate speed advantage, and isn't available in BSD locate besides.
locate will fail to name files that were created since the last database update.

You learn to be somewhat distrustful of locate output, knowing it may be wrong.
There are ways to solve this problem, but I am not aware of any implementation in widespread use. For example, there is rlocate, but it appears to not work against any modern Linux kernel.
find(1) never has any more privilege than the user running it.
Because locate provides a global service to all users on a system, it wants to have its updatedb process run as root so it can see the entire filesystem. This leads to a choice of security problems:

Run updatedb as root, but make its output file world-readable so locate can run without special privileges. This effectively exposes the names of all files in the system to all users. This may be enough of a security breach to cause a real problem.
BSD locate is configured this way on Mac OS X and FreeBSD.
Write the database as readable only by root, and make locate setuid root so it can read the database. This means locate effectively has to reimplement the OS's permission system so it doesn't show you files you can't normally see. It also increases the attack surface of your system, specifically risking a root escalation attack.
Create a special "locate" user or group to own the database file, and mark the locate binary as setuid/setgid for that user/group so it can read the database. This doesn't prevent privilege escalation attacks by itself, but it greatly mitigates the damage one could cause.
mlocate is configured this way on Red Hat Enterprise Linux.
You still have a problem, though, because if you can use a debugger on locate or cause it to dump core you can get at privileged parts of the database.

I don't see a way to create a truly "secure" locate command, short of running it separately for each user on the system, which negates much of its advantage over find(1).

Bottom line, both are very useful. locate(1) is better when you're just trying to find a particular file by name, which you know exists, but you just don't remember where it is exactly. find(1) is better when you have a focused area to examine, or when you need any of its many advantages.
Comment: @nuttyaboutnatty: It's an ancient convention in Unix manuals, meaning manual section 1. While it is true that there is no `find`, `locate`, etc. in other sections so it doesn't have to be there to disambiguate the same name used in different sections of the manual (e.g. `unlink(1)` vs `unlink(2)`), those of us used to the convention see that as a man page reference.
Comment: First implementations of `locate` was roughly someting like `find / -type f | gzip > locate.gz`, and `zgrep "$1" <locate.gz`
Comment: @WarrenYoung why is there a constant reference to foo(1) instead of just foo? are there different versions etc of foo?
Comment: Sorry, I overlooked the "slocate" paragraph. rlocate addresses the _stale cache_ issue. You may want to mention some of the quirks of find, like `find -- "$dir" ` not robust (`$dir` may be taken for a predicate), no way to test for the attributes of a symlink, race condition issues... For me `find` and `locate` address two different problems. There are many places where using find is  not realistic (like directories containing millions of files). locate is an indexing system limited to file names.
Comment: @F.Hauri: Interesting trivia. Here's more: GNU `locate` is in the `findutils` package, and its `updatedb` program is implemented in terms of `find(1)`. So in that sense, `locate(1)` actually *requires* `find(1)`. :)
Comment: """ locate(1) simply spews up everything[*] it knows""" -- not GNU locate either, since it supports setuid (similarly to slocate, and in fact it can consume slocate databases).
Comment: All I know is I tried 10 different `find` searches for Python.h unsuccessfully and one try of `locate Python.h` gave me the file location
Answer: locate uses a prebuilt database, which should be regularly updated, while find iterates over a filesystem to locate files.
Thus, locate is much faster than find, but can be inaccurate if the database -can be seen as a cache- is not updated (see updatedb command).
Also, find can offer more granularity, as you can filter files by every attribute of it, while locate uses a pattern matched against file names.
Answer: find is not possible for a novice or occasional user of Unix to successfully use without careful perusal of the man page. Historically, some versions of find didn't even default the -print option, adding to the user-hostility.
locate is less flexible, but far more intuitive to use in the common case.
Comment: What's hard about it?  `find . -name 'nametosearch'`, or `-iname` for case-insensitive.  Replace `.` with a directory path to search other than current directory.  There, that's 90% of a novice user's requirements covered without even getting into file globbing.  (I would generally use `find . -iname '*partialfilename*'` and if I'm searching from `/`, I use `find / -maxdepth 5 -iname '*partialname*'` which cuts down the search time while finding everything I'm interested in 90% of the time.  There, 75% of intermediate users requirements.)  :)
Comment: On the other hand locate has to maintain a DB and run periodically, so I have disabled it on all the Linux servers that reside on our private network.
Answer: A slight drawback of locate is that it may not be indexing the area of the file system you are interested in.  On Debian desktop systems, for example Linux Mint 17.2, the /etc/updatedb.conf file is configured to exclude certain areas from consideration, including /tmp, /var/spool, and /home/.ecryptfs.
Ignoring /home/.ecryptfs prevents file names in encrypted directories from being exposed to unauthorised users.  However, if your home directory is encrypted with ecryptfs, it also means your home directory is not indexed, and locate will therefore never find anything in your home directory.  This might make it largely useless for you (it does for me).  In addition to not finding results, the updatedb process will periodically load your disk for no benefit, and might as well be disabled if you are the main or only user of the system.


What is the meaning of だ when used in a sentence involving a past tense verb like 来たばかりだ?

Question: English dictionaries translate ばかり as "just (finished, etc.)" but that doesn't seem to really work because "I just came" is past tense and "私は来たばかりだ" is present tense. ばかり is an adverbial particle in the same vein as だけ and まで, but I don't see how ばかり modifies だ. An entry in a Japanese dictionary describes it as 動作が完了してまもない状態にある意を表す, but that doesn't really tell what the meaning of だ is in those sentences since the meanings of ある and だ are quite different. Is だ in たばかりだ sentences being used the same way as in 私は先生だ (noun) or 私は静かだ (adjective)? Since ばかり is an adverbial particle and not something that can connect だ with a noun, I am confused.
Comment: ばかり is a noun, to begin with.
Answer: ばかり is one of those words that doesn't work very well as an English part of speech. A translation of these phrases gets the meaning across, but it does not represent the structure of the Japanese at all. But if it helps, think of it this way: saying "来たばかりだ" means "the current situation is that I have just arrived." If you said "来たばかりだった," that would mean "a situation in the past was that I had just arrived"; the meaning becomes pluperfect since you're talking about something that had already happened at an earlier point in time.
For a more rigorous explanation, let's break down the sentence: 私は来たばかりだ into parts.
私は: I-topic/as for me
来たばかり: came-just (just came)
だ: copula/it is (that)
So if you wanted to go for a really liberal translation, you could argue it says, "it is that I just came," where "it" refers to the general situation or something similarly ambiguous. I feel like I could have explained this better, but I hope that helps.
Comment: You translated it as "the current situation is that I have just arrived," but I don't understand how that corresponds to 来たばかりだ. ばかり is an adverbial particle while "situation" is a noun.
Comment: The "situation" part is implied, I added it to make the meaning more clear. You could also say, "It is I have just arrived," but that's bad grammar, sounds awkward, and doesn't convey the meaning as well.
Comment: It's an implicit topic. If we wanted to try to mark it properly, we might write "[The current situation] is 'we have just arrived'".