Apache2 - Not Found Error for Any Deep Url

Question: I have created a laravel 8 application and installed apache2.
My configuration files look like the following:
000-default.conf
<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    #ServerName www.example.com

    ServerAdmin webmaster@localhost
    DocumentRoot /home/admin/Desktop/Code/
    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

    <Directory /home/admin/Desktop/Code/laravel_project/public/>
      AllowOverride All
      allow from all
      Options +Indexes
    </Directory>

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

apache2.conf
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.

# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
#   /etc/apache2/
#   |-- apache2.conf
#   |   `--  ports.conf
#   |-- mods-enabled
#   |   |-- *.load
#   |   `-- *.conf
#   |-- conf-enabled
#   |   `-- *.conf
#   `-- sites-enabled
#       `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.

# Global configuration
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the Mutex documentation (available
# at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#Mutex file:${APACHE_LOCK_DIR} default

#
# The directory where shm and other runtime files will be stored.
#

DefaultRuntimeDir ${APACHE_RUN_DIR}

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 184.108.40.206 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the severity of messages logged to the error_log.
# Available values: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the log level for particular modules, e.g.
# "LogLevel info ssl:warn"
#
LogLevel warn

# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

# Include list of ports to listen on
Include ports.conf

# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

#<Directory /srv/>
#   Options Indexes FollowSymLinks
#   AllowOverride None
#   Require all granted
#</Directory>

# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>

#
# The following directives define some format nicknames for use with
# a CustomLog directive.
#
# These deviate from the Common Log Format definitions in that they use %O
# (the actual bytes sent including headers) instead of %b (the size of the
# requested file), because the latter makes it impossible to detect partial
# requests.
#
# Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
# Use mod_remoteip instead.
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

My .htaccess file is the standart file when creating a laravel project
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

The following modules are enabled for my apache2 installation:
> apachectl -M
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php7_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 status_module (shared)

My server configuration looks like the following:
sudo apache2ctl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80                   127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

When I open the / url everything is working fine. However, when opening a deep-url such as /company/appl I get the following error:

Any suggestions what I am doing wrong? I already used AllowOverride All and allow from all for my DocumentRoot.
I appreciate your replies!
Answer: There are a couple of items that you'll need in your .htaccess file:

Set the RewriteBase value after setting the RewriteEngine:
RewriteEngine On
RewriteBase /

The final rewrite rule for index.php is missing some characters:
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^.*$ ./index.php

Hope this helps


When my origin serves a "304 Not Modified", Cloudflare sends "200 OK" and makes the user download the page again

Question: I'm using Cloudflare to cache certain APIs. I'm setting the below headers in my Origin server:
Cache-Control: public, must-revalidate, max-age=300

Basically, I'm instructing the browser here to cache the response for 5 minutes. Along with these headers I also send an etag across.
After 5 minutes , I get the latest request and check its Etag headers. If they match, my origin server sends back an HTTP 304.
But Cloudflare isn't proxying back an HTTP 304 but an HTTP 200 back to the browser making the browser download the response again despite there being no change.
These are the response headers I get back from Cloudflare:
cache-control: public, must-revalidate, max-age=300
cf-cache-status: REVALIDATED
server: cloudflare
status: 200
vary: Accept-Encoding

But I can see from my server logs that there is an HTTP 304 sent back. Why is CF still sending an HTTP 200 to my browser. Is there something I need to modify in my cache headers?
Answer: So i found a workaround for this - i had to add the disable-performance page rule to cloudflare. Now i seem to be correctly getting a HTTP 304 in the browser.


How can we calculate Amritha kalam and varjyam in panchangam?

Question: I want to calculate Amritha kalam and varjyam for Panchang.
Please help me for calculating those by providing any formulas.
Thanks in advance and be safe.
Answer: Firstly need to understand the Method to Calculate Chaughadia Muhurats
First each day is divided into two time periods:

day time (Din-maan) - the period from local sunrise to sunset

night-time (Ratri-maan) - the period from sunset to sunrise (next day)

Each time period contains eight Chaughadias. To calculate the duration of each Chaughadia, the respective time period is divided by eight to get 8 chaughadias of equal time. Since there are only 7 types of chaughadias, therefore, in each time period six Chaughadias get 1 division each in their share while one Chaughadia gets 2 divisions.
The Chaughadias are assigned to 8 equal divisions of each time period (day time or night time)  in a pre-determined order according to the weekday. The sequence of day-time and night-time Chaughadias varies for each week day. However, the sequence is fixed and does not change for each week day. For example, the sequence for Monday is different to that for Tuesday, which in turn is different to that for Wednesday. But the sequence for each Monday is the same, as also  for each Tuesday.  [Study the Tables Below]
Clearly, the 16 time divisions of 24 hours are assigned to 7 types of Chaughadias. There will be at least two Chaughadias of the same type within 24 hrs. and two types of  Chaughadias are repeated three times within 24 hrs.
The seven types of Chaughadias are as follows:
<code> Chaughadia       Ruled by               Nature

    1. Udwega

    2. **Amrit**

    3. Roga

    4. Laabh

    5. Shubh

    6. Chara

    7. Kaala
</code>
Comment: Thank you so much @ShreeM
Answer: Varjyam basically depend on the Nakshatra of the day and its duration.
Starting time of Varjyam = A×DurationOfNakshatra/60
(A = a fixed number for each nakshatra. Example Aswini Nakshatra A = 50)
DurationOfVarjyam = DurationOfNakshatra/15
A = 50,4,30,40,14,21,30,20,32,30,20,1,21,20,14,14,10,14,20,20,20,10,10,18,16,30,30 respectively as per the sequence of nakshatras.


Ethics of Looking Up Company Interview Questions

Question: So I'm currently in the process of interviewing for a new software engineering position. I notice that the specific questions that companies ask are on Glassdoor and other websites among others. If I were to see these questions in an actual interview, I would disclose it. But is it unethical to practice or look at these questions ahead of time to begin with?
Comment: If you're talking about the questions on http://leetcode.com and http://binarysearch.com Then, it's the opposite. Not practicing these types of questions ahead of time is a waste of time when you know these are the types of questions that will be asked of you.
Comment: They want you to start talking about things they would like to know.  Having thought things over beforehand may be a good idea, like "what is your greatest weakness?" and "why did you leave your old job?".
Answer:
is it unethical

Not at all. An interview is not a test. Many  questions don't even have right or wrong answers. Here are some of my standard questions:

What do you like and don't like about your current job?
Tell me about a time when you had to deal with conflict.
Tell me about a time when you had to solve a really tricky technical problem.
Tell me about a time when you made a mistake.

By all means, you can  (and should) practice answers to these questions. Note that these are specific to you, so looking up cookie cutter answers on the internet isn't particularly useful. Bob's answer are different than Alice's because they are different people and have different experiences.
Sure, there will also be technical questions but these are often tailored to the specific role and I also tend to adjust on the fly depending on how things are going.
If someone actually asks you "how many ping poll balls fit into a 747", it's probably time to look elsewhere.
Comment: "If someone actually asks you "how many ping poll balls fit into a 747", it's probably time to look elsewhere." Unless you're applying for a job as a pilot or something where the correct answer of "look up the cargo capacity in the operations manuals and do a calculation to determine that it falls within the MTOW and CG constraints" would be relevant, anyway.
Answer: Nothing wrong with it, if they want to reuse questions it's not your problem.  Preparing for an interview shows good initiative.
What you don't want to do is pretend like you have knowledge in an area of expertise when you don't though.  You may get yourself into a lot of poopee down the line.
Answer: As always with 'ethics' it totally depends on the context.
Say I'm applying to be a Widget6000 Operator .
Scenario 1.
I cannot use Widget6000, never even seen a Widget6000 and barely know what one is. I learn that the company always asks 3 specific questions about 3 specific features out of the 6000 features a Widget6000 offers.  I memorise the answers to these and get a 'Widget6000 Operator' job.
Scenario 2.
I am an expert user of the Widget6000, I learn that the company always asks about 3 specific features of the Widget6000 that I've never used professionally. I learn about them in depth to make sure I can talk confidently about them in the interview, but say I've never used them.
Which scenario are you in?
Answer:
If I were to see these questions in an actual interview, I would disclose it.

What if they asked a generic question? Like how are you? "I saw this question online and to answer that, I'm okay." Probably won't look good.

But is it unethical to practice or look at these questions ahead of time to begin with?

It is mostly on them to know if your answer falls with whatever people post online. Also, what if they purposely post an answer and see if anyone says it just to see how far you'd go with pretending its your own answer or one of your own? Best to have a guideline and simply state your own answers to questions instead of looking up answers.
Answer: Is it ethical?
At your first interview, you'll be at a disadvantage relative to a candidate who has had more interviews. Is that unethical?
Having some experience with the types of questions you'll get will help your confidence during the interview. Technical interview questions are not an exception to this rule. So, practice.
Why do companies re-use questions?
For entry-level positions, the questions are often used to determine that you meet a skill floor: If you manage to solve the question, you are skilled enough. If you manage to recite a memorized answer, you are teachable enough.
Later in your career, an early interview stage may re-use simple questions to filter candidates that misrepresent their experience. The company does not have an incentive to update the questions, unless bad candidates (that are not worth the time of the interviewers) make it past the initial interview stages.
Interview questions may also be re-used at later interview stages and by capable interviewers. In that case, the question serves as a conversation starter: You'll probably get a few hints, if you get stuck. And the interviewer will have follow-up questions that are specific to your answer and cannot be found online. This stage is about testing your insight, your ability to explain your thought process and the way you collaborate.
Answer: Never a bad thing to refresh your technical knowledge
First of all, I assume you are talking about technical question, not one of those stupid open-ended questions like "Where do you see yourself in 5 years ?". Technical questions are usually based on exact science and have exact answers. Therefore, when practicing technical questions you are either learning something new or refreshing your current knowledge. Effectively, you would be filling some holes in your knowledge, and there is nothing wrong with that because you are effectively becoming better software engineer, which would in turn benefit to the company that hires you.
Is this cheating ? Well, technical interviews are not university exams. In university exams you are required to learn whole area covered by certain university course. Since there is no time to examine each student about whole course, they get set of usually random question to test sample of their knowledge. However, during technical interviews neither you or company are required to cover any specific area of knowledge. They could ask whatever they want, you could answer or not and that is that. If they are satisfied to repeat same questions over and over again, that is their problem. Note that, unlike university they are not required to "pass" you (i.e. hire you) even if you answer all the questions brilliantly !
Therefore, as an advice, especially if you are gearing up for your first job, practice with interview questions and tests as much as you can. Do not disclose anything to interviewing company, just as they would not disclose why they are hiring/not hiring you. And get rid of that university mentality, you are now in real real world and different rules apply.


How to use properties of bevel tool?

Question: Is it possible with Bevel tool to type desired values directly, instead of applying it only by mouse movement?
Answer: Yes, just stop dragging and the dialog box to tweak everything will appear at the bottom (you just might need to expand it).
Comment: I found it in lower left corner. Thank you.
Comment: It's not working. I am using blender 2.8.
Comment: did you click anywhere after dragging the bevel?
Answer: Do you bevel with the mouse, then press F9 to get the last action menu to pop up.
Answer: You can bevel and use the Adjust last operation menu as Francois said, or you can while dragging the mouse to adjust the bevel width press:
A: to adjust the amount of width
M: to cycle through width type
P: to adjust the bevel profile
S: to adjust the number of segments
All these proprieties can be set using the numbpad.

How to use properties of bevel tool?


Should I give attribute to transitive dependencies if I am using a package in binary form?

Question: I am including the PostgreSQL JDBC driver (BSD-2) in my project in binary form (which I got from their website). I copied the license text in my repo, however I found the github repo for the driver and they give attribute to other code. Do I have to copy those licenses and give attribute to them too?
Answer: Yes, you have to fulfil the licenses of all the software that you distribute, including transitive dependencies. So if you distribute the pg-jdbc binaries, you also have to comply with all the licenses for all the software in those binaries.
However, it is common in the Java world to include all licenses within the JAR. As long as this license information is correct, this vastly simplifies keeping track of which licenses cover parts of the software. You can likely extract these licenses programmatically.
However, different licenses have very different requirements. Some licenses not only require that a copy of the license is preserved with the software, but also that the license is made accessible to users of the software. Hiding the license in a JAR isn't really accessible to end users. Therefore, it could make sense to show these licenses in a manual for your software, or in an interactive help screen of your software. What is appropriate depends a lot on what your software is doing.
Comment: Thank you. What if I don't include the JAR file, but tell the users to download them, do I still have to give attribute (also to pg-jdbc)? If valid, is this considered bad practice? This is a small project and not worth diving deep into the tree.


Filter out daytime image of LANDSAT 8 using Google Earth Engine

Question: I saw an answer here saying that we should sort by 'system:time_start' but shouldn't that refer to the date (like 2015-05-01) instead of hour of the day? I also tried something like ee.Filter.calendarRange(7, 15, 'hour') but it didn't seem to work.
Answer: About using ee.Filter.calendarRange() - you might have expected that images in certain location will be coming at different hours. In many areas, it's not a case. Also,ee.Filter.calendarRange() is way to go (you should avoid using .sort as suggested in other example for many reasons).
In the example below all the images for given locations were taken between ~10:38-10:41.
I've added an example of using ee.Filter.calendarRange(), showing that it does what it is expected to do.
var l8 = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2"),
    geometry = /* color: #d63000 */ee.Geometry.Point([-1.6843750000000135, 31.62971723875741]);

var ic = l8.filterBounds(geometry)

print("Size of filtered image collection", ic.size())

// What time of the day images were taken?
print("SCENE_CENTER_TIME histogram", ic.aggregate_histogram("SCENE_CENTER_TIME"))

print("Filter includes 10am", ic.filter(ee.Filter.calendarRange(10,17,"hour")).size())
print("Filter excludes 10am", ic.filter(ee.Filter.calendarRange(11,17,"hour")).size())

Here is the link to the example:
https://code.earthengine.google.com/005c8c3616ee0371b6cdf9597d91f095
Next time include an example script illustrating what didn't work for you.
I hope, it helps. Good luck with your analysis!
Comment: Thanks a bunch! It really helps!
Answer: You can use the SUN_ELEVATION property to filter out daytime Landsat images in Earth Engine. Night images will have a negative sun elevation indicating that the sun was below the horizon at the acquisition time. Other properties like SCENE_CENTER_TIME and methods like filterDate and ee.Filter.calendarRange are based on UTC time, making it difficult to find nighttime images across different time zones.
Note that night images are almost always excluded from Level 2 and Tier 1 collections, so a collection like Tier 2 TOA is usually the best choice.
Here's a quick demo script that loads a night image and visualizes the thermal IR band:
// Select images where the sun is below the horizon
var night_images = l8
  .filterBounds(geometry)
  .filter(ee.Filter.lt("SUN_ELEVATION", 0));

var image = night_images.first()

// Print the local time of the image acquistion
print(image.date().update({timeZone: "America/Los_Angeles"}));

// Add the thermal infrared band to the map with a custom color palette
var magma = ['000004', '2C105C', '711F81', 'B63679', 'EE605E', 'FDAE78', 'FCFDBF'];
Map.addLayer(image, {min: 285, max: 295, bands: ["B11"], palette: magma});


Which object is seen if light reflects from one object after another?

Question: This is a question I ask because I am having trouble understanding how mirrors work and how angle of object placed, your eye placed and how angle of light reflected all affect how object is seen. So my question basically is that imagine there are multiple objects like a book, a wall,and finally a pair of human eyes. Lets says light first striked a upright book, where some rays are reflected and the reflected rays then hit the wall as it is traveling. Then imagine the some of the reflected light that hit the wall is again reflected to some direction where your eyes are now positioned. Now the question is that which object is seen by you? The wall or the book? I think you see the wall but now if instead of wall we have a mirror. Do you see the book or the mirror? Any help will be appreciated.
Comment: Have you considered doing an experiment to find out? If you look at a wall, do you see the wall or do you see reflections of other things?
Answer: Books and walls scatter light in every direction but mirrors reflect light in a straight line. You see objects which scatter light and you see reflections in objects which reflect light.
Comment: *Diffuse* reflection describes reflection off of walls and books whereas mirrors produce *regular* or *specular* reflection.


The descriptions of pyramids in Vedic scriptures

Question: Do Vedas (and any other Vedic scripture, such as Puranas) hold any information on pyramids? What is their function? What can they do?
Comment: How is it an off-topic question? OP clearly asking about pyramids in Hindu scriptures.
Answer: A Pyramid will have 5 faces.

The Vedic literature contains many hymns, describing spiritual aspects, in esoteric fashion.  So if we consider those esoteric mentions, we can infer that a Pyramid is a an symbolic representation of panchabhutas or 5 elements.

Agni - Fire
Vayu/Indra - Air
Varuna   - water
Earth   - Aditi
Space/Heaven   - Tvastr

Earth and Heaven are called the Parents of Gods in Rig Veda I.185.4

May we be close to both the Worlds who suffer no pain, Parents of
  Gods, who aid with favour, Both mid the Gods, with Day and Night
  alternate. Protect us, Heaven and Earth, from fearful danger.

The 5 faces of a pyramid represent 5 elements of Nature/God.  That is why even the temple domes resemble, though not in exact manner, a pyramid.

The Meru Sri Yantra also resembles a pyramid.

Even a human sitting in a cross-legged fashion or in padmAsana, resembles a pyramid.

So pyramid is every where and in all times, only difference being in Egypt, the structures were constructed in exact pyramid shape.
Comment: These are only similar shapes of Pyramids but is there anything specifically about pyramids itself? Their effects, uses etc., I ask this because people who are advocating pyramids are not suggesting Meru Sri Yantra or gopuram. They are suggesting an exact replica of pyramidal shape while meditation.
Comment: Based on my research of Vastu-sastra (derived from hindu websites), pyramids provide an overall positive effect on human beings. They somehow focus energies. However, I couldn't find any infomration from original Vedic sources. I wonder if Vastu-sastra has any information.
Comment: @Sarvabhouma: has it been proven that if one meditates under pyramid shaped structure, advancement in spirituality is guaranteed?  I don't think so.  If that was the case did Sri Ramakrishna or Sri Ramana Maharshi or for that Buddha meditate under pyramid shaped structure?
Comment: @MarinoKlisovich: Personal experiences may be different.  You mght have experienced such positive effect out of your own advancement in spirituality. We cannot generalise.


Are there emotions that motivate pattern completion? If so, where in the brain are they located?

Question: I have been studying musical "tension." Musical tension essentially refers to the "expectations" one builds up in a melody that are then "released" when a stimulus matching the expectation occurs. For example, if you play the white notes on a piano in order CDEFGAB, you have a "tension" that motivates you to finish the scale and play C to complete the pattern.
I am aware pattern completion occurs in the brain and have seen a few biological models of this. For example, with attractor network models of human memory. So I am not surprised obviously that pattern completion occurs. But this example with musical tension highlights how there is an emotion (aka drive or motivation) that compels me to complete the pattern. When I hear the sequence CDEFGAB, I am compelled to finish the sequence.
My Question
Can someone provide me of examples of canonical models of emotions influence on pattern completion? I would like to learn example mechanisms as to how, on a circuit level, emotion would influence pattern completion.  I am particularly interested in examples relating to common forms of human creativity like visual art, problem-solving, etc., but any examples will do.
Comment: This question should also be suitable for http://cogsci.stackexchange.com/, and users there might be able to offer a different perspective.
Answer: This "tension" is actually called anticipation in neurobiology and related fields. Whole purpose of this is to get higher reward. This is generally happens because of dopamine release. Many musicians have utilized this 'anticipation' technique in their compositions. Famous example is Led Zeppelin's stairways to heaven in which audience is 'anticipating' third part of song where Page's guitar in high tempo. Anatomically distinct dopamine release happens during anticipation and one will experience of peak emotion to music. You can read this paper for experiments related to this. This paper's introduction has given reference to many of such research papers. Go through it's references.


upload googlemap in android app, using eclipse

Question: I'm tring to upload googlemap in android app, using eclipse. But the results are that I only see white grid with no map on it. Is it because I used  a temporary Maps API Key? How can I register for a new Key?
Answer: By upload googlemap, do you mean run an application that uses a mapactivity? If you've registered your key and put it in the xml correctly, you're almost certainly forgetting to add the INTERNET permission.
Comment: I meant to run an application that uses a mapactivity,i did add the INTERNET permission in mainfest: ... . Regard the key registration, i put it in main.xml: .... Thanks


Callback function in user mode vs kernel mode

Question: Why is it advisable to run callback functions in user mode vs kernel mode?
Answer: The only code that should execute in kernel mode is that which has been loaded into pages that are protected to restrict kernel mode access.
If you could execute a kernel mode callback function, that would open the door to all kinds of security holes.


2 Chromium windows

Question: I am trying to open up 2 separate Chromium windows using /.config/lxsession/LXDE-pi/autostart. I am able to open both urls when adding two lines but they open in the same browser as two tabs. I would like to open them in two separate windows. Is this possible?
Comment: Have you looked [through this](https://peter.sh/experiments/chromium-command-line-switches/) to see if you can get what you want that way?
Comment: Thanks, that is a great resource. I have been able to create two windows with the --new-window switch on two lines . The issue is that the window size and position is only following the first --window-size and --window-position switch. Any thoughts?
Comment: You're better off researching chromium usage on a larger exchange, e.g., [Super User](http://superuser.com/) or possibly [Unix & Linux](http://unix.stackexchange.com/).  Or somewhere like reddit where there are groups dedicated specifically to chromium, or even from the chromium devs themselves, who surely have at least one mail list and IRC channel.  First you find out if it is possible period, then if it doesn't work on the Pi, drill down on that.
Answer: Posting this here so hopefully it will help others.
After a bit of digging I found out the tricks to get this working.
First in Chromium you need to create a new user, (doesn't matter what it's called).
Then when editing /etc/xdg/lxsession/LXDE-pi/autostart
Use the following
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --new-window --start-fullscreen http://google.com --window-position=0,0 --user-data-dir=Default --start-fullscreen
@chromium-browser --new-window --start-fullscreen http://bbc.co.uk --window-position=0,0 --user-data-dir='Profile 1' --start-fullscreen

Note the --user-data-dir setting and the --window-position setting, basically you need to treat the two screens as one big screen.
Answer: I'm adding some information to the first comment posted here...
Firstly I made another Profile in chromium of course, thats pretty easy.
What I then did instead of fullscreen was adding the following to the /etc/xdg/lxsession/LXDE-pi/autostart:
@chromium-browser --new-window --incognito --kiosk http:// --window-position=0,0 --user-data-dir=Default --kiosk`

@chromium-browser --new-window --incognito --kiosk http:// --window-position=4000,0 --user-data-dir='Profile 1' --kiosk`

I firstly had some struggles with finding out the window positions but the following worked for me:
I have a 4k Monitor and next to it a normal sized one, so what I did was go to screen settings and go to resolution to find out the size of my HDMI-1 Screen which was the 4k one. It was 3980 x something, so I just did --window-position=4000,0 on the second one.
I don't know if this is gonna help anyone, but I had to invest quite some time to get this running so I would have appreciated that info. Hope I was able to help someone.
Answer: (I wonder if this is still relevant to anyone anymore)
For me two Chromium windows worked (almost) right away without any actual tricks. I opened a Chromium-window, moved it to the secondary screen, maximized it by double-clicking the top-bar and then opened another Chromium window in the primary screen by simply clicking the web-browser icon anew. Voila, two windows.
In order to copy/paste between the two sessions, Chromium (or Google) required of me that I installed a plug-in for off-line usage in my browser.
Happy New Year
Thomas

2 Chromium windows


How to use the pyspark module in python script?

Question: I downloaded the pyspark module, and I would like to use it in my IDE (Spyder). But it is not working at all. I typed export PYTHONPATH=$SPARK_HOME/python/:$PYTHONPATH  to include it in python path, but still "no module named pyspark" is the message I get.
Is it always that I have to use pyspark console in order to use the spark module? Is there no way to use the module directly in other python IDE?
Comment: Can you try setting the executable to call (preferences->console->advanced settings) from within spyder to be pyspark?
Comment: its not working neither
Answer: First download sources from spark website. Then download and install sbt from this website.Now go to sbt folder in spark source downloaded. Run sbt file with sbt package installed earlier. It will start building and will take around 30 minutes to complete.For more info,goto this link.
Remember, you should have latest version of JDK installed in your PC/Laptop. Get JDK from here.After building , follow the commands given in spark website to create pyspark PYTHONPATH and environment. You can do this on spyder also.


I accidently overcharged my iPhone 5c and it stopped working. What should I do?

Question: For the first time, I left my iPhone 5c charging all night for about 4 hours. In the morning when I unplugged it, it had turned off when it was on when I left it for charging. I tried to turn it on, but the screen won't hitch. At first I thought it got stuck, but it seemed like the battery had been damaged because it won't buzz at all. What should I do?
Comment: It doesn't work this way, You should be able to leave your iPhone plugged in 24/7 without worry.
Comment: How where you charging it? (i.e. what was the cable plugged into).
Comment: This also happened to me today. I left it for like 11 hours and now Im using it and it has no problems like switching out automatically. I guess you're charging your phone and using it at the same time, that's the risk of an iPhone 5c bcoz my iPhone battery bubbled and they changed my battery. So I guess its not about overcharging it, its about charging and using it at the same time. I hope this can help. x
Answer: Theoretically overcharging a device is not possible, as once it reaches the 100% of the battery capacity, it will just stop charging.
Are you sure the device was being charged when you left it? Perhaps you connected the iPhone to the charger but not the charger to the AC?
This will explain why it won't turn on as it would be battery drained.
If this is not the case, going to an Apple Store would be the best option.
It's far more likely you just had a failure, unrelated to charging and need service. If it was overcharging, getting a technician to look at it would be even more important that a simple failure, so have it checked out.
Comment: To be clear, OP should also try using a known, working charger on a known, working outlet first to ensure that the device simply is uncharged. Service, though, would be recommended beyond that.


"Never ever" sentence construction

Question: "But they rejected me, because they say that in those woods was never seen a single wolf ever." - Is this use of never ever correct?
Answer: It's difficult to comment on how correct it is because the entire sentence sounds very poetic and antiquated. Expressions like "was never seen" are not in common usage in modern English however it is commonly heard in movies about the early 1900's and so. If someone made this statement in everyday speech, I would assume he was quoting some old literature and consequently, the validity of it loses relevance.
If the statement was made in earnest, I would assume he really wanted to emphasize "never". I do not think it is technically correct in modern English though and it wouldn't naturally be comprehensible.
Comment: I want to use this sentence in a book and I'm not native speaker so I don't know whether use it or not. Do you know any alternative which I could use?
Comment: "But they rejected me saying that no one has ever seen a single wolf in those woods" perhaps? IT would be easier with more context. I can't determine if "because" is appropriate without knowing what happened before.
Comment: Thanks for help, I really appreciate it. I think this suits my sentence better than context with because.

"Never ever" sentence construction


Does OnePlus 5 use the same screen as OnePlus 3/3T?

Question: In the recent presentation, OnePlus CEO stated that because OnePlus thinks 2K resolution is unnecessary for a 5.5" screen, OnePlus 5 will continue using 1080p AMOLED as OnePlus 3 and 3T do. I've heard major criticism on the screen of 3/3T, so I wonder if there's any improvement on the screen of OnePlus 5.
Comment: Deleted my answer (actually should have been a comment) since it wasn't conclusive enough and both sources differed
Answer: Sort of.
The OnePlus 3T and 5 share the same display model. Pocketnow even wrote an article about it.
However after further inspection, only some 3T phones have the display model of S6E3FA5 (This is the OnePlus 5's display.) Others are S6E3FA3.
Therefore, only some of OnePlus 3T's share the same display as the 5.
Can't tell for certain but from this forum post, the OnePlus 3 shares a similar story.
Comment: Some claim that the S6E3FA5 isn't the model number of the **panel**, but the **controller chip** instead.


What constitutes a draw?

Question: I know what makes a game a stalemate, and I know that stalemate is 1/2 point to everyone, and I assume draw is the same, but can there be a draw without a stalemate?
Comment: The definitive answer is Article 9 "The Drawn Game" in https://www.fide.com/FIDE/handbook/LawsOfChess.pdf , but for a beginner some explanation of what is being said there is probably required
Answer: As Ian Bush points out in his comment the gory details are spelled out in the latest version of FIDE Laws of Chess. Article 9 covers most of the points but others are hidden in articles 6.9, 7.5.5 and A.4.3
Summarising:

Players agree a draw
Stalemate
Neither player can mate the other even with the other player trying to get checkmated
Correct claim by the player on move that the position has or is about to be repeated for the 3rd time
Correct claim by the player on move that 50 moves (100 half moves) have been completed or are about to be completed with no captures or pawn moves
Variation of 4. If the position is repeated 5 times then regardless of any claim the game is drawn. An observant arbiter is supposed to spot this and step in.
Same variation of 5. If 75 moves (150 half moves) have been completed with no pawn moves or captures then the game is drawn.
If one player "loses" for a "normal" chess reason (doesn't include resigns) but the opponent can't mate with any series of helpful moves from both sides (i.e. helpmate is impossible) then the game is drawn. These "loses" include losing on time, two illegal moves.

What constitutes a draw?


Customize People Search Results

Question: i want to edit my people search results but i can't do it. i want to show phone numbers , email or id of the users. how can i do that?
Comment: Did you try the People Search Core Results webpart? This webpart displays OOTB phone number and email.
Answer: Part 1:
http://www.sharepointology.com/development/customize-the-people-search-results-part-1/
Part 2:
http://www.sharepointology.com/development/customize-the-people-search-results-part-2/
Just requires some custom xslt on the search results page.

Customize People Search Results


How to change DST start and end dates for a timezone in Red Hat Enterprise Linux and Oracle Linux?

Question: DST start and end dates keep changing over the years for different timezones. For example, I found below link where DST start and end dates are provided for EST for different years. https://www.timeanddate.com/time/zone/usa/new-york?year=1963 In Windows, we can update a timezone info using the registries. In SUSE linux, we get updated timezone file updates and steps to apply the updates are given in the below link: https://www.suse.com/support/kb/doc/?id=000016358#:~:text=Linux%20will%20change%20to%20and,DST%20is%20entered%20or%20left. However, I couldn't find a way to update the timezone for DST changes in RHEL and Oracle Linux. I need help regarding this.
Answer: The start and end dates keep changing, but in many cases the rules that define them don't; for example, EST switches to EDT at 2am on the second Sunday in March since 2007. The time zone database used on Linux systems (and others) encodes the rules, not the dates, whenever the dates can be calculated.
For time zone rules which do change, or time zones with specific dates, keeping your systems updated will ensure that your systems are aware of the changes. This will also take care of leap seconds. On RHEL and Oracle Linux, make sure the tzdata package is kept up-to-date. The instructions you found for SUSE are the manual equivalent of updating the tzdata package; they will work on RHEL and Oracle Linux too.
Comment: It is possible the OP needs to update the DST information for some location that decides the DST times separately for each year (yes, those exist!) and/or has the misfortune of needing to maintain old systems that have already dropped out of official support (I've been in that position a few times). The SUSE instructions for manual updates are not specific to SUSE, but applicable to most distributions, including RHEL and Oracle Linux.
Comment: Right, the last part is what the last sentence of my answer was supposed to convey. For locations which change DST dates every year, there are `tzdata` updates pretty much as soon as the rules are published, but it can happen that the distro updates aren't ready on time...


Can I oil a new board with olive oil?

Question: I just got myself a new wooden board. I have been told to put some olive oil onto it and let it sink in for a few hours first. But now I'm reading from sources that I should be instead using mineral oil. Which is true? Is it ok to use Olive oil?
Comment: The question isn't phrased the same but the answers here generally apply, and the top one addresses whether oils like this are a good choice: https://cooking.stackexchange.com/q/21766/1672
Comment: Does this answer your question? [Is there something better than mineral oil for cutting boards?](https://cooking.stackexchange.com/questions/21766/is-there-something-better-than-mineral-oil-for-cutting-boards)
Comment: Agreed, marked as duplicate.
Answer: Use food grade mineral oil
While one could use any edible oil (assuming frequent washing as many go rancid) to condition a wooden cutting board, food grade mineral oil or "butcher block conditioner," which is food grade mineral oil with waxes, is preferred because it will not affect the flavor of foods cut on the board.
Comment: I'd suggest editing the discussion of rancidity into your answer; it's just as important as affecting flavor.
Comment: So considering that 90% of the food I will be cutting on it will be cooked in a pot with the same olive oil... I probably don't care, right?
Comment: If you're frequently washing and re-oiling it probably doesn't matter other than the flavor it contributes to the food. If you use the same oil you cook with than so long as the oil isn't allowed to go rancid or the wood go dry it doesn't matter much. I prefer a mineral oil and beeswax "butcher block conditioner" which lasts a long time and doesn't go rancid.
Answer: I've been seasoning my boards with olive oil for about 8 years now (same board!) and never had any problems with olive oil making the wood bad, there be a taste or smell.
Now, I do a mild oven dry after saturating it in oil, and then wipe off the excess. I do this once or twice a year.
For the record, we have the board covering one half of our sink and it gets a lot of use, lots of foods, lots of wet, lots of washes in the sink, lots of everything. We put it upright at night to drive if it was washed.
It is a laminated bamboo board.
Olive oil seems to work fine!
PS - I have also done this with one of my previous oak boards.
Comment: Um ... laminated bamboo boards don't need to be oiled.  They're already 100% sealed against moisture using resin.
Comment: Don't know about that. From what I can see about moisture retention (my board) and the other info online, they do need to be oiled like any other wood cutting board - especially when they get wet often. As per this and so many other advices online: https://cooking.stackexchange.com/a/34325/63375 . Now if they don't that's news to me. Looking at the wood on mine, I would still oil it.
Comment: Huh.  Bamboo boards are made from laminated layers of split bamboo, so I don't get why they  would want to be oiled.  But you're right, most manufacturers do recommend oiling them.
Comment: They still rot - especially when used near a sink where they don't dry out completely between uses. The oil also prevents proteins from sticking - just like they put oil on everything at the meat shop (they even oil glazed ceramic walls in the meat shop!).

Can I oil a new board with olive oil?


how to update Group policy for the whole domain?

Question: I recently found the Group policy of our domain (windows server 2012) is not updated enough to support our Win10 end-user machine. which are the correct ways to update the Group policy definition library?
a. manually install admx files?
b. install one domain controller with server 2016?
c. raise the function level of the domain to the server 2016?
Answer: You will need the ADMX files for the Windows Server 2012 DC's in order to support any changes in Windows 10  Group Policy, regardless of if you were to deploy a Server 2016 DC.
Comment: And you absolutely do not need to raise the domain functional level.
Answer: Don't raise domain functional level. If you do, the Server 2012 DCs will no longer be able to service the domain.
My recommendation would be to create a central store. The central store can be created on the SYSVOL partition on any domain controller (SYSVOL replicates through DFS to all domain controllers) and then go to the domain folder and find the Policies folder. An easy way to access this would be to use the following UNC path: "\FQDN of domain\SYSVOL\FQDN of domain\Policies".
From there, presuming that a PolicyDefinitions folder has not yet been configured, none will exist. Go to a Server 2016 DC and copy the C:\Windows\PolicyDefinitions folder to the aforementioned directory.
This will copy all of the ADMX files over to the central store where all DCs can access them, including Server 2012 DCs.
Answer: When I had Windows 2012 R2 server and Windows 10 clients, I had to download ADMX templates and place them in server policy store with each Windows 10 major version.
This link should help you:
https://support.microsoft.com/cs-cz/help/3087759/how-to-create-and-manage-the-central-store-for-group-policy-administra


How to Paginate an entire set of results in JSP

Question: The problem I am facing is I am unable to paginate all the results that I have. To give a clear explanation I will try to give an example. Supposedly a person tries to search for a restaurant in a particular area. Now in the first go itself I am filtering out all the restaurants rather than fixing a pagelimit and search limit. So basically I have the entire list of restaurants for that particular area. Now I want my page to display 10 restaurants at a time. Can I do this entire operation on the client side itself ? Means the next button should just iterate through the rest of the restaurants left to display and 10 at a time. Similarly the previous button should work as well. Moreover I am using google big table rather than traditional db. Any answer is heartily obliged.
Answer: Generally speaking, you want to grab only the amount of data you need for your page.  Example: I have 1000 records, but I only show 25 at a time, and I want first, last, previous, next buttons.  A good place to get started for JSP is DisplayTag: http://www.displaytag.org/1.2/.


How to replace an item the player has in their inventory in 1.13?

Question: I'm not very familiar with the new Minecraft 1.13 commands so I'm not exactly sure of how I would go about doing this.  I would like to replace the item "Water Bottle" with a different item whenever a player has either filled a water bottle up or found one in the world.  For example, the player walks up to a body of water with an empty glass bottle, they fill it up and immediately the water bottle is replaced with a fire resistance potion (just as an idea of what I'm trying to do).
I had tried to use a repeat command block that clears the player's inventory of any water bottle that is in their inventory using the /clear command, and then if that is successful (I check with a comparator) I simply give the player my desired item using the /give command.  However, the problem I'm having with this is that it seems to be very inconsistent.  For example, if I was to click multiple times on a source of water relatively fast then the majority of them are not turned into my item and the player is left over with different Water Bottles.
Comment: If you're already using a comparator, you might as well put a long redstone line behind it and command blocks with that `give` command in them. That way, if two items are cleared, two command blocks are activated and give two items. The proper way would be putting the return value of `/clear` into a scoreboard using `/execute store` and then using that.
Answer: If you are willing to use a datapack (its pretty simple and easy) you can set it up to run a function every tick which checks for a player having a water bottle, and if they do have one you can give them something else. Unfortunately, this requires recursion if you want to handle the player putting multiple items in their inventory at once (so taking them out of chests), so if someone knows how to do recursion, or has another fix, please modify my answer to explain it. If you want to do the datapack, [here][1] are some instructions for setting it up. Your tick function might look like this:
<code>execute as @a[nbt={Inventory:[{id:"minecraft:potion",Count:1b,tag:{Potion:"minecraft:water"}}]}] run give @s minecraft:dragon_breath 1
execute as @a[nbt={Inventory:[{id:"minecraft:potion",Count:1b,tag:{Potion:"minecraft:water"}}]}] run clear @s minecraft:potion{Potion:"minecraft:water"} 1
</code>
Because a tick is the smallest unit of game time, you couldn't outclick this function. Make sure your give command comes before your clear, and you can change the dragons breath to any item id you want.
Edit: Just realized the link doesn't explain how to make a function run every tick. Basically, you put the above function in a .mcfunction file in your functions folder in your namespace. However, in your data folder (which has your namespace) you make a folder called minecraft, and inside that a folder called tags, and inside that a folder called functions. That folder will get a JSON document with the name 'tick' and the following text:
<code>{
    "replace": false,
    "values": ["<your namespace>:tick"]
}
</code>
This runs the function (which checks for water bottles) every tick.
[1]: https://minecraft.wiki/w/Tutorials/Creating_a_data_pack
Comment: So I noticed that when I tried this out water_bottle didn't work, since that is not what it is called in the game.  I tired minecraft:potion, which works but it will activate with any potion the player has in their inventory, not just the water bottle.  I tired  execute as @a[nbt={Inventory:[{id:"minecraft:potion{Potion:minecraft:water}"}]}] run say True but that doesn't seem to work either.
Comment: Sorry yeah I think that's a new 1.14 thing or maybe it was like that all along. Either way for a new execute command try `execute as @a[nbt={Inventory:[{id:"minecraft:potion",Count:1b,tag:{Potion:"minecraft:water"}}]}] run give @s minecraft:dragon_breath 1`. This works because each set of curly braces in the `Inventory:[]` tag is an item stack, and the potion type is in the `tag:{}` tag, so this specifies a single water bottle potion in the player's inventory.
Comment: Added the new give command and accompanying clear command to the answer.


Does GoogleBot respect User-agent: *

Question: I blocked a page in robots.txt under User-agent: *, and tried to do a manual removal of that URL from Google's cache in the webmasters tools. Google said it wasn't being blocked in my robots.txt, so I then blocked it specifically under User-agent: GoogleBot and tried     removing it again and this time it worked. Does that mean Google doesn't respect User-agent: * or what?
Answer: GoogleBot should properly follow rules for User-agent: *, however it will not update it's cache until it GoogleBot has crawled your site again, which takes some time. Google doesn't release the exact minimum time between crawls, but I'd speculate it's about 15 to 30 minutes.
Comment: You can interact with the cache/index, in the webmasters tools, click Site configuration>Crawler access>Remove URL and enter the URL. You can remove a page from just cache or both cache and search results..
Comment: The problem is it doesn't update its cache every time it crawls and sees my robots. That's why I'm trying to expedite the process by manual removal. GoogleBot seems to crawl at diff speeds depending on a lot of factors but according to my access logs it's only about once or twice a day for my site
Comment: The interfaces available to the public only requests that GoogleBot crawls sites in a certain way, you can't control exactly what it does, and there is no way at all of directly interacting with the cache/index itself. Also, I'm fairly certain the more you request, the longer it is between re-crawls.
Comment: I just tried this whole thing again on another page and the same thing happened. Google denied my request when under User-agent: *: "Your request has been denied because the webmaster of the site hasn't applied the appropriate robots.txt file or meta tags to block us from indexing or archiving this page.

Please work with the webmaster of this site or select an alternate removal option from the webpage removal request tool." And when i put it under GoogleBot in robots.txt it suddenly accepted it for removal. So my question still stands.
Answer: Incoming links will also make the url indexed by google.
It wouldn't have an index of the actual content
Answer: If webmaster tools said it wasn't being blocked by robots.txt, I'd say you must have had an error in your robots.txt file.  Google definitely does honor User-Agent so something else must be wrong.  You can check out robots.txt in some detail via the help pages under Google Webmaster Tools.
Index removal takes 24-48 hours in my experience, although I have seen it happen in as little as 5 hours.
Comment: I didn't make any changes to my robots.txt after it didn't work other than putting the line that blocked the page under GoogleBot instead of *. Plus I did check that robots.txt was valid in the tools at the time. So that's not it. So it was either a fluke or GoogleBot doesn't always honor *. As for how long it takes, that's irrelevant because it put my request in the 'denied' section - meaning it processed it - which is what spurred me to come ask about this issue here.

Does GoogleBot respect User-agent: *


Setting up CrashPlan with NAS drive attached to Airport Extreme?

Question: I have one of the new (well it's not so new anymore) Airport Extremes with ac wireless. I am using Crashplan to back up my data online, but I also want a more local backup -- so I would like to hook up a big external hard drive to the Airport Extreme as an NAS, and back up my computer using Crashplan's software to the Airport Extreme NAS. What's the best way to set this up? I know that Drobo's NAS can install Crashplan on the NAS, but since you can't install any software on a hard drive using the Airport Extreme as an NAS, what's the ideal way to set this up?
Comment: You can't install software using the AirPort Utility.app. All you have to do is set up a NAS which can run the CrashPlan service, give it a static local IP and tell the Extreme to port forward the correct ports to the NAS' IP.
Answer: You should be able to use the drive on the Airport Extreme as a destination folder for your CrashPlan backups. CrashPlan can backup to a local folder, or to an external hard disk in addition to their online service. You should be able to treat the NAS in the same way as you treat an external hard drive, from CrashPlan's point of view. At least, that's my guess, but I haven't tested this.
This assumes you want to backup from your computer TO the NAS, and not that you want to backup FROM the NAS to CrashPlan's servers (although I'd imagine both are possible).


Why don't most physics programs study the primary sources?

Question: Why don't most physics programs study the primary sources? In other words: Why don't they include Newton's Principia, Lagrange's Analytical Mechanics, etc., in the curricula?
Answer: The reason is that this is too time-consuming. The old papers are very difficult to read, because they have suboptimal presentation. Newton's Principia is not written well for the purposes of teaching mechanics. It is designed to emulate Aristotle in scope and completeness (but with the advantage of being correct physics), and it is optimal for the goal it served historically, getting Aristotle out of physics. It's absurd latin and old-fasioned geometrical phrasing with Greek-style geometry is suboptimal for pedagogy and clarity. One needs to use coordinate geometry and vector components in a modern presentation, there is no advantage to the old style.
In order to assign the Principia, one needs a modern translation of all the ideas in it. This is not provided by any source. Such a translation would keep all the arguments, but rearrange the order and the phrasing to be in common language and using modern calculus and vector component notation. This is very simple to do for someone who knows any physics, and Chandrashekhar did something like this in his annotated Principia (this is a very nice and respectful presentation). But Chandrashekhar wasn't writing an introductory physics book, rather he was trying to place the Principia's monumental achievement in historical context, to let modern readers know exactly what Newton was doing.
But I think it is possible to assign the Principia as an elementary physics book, if the translation is authentic and modernized. It requires rewriting the whole thing from scratch, but without throwing away any of Newton's insights. These insights are mostly contained in the special problems he solves.
I tried to provide an example of how to do this for less difficult things. The oldest is Archimedes "The Method of Mechanical Theorems", and you can read the gloss on Wikipedia, under Archimedes' "The Method". Using modern calculus, you can explain what Archimedes is doing in two minutes, and you can see exactly why his paper is so laborious--- he didn't have an algebraic notation or a standardized way to talk about infinitesimals. One should do a similar thing for "on floating bodies", "the equilibrium of planes" (this is simple to do, since it is all center-of-mass results which are trivial with modern calculus), "on the sphere and cylinder" (also simple, but it requires summing the squares, which is simple with modern calculus of finite differences), and the other works. All physics comes from Archimedes originally, especially the concept of force and torque.
One of the ideas in "the method" is the observation that certain integrals involving boundaries which are curvilinear algebraic varieties end up being polynomials in certain plane slicings, and so give rational number integrals. The simplest example he gives is of two cylinders intersecting at right angles. The question of which figures enclose rational volumes has never been investigated again, as far as I know, although it is interesting. It is similar to the question of periods, but it is different because of the slicing freedom. If people are familiar with the method, maybe there is interesting mathematics left undiscovered here.
With Newton, people keep the statement of the three laws of motion (the least important part of the Principia) and throw away all the special problems Newton analyzes. This is exactly the opposite of what they should be doing. One can state Newton's laws today as follows:

There is a conserved momentum, equal to the total mass times the velocity for an isolated body, and when it flows from one body to another, this is a force.

That's it. That's Newton's three laws. There is a further result

There is a conserved angular momentum, equal to the momentum cross the position for a point particle, and it is conserved under pairwise attraction repulsion events.

If you add the assumption that all matter is composed of points with pairwise forces which are attractions and repulsions, you get Newton's model of the world. The division of the laws into "1st law" "2nd law" "3rd law" is arbitrary and unnecessary, and only of historical interest. If you start with these two assumptions, you can state the three laws and show why and how they work, and the angular momentum law, and how and why it works, and then you can go to the special problems.
Newton's argument using infinitesimal triangles that the angular momentum is conserved during a radial attraction/repulsion event is essential, and it needs to be preserved unchanged. Newton's argument about the parabolic shape of spinning water needs to be preserved, although one should use the notion of potential energy in the argument. Newton's derivation of the speed of sound needs to be transmitted with both a derivation of the wave equation and an explanation of the adiabatic/isothermal distinction. Newton's analysis of the orbits of the planets is a little difficult to translate--- Feynman attempted to do this in "The Lost Lecture", but this is a place where improvements are possible, because one wants to use the modern insights about the central force, while keeping Newton's insights about the inverse-square special case. I don't know how to best present this.
All these things are usually skipped in elementary books, and instead you get an endless stream of unimaginative problems that are copied from one book to the next. These can be summarized in about a dozen or two orthogonal mechanical problems.
Regarding Laplace, the issue here is that the method of secular perturbations is greatly clarified by using action angle variables, and some special transcendental functions which flip from angle to time. The presentation in Laplace (which I haven't read) is not going to be optimal.
Translating Maxwell is going to be a pain, because you need to keep the modern insight that E and B (and A and $\phi$) are fundamental, not E and H. Maxwell is mislead by the fact that it wasn't appreciated that electric fields come from point sources, while B fields come from currents, so he wants the continuity conditions across material boundaries to be the same for the electric and magnetic field, and this picks out E and H as analogous and fundamental. This disease infects the literature right up to the 1950s, it is only fixed in the 1960s (and Feynman and Landau and Lifschitz help here).
The insights in Maxwell are so enormous that it is impossible to describe what is lost. These are the material dielectric and magnetic properties that are described phenomenologically. In my opinion, a good translation of Maxwell is essential to keep the 19th century E&M thinking alive.
For thermodynamics the problem is more severe, because the original authors did not understand that entropy was statistical, and energy was fundamental. They thought that the energy was the fundamental thermodynamic function, not the entropy. Here, one can start with stat mech, explain the thermodynamic potentials, and then go back and translate all the old papers into modern notation. These are all enormous projects, however. Thermodynamics has not been transmitted well--- most of the old thinking is lost. Statistical mechanics has been transmitted well, and includes the old thinking in principle, but the intuitions are different. If you don't believe me, look at any 19th century physics journals where they are busy measuring the heat capacities of materials at different temperatures, nd there are dozens of annoying thermodynamic identities you have to internalize. There is no way that studying this nonsense is productive, but it needs to be translated to modern language. The chemistry departments are responsible for this, and I don't think they are doing a great job of this.
Regarding 20th century physics, it is essential to modernize the treatment of Bohr, so that old-quantum theory is preserved. This is done in a wonderful way by Ter-Haar in the 1950s in a little book called "Old quantum theory". The Wikipedia pages on Adiabatic Invariant, Correspondence principle, and Old quantum theory try to present the results in a modern translation, without fussing over the ambiguities that are now known to be caused by working to leading order in h-bar.
Some things missing from all modern books:

The Lee model: This was historically essential for understanding renormalization, and this needs a modern translation. It doesn't appear in any modern field theory book.
The Bethe-Salpeter equation: This is important for bound states, although a full bound-state formalism is lacking today.
The pion-nucleon models: these don't work, but they are an important source of intuition. The magical pion decay rate calculations, the false theorem on identity of the pseudovector vs. vector coupling, etc, these are all forgotten.
Regge theory: This is unforgivable. There is a short intro in Landau and Lifschitz quantum mechanics, but the only good source is Gribov's book "The theory of Complex Angular Momentum". You need to know which hadrons are on which trajectory, and you won't find this presented in modern language or notation.
S-matrix theory: This is also unforgivable. I don't know the best book here, there are a few. This is coming back in style, so it might get fixed soon. This includes what Chew was doing with pions and nucleons, that I still can't figure out. But Weinberg eventually concludes it's all equivalent to effective field theory (it should be, but then you need to show the equivalence in some way).

There are a bunch of other things that can be dispensed of quickly today, I can't think of them at this moment.
So the main reason is that the historical documents need to be modernized to be pedagogical, and nobody does this. The only person who (secretly) did this is Feynman! He would rework the results with incredible fidelity to the historical literature, but without saying he is doing history. Almost all his elementary textbook arguments are reworked forgotten results from the old literature, done
in his own way. This is why they are such classics, in my opinion, they are extremely historically faithful.
Comment: I think even Maxwell isn't worth reading today because he predates special relativity. Far better to read the works of talented *teachers* who teach as a profession and get feedback such as Griffiths with his Classical Electrodynamics book. Prof Lewin is another fantastic teacher who hasn't written a book, but has lectured on the web and maybe this is his medium. Maybe you're starting to fall asleep in the past and not keeping upto date with modern books.
Comment: @Physikslover: I think the modern books on everything elementary are a total scandal, with the exception of Feynman's lectures and Landau and Lifschitz. The issue is that you just haven't read Maxwell. Maxwell's concerns do not involve special relativity, but analyzing systems of materials in interaction with electricity, magnetism and light. The reason it is annoying to read is the lack of vector notation and the annoying multiplicity of fields (E,H,B,D), plus the lack of computation. But it would be worthwhile to read a condensed modern version which updates the thing, but keeps the results.
Comment: Interesting, as always. "The only person who (secretly) did this is Feynman! He would rework the results with incredible fidelity to the historical literature, but without saying he is doing history." So by "(secretly)" are you saying Feynman is misleading us into thinking that he's being original?
Answer: Much of Physics is now far better understood than when it was first formulated. For example, if you wanted to learn Maxwell's equations you are far better off using a modern textbook than going back to Maxwell's original work. Likewise Einstein's General Relativity. You mention Newton, but he used a notation that would flummox most modern students.
There are exceptions, for example Dirac's book on quantum mechanics is widely regarded as a classic and valuable even for modern students. However, apart from these exceptions the original documents are of most interest to historians of science.
Answer: Because it's in Latin.
That is not the only reason though, just read for yourself a relative modern translation:

SCHOLIUM.
  If the ellipsis, by having its centre removed to an infinite distance, de generates into a parabola, the body will move in this parabola; and the force, now tending to a centre infinitely remote, will become equable. Which is Galileo's theorem. And if the parabolic section of the cone (by changing the inclination of the cutting plane to the cone) degenerates into an hyperbola, the body will move in the perimeter of this hyperbola, having its centripetal force changed into a centrifugal force. And in like manner as in the circle, or in the ellipsis, if the forces are directed to the centre of the figure placed in the abscissa, those forces by increasing or diminishing the ordinates in any given ratio; or even by changing the angle of the inclination of the ordinates to the abscissa, are always augmented or diminished in the ratio of the distances from the centre; provided the periodic times remain equal; so also in all figures whatsoever, if the ordinates are augmented or diminished in any given ratio, or their inclination is any way changed, the periodic time remaining the same, the forces directed to any centre placed in the abscissa are in the several ordinates augmented or diminished in the ratio of the distances from the centre.

I personally think this is not a straightforward way to express a physical law. As an undergraduate I would have really disliked to read such a text, even if it is written by Newton himself. As our knowledge advances we can connect different areas of physics, these connections might have not been obvious at all at the time of their discovery. Compare this with the lecture from Feynman (can be found online) about the same law.
Comment: @RonMaimon: I agree that it can be rephrased in a few sentences. But isn't this exactly the reason that we don't read the original because it is in a language that is hard to understand? Your idea to create a better translation is tempting and I don't know any publisher that started a project in that direction.
Comment: Yes, but this passage has some ideas that can be rephrased in modern language in two or three sentences: the first part says that if the gravitating mass is infinitely far, the gravitational field becomes constant, and the motion parabolic a-la Galileo. The second part is simply deriving the scaling law for the force by dimensional analysis from the speed with which you traverse the orbit. Both need to be expressed in any modern textbook, and neither are, because the textbooks don't read the Principia and translate as I did in the comment.
Comment: This is something I try to do online when I can. Chandrashekhar did something like this. The issue for me is that nobody translates the ideas, so that _all of them are present_. They always pick the least interesting points and transmit these. So you end up having to go back to the original to get all the ideas.
Answer: It's because knowledge is being continually updated and errors corrected. Newton's Principia Mathematica doesn't even contain his second law where force is proportional to the rate of change of momentum. Lagranges's Analytical Mechanics is very difficult to follow where he used concepts such as "the living force" to represent $mv^2$ and levers and pulleys to justify his use of the principle of virtual work. Both these books can be summarised in a few pages without losing the basic principles of what they were doing.
Productive young people at the cutting edge of research are lead by their peers and modern textbooks. Please, please don't look at the old text books until you understand the modern ones, otherwise you'll end up on a merry go around in the past, convinced you've discovered something new.
Comment: -1: sorry, this answer is both factually incorrect and ridiculous. Newton's Principia contains the second law, and the concept of "vis-viva" is not "living force", but Leibnitz's term for what we now call energy. The levers and pullies justification for virtual work is essential, and must be presented to students in order to explain the concept of work. Feynman does this in vol 1, and this is one of the highlights of his presentation. There is not a single physicist who does original research who doesn't know the history, and the modern textbook treatments are woefully inadequate in every way.
Comment: yeah, his second law as in "A change in motion is proportional to the motive force impressed and takes place along the straight line in which that force is impressed" which isn't expressed as proportional to the rate of change of momentum. And Lagranges Analytical Mechanics is very long winded when it comes to explaining virtual work, whereas Feynman does it in a paragraph - why? because we've moved on from 250 years ago as teachers and researchers refine and improve the interpretation and techniques. Please remove the -1
Comment: Newton _defines_ "quantity of motion" two paragraphs previously as mass times velocity! So that "a change in motion" is a change in momentum, except he doesn't use the word "momentum", and calls it "motion". Please _read the book_, I would -1 the comment too if I could. Newton doesn't mean "proportional", by the way, but "proportional with a universal coefficient", i.e. what we would today call "equal" (up to units). One reason you know the coefficient of proportionality between F and $\dot{p}$ is universal is the third law, but Newton  assumes you have some other F notion to fix units.
Comment: @RonMaimon goddamnit you're right on Newton.
Comment: @Physicslover: I read the book. As far as "moving on", if you don't read the book, it is hard to determine if we've moved on or not. We have, but at the cost of leaving behind some stuff which is not obsolete.


Financial transaction validation

Question: Am I wondering how can I validate simple money transfer from one address to another?  I'm querying the blockchain with etherscan and have transaction hash. Is it enough just to check from, to and amount, or I need to check something else?
Comment: Yes. The transactions hash is enough. its existence and passing means that the value transferred from the `from` account to `destination` account.
Answer: You should also consider a number of validations to make sure the transaction is final.
Have a look at this very good reddit thread regarding the recommended number of confirmations.
If you're receiving small payments, with low chances of fraud, then yes, you can assume that what etherscan shows is correct.
If you're handling large amounts, with high chances of frauds, then the same thread recommends you to wait for 12 confirmations and to:

exchanges and entities handling very large
  amounts of Ether frequently are still encouraged to run two different
  Ethereum implementations and only accept transactions that have been
  confirmed by both for maximum security (e.g. Go & C++).
Comment: Thank you for the response, yes I forgot to mention the confirmations, but I rather thought of some code that can be in the transaction/contract itself? I'm aware that this question could sound stupid, but I'm not sure what's the difference between contract and transaction in ethereum.
Comment: for `ETH`, once your regular account (ie, not a smart contract) shows a balance, that can't be decreased. Nobody can transfer funds from your account once the funds are there and you're the only one having the private keys.

Financial transaction validation


Can you create an array for functions?

Question: Let's say I want to create 10 functions, named Function1, Function2 until 10. Each function is used if a certain variable is equal to its number. Rather than using individual functions, I was wondering if its possible to use some sort of array concept for functions when it comes to naming? I tried reading about it and saw pointers but I honestly didn't understand what I saw about it because I'm not that adept to the language yet.
Comment: Of course this is possible, you can make an array of any data type you like. And a function pointer is a data type. But this is a broad issue, so you rather get a good book or online resource on C++ and start to learn.
Answer: Here's an example of how to do it:
jump_table.ino
int func1(int arg)  { return arg + 1; }
int func2(int arg)  { return arg + 2; }
int func3(int arg)  { return arg + 3; }
int func4(int arg)  { return arg + 4; }
int func5(int arg)  { return arg + 5; }
int func6(int arg)  { return arg + 6; }
int func7(int arg)  { return arg + 7; }
int func8(int arg)  { return arg + 8; }
int func9(int arg)  { return arg + 9; }
int func10(int arg) { return arg + 10; }

int (*jump_table[10])(int) = { func1, func2, func3, func4, func5,
                               func6, func7, func8, func9, func10 };

void setup() {
}

void loop() {
  int index = 2;
  int argument = 42;
  int result = (*jump_table[index])(argument);
  // result is 45
}

All functions stored in the array must have the same signature.  This simply means that they must return the same type (e.g. int) and have the same arguments (a single int in the example above).

You can do the same with static class methods (but not instance methods).  For example you could use MyClass::myStaticMethod in the array above but not MyClass::myInstanceMethod nor instance.myInstanceMethod:
class MyClass {
public:
  static int myStaticMethod(int foo)   { return foo + 17; }
  int        myInstanceMethod(int bar) { return bar + 17; }
}

MyClass instance;

There's a similar question over on stackoverflow.
Comment: Hi, is argument different from arg? But it seems like your code is correct.
Comment: @AndroidV11 The value of `argument` gets passed to the appropriate function where it available as `arg` (or `foo` in the class example).  BTW, based on your comment it sounds like you're pretty new to programming.  If that's the case I'd recommend learning more of the basics of C++ before you use this technique; it's fairly advanced and really only makes sense to use in specialized situations (e.g. remote procedure call handlers).
Comment: @AndroidV11 I just fixed a rather nasty typo in the code.  C++ uses zero-based array indices so to call the third function `index` needs to be `2`, not `3`.

Can you create an array for functions?


iPhone SDK: UIWebView

Question: I'm working on an app that uses a UIWebView to display its help files. The webView lives in it's own view, DocViewController...when its called the
- (void)viewDidLoad {

method uses
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:   [[NSBundle mainBundle] pathForResource:docPage ofType:@"html"]isDirectory:NO]]];

to load the proper doc page.  However, once the first page is loaded, the view becomes static and new pages aren't loaded when the docPage changes and the view is toggled. Is there a way to clear the webView so new pages load when requested?
Edit:
The first answer is confusing to me. As is the routine below works. It's just that it only works once. After the view is loaded the first time it does not change when this view is toggled on again and the requested html page is different. The view always displays the first html page requested and will not load new requests.
 - (void)viewDidLoad {

     docPage = [NSString stringWithFormat: @"%d", hexpage];

     [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[NSBundle mainBundle] pathForResource:docPage ofType:@"html"]isDirectory:NO]]];

 }

Comment: Are you loading the new requests programatically or do they originate from interaction within the web view, i.e. tapping hyperlinks. If it's the latter there might be a problem with your paths, therefor the use of baseURL to tell the webview where your web root is
Comment: No interaction, it's all programmed. Thanks for the comment!
Answer: viewDidLoad is only called once, unless the view is released and needs to be reloaded.  This occurs usually only when the view controller receives a low memory warning.  Instead of viewDidLoad, try putting that code in viewWillAppear:, which gets called every time the view will show on the screen.
Answer: Try using
- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL

passing an NSURL object to the dir that contains your HTML as baseURL and loading the HTML string with something like
NSString *path = [[NSBundle mainBundle] pathForResource:@"myfile"
                                                 ofType:@"html"];
NSString *html = [NSString stringWithContentsOfFile:path
                                           encoding:NSUTF8StringEncoding
                                              error:nil];

Edit:
Also, make sure that your hyperlinks are not trying to open in a new window with something like target="_blank", your webview will not open those

iPhone SDK: UIWebView


What story was this? Set in Florida, with a quip about Mexican and American road projects

Question: I recall a story set in Florida containing a quip along the lines of "the Mexicans, in all their ignorance, built a highway through mountains in six months, but it takes real Americans to know how to turn widening a straight and level road into a multiyear project." I'm trying to find the actual quote, but recall neither the author nor title of the story. I think it was a detective novel written in the 80s, but have no confidence in that recollection.
Answer: I found a quote that contains elements from what you remember, but with a different view on those "real Americans":

Florida is full of longrange, unending road jobs that break the backs, pocketbooks and hearts of the roadside businesses. The primitive, inefficient, childlike Mexicans somehow manage to survey, engineer and complete eighty miles of high-speed divided highway through raw mountains and across raging torrents in six months. But the big highway contractors in Florida take a year and a half turning fifteen miles of two-lane road across absolutely flat country into four-lane divided highway.

The quote is from the novel Pale Grey for Guilt (1968, part of the Travis McGee series) by John D. MacDonald (1916–1986), which was republished in 2013 with a foreword by Lee Child.
Comment: The line about Mexico feels like this is what I remember, but I'm guessing that in the 30 some years since I've read it, I've misremembered the statement about contractors.


Mass Matrix of Tetra10 Element

Question: How or where can I find the mass matrix of a 10 nodes tetraedron element for FEM computation? Every nodes has 3 dof (x,y,z) so that the element has 30 dof. The Stiffness Matrix is a 30x30 matrix and the Mass matrix should have the same dimensions
Answer: Generally speaking, denoting $(\phi_i)_i$ the basis functions, the Mass matrix entries are
$M_{ij} = \int_{\Omega} \pmb\phi_i \cdot \pmb\phi_j $
With 10 nodes, I assume you are dealing with the degree $2$ Lagrange basis. The basis can be further split into $(\phi_i^x)_i$, $(\phi_i^y)_i$ and $(\phi_i^z)_i$ with each $\phi_i^\nu$ associated to the $i$-th node and colinear to the basis vector $e_\nu$. This means for instance, that $\phi_i^x \cdot \phi_i^y = 0$, so your matrix can be arranged as a block matrix
$M = \begin{pmatrix} M_x & 0 & 0 \\ 0 & M_y & 0 \\ 0 & 0 & M_z \end{pmatrix}$
if we arrange the degrees of freedom as $\phi_1^x...\phi_N^x, \phi_1^y ...$. The three sub-matrices are identical, each equal to the usual scalar mass matrix. The nodes of the tetrahedron can be ordered as $2000$, $1100$, etc. $2000$ corresponds to the first vertex, $0200$ to the second vertex, $1100$ is the edge node between the first and second vertex, and so on. The associated Lagrange functions are, as a function of the barycentric coordinates $(\xi_1,\xi_2,\xi_3,\xi_4)$,
$\phi_{2000}(\xi) = \xi_1(2\xi_1 - 1)$
$\phi_{1100}(\xi) = 4\xi_1\xi_2$
and so on. This is the advantage of the barycentric coordinates, the expressions are symmetric. To integrate over the reference element $\hat K$, you'll want to replace $\xi_1$ by $1-\xi_2-\xi_3-\xi_4$. To be clear, you need to compute the following integrals:
$6 |K| \int_{\widehat K} \phi_{2000}(\xi)^2 \quad \text{(vertex with itself)}$
$6 |K| \int_{\widehat K} \phi_{2000}(\xi)\phi_{0200}(\xi)\quad \text{(vertex with other vertex)}$
$6 |K| \int_{\widehat K} \phi_{2000}(\xi)\phi_{1100}(\xi)\quad \text{(vertex with adjacent edge)}$
$6 |K| \int_{\widehat K} \phi_{2000}(\xi)\phi_{0110}(\xi)\quad \text{(vertex with opposite edge)}$
$6 |K| \int_{\widehat K} \phi_{1100}(\xi)^2\quad \text{(edge with itself)}$
$6 |K| \int_{\widehat K} \phi_{1100}(\xi)\phi_{1010}(\xi)\quad \text{(edge with adjacent edge)}$
$6 |K| \int_{\widehat K} \phi_{1100}(\xi)\phi_{0011}(\xi)\quad \text{(edge with opposite edge)}$
Then all the others are found from these. You can compute these by hand or use quadrature. The term $|K|$ is the tetrahedron volume, otherwise compute the Jacobian of the element mapping $J_K = \frac{|K|}{6}$.
Comment: thank you for your answer. I think I understand the general procedure. I came across [this article](https://arxiv.org/ftp/arxiv/papers/1411/1411.1341.pdf) and I was wondering: starting from the 10x10 matrix of equation (13) it would be enough for me to triple the rows and columns to get the 30x30 matrix, since apparently the article calculates all the integrals between the possible pairs of shape functions?
Comment: Yes, your basis is basically 3 bases of vectors orthogonal with each other, so those integrals will vanish whenever you consider $\int \phi_i^x \phi_j^y$. If you order the basis as $(\phi_1^x,...,\phi_{10}^x,\phi_1^y...)$, then the associated matrix is block-diagonal and each block is the $M^0$ of Eq. 13 (trusting the derivations there). In the notations of the answer, replace $M_x = M_y = M_z = M^0$.
Comment: Thank you. The question can be considered closed.
Comment: In that case, consider marking the answer as "accepted".

Mass Matrix of Tetra10 Element


What makes nuclear binding energy so much stronger than chemical energy

Question: The strong force acting between quarks and responsible for holding protons together is 100 times stronger than the electromagnetic force. How come the nuclear binding energy derived from the strong force is millions time stronger than chemical energy. (rather than 100 times)
Comment: Are you asking what makes a force stronger than another force? Or are you saying, why does the electromagnetic force not pull apart atoms?
Comment: I mean why are the nuclear energy so large while the forces involved are "only" 100 times stronger than the electromagnetic force
Comment: this reminds me of the "conflict" over "vis viva" and momentum (one is quadratic in velocity, other is linear). [D'Alembert (contributed in) clarified the issue](http://nature.berkeley.edu/departments/espm/env-hist/articles/1.pdf) making clear how each is applied ([wikipedia](http://en.wikipedia.org/wiki/Conservation_of_energy#History))
Answer: In both cases the potential energy for two interacting unit charges is
$$
U = -\alpha\frac{\hbar c}{r}
$$
The strong force is between color charges and has $\alpha \approx 1$, while the electric interaction is between electric charges and has $\alpha \approx 1/137$.
However the gluons, which carry the color force, are themselves charged. This means that the interaction energy between distant color charges is dominated by self-interactions among the gluons going back and forth between them. This gives color confinement, which means that the color force only occurs between color charges that happen to be very close together — $r$ is small, so $U$ is large.
I'm not sure it's not quite right to directly compare the color force between quarks to the electrical interaction between a nucleus and its electrons. The most important degree of freedom inside the nucleus is the pion, which has a Yukawa potential and (I suppose probably) a different coupling constant. However if you note that a nuclear radius is typically a factor of $10^5$ smaller than an atomic radius, and that the $\alpha_\mathrm s$ and $\alpha_\mathrm{em}$ differ by a factor of 100, you get an energy ratio of somewhere around $10^7$. That takes you from sub-eV to few-MeV, which does have the right scale.
Answer: Chemical forces are the result of the higher order moments, mainly of the electric field, of the neutral atoms. Look at these orbitals:

The five d orbitals in ψ(x, y, z)2 form, with a combination diagram showing how they fit together to fill space around an atomic nucleus.

These anisotropic shapes in space allow for spill over attractive and repulsive fields that are collectively called Wan der Waals forces. , spill over forces from the combined electric fields of the electrons and nucleus .
Correspondingly the nuclear force between protons and neutrons in the nucleus are spill overs of the strong force as it appears in the "geometry" of each nucleus. As the strong force is color confined , as rob describes in his answer, these forces do not exceed the fermi distances which characterize the size of the nucleons. They still are due to gluon exchanges and these are highly confining.

How come the nuclear binding energy derived from the strong force is millions time stronger than chemical energy. (rather than 100 times)

In this article the energy of intermolecular forces due to the VdWs forces is estimated as 1/r^6 , r distance between molecules.  I do not have a functional estimate for the spill over forces of the strong interactions, but it is evident that the inter nucleon distance, of the order fermi, will play a corresponding role. The difference in the dimensions of the atomic orbitals and the nucleus dimensions allows for the large difference in the energies manifested as chemical and nuclear,  overcoming factors coming from coupling constants just by "geometry".


MOSFET on condition - Relationship between drain-gate voltage and drain-source voltage?

Question: I am trying to learn the relationship between drain-gate (VDG) voltage and drain-source (VDS)voltage?
From one of the QA readings in StackE, I understand that drain-gate voltage is less than drain-source voltage at MOSFET on condition. I am not sure how is it possible. At this on condition, drop across drain-source voltage would be so small. With that much of small drop, how (VDG) < (VDS) can be true?

Image is taken from here
Comment: In the question you reference, they are asking what happens when you control a MOSFET with a gate voltage that is higher than *the voltage the MOSFET is switching*.  For instance using a MOSFET with a 10V gate drive to control a 5V circuit.  They are not referring to the voltage across the MOSFET when the mosfet is conducting.
Comment: It is not necessarily true that \$V_{DS}\$ will be "so small" when the MOSFET is conducting. In general, there is no guaranteed relationship between \$V_{GD}\$ (do you mean \$V_{GS}\$?) and \$V_{DS}\$.
Comment: From my understanding, the drain voltage has no relationship with the gate voltage. The drain simply receives charge carriers in an NMOS device and provides a current path. You apply a VGS across the MOSFET to control the inversion layer within the FET, this in turn controls the current allowed to flow from drain to source.
Comment: @ElliotAlderson, I am taking about VGD itself. I am curious know how the value of VGD will change as MOSFET change its region of operation from linear to saturation.
Comment: It behaves like a resistor. as it goes from linear to saturation VDS resistance decreases. The effect on the gate is do to the capacitance of the package, external circuit and the die itself.
Answer: The voltage on the drain is independent of the voltage on the gate. To control the device, you control the electric field between the gate and the source. When you apply an electric field to the source-gate region of the device, you change the conduction of the source-drain region by rearranging the charge carriers in that region.