Expiration date for block cheese (mozzarella, Monterey Jack)

Question: How long after the expiration date is block cheese (mozzarella, Monterey Jack) safe to eat IF it has been kept refrigerated AND has never been opened? They LOOK as fresh as the day I bought them, about 6 months ago.
Thank you.
Comment: Most, if not all, of the block cheeses I've seen have a 'sell by' date or a 'best by' date rather than an expiration date.
Answer: It is easy to see if mold is forming on block cheese.  I have, many times over the years, simply excised moldy portions from blocks of cheese, rinsed the remainder with cold water and if it looked and smelled okay, tried a nibble.  If I was satisfied that it still tasted good, I've gone right ahead and eaten it, with no ill effects.
Shredded cheese, on the other hand, can be difficult to evaluate.  Usually, once shredded cheese starts to go bad, the whole bag picks up the smell and off flavor, rendering it garbage.
Of course, I am NOT recommending that anyone (including you) eat foods beyond their expiration dates and I would NOT risk anyone else' health with such gambles.  I'm just sharing what seemingly silly, reckless behavior I've managed to get away with, unharmed.  Your mileage may vary.  Beware.
Comment: In the US, only infant formula are required to have an expiration date and selling an expired product is illegal. Other than that, everything is at the manufacturers' and sellers' discretion, method of determination (or arbitrarily), lingo (exp, best-before, sell-by, use-by, made-on, etc), have it or not, decision to sell or discard post such dates. Liability insurance cover may have a hand in this. Such dates are not always scientifically and statistically determined. https://www.fda.gov/AboutFDA/Transparency/Basics/ucm210073.htm


Timeout on CPU usage?

Question: Is there any way, in SQL Server, to cause a batch to time out if its CPU usage exceeds some value specified in the batch?  I need this to occur at the batch, and not the connection level.
Comment: How exactly do you specify a batch? One command, or a "true" batch (what was sent from the client to the server for parsing, optimization and execution)?
Answer: There has been a quick and dirty method in SQL Server for 20 plus years - you set the value of Query governor cost threshold to your arbitrary amount and then if the estimated cost of the execution plan exceeds that the query is rejected - I believe the end user receives some kind of error message but I haven't seen this enabled in the wild for a VERY long time so can't remember any details.
NB: more than just CPU costs is included from the link : CPU time, memory, and disk IO.

Timeout on CPU usage?


Publish/Subscribe vs Producer/Consumer?

Question: From messaging point of view with systems like Kafka, RabbitMQ, HornetQ, ActiveMQ, etc. is there a difference between pub/sub and prod/con or are they used interchangeably?
Answer: There is a difference between the publish/subscribe and producer/consumer models.
Publish/Subscriber: Subscribers subscribe to the publisher. Each message the Publisher publishes is sent to all the subscribers. That is, all subscribers receive the same message. (Think of a newspaper or magazine subscription. All subscribers receive the same magazine or newspaper)
Producer/Consumer: Each message the producer produces will be consumed by a single consumer. This is a mechanism to distribute the workload to multiple consumers. (Think of the several cash registers at the supermarket. Each customer goes to a single cash register. The customers are like the messages that are produced and the cash registers are the consumers)
Comment: @Hackerman `consumer group` is a term that is specific to certain message brokers such as Kafka.
Comment: Consumers in different consumer groups can consume the same message from a topic.
Answer: Although both Publish/Subscribe and Producer/Consumer terms are related to messaging, they are different and can't be used interchangeably.
Publish/Subscribe is a messaging pattern where a publication is distributed to multiple receivers. A Producer is the sender of messages and consumer is the receiver of messages. Producers and consumers are an integral part of both Publish/Subscribe and Point-to-Point messaging patterns.
Hope this helps.
Comment: Yes, Publisher/Subscriber and Producer/Consumer are used interchangeably but not Pub/Sub and Producer/Consumer. Publisher/Subscriber is specifically used in Pub/Sub messaging pattern and Producer/Consumer in P2P messaging pattern.
Comment: You wrong I think.

The point is when a message is consumed will not process with other consumer in producer/consumer pattern. In contrast a message will be sent to all subscribers when publisher/subscriber (Observer pattern) is being used.

*** So they mustn't be used interchangeably!!! ***
Comment: But they are quite often used interchangibly. Publiser and Subscriber then?
Answer: In producer consumer , message produced by producer is only consumed by one consumers . Even with n number of consumers each message will be consumed by only one consumer . Producing n messages to n consumers , each message will be consumed by one consumer (round robin algorithm) .
In contrast in Publisher subscriber , message produced by publisher is consumed by all subscribers that have subscribed to specific queue . Publishers produce messages while subscriber consumes message . Messages are posted in subscription queue .
Answer: As per my understanding
- Prod/Consu -  Producer produces and Consumer consumes the produced task .
- Publisher/Subscriber - Publisher produces and Subscriber consumes the produced task only if Subscriber is subscribed to Publisher.
Both can be interchanged but the later one makes sense in terms of Architectural real use cases .Produce and publish only if it is subscribed based upon subscription agreement .
Thanks
Comment: This is the actual answer for this question. Publish-Subscribe involves registration of  subscribers before consuming

Publish/Subscribe vs Producer/Consumer?


Transform linear system into a matrix form

Question: I have a system of linear equations in variables $A_n$ of form:
$$
 \sum _{k=-K}^K h_k A_{n-k} J_{n-k}\left(\frac{(1-i) \text{$\eta
   $Sqrt}(n-k)}{\sqrt{2}}\right)+A_n\left(\frac{(1-i) \eta  \sqrt{n-k} J_{n-1}\left(\frac{(1-i)
   \sqrt{n-k} \eta }{\sqrt{2}}\right)}{\sqrt{2}}-(n-k) J_n\left(\frac{(1-i) \sqrt{n-k} \eta
   }{\sqrt{2}}\right)\right)=t_n
$$
How can I transform it into a matrix form in Mathematica?
I need it to put this matrix into a Gaussian elimination procedure (https://mathematica.stackexchange.com/q/84324/29728) and get these $A_n$.
If that's important, $t_n$ is a coefficient from Fourier series $t_n=\frac{\int_0^{2 \pi } e^{-\text{in$\phi $}} t(\phi ) \, d\phi }{2 \pi }$, also $h_k=\frac{\int_0^{2 \pi } e^{-\text{ik$\phi $}} h(\phi ) \, d\phi }{2 \pi }$, and variables $A_n$ are coefficients of the Fourier series $F(r,\phi )=\sum _{n=-N}^N e^{\text{in$\phi $}} A_n J_n\left(\frac{(1-i) r \eta }{\sqrt{2}}\right)$
Comment: What are the boundary conditions?
Comment: the first equation is a transformed Robin BC for PDE.
Comment: your definition of h_k is independent of k. I assume you meant to replace the variable n there.
Comment: @SjoerdC.deVries you're right, my negligence. Done.
Answer: I think the function you are looking for is CoefficientArrays; here is its documentation.
Your system is quite complex so I will let you deal with its intricacies, but here is a demonstration on a toy example.
Let's define a set of linear equations in $x$, $y$, and $z$:
eqns = {2 x - y + 4 z == 12, 3 x + 2 y + z == 10, -y + z == 1};

The solutions of this system are of course $x=1, y=2, z=3$.
Once you have your system represented as a list of equations, use CoefficientArrays to transform them into matrix form:
linsystem = CoefficientArrays[eqns, {x, y, z}];
Normal@linsystem

{ {-12, -10, -1}, { {2, -1, 4}, {3, 2, 1}, {0, -1, 1} } }

CoefficientArrays returns the coefficients as SparseArray objects, which is why I used Normal to visualize them as regular arrays, but you should be able to use the SparseArrays directly in further computation.
You can then feed those matrices to your Gaussian elimination routines, or alternatively use Mathematica's built-in linear system solver, LinearSolve:
LinearSolve[#2, -#1] & @@ linsystem

{1, 2, 3}

The $(-1)$ coefficient I used in the second argument to LinearSolve is a product of how CoefficientArrays interprets equations in its input, rather than plain polynomials, as mentioned in the "Details" section of the documentation.


Use one chip from multiple daisy-chained ADCs

Question: My PCB consists of multiple ADC chips (AD7685) connected in a daisy-chain mode with STM32F303 as MCU and SPI communication. As far as I know, increase in the number of chips in the system results in decrease of the sampling rate per channel. So if I use twenty ADCs, the max sampling frequency can be 75kSPS, considering the data rate of STM32. One AD7685 chip can operate at max 250kSPS, according to the datasheet. My question is can I use only one chip to its fullest (250kSPS) in some cases when I do not need all twenty ADCs?
Answer:
My question is can I use only one chip to its fullest (250kSPS) in
some cases when I do not need all twenty ADCs?

Yes you can but, it is limited to the first in the daisy-chain closest to the MCU. If you wanted to use the next chip, then you would process chip 1's result and discard it and keep chip 2's result. Clearly this takes about longer and, chips further down the daisy-chain take even longer. Then begin a new conversion.

So if I use twenty ADCs, the max sampling frequency can be 75kSPS

All ADCs simultaneously produce their conversions in a maximum time of 2.2 μs. Then, you have to clock all twenty serially at the maximum rate of the AD7685 (50 MHz). So, if you want 20 × 16 bit results, it will take 320 serial bits to complete the task.
That's 2.2 μs + 6.4 μs = 8.6 μs or, an overall sample frequency of 116.28 kSps. It looks like the MCU is the limitation here. It also sounds like you are assuming a clock rate of 24 MHz but, don't forget to take into account the conversion time of 2.2 μs. That would make an equivalent sample time closer to 64 kSps if you are running SPI at a clock of 24 MHz.
Answer: The communication rate, of course, is not directly related to the sample rate, but it may limit it.
If you are only interested in the ADC or ADCs nearest to the data input of the MCU you can trigger a conversion and just read the ADCs of interest, then trigger a new conversion. As shown in the datasheet


How to verfiy that an external hard drive is failing

Question: Ubuntu 16.10, Kernel 188.8.131.52-generic
I have an external hard drive connected.  It is configured with the ext4 file system.  It has 600 GB of important family photos and videos on it.  I have a backup of it, so we are not in imminent danger of losing all that data.  It is a fairly new (purchased about 18 months ago) 5TB drive.
Recently, whenever I try to copy or move a file from that drive, the system gives me this error message:  "Error Code 9:  Bad file descriptor".  This happens only when that drive is the source of the copy or move - When I attempt copying or moving of files from other sources/drives, I do not get that error.
My guess is that the drive is failing, but I don't know that for certain.  I have run fsck (via gparted) on the drive.  The first time it reported an uncountable number of errors, but it said it was able to fix all of them.  I repeated running fsck on it a couple more times after that, each time it reported no problems.  Since then, my problem has been gone.  But, my concern is, How do I know if it is only a lucky, temporary reprieve?
How can I determine for sure that the external hard drive is failing?
If it is, how can I determine if simply reformatting it and copying the data back onto it will be fine, versus having to replace it?
Or.....  Is my guess incorrect, and the description of my problem indicate something else is wrong?
Thanks.
Here is the result of running the smartctl command, I do not know how to interpret these results (the "WHEN_FAILED" column had only dashes in it):
main1@system1:~$ sudo smartctl -a -d sat /dev/sdi [sudo] password for main1:  smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.8.0-45-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION === Model Family:     Western Digital Green Device Model:     WDC WD60EZRX-11MVLB1 Serial Number:    WD-WX21DC42E2TP LU WWN Device Id: 5 0014ee 2b6db3009 Firmware Version:
80.00A80 User Capacity:    6,001,141,572,096 bytes [6.00 TB] Sector Sizes:     512 bytes logical, 4096 bytes physical Rotation Rate:    5700 rpm Device is:        In smartctl database [for details use: -P show] ATA Version is:   ACS-2, ACS-3 T13/2161-D revision 3b SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s) Local Time is:    Tue Apr  4 20:24:33 2017 CDT SMART support is: Available - device has SMART capability. SMART support is: Enabled

=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED

General SMART Values: Offline data collection status:  (0x82)   Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled. Self-test execution status:      (   0)  The previous self-test routine completed
                    without error or no self-test has ever
                    been run. Total time to complete Offline  data collection:      ( 4064) seconds. Offline data collection capabilities:           (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported. SMART capabilities:            (0x0003)  Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer. Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported. Short self-test routine  recommended polling time:    (   2) minutes. Extended self-test routine recommended polling time:    ( 694) minutes. Conveyance self-test routine recommended polling time:      (   5) minutes. SCT capabilities:
           (0x3035) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

    SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
 1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always      -       1
 3 Spin_Up_Time            0x0027   202   187   021    Pre-fail  Always       -       8883
 4 Start_Stop_Count        0x0032   097   097   000    Old_age   Always       -       3408
 5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always      -       0
 7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
 9 Power_On_Hours          0x0032   089   089   000    Old_age   Always       -       8454
10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always      -       0
11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
12 Power_Cycle_Count       0x0032   097   097   000    Old_age   Always       -       3405
192 Power-Off_Retract_Count 0x0032   196   196   000    Old_age   Always      -       3259
193 Load_Cycle_Count        0x0032   076   076   000    Old_age   Always       -       372574
194 Temperature_Celsius     0x0022   102   093   000    Old_age   Always       -       50
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always      -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always      -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1 No Errors Logged

SMART Self-test log structure revision number 1 No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1  SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing Selective self-test flags (0x0):   After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.

main1@system1:~$

Comment: Use both the -a and the -s sat on the smartctl command.  sudo smartctl -a -d sat /dev/sdi
Answer: Ensure when you backup you don't overwrite any previous backups -- you might have already lost some files, so the old backups may be your only source. Install the smartmontools package
sudo apt-get install smartmontools

then run a disk check on whatever disk you have problems with (sdb used below, use what your system has for the device:
sudo smartctl -a /dev/sdb

Post the results in your question for further opinions on disk health.
Look at the "When failed" column to see if there is anything.

There are no errors reported on the drive, so the problem was probably not hardware.  With fsck "fixing" many errors, maybe you'd be better off reformatting and restoring from your backups.  Ensure you can read your backups first though!


Menu link to block or div

Question: Is it possibile to link menu links to the div or block on the certain subpage? If yes what is the method to do this?
Answer: This is not completely straight forward. If you try to create and save a menu link like book/page#anchor-id, Drupal will give this error

The path 'book/page' is either invalid or you do not have access
  to it.

You will need the node ID. Drupal wants the link to look like this: node/55#block-you-want.
The easiest way to do this is

Save the menu link without the anchor id. ex: /book/page
Drupal will create the menu link like this: node/55
Edit your menu link to: node/55#anchor-id. Save again.
Answer: One way of doing that using the #id of that block or div in the path of menu link pointing to the page like below:
<code>PAGE-PATH-URL/#ID-OF-BLOCK-OR-MENU
</code>
basically you can link the menu to any div, block or anything having id attribute by appending the #ID at the last of the page path.

Menu link to block or div


Installing command line tool with pgAdmin4

Question: I have pgAdmin4 and the latest version of PostgreSQL installed on my machine. When I tried to insert large amount of data using INSERT statements contained in a .sql file of size 40 MB, 50MB and above, the app crashed. Hence, I am wondering if dumping heavy data using those sql files via command line is a good idea? If yes, then from where can I install that command line utility in pgAdmin4 ?
Comment: if You have installed PostgreSQL - You are already have all. psql - then select database and use command -  \i file.sql
Comment: @a_vlad Could you tell me from where I could access psql? Either from pgAdmin4 or by going into `Program Files/PostgreSQL/10/` folder and going again into one of the folder listed there? There are many like bin,data, doc etc
Comment: CMD windows, if PostgreSQL in PATH - just type psql -u postgres -p , if not - first cd to Program Files/PostgreSQL/10/bin
Answer: Firstly, I have no idea about pgAdmin4
Secondly, It would take a lot of time when executing a large SQL file. Please consider using pg_dump (custom format) & pg_restore to enhance your performance.

Output a custom-format archive suitable for input into pg_restore.
  Together with the directory output format, this is the most flexible
  output format in that it allows manual selection and reordering of
  archived items during restore. This format is also compressed by
  default.

For example:
-----#### Exporting large table with custom format
pg_dump -h your_host -p 5432 -U user_name  --format custom --no-password   --encoding UTF8  --no-security-labels --no-tablespaces --table=your_schema_name.your_table_name --verbose --file your_file_name.backup --schema your_schema_name your_database_name

-----#### Importing large table with custom format
pg_restore -h your_host -p 5432 -U user_name --dbname=your_database_name --role=user_name  --format custom --no-tablespaces --schema=your_schema_name --verbose your_file_name.backup

Comment: Thanks. I believe the above commands needs to be executed in the command line. Could you tell me how can I access the plsql so that I could run the command line to run above commands? Also, I am little bit unclear as to what the `pg_dump` and `pg_restore` will do to the 50 MB `.sql` file. Could you please elaborate? TIA


Find parametric expression of an arc given its start point, end point and central angle in 3D cartesian coordinate system

Question: In a 3D cartesian coordinate system, the coordinates of start point and end point have been given as $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$. If the central angle of the two points (the one smaller than 180 degrees) is known as $\theta$, and the plane on which the arc lies is perpendicular to $XY$ plane, how to find the parametric expression $(x, y, z)$ of the arc?
I mean, each coordinate of $(x, y, z)$ needs to be represented by variables given above. Can anyone help? Thanks!
Comment: Your specs will still give you at least two solutions, one concave and one convex relative to the xy plane. Is that acceptable?
Comment: Any give arc can have an infinite number of parametric equations. Do you have any further conditions that would help us to pick the right one?
Answer: First you can assume $(x_2,y_2,z_2) = (0,0,0)$. If it isn't, you can just add $(x_2,y_2,z_2)$ back into all the parametric equations at the end. So we'll work with $(x_1',y_1',z_1') = (x_1-x_2,y_1-y_2,z_1-z_2)$.
Next let $(x_1',y_1',z_1') = (r_1\cos\phi_1,r_1\sin\phi_1,z_1')$. This simplifies things because now your $(r,z')$ plane is perpendicular to the $(x,y)$ plane and we can just work with two coordinates for now.
Now we need to find the center $(\overline r,\overline z')$. This will be one of two points on either side of the midpoint $(r_1/2,z_1'/2)$, perpendicular to the line that goes through the origin and $(r_1,z_1')$. We can just find a constant $c$ such that $(\overline r,\overline z') = (r_1/2,z_1'/2) + c(-z_1',r_1)$. We just need to be sure that the angle is right. We can do that by computing the dot product between the segments from the center to each point, or:
$$\begin{align*}
\langle(r_1/2 - c z_1',z_1'/2 + cr_1),(-r_1/2 - c z_1',-z_1'/2 + cr_1)\rangle
&= \cos\theta \ell_1 \ell_2 = \cos\theta \ell_1^2
\\c^2(z_1')^2 - r_1^2/4 + c^2r_1^2 - (z_1')^2/4
&= \cos\theta (r_1^2/4 + (z_1')^2/4 +  c^2(z_1')^2 + c^2r_1^2)
\\(c^2 - 1/4)(r_1^2 + (z_1')^2)
&= \cos\theta (c^2 + 1/4)(r_1^2 + (z_1')^2)
\\(c^2 - 1/4)
&= \cos\theta (c^2 + 1/4)
\\c^2(1-\cos\theta)
&= (\cos\theta + 1)/4
\\4c^2
&=\cot^2(\theta/2)
\\c
&=\pm\cot(\theta/2)/2
\end{align*}$$
Once you have the center, one possible parametric equation for the arc is an easy matter of letting $\gamma_0$ be the angle in the $(r,z')$ plane where you find $(\overline r,\overline z')$ (i.e., $\gamma_0 = \arctan(\overline z'/\overline r)$). Then you can use a parametric form like this:
$$
(r,z') = (\overline r,\overline z') - \ell_1(\cos(\gamma_0 \mp \gamma),\sin(\gamma_0 \mp \gamma))
$$
The $\gamma$ parameter will trace out your arc in the range $[0,\theta]$.
So to sum up:
$$
(r,z') = (r_1/2,z_1'/2) \pm\cot(\theta/2)(-z_1'/2,r_1/2) - \ell_1(\cos(\gamma_0 \mp \gamma),\sin(\gamma_0 \mp \gamma))
$$
Where $\ell_1^2 = (r_1^2 + (z_1')^2)/(4\sin^2(\theta/2))$, $r_1^2 = (x_1')^2+(y_1')^2$, and $(x_1',y_1',z_1') = (x_1-x_2,y_1-y_2,z_1-z_2)$.
Answer: The expression for the locus of points of the circle containing the arc is
$$ {\rm RZ}(\psi) \begin{pmatrix}
  x_c + r \cos \varphi \\
  y_c \\
  z_c + r \sin \varphi
\end{pmatrix} = \begin{pmatrix}
  r \cos\varphi \cos\psi + x_c \cos\psi - y_c \sin\psi \\
  r \cos\varphi \sin\psi + y_c \cos\psi + x_c \sin\psi \\
  r \sin\varphi + z_c
\end{pmatrix} $$
where $(x_c,y_c,z_c)$ is the center of the circle, $r$ is the radius and $\varphi$ is the azimuthal position along the circle. Also $\psi$ is the orientation of the plane of the arc relative to the XZ plane, as rotated by the z axis. For the end points of the arc, one can use an unknown center azimum $\varphi_c$ and the range $$\varphi = \varphi_c - \frac{\theta}{2} \ldots \varphi_c + \frac{\theta}{2}$$
Now we have the equations
$$ \begin{pmatrix} x_1 \\ y_1 \\ z_1 \end{pmatrix} = \begin{pmatrix}
  r \cos(\varphi-\frac{\theta}{2}) \cos\psi + x_c \cos\psi - y_c \sin\psi \\
  r \cos(\varphi-\frac{\theta}{2}) \sin\psi + y_c \cos\psi + x_c \sin\psi \\
  r \sin(\varphi-\frac{\theta}{2}) + z_c
\end{pmatrix} $$
$$ \begin{pmatrix} x_2 \\ y_2 \\ z_2 \end{pmatrix} = \begin{pmatrix}
  r \cos(\varphi+\frac{\theta}{2}) \cos\psi + x_c \cos\psi - y_c \sin\psi \\
  r \cos(\varphi+\frac{\theta}{2}) \sin\psi + y_c \cos\psi + x_c \sin\psi \\
  r \sin(\varphi+\frac{\theta}{2}) + z_c
\end{pmatrix} $$
By subtracting the 2nd point from the first point and dividing the y coordinate with the x coordinate the orientation of the plane $\psi$ is found
$$ \tan \psi = \frac{y_2-y_1}{x_2-x_1} $$
Further manipulation of the subtraction of the two points yields the center angle
$$ \tan \varphi_c = \frac{\sqrt{2} (\sin \frac{\theta}{2}) \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}}{(z_2-z_1)\sqrt{1-\cos\theta}} $$
and the radius of the circle
$$ r = \frac{\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}}{\sqrt{2}\sqrt{1-\cos\theta}} $$
Now by adding the end points, one finds the center of the circle
$$ \begin{pmatrix} x_c \\ y_c \\ z_c \end{pmatrix} = \begin{pmatrix}
  \frac{x_1+x_2}{2} \cos\psi + \frac{y_1+y_2}{2} \sin\psi - r \cos\varphi_c \cos \frac{\theta}{2} \\
  -\frac{x_1+x_2}{2} \sin\psi + \frac{y_1+y_2}{2} \cos\psi  \\
  \frac{z_1+z_2}{2} - r \sin\varphi_c \cos \frac{\theta}{2}
\end{pmatrix} $$
The arc is now fully defined.


2000 Chevy Silverado abs engaging 5mph

Question: My 4.3L 4x4 base pickup has the abs engage everytime Im braking at 5-6 mph replaced abs module front wheel sensors and speed sensor on tail of transfer case bleed the abs module with diagnostic tool still engaging when taking it up the road the rear speed sensor trails behind the front and when braking it dips to zero when abs engages the others don't went and cleaned the connections on the ecm nothing what do I do next
Comment: Did it get better for awhile (weeks?) after you replaced the front wheel sensors? Then resumed engaging every time you stop?
Comment: Did you change the front hub assemblies with the sensors or just the sensors?  Worn bearings can cause ABS issues.
Comment: The issue hasn't went away ever and haven't changed the hub assembly because the front sensors read the same on the scanner I would think if the hub was bad they would be wrong
Comment: Have you checked to ensure your tires are all the same size?
Comment: Tires are the same size
Answer: The following can also cause issues like this -

Cracked Reluctor Ring
Rusty Reluctor Ring
Worn wheel bearing (allows the ABS sensor to move away from the
reluctor ring)
Rust stopping the ABS sensor seating close to the reluctor ring

On some vehicles it is easy to see the reluctor ring, on others you may have to remove the sensor to view it.  Do they look clean and are firmly attached?  Can you see any cracks?
Check the wheel bearing for play.
Comment: Would t that make the front speed sensors read wrong, an no play in the bearing
Comment: Presumably there are ASB sensors on the rear wheels too? Have you checked those?  When you talk about the front and rear speed sensors, does it have 2 or is it getting the speed from the ABS sensors?
Comment: There is a sensor on the front and rear of the transfer case I replaced the one that reads the speed going to the rear drive shaft on the tail end of the transfer case with no change in symptoms afterwards
Comment: These sensors drop input to the abs module at 4.5 mph. You should double check with the scanner and check each sensor to see if they all match speed at 4.5 and higher. The one that doesn't match is the problem. If it's a sensor in the tranny, find which one feeds the abs module. Then check sensor reluctor connectors and wiring. It's probably going to be found in these areas.
Comment: Another thing to check is to see if the reluctor ring is fully seated and not spinning in place. Very rarely would this happen, but it is still a posibility.
Comment: So if I'm understanding correct the reluctor ring is in the wheel hubs  which my speed sensors are in the front two wheel which are reading correct the rear is reading incorrectly measuring on the tail end of the transfer case that sensor has been replaced

2000 Chevy Silverado abs engaging 5mph


I get an insufficient storage space error when trying to download an app and I have several gigabytes of free space

Question: I have my phone set to use my SD card as default storage. When I attempts to download the Facebook for Hulu app from the Google store it always gives me this error message. I checked both apps both take around 40 some odd megabytes. I have around 4 gigabytes of free space on my SD card. I have around two gigabytes of free space on my internal storage. Can you tell me what's wrong?
Comment: related post http://android.stackexchange.com/questions/23010/insufficient-storage-when-trying-to-install-new-app
Answer: Apps don't necessarily install on an external SD card. Normally, they would install on the system memory and then, if capable, the app can be "moved" to the SD card. Moving still leaves part of the app on the phone memory and usually increases the overall size of the app.
Long story short- make sure you have room on your device's internal memory to install apps.
Comment: I have two gigs free on my internal memory. the app takes around 44 megs. Thanx for the suggestion. this one has me stumped.
Answer: This happens with me all the time. The problem with my phone was that - Despite 4GB of internal memory and 8 GB SD card, it kept giving me that error. The operating system had made a partition in the internal memory of 4 GB where it stored the ROM and necessary apps. It will not store any other app data like Facebook, whatsapp, etc on the remaining internal memory. It kept using the small partition it made in that internal memory.
Thus I had to keep moving and clear data all the time.
I searched on XDA for a memory fix solution for my phone and it worked.


Does Light Experience Length Contraction?

Question: Lorentz length contractions states that the length of any moving object gets divided by the Lorentz factor equal to the Lorentz factor for that object (always $\geq 1$), equal to
$$
\gamma=\frac{1}{\sqrt { 1-\frac { { v }^{ 2 } }{ { c }^{ 2 } }  } }
$$
However, in massless particles $v=c$, so the Lorentz factor becomes $\infty$, meaning that an object traveling at $c$ will have $0$ length. However, photons and obviously all forms of electromagnetic waves move at c when traveling through a vacuum, such as from a space shuttle to a space station or back to Earth. Does this mean that photons have no length? How does this affect wavelength?
Answer: Let's think clearly about length contraction.
In the frame of reference in which an object is at rest, the measured length of an object is $L_0$.
In a frame of reference in which the object is moving with velocity $v$ parallel to the length of the object, the measured length of the object is
$$L'(v) = L_0\sqrt{1 - \frac{v^2}{c^2}} $$
Now, in your question, you wrote:

However, in massless particles $v=c$, so the Lorentz factor becomes $\infty$,
  meaning that an object traveling at $c$ will have $0$ length.

The problem here is that, for a massless particle, there is no frame of reference in which the object is at rest; a massless particle has speed c in all frames of reference.
Thus, the proper length, $L_0$, doesn't exist so the formula above is not valid for massless particles.
This shouldn't be too surprising since the Lorentz transformations, from which the length contraction formula above is derived, doesn't exist for $v = c$ since the Lorentz factor
$$\gamma = \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}}$$
is undefined for $v=c$.
This brings us back to the question of whether or not a massless object can have extent along the direction of motion since we cannot use length contraction, as you have, to reason that it can't.

I had intended to address the open question above as an update after spending some time thinking about it while mowing.  In the meantime, another answer has been given that approaches this question in essentially the same manner.  For what it's worth, here's the addendum.
Consider the question:  Given the equation for the world line of a uniformly moving particle in some frame of reference, what is the equation in another relatively moving frame of reference?
Working in 1-D and with standard configuration, assume a particle's world line in the unprimed frame of reference is given by
$$x(t) = ut + x_0$$
where $u$ is the velocity of the particle and $x_0$ is the position when $t=0$.
In the primed frame of reference, which has velocity $v$ in the unprimed frame, the particle's world line is given by
$$x'(t') = u't' + \frac{x_0}{\gamma_v(1 - \frac{uv}{c^2})} $$
where
$$u' = \frac{u - v}{1 - \frac{uv}{c^2}}$$
Now, assume we have two particles with world lines given by
$$x_1(t) = ut$$
$$x_2(t) = ut + d$$
Clearly, we have
$$x_2(t) - x_1(t) = d$$
$$x'_2(t') - x'_1(t') = \frac{d}{\gamma_v(1 - \frac{uv}{c^2})}$$
It's straightforward to show and, indeed, intuitive that, except for one special case, there is a maximum value when $v = u$
$$x'_2(t') - x'_1(t') = \frac{d}{\sqrt{1 - \frac{u^2}{c^2}}} = d_0 $$
The value $d_0$ has physical significance in that it is the separation of the world lines in the frame of reference in which the particles are at rest.
This is physically significant since, in this frame of reference only, the separation can be measured without requiring synchronized, spatially separated clocks.  This separation, $d_0$ is thus an invariant, an objective quantity of physical significance.
In terms of $d_0$ and the speed $u$, we can write
$$d(u) = d_0 \sqrt{1 - \frac{u^2}{c^2}}$$
which is the familiar length contraction formula.
However, for the case that $|u| = c$ (the world lines are light-like), we cannot set $v = u$; the Lorentz factor is not defined for $v = c$.
For $u = c$, we have
$$x'_2(t') - x'_1(t') = \frac{d}{\gamma_v(1 - \frac{cv}{c^2})} = d\sqrt{\frac{1+\frac{v}{c}}{1- \frac{v}{c}}}$$
Thus, for the case that the particles are light-like, there is no maximum value of $d$; no $d_0$ that we can attach physical significance to.
Comment: The term "rest length" is not really standard, and is a bad idea.  Max Born showed long ago that the concept of a rigid body actually makes no sense in Special Relativity.
Answer: Lorentz' law only applies to physical objects, i.e. those with rest mass.  Wavelength is a parameter -- as you probably know, particles with mass have a wavelength related to their momentum -- so it's not sensible to discuss wavelengths changing with speed for photons whose speed is always $c$ .
As an aside, I find it hard to conceive of a way to assign a "length" to a massless particle travelling at $c$ in the first place :-) .
Comment: @CarlWithoft: "it's not sensible to discuss wavelengths changing with speed for photons whose speed is always c", I think the speed of photons changes depending upon the medium in which it is travelling, I think it is not constant.
Comment: @Godparticle that is true, but it's not related to any  kind of Lorentz transformation.  But thanks for pointing that out so I don't lead anyone astray.
Comment: Lorentz's law applies to empty space as well: it is kinematical, and has nothing to do with mass or matter or rigid bodies.
Comment: @CarlWithoft: I really appreciate your answer. Thank you for the response.
Comment: That wavelengths of a light ray change with the speed of the observer is the Doppler effect, and that is what is really the point here.  The observer's speed can never be equal to the speed of light, but it can be very close, and then something similar to what the O.P. asks about does indeed happen.
Answer: There are several conceptual confusions here.  Mass is irrelevant.  This is purely a kinematical question, it does not depend on dynamics at all.
The difference between Lorentz's (and Fitzgerald's and Larmor's) approach to the Lorentz--Fitgerald contraction (and Larmor time dilation) on the one hand, and Einstein's revolutionary and conceptual breakthrough, the relativity principle, is precisely that Lorentz and the others thought of the contraction as somehow being a property of matter and dynamics and forces, it was a property of a material body.  It was Einstein (and Poincaré) who realised that no, this is a property of space-time itself, of the geometry of space-time.  It happens even for massless points not even connected to each other by a body at all.
So you could suppose the Universe is completely empty---no mass or energy, completely flat Minkowski space.  For simplicity, suppose there is one spatial dimenion, $x$, and one time dimension, and the velocity of light is unity, and $ds^2 = dx^2 - dt^2.$
If one co-ordinate system has its origin moving at the speed of light with respect to the origin of another co-ordinate system, one of them must fail to be an inertial reference frame.  They cannot be connected by a Lorentz transformation.
This is a kinematical theorem which does not depend on what dynamical law of motion Nature employs: it only depends on the principle of relativity.  (It is true in General Relativity also, but has no importance there because in GR we do not care about whether a co-ordinate system is inertial or not.)  So we cannot use a Lorentz transformation to compare what is seen by an observer travelling along with a photon with whast is seen by another observer for whom that origin is moving at the speed of light.
But the O.P. is getting at something, it just needs to be slightly rephrased: two observers in relative motion to each other, each using an inertial frame, will see the shape of a photon differently---there will be a contraction or expansion---this is the Doppler effect.
No one really knows what the shape of the photon is, but let us suppose that it has no mass and is perfectly spherical to observer 1 in the x,t reference frame (a sphere in one dimension is an interval) with unit diameter.  I.e., suppose one edge of the photon is at (0,0) and the other edge at (1,0) in the x,t reference frame.  If anyone wants to criticise the O.P. and naive ideas of spherical massless photons, just think of two points in space-time which are moving at the speed of light.  There are no rigid bodies in the real world either, so we need not imagine anything in between.
For the sake of generality, though, we need not assume these two points are travelling at the speed of light: assume only that they are travelling at the same velocity $w$, i.e., at the same speed $|w|$ and in the same direction, so that for observer 1 they are always the same spatial distance apart.
This means that we are considering two world-lines: the world-line of (0,0) (point one) is
$$x_1 = wt_1$$
and the world-line of the other point, which started at (1,0), is
$$x_2 = wt_2 + 1.$$
Consider another reference frame x',t' travelling at velocity $v$ relative to the first one, so that the co-ordinates are connected by the usual Lorentz transformation,
$$ x' = {x-vt\over\sqrt{1-v^2}}$$
$$ t' = {t-xv\over\sqrt{1-v^2}}.$$
The first world-line becomes
$$ x'_1 = {wt_1-vt_1\over\sqrt{1-v^2}}$$
$$ t'_1 = {t_1-vwt_1\over\sqrt{1-v^2}}$$
where $t_1$ is merely a parameter.  On eliminating this parameter, be obtain
$$x_1' = {w-v\over 1-vw}t_1',$$
i.e., the apparent velocity has suffered a shift, which is not the Lorentz contraction at all.  Of course.  Unless $w=1$, in which case there has been no change (the speed of light is invariant under a Lorentz transformation).
But the O.P. asks about the change in the spatial separation between the two world-lines.
The second world-line is
$$x'_2 = {wt_2+1-vt_2\over\sqrt{1-v^2}}$$
$$t'_2 = {t_2-v(wt_2+1)\over\sqrt{1-v^2}},$$
which will have the same slope but a different intercept: eliminating $t_2$ we proceed as follows.
$$x'_2 = {t_2(w-v)\over\sqrt{1-v^2}} + {1\over\sqrt{1-v^2}}$$
$$t'_2 = {t_2(1-vw)\over\sqrt{1-v^2}} -{v\over\sqrt{1-v^2}},$$
and so
$$x'_2 = {w-v\over 1-vw} t'_2 + {v{w-v\over 1-vw}\over\sqrt{1-v^2}} + {1\over\sqrt{1-v^2}}.$$
The second reference frame sees, at $t'_2 = 0$, the first point at (0,0) but the second point at $((v{w-v\over1-vw}+1)/\sqrt{1-v^2},0)$.
Simplifying, since $v{w-v\over 1-vw} + 1 = {vw-w^2\over1-vw} + {1-vw\over1-vw} = {1-v^2\over 1-vw}$, and now dividing by  $\sqrt{1-v^2}$, we obtain a simpler expression for point 2 at this time,
$$ ({\sqrt{1-v^2}\over1-vw}, 0 ).$$
This is not the Lorentz contraction, it is the Doppler effect, unless $w=0$, which is the case considered by the Lorentz contraction, so we do get the Lorentz contraction as a special case of the Doppler effect: a separation in space of $\sqrt{1-v^2}$ between the two world lines in the second reference frame, instead of unit separation in space as seen by the first reference frame in which the points are motionless.
That is, the Doppler effect includes the Lorentz--Fitzgerald contraction as a special case.
But suppose $w=1$, as is the case with a photon.  We then get a separation in space of $${\sqrt{1-v^2}\over1-v} =
\sqrt{1+v\over1-v}.$$  Sometimes this is a contraction of the spherical photon, other times, an expansion.  In reality, of course, it is impractical to observe the two diametrically opposite ends of a photon...so the practical application of this formula is for two wave crests of a wave travelling at the speed of light or the speed of sound.  The apparent wavelength will expand or contract.  But in theory, if the photon were a massless particle with a spherical shape in reference frame 1, it would have some other shape in reference frame 2.  And by letting $v\rightarrow \pm 1$, one can see the contraction approach zero, and the expansion approach infinity.
Comment: Remarkably, while mowing, I was running through more or less the same separation of worldlines reasoning you've shown above and I had planned to write it up and add as an addendum to my answer (which I left somewhat open ended).
Comment: *"No one really **knows** what the shape of the photon is"* implies that there *is* an objective property *shape* possessed by a photon.  But, there is no reference frame that is privileged; the photon has speed *c* in all frames and the 'shape' is different in each.  This argues for the position that, whatever properties a massless particle has, *shape* is not one of them.
Comment: I think, he said harshly, you answered too quickly.  After all, the Doppler effect is the real point of the O.P., and no one quicker than me really picked up on that.  And B: this anthropomorphic teaching of beginning Relativity is precisely what produces the O.P.'s confusion, and so answers that still pander to the idea that rigid bodies and mass and physical observers are important, do not clear up those confusions.  Admittedly, many teachers need to use some sort of crutch to start teaching.  But when the confusions produced by those simplifications have arisen,
Comment: Then it is time to present the material without the misleading crutch.  This is kinematics, not dynamics, and there are no rigid bodies.
Comment: What misleading crutch are you referring to Joseph?  Is there something in particular about the phrase *"the measured length of the object"* that you object to?
Comment: Rigid bodies.  fundamentally, that is what I object to.  But there are related issues: "particle". The idea that lengths, the Lorentz contraction, etc., happen to bodies instead of to empty space.  I mean, they do happen to bodies, but they happen to bodies because they happen to empty space. You can prove this by analysing the process of measurement, but "measurement" is a little misleading: the contraction happens even if no one exists to do the measuring.  A lot of this is harmless, but what I object to in your answer in particular that is harmful...although not worth downvoting...is
Comment: "The problem here is that, for a massless particle, there is no frame of reference in which the object is at rest; a massless particle has speed c in all frames of reference."  This does not address the O.P.'s confusion.  Nor is "frame of reference " standard terminology: no one can be sure whether you mean "co-ordinate system" or "inertial system".  What you write is false if the former, so of course I assume you mean the latter.  But will most student's be aware of this? No.  Precisely what has confused this student is that the co-ordinate system of an observer moving along with the photon
Comment: is not inertial.  To put it more incisively, the O.P. has not understood that not every system of co-ordinates is inertial.  But they are, literally, "frames of reference", they're just not inertial frames.  Also your use of "physical significance" is just false, and even if true, would be a red herring.  But this is less important.
Answer: Light has a frequency and a velocity (c). The wavelength, in appropriate units (i.e. with c=1), is simply the reciprocal of the frequency. It's the distance the light travels in the course of one cycle. It's not a measure of the size of an individual photon. A wavelength can be several meters, and obviously (or at least I hope it's obvious) this doesn't mean that the photons are each several meters long. However I don't know how you would measure the length of an individual photon, other than by measuring its wavelength, or what such a measurement might mean.
A photon would be contracted to length zero, in its own reference frame, if we could define such a thing. In that frame it would be stationary, and in going from A to B (for any A and any B) it would cover a distance of zero, taking zero time to do so. How it would oscillate through a possibly large number of cycles during an interval of time equal to zero seconds is left as an exercise to the reader.
Comment: "A photon would be contracted to length zero, in its own reference frame." This is false, assuming you are boosting in the direction that the beam is traveling (to naively try to boost to the light's reference frame which you can't ever do), then the frequency (via doppler shift) would decrease and thus the wavelength would go to infinity not 0.
Comment: Measuring the length of a photon practically useless as far I know so far, but we do know things such as the diameter of atoms (not sure) the size of an electron, so maybe photons can have size. Aside from this, how can a photon have velocity $c$ in its own reference frame? Any object is stationary relative to itself.
Comment: whether it goes to infinity or zero depends on what direction you are moving.  Now @Arc676: it is true that any object is stationary relative to itself.  And in theory you could define a co-ordinate system with origin always located at a photon.  And in that co-ordinate system, the photon is motionless.  But it is not an inertial system, the laws of Physics would take a strange form in it (you would hae to use General Relativity to get them). And that system could not be connected by a Lorentz transformation to the system of an observer for whom the photon was travelling at the speed of light.
Comment: The usual analysis of the Doppler effect, which I developed in my own way above, analyses how different observers see the wave length of the same light wave: that wavelength being the spatial separation between two crests of the wave.  But what people do not usuall notice is that the same analysis applies to any two points moving in the same direction and the same speed.  So if the photon were a particle, and if it had a diameter, and if the two diametrically opposite points were moving in the same direction and at the same speed, the analysis applies without any changes.
Answer:
Q: Does Light Experience Length Contraction?
"... so the Lorentz factor becomes ∞, meaning that an object traveling at c will have 0 length. However, photons and obviously all forms of electromagnetic waves move at c when traveling through a vacuum, ..."

An object traveling at the full speed of light (not just nearly so), that has mass (weighs something, anything), would require infinite energy to reach the speed of light; that would also take an extremely long time or it would be flattened by the acceleration, let alone contraction.

"Does this mean that photons have no length? How does this affect wavelength?"

A photon has no mass, no size; therefore no height, width or length.
The speed of the photon's emitter (and other factors not speed related) that determine it's frequency, it's wavelength. An object moving away from you becomes red shifted, an object moving towards you gains blueshift.

Instead of giving a mathematical answer I'll provide an example using a free-electron laser (FEL); a laser whose lasing medium consists of very-high-speed electrons moving freely through a magnetic structure, hence the term free electron.
A FEL is particularly useful as an example because it uses electrons (which have weight and mass) to create photons (which have no weight or mass), once the electrons have done as much work as is possible (saturation) they are dumped out of the beam.
Since the electrons have weight they can't pass the photons that they create because they can't be accelerated to light speed (though they come close to it in a FEL).
Beam Creation
To  create a FEL, a beam of electrons is accelerated to almost the speed of light. The beam passes through a periodic arrangement of magnets with alternating poles across the beam path, which creates a side to side magnetic field. The direction of the beam is called the longitudinal direction, while the direction across the beam path is called transverse. This array of magnets is called an undulator or a wiggler, because due to the Lorentz force of the field it forces the electrons in the beam to wiggle transversely, traveling along a sinusoidal path about the axis of the undulator.
The transverse acceleration of the electrons across this path results in the release of photons (synchrotron radiation), which are monochromatic but still incoherent, because the electromagnetic waves from randomly distributed electrons interfere constructively and destructively in time. The resulting radiation power scales linearly with the number of electrons.
Mirrors at each end of the undulator create an optical cavity, causing the radiation to form standing waves, or alternately an external excitation laser is provided. The synchrotron radiation becomes sufficiently strong that the transverse electric field of the radiation beam interacts with the transverse electron current created by the sinusoidal wiggling motion, causing some electrons to gain and others to lose energy to the optical field via the ponderomotive force.
This energy modulation evolves into electron density (current) modulations with a period of one optical wavelength. The electrons are thus longitudinally clumped into microbunches, separated by one optical wavelength along the axis. Whereas an undulator alone would cause the electrons to radiate independently (incoherently), the radiation emitted by the bunched electrons is in phase, and the fields add together coherently.
The radiation intensity grows, causing additional microbunching of the electrons, which continue to radiate in phase with each other. This process continues until the electrons are completely microbunched and the radiation reaches a saturated power several orders of magnitude higher than that of the undulator radiation.
The wavelength of the radiation emitted can be readily tuned by adjusting the energy of the electron beam or the magnetic-field strength of the undulators.
FELs are relativistic machines. The wavelength of the emitted radiation, λr, is given by
$${\lambda _{r}={\frac {\lambda _{u}}{2\gamma ^{2}}}\left(1+{\frac {K^{2}}{2}}\right)},$$
or when the wiggler strength parameter K, discussed below, is small
$$\lambda _{r}\propto {\frac {\lambda _{u}}{2\gamma ^{2}}},$$
where λ$_u$ is the undulator wavelength (the spatial period of the magnetic field), $\gamma$ is the relativistic Lorentz factor and the proportionality constant depends on the undulator geometry and is of the order of 1.
This formula can be understood as a combination of two relativistic effects. Imagine you are sitting on an electron passing through the undulator. Due to Lorentz contraction the undulator is shortened by a $\gamma$ factor and the electron experiences much shorter undulator wavelength λ$_u/\gamma$.
However, the radiation emitted at this wavelength is observed in the laboratory frame of reference and the relativistic Doppler effect brings the second $\gamma$ factor to the above formula. Rigorous derivation from Maxwell's equations gives the divisor of 2 and the proportionality constant. In an X-ray FEL the typical undulator wavelength of 1 cm is transformed to X-ray wavelengths on the order of 1 nm by $\gamma$ ≈ 2000, i.e. the electrons have to travel with the speed of 0.9999998c.
Wiggler Strength Parameter K
K, a dimensionless parameter, tells the wiggler strength as the relationship between the length of a period and the radius of bend,
$${\displaystyle K={\frac {\gamma \lambda _{u}}{2\pi \rho }}={\frac {eB_{0}\lambda _{u}}{2\pi m_{e}c}}}$$
where $\rho$ is the bending radius, B$_0$ is the applied magnetic field and m$_e$ the electron mass.
Expressed in practical units, the dimensionless undulator parameter is $${\displaystyle K=0.934\cdot B_{0}\,{\text{[T]}}\cdot \lambda _{u}\,{\text{[cm]}}}$$.
Quantum Effects
In most cases, the theory of classical electromagnetism adequately accounts for the behavior of free electron lasers.
For sufficiently short wavelengths, quantum effects of electron recoil and shot noise may have to be considered

How it works
https://www.xfel.eu/facility/overview/how_it_works/index_eng.html
To generate the X-ray flashes, bunches of electrons are first accelerated to high energies and then directed through special arrangements of magnets. Electrons are first brought to high energies in a superconducting accelerator. They then fly on a slalom course through a special arrangement of magnets (called an "undulator"), in which they emit laserlike flashes of radiation.
There's a virtual tour here: http://winweb.desy.de/pr/Virtueller_Rundgang/xfel/index.html
First the electron bunches are generated by knocking the particles out of a piece of metal using a conventional laser.

Next the electrons are accelerated in special cavities, the so-called resonators. In these resonators, an oscillating microwave transfers its energy to the electrons.
Buncher Video: http://winweb.desy.de/pr/Virtueller_Rundgang/xfel/assets/beschleuniger.mp4
Finally the accelerated electrons race through so-called undulators, periodic arrangements of magnets that force the electrons onto a tight slalom course. In the process, each individual electron emits X-ray radiation that amplifies more and more.

This amplification process is induced by the interaction of the X-ray radiation with the electrons: Because the radiation is faster than the electrons speeding along their slalom path, the radiation overtakes the electrons flying ahead and interacts with them along the way, accelerating some of them and slowing others down.
As a result, the electrons gradually organize themselves into a multitude of thin disks. The key property of this process is the fact that all of the electrons in a given disk emit their light "in sync." This produces extremely short and intense X-ray flashes with the properties of laser light.
Read "A simplified description of X-ray free-electron lasers" for a layperson's explanation.

Why are the emitted wavelengths in the X-ray range?
Relativity provides the answer.

(a) The relativistic electron approaches the periodic B-field of the undulator.
(b) In the electron reference frame the undulator period L is Lorentz-contracted to L/γ and the B-field is accompanied by a transverse E-field perpendicular to it: the two fields resemble an electromagnetic wave.
(c) This wave stimulates the electron to oscillate and emit waves of equal wavelength.
(d) The (relativistic) Doppler effect further reduces the wavelength in the laboratory frame, bringing it to the X-ray range.
You can see how closely the electron follows the photon it produces but due to it's greater mass and slower speed it's a race that the electron can never win.
(When written the MathJax renderer was working but during editing it failed. The few equations and special characters are from this Wikipedia article should any subsequent editing be necessary. Thanks. This is my first attempt at using this feature.)
Answer: I won't write ten paragraphs just to try sound smart. The answer to this question, I think, is quite simple. Space doesn't have mass, yet it must contract where mass experiences a time dilation, to prevent the possibility of mass exceeding light speed from an unprimed observer's perspective. It would contract in accordance with the Lorentz Factor for length contractions. To prevent energy from blue shifting for the unprimed observer, and ensure that wavelengths remain just as constant as light speed in all frames of references, I think it would be fair to assume, therefore, that light contracts with space, or at least vanishes with it. If this weren't the case a light bulb in a ship moving close to light speed would become lethal due to thickening energy. Assuming photons have three dimensions, this would even work for light moving perpendicular to a ship's motion. This answer involves an assumption, but I think it's a reasonable one.


When do we use matrix norm?

Question: When do we use matrix norm? matrix norm is one of the property of a matrix, but I am not sure when I will use it. Do we use it for calculating a upper bound of a matrix?
https://en.wikipedia.org/wiki/Matrix_norm
Answer: Matrix norms can be a way to state that "a matrix is big".
In statistics, per example. If you are trying to compare variances of multiple estimators $\hat\theta_1,\hat\theta_2$ of a multivariate $\theta$ you need to compare $var(\hat\theta_1)$ and $var(\hat\theta_2)$. As they are matrices, they may not be comparable. Looking at their norms can be a way to compare them.
In numerical analysis matrix norms can provide useful inequalities when looking for eigenvalues. Per example :

Let $A$ be a symmetric $n \times n$ matrix. Consider $A$ as an operator in $\mathbb{R}^n$ given by $x \mapsto Ax$. Prove that $||A|| = \mathrm{max}_j |\lambda_j|$, where $\lambda_j$ are the eigenvalues of $A$.

With more details here:https://math.stackexchange.com/questions/603375/norm-of-a-symmetric-matrix-equals-spectral-radius
Edit, following the comments If you are able to prove $||A||<1$, then a sequence defined by $x_{n+1}=Ax_{n}$ converges to 0.
Comment: Thanks for the answer. So, why do we want to know the max value of norm is equal to max value of eigenvalues?
Comment: The fact that $|\lambda_{max}|<1$ (or the opposite) can have a lot of implications on what you are studying... Looking at the norm is cheaper than evaluating all the eigen values.
Comment: So, what are the implications?

When do we use matrix norm?


What did the rings of the Nazgûl do?

Question: The One Ring can corrupt its wearer and make them invisible (potentially with other powers?), but I'm unsure what the other rings of power could do. Were they only able to make the Nazgûl immortal, or did they have other powers?
Comment: Does this answer your question? [What are the powers shown by the Rings of Power?](https://scifi.stackexchange.com/questions/60475/what-are-the-powers-shown-by-the-rings-of-power)
Comment: Neither of those are "powers" of the One Ring, but side effects. While the One Ring was specifically designed to allow Sauron to exert his will over the users of the other Rings, no explicit details are ever given as to what the other Rings actually *do*.
Comment: I don't have time to chase down sources, but [Tolkien Gateway](http://tolkiengateway.net/wiki/Nine_Rings) says they conferred "powerful magical abilities and gave them the ability to influence peoples' will."  [The LOtR Wiki](https://lotr.fandom.com/wiki/Rings_of_Power) says "they each acquired great power and wealth, became powerful Sorcerers [...] and appeared to have eternal life, for they did not age."
Answer: The Silmarillion says that the men who were granted the rings obtained "power" and became "sorcerers" (thus, the "Witch-King") but we don't get too much in the way of specifics.

Those who used the Nine Rings became mighty in their day, kings, sorcerers, and warriors of old. They obtained glory and great wealth, yet it turned to their undoing. They had, as it seemed, unending life, yet life became unendurable to them. They could walk, if they would, unseen by all eyes in this world beneath the sun, and they could see things in worlds invisible to mortal men; but too often they beheld only the phantoms and delusions of Sauron. And one by one, sooner or later, according to their native strength and to the good or evil of their wills in the beginning, they fell under the thraldom of the ring that they bore and of the domination of the One which was Sauron's. And they became forever invisible save to him that wore the Ruling Ring, and they entered into the realm of shadows. The Nazgûl were they, the Ringwraiths, the Úlairi, the Enemy's most terrible servants; darkness went with them, and they cried with the voices of death.

So other than the powers you listed, the two major other ones would be invisibility—at first at will, and then permanently—and some sort of visionary power.
Another I would add from The Lord of the Rings would be their piercing screams, which are said to strike terror in the hearts of ordinary men. There's also a lot in The Lord of the Rings suggesting the wraiths have the power to strike fear in those around them, but it's not clear if that's a magical power or if they're just very intimidating—magic in Tolkien's universe tends to be very subtle.
Somewhat less subtly, we do at one point see the Witch-King casting a spell to set his sword on fire:

The Black Rider flung back his hood, and behold! he had a kingly crown; and yet upon no head visible was it set. The red fires shone between it and the mantled shoulders vast and dark. From a mouth unseen there came a deadly laughter. 'Old fool!' he said. 'Old fool! This is my hour. Do you not know Death when you see it? Die now and curse in vain!' And with that he lifted high his sword and flames ran down the blade.
Comment: I think "they cried with the voices of death" is alluding to their screams.
Comment: The "invisibility" and "visionary power" are the same thing - as with the One, the wearer can (or if insufficiently wilful, is forced to) enter the spirit realm.
Comment: The scream and ability to cast fear is due to their being *(un)dead shadows* rather than to their rings, I'd presume. That's a bit wiggly because they became what they are because of their rings, but I still maintain that their status is the source of these powers, not their ring-bearing as such.
Comment: Did the Witch-Kings sword actually emit flames, or was "and flames ran down the blade" a poetic metaphor for its mirror like surface reflecting the fires inside and outside Minas Tirith?
Comment: @M.A.Golding- maybe the blade was just reflecting the fire from a Balrog's wings?

What did the rings of the Nazgûl do?


Is software like tune up utilities essential?

Question: Is software like tune up utilities necessary? Can't we perform the tasks using some other free ware tools and built in windows tools?
Comment: It is not necessary.
Answer: The use of these tools is nto essential, but by using this type of application - old files, services, fragments etc which can slow down your machine can be removed which keeps your computer performing better.
There are a lot of freeware and builtin tools which can be used to optimise your PC.
Freeware includes CCLeaner, Glary, TuneUp, CleanMaster, WiseReg.. there are loads.
Builtin Windows Utilities include:
Disk Cleanup - deletes unwanted files and temp
Chkdsk - Checks your disk for errors and recovers file fragments
msconfig - stops unwanted services from starting with your computer
Disk Defrag - defragments your drive
Security Essentials (not builtin, but MS anyway) will scan for viruses, spyware etc which could be slowing down your machine
IE Control Panel - can be used to wipe IE history, session info etc - keeping your machine clean
Some of these will accomplish some of the tasks required to keep your machine in top condition
Other advice on keeping your computer running well and in good condition I could give includes:

Regular updating of windows to avoid security holes and potentially improve performance
Regular disk cleanups/defrags to keep the machines drive litter-free
Regular AV scanning to keep your machine in good health
Regular Reboots of your computer - "turn it off and on again" really does work!

Most of these tasks can be run on a schedule using the windows task scheduler to take the work away from yourself.
Comment: Using such a program means you don´t have to remember all the built in options and makes accessing things like the start-up manager easier. I find "TweakNow" quicker as I only use it every month or so. Others will have their favourites!
Comment: While this is very true Brian, there are a lot of environments (schools & colleges, work placements) where licensing prohibit this - so these tools are amazing and very quick & useful - but not always a viable option.
Answer: I have Win 8.1, and I had the same question like you. With Win 3.1, 95, 97, XP I used similar software a lot. Now, since Win 7, I simplified things down, and don't use them anymore.
I run CCLeaner occasionally, and the rest is done by Windows' built in tools running in the background automatically. I find that about 10 years ago the freeware tools were really necessary, but over time Windows got most of the helpful features covering 80% of the needs. Like I used Diskeeper to defragment on XP, but Win 8.1 trims the SSD automatically, and the built in Defragment feature is good enough.
As Fazer87 says, I experience that at least a weekly reboot improves a lot.


Using BC License Plates in Alberta

Question: I moved permanently to Alberta from BC.  I now have Alberta driver's license and Alberta license plate.  Can I continue using my BC license plate?
Answer: It probably ceased to be proper to use your BC plate no later than the time at which you got the Alberta plate. The Alberta registration supersedes the BC registration. It may have been improper earlier than that, but since nothing has happened so far, it is moot point.

Using BC License Plates in Alberta


Is the Wachau Valley interesting only to skiers?

Question: I'm doing a trip from Vienna to Salzburg just after the beginning of the new year, probably 2-3 January. I'd like to stay for a day and night in Salzburg, but would also like to do another day and night somewhere smaller and more provincial. Is Wachau more than just a place for skiers? Or could I make my own fun as a non-skier? Same question for Pongau.
Comment: In the Wachau there are some great wineries.
Comment: @RoflcoptrException Excellent! I was just looking through my book for that exact thing. Have you got any particular suggestion? Thanks!
Answer: I don't know where you got it from, but the Wachau is definitely not a ski region. So, yes it is fine for non-skiers. By definition, so to say. The Wachau a quite picturesque region. It has some interesting historical monuments. The Wachau is also famous for its wine. An interesting way to explore the place and enjoy the landscape is by cycling. Have a look at the Donauradweg.
The Pongau is a ski destination. But as anywhere else in the Alps there are plenty of other things to do. For instance Bad Gastein is a thermal resort. A nice place to relax not only for skiing.
Answer: If you are travelling through Wachau, the ruins in Duernstein and Loiben are remarkable, Duernstein having a connection to the myth of Blondel the singer.  Both venues offer breath taking views of the Danube.  And of course the local cuisine is a treat.


Weekday Formula Error

Question: I'm trying to use the Weekday formula. However, instead of getting a 0-7 number returned, I am getting 12/31/1899. I have watched several videos, tried on different browsers and devises. What can I do?
Answer: If you are seeing 12/31/1899 instead of 0 this is because the cell format number is set to date instead to number.
To fix this, click Format menu then Number then Number
Comment: Thanks. I'll try this. But it still thinks the year is 1899.
Answer: Jen, if the information below doesn't solve your problem, please provide your existing formula that is failing so we can help you to correct it.  Currently we have to guess at the specific problem you might be having.
My own 'guess' is you have a formatting issue.  I suggest you make sure that the number format of the cell with the formula is not a date.  If you format a number that is not a date (ex: 1-7) as a date, you will get a date returned which is the result you provided (12/31/1899).
Here is a link to a succinct overview of Weekday at support.google: Weekday Explained
I recommend reviewing the notes in that article.  In particular:

Insure that the input to the function is either a reference to a cell containing a date, a function which returns a date object such as DATE, DATEVALUE or TO_DATE, or a date serial number of the type returned by the N function. Google Sheets represents dates internally as numbers for ease of use in calculation, and while this conversion is done automatically when a date in the form of a string is input into a cell, this function does not perform this conversion.
WEEKDAY does not autoconvert number formats in the same way that Google Sheets does upon direct entry into cells. Therefore, WEEKDAY(10/10/2000) is interpreted as WEEKDAY(0.0005), the quotient of 10 divided by 10 divided by 2000.
Comment: Thank you. I tried changing the format of the date, from 5/5/2019 to 5-5-2019 and got the same error.
Comment: @jen do not change the format to 5-5-2019  change it to 0.  Format>Number>More Number Formats>Custom Number Formatting.  Then erase whatever is in that dialog box and just type a 0.
Comment: Please read how to and [share a test sheet](https://webapps.stackexchange.com/a/138383/117311) so as you can be easier helped.

Weekday Formula Error


How can I tell if Nintendo Wii accessories are genuine/official?

Question: The Wiimote and Nunchuk resale market (e.g., Amazon/eBay) varies between questionable and legit. Many reviews complain about scam products mixed in with resale of certified genuine hardware. What are the easiest ways to visually tell official Nintendo Wii Remote Plus and Nunchuk hardware apart from knockoffs if a scammer tries to pull one over on me?
Comment: I would say it is worth spending the money and getting the real deal from a legit store...
Answer: Sadly, the bad fakes are pretty obvious, but the good fakes are nearly indistinguishable from the genuine article.
There's a few easy ways to spot a "bad fake:"

Weight - the counterfeits tend to weigh less
Cheap plastic - bits may be rattling around inside, or the plastic may be thinner to reduce the cost.  If you see a lot of light leakage around the LEDs, (ie, the plastic seems to "glow" around them) this is a good indication that the plastic is cheap/thin
Missing/bad/poorly aligned logos
Bad paint job (matte where it should be glossy, or things like the logo just scratch off) - this is especially obvious on buttons, which are usually coated to prevent the numbers/letters from rubbing off, but probably won't be nearly as durable on a fake.

On the other hand, visually inspecting a "good fake" is much, much harder.  I've got some replacement DS case parts that look absolutely identical to the original model.  I assume that security in many of the factories that produce these items is relatively lax (or the intellectual property rights aren't completely enforced) because I could swear they came from the same molds the original parts did.  There were even compliance and serial number labels in the proper places, and they fit just fine with the other case parts I had from my broken DS.
In your case, I looked up images of the "fake" Wiimotes that are floating around, and found some photos in this thread where they were pretty sure they got a counterfeit, but it looked practically identical:

(mirroring the image here, since I had trouble accessing the site & had to hit a google cache - apologies & credit to the original poster, crashcraz3)
As you can see, they're virtually identical from a visual standpoint - the differences were only noticeable when it was in use.  (The speaker was too loud, the tracking was off, and the LEDs were too bright)
If you're concerned about fakes, I'd stick to buying from reputable sellers who have clear return policies and plenty of positive feedback.  Buying from the lowest bidder on eBay/Amazon/etc is likely to give you a high probability of being stuck with a counterfeit item.
Comment: Right one, easy to see it's a fake, The colors are more pale then the originals.


Why isn't smoothsort more common?

Question: From reading this article from Wikipedia on sorting algorithms, it would seem that smoothsort is the best sorting algorithm there is. It has top performance in all categories: best, average, and worst. Nothing beats it in any category. It also has constant memory requirements. The only downside is that it isn't stable.
It beats timsort in memory, and it beats quicksort in both worst-case performance and memory.
But I never hear about smoothsort. Nobody ever mentions it, and most discussions seem to revolve around other sorting algorithms.
Why is that?
Comment: Though a very good question, I don't think it fits SO very well. Voting to close as "not constructive": `this question will likely solicit debate, arguments, polling, or extended discussion.`
Answer: Big-O performance is great for publishing papers, but in the real world we have to look at the constants too.  Quicksort has been the algorithm of choice for unstable, in-place, in-memory sorting for so long because we can implement its inner loop very efficiently and it is very cache-friendly.  Even if you can implement smoothsort's inner loop as efficiently, or nearly as efficiently, as quicksort's, you will probably find that its cache miss rate makes it slower.
We mitigate quicksort's worst-case performance by spending a little more effort choosing good pivots (to reduce the number of pathological cases) and detecting pathological cases.  Look up introsort.  Introsort runs quicksort first, but switches to heapsort if it detects excessive recursion (which indicates a pathological case for quicksort).
Comment: No amount of fiddling with pivots or detecting pathological cases can keep worst case performance for quicksort from being O(n*n). That's the whole point of introsort: it's worst case performance is O(nlogn).
Answer: Better asymptotic doesn't imply better performance (though usually it turns out so). Hidden constant may be several times bigger, causing it to be slower that another algorithm (with same or even worst asymptotic complexity) on arrays of relatively small size (where relatively small array, in fact, may be of arbitrary size, 10100, for example. That's asymptotic analysis). But I don't know anything about smoothsort hidden constants.
For example, there is a O(n) worstcase in time algorithm for finding kth order statistic, but it's so complex that O(n log n) worstcase version outperforms it in most cases.
Also, there is an interesting comparison:

…As you can see, both Timsort and Smoothsort didn't cut the mustard. Smoothsort is worse than STL sorts in all cases(even with std:bitset replaced with raw bit operations)…
Answer: Well first I would say that it is not like Smoothsort is not famous. It depends on the need of a user and also it depends on the user whether to use it or not.
The advantage of smoothsort is that it comes closer to O(n) time if the input is already sorted to some degree, whereas heapsort averages O(n log n) regardless of the initial sorted state.
From the Documentation:-

The smoothsort algorithm needs to be able to hold in memory the sizes
  of all of the heaps in the string. Since all these values are
  distinct, this is usually done using a bit vector. Moreover, since
  there are at most O(log n) numbers in the sequence, these bits can be
  encoded in O(1) machine words, assuming a transdichotomous machine
  model.

Why isn't smoothsort more common?


chrome.socket UDP API useless on Chromebook?

Question: I am working on a Chrome packaged app that requires multicast communication over the local network and is specifically targeting Chromebook users.  The 'Network Communication' documentation on the packaged app site is outdated and the chrome.socket API documentation is lacking.  I was able to get some idea of how to get multicast working by looking through Chrome's 'multicast' sample app (https://github.com/GoogleChrome/chrome-app-samples/tree/master/multicast).
I tested my app by loading it into the Chrome browser on my Mac and everything worked great.  I loaded it onto my Chromebook and multicast did not work.  I then tried the 'multicast' sample app on my Mac and Chromebook with the same result.  The 'multicast' sample app is a chat app.  When loaded on both computers on the same network, everything works as expected on the Mac - I can send chat messages out and receive chat messages.  On the Chromebook I can send chat messages but not receive them - including the ones that the Chromebook sent.
According to this post - Chrome Sockets API Behaves Differently on Chrome OS (vs. Ubuntu, Windows)? - it looks like Chromebook has a restricted firewall that is blocking UDP packets.  I followed the instructions on the post to turn on developer mode and allow UDP packets and that allowed my app to run as expected, but that is not a solution for me.  I can't expect Chromebook users to run in developer mode to run my app.
Anyone know if it is possible to allow UDP packets on the Chromebook without going into developer mode?  Is there an undocumented permission I can add to my manifest to override the Chromebook UDP restrictions (this seems possible since the 'udp-multicast-membership' permission included in the 'multicast' sample app is undocumented)?  This seems like a long shot but chrome.socket.create can be given optional socket options which don't appear to be documented anywhere.  Maybe there is something I can add there?  And why have Chrome sample apps that don't run on a Chromebook???
---UPDATE---
In case someone is having a similar problem, it looks like this has already been filed as a bug and been looked at just within the past couple of weeks.
https://code.google.com/p/chromium/issues/detail?id=275737
I have no idea when it will actually make its way to a Chromebook update.
Comment: The 'Network Communication' documentation I referenced: http://developer.chrome.com/apps/app_network.html

chrome.socket API docs: http://developer.chrome.com/apps/socket.html
Answer: Regarding:

I have no idea when it will actually make its way to a Chromebook
  update.

usually ChromeOS follows the same release schedule as desktop chrome, with new stable versions coming out about every 6 weeks. But because of the holidays in December when lots of people are on vacation, there is sometimes a hiccup. You can give the dev channel a try and see if the fix showed up there yet: https://support.google.com/chromebook/answer/1086915?hl=en


How can it preserve source mac address unchanged after layer-3 filtering through a Linux bridge (which using bridge-utils and ebtables)

Question: Background:
I have a Linux bridge (Ubuntu 15.10, 64bit, name Bridge B) with two physical interfaces, eth0 and eth1, and the bridge interface's name is br0. Send A (Win 10) connects to eth0, and Receiver C (Win 10) connects to eth1. As shown in the figure below.
Sender A <------> (eth0) Bridge B (eth1) <------> Receiver C
Sender A's MAC Address: D4:EE:07:3F:F9:0D, IP Address: 192.168.1.2
Bridge B's eth0 MAC Address: B0:51:8E:FF:2F:C8, No IP Address
Bridge B's eth1 MAC Address: B0:51:8E:FF:2F:C9, No IP Address
Bridge B's br0 MAC Address is the same with eth0 (Auto), IP Address: 192.168.1.1
Receiver C's MAC Address: 4C:CC:6A:DC:91:60, IP Address: 192.168.1.3
Send A send packet to Receiver C, such as icmp ping.
Problem:
Before I configure ebtable rule in Bridge B for redirecting packet to layer 3, everything is OK, Receiver C receive Send A's ping packet with source MAC Address D4:EE:07:3F:F9:0D, and destination MAC Address 4C:CC:6A:DC:91:60, nothing changed after packet send out from Send A.
When I set up ebtable rules in Bridge B for redirecting forwarded packet to layer 3, then I can use iptables for packet filtering in Bridge B. Code is:
ebtables -t broute -A BROUTING -p IPv4 --logical-in br0 -j redirect

Then problem happened. Packet from Send A to Receiver C which through Bridge B's layer 3, I can see in Receiver C that the source MAC Address of the packet is B0:51:8E:FF:2F:C8. Obviously, the source MAC Address is changed to Bridge B's br0 MAC Address.
I am wondering the problem is that when packet is redirected from layer 2 to layer 3, and then reroute by Bridge B in layer 3, the source MAC Address then be changed by Bridge B's kernel.
Questing:
Is there something I can do or configure to preserve source MAC Address unchanged after layer-3 filtering through Bridge B?
/etc/network/interface configuration in Bridge B
auto eth0
iface eth0 inet manual
up ifconfig eth0 up

auto eth1
iface eth1 inet manual
up ifconfig eth1 up

auto br0
iface br0 inet static
address 192.168.1.1
netmask 255.255.255.0
pre-up ip link set eth0 promisc on
pre-up ip link set eth1 promisc on
pre-up echo "1">/proc/sys/net/ipv4/ip_forward
bridge_ports eth0 eth1

CGretski, I read the man page of ebtables in http://ebtables.netfilter.org/misc/ebtables-man.html. My personal understanding is that when using ebtables "-j redirect", the redirect target will change the MAC target address to the bridge device, then the packet can be sent to bridge interface br0, as mentioned in the example above. So, a packet from Sender A to Receiver C, the target mac address will be changed to bridge's mac address, nothing mention about source mac address whether will be changed or not.
After filtering by Bridge B's layer 3 (or nothing done by layer 3), the packet now should be rerouted to Receiver C. Then the target mac address of the packet will be changed to Receiver C. But on the same time, packet's source mac address be changed to Bridge B's mac address.
If I use "-j accept" in ebtables target, as you advice, packet will not be sent to layer 3, and transparently pass through Bridge B, nothing be changed, including source and target mac address. But I cannot do any layer 3 filtering.
The reason I want to maintain packet's layer2 information is that I do not want Receiver C to sense of any existence of device between Sender A and itself. Another imporent reason is that in some scenarios, Receiver C (especially when it is a gateway) will drop the packet after source mac and ip verification.
Answer: Losing layer2 info is an expected side-effect of introducing Layer3 routing and is the very definition of the "-j redirect" target.
From ebtables man page:

The redirect target will change the MAC target address to that of the
  bridge device the frame arrived on.

you could try "-j accept"  though that may not pass it up to layer 3 filtering.
What are you trying to achieve by maintaining layer2 information?


Not able to login after suspend/sleep in Linux Mint 20.04 from XFCE DE

Question: I think this is due to Deepin Desktop Environment, which I install just now, from ubuntudde-ppa.
I tried this post:- https://askubuntu.com/questions/818919/xubuntu-16-04-how-do-i-make-it-lock-screen-automatically-after-timeout
But, xfce-power-manager was not working?.
Whenever I sleep/suspend the system, the is no login screen after resuming, just black blank screen, with some screen brightness, I also can't reach tty and I have to force shutdown, to reboot.
Comment: Can you press e.g. Ctrl + Alt + F3 after resuming and check if you see a login prompt?
Comment: Apparently, I don't get the login prompt nor can I reach the tty, from a logined session
Answer: The problem was xfce4 package had some how got deleted.
After reinstalling it everything is fine now


Can we capture the web service call out request and web service call out response times?

Question: Can we capture the web service call out request and web service call out response times.I am able to see these times in debug logs.But i am unable to capture these time.Could you please help on this.
Please find below screen shot.
User-added image
Need to capture the call out request and call out response time in diffrent stings.
Could you please help on this.
Comment: Please add your code to your question so we can see what you've tried.
Answer: You can put simple System.Now() before and after the call-out statement.
Example
<code>    public sendSMS()
    {
        DateTime t = System.Now();
        // Do Webservice Callout
        // .... callout statement
        DateTime t2 = System.Now();
        // perform operation according to two datetime received.
    }
</code>


Methods to solve differential equations

Question: We are given the equation
$$\frac{1}{f(x)} \cdot \frac{d\left(f(x)\right)}{dx} = x^3.$$
To solve it, "multiply by $dx$" and integrate:
$\frac{x^4}{4} + C = \ln \left( f(x) \right)$
But $dx$ is not a number, what does it mean when I multiply by $dx$, what am I doing, why does it work, and how can I solve it without multiplying by $dx$?
Second question:
Suppose we have the equation $$\frac{d^2f(x)}{dx^2}=(x^2-1)f(x)$$
Then for large $x$, we have $\frac{d^2f(x)}{dx^2}\approx x^2f(x)$, with the approximate solution $ke \cdot \exp \left (\frac{x^2}{2} \right)$
Why is it then reasonable to suspect, or assume, that the solution to the original equation, will be of the form $f(x)=e^{x^2/2} \cdot g(x)$, where $g(x)$ has a simpler form then $f(x)$? When does it not work?
Third question:
The method of replacing all occurences of $f(x)$, and its derivatives by a power series, $\sum a_nx^n$, for which equations does this work or lead to a simpler equation?
Do we lose any solutions this way?
Comment: Your first equation has what is often called a *logarithmic derivative*; from the chain rule, we know that the derivative of $\log\,f(x)$ is $f^\prime(x)/f(x)$.
Comment: I'm also curious of this, and I know two Wiki articles that may help (though I did not have the patience to read it through)
http://en.wikipedia.org/wiki/Differential_of_a_function#Other_approaches
http://en.wikipedia.org/wiki/Differential_(infinitesimal)
Comment: I guess that we can do so, is guaranteed by the fundamental theorem of calculus involving Riemann Sums, showing that they are equivalent to the integral and that integration is inverse of differentiation.
Comment: Shouldn't this be three separate questions, rather than three-in-one?
Answer: Re: 2nd question. Our suspicion does not have to be reasonable. I think that some mathematical discoveries happened precisely because someone had a less-than-reasonable suspicion and was not too afraid or lazy to investigate. Noticing that the second derivative of $e^{x^2/2}$ is $(x^2+1)e^{x^2/2}$, which is not very different from our equation, we think that $f$ might have something to do with $e^{x^2/2}$. Or it might not. But we have to try something, right? So we try writing $f$ in the form $f(x)=e^{x^2/2}g(x)$. Plugging this into the equation, we get $g''+2xg'+2g=0$. This does not look much simpler than what we had. It seems that the ansatz $f(x)=e^{x^2/2}g(x)$ does not work. We have to keep thinking.
Thinking more, we notice (or should have noticed earlier) that the plus sign in $(e^{x^2/2})''=(x^2+1)e^{x^2/2}$ does not fit our equation as well as minus sign would. So we put the minus sign in: $(e^{-x^2/2})''=(x^2-1)e^{-x^2/2}$. When we plug $f(x)=e^{-x^2/2}g(x)$ into the equation, the term with $g$ drops out: we get $g''-2xg'=0$. The guess worked! We already have $g=C$ as one of the basis solutions, and we find the second one by solving the 1st order equation $h'-2xh=0$, etc.
Re: 3rd question. The power series method usually does not really tell you what a solution is, it's more of a way to get an approximation to the solution. It works best for linear systems with polynomial coefficients, but can give some information even for seriously nonlinear equations (recent example). With this method you don't get solutions that are not represented by a power series, in particular those that are singular at $0$. For example, try solving $2xy'+y=0$ with the power series method.
Answer: FIRST QUESTION
This is answered by studying the fundamental theorem of calculus, which basically (in this context) says that if on an interval $(a,b)$
\begin{equation}
\frac{dF}{dx} = f
\end{equation}
then,
\begin{equation}
\int^{b}_{a} f\left(x\right) dx = F(b) - F(a)
\end{equation}
where the integral is the limit of the Riemann sum. And then, you can specify anti-derivatives (indefinite integrals) as $F\left(x\right) + c$ by fixing an arbitrary $F\left(a\right) = c$ and considering the function
\begin{equation}
F\left(x\right) = \int^{x}_{a} f\left(x\right) dx
\end{equation}
where we do not specify the limits as they are understood to exist and are arbitrary. It is from here actually, that we get that multiplying by $dx$ rule.
For,
\begin{equation}
F = \int dF
\end{equation}
and hence
\begin{equation}
dF = f(x)dx \implies F = \int f(x) dx
\end{equation}
This is a little hand waiving, and for actual proofs, you would have to study Riemann sums.
Now, after this, for specific examples such as yours, I guess Andre Nicolas's answer is better but still I will try to offer something similar.
We can say let $g\left(x\right) = \int x^{3} dx$ and $h\left(x\right) = log\left|f\left(x\right)\right|$. Then,
\begin{equation}
\frac{dh\left(x\right)}{dx} = \frac{dg\left(x\right)}{dx}
\end{equation}
for all $x \in \left(a,b\right)$
and hence, we can say that
\begin{equation}
h\left(x\right)= g\left(x\right) + C
\end{equation}
Answer: More Deapth for Question 1:
Andr'e noted that the idea of multiplying by dx is "mathematically dubious", and in reality there are many situations where this technique will get you into trouble if you apply it haphazardly without understanding what's going on in the background. To the end of providing that background I'm going to go throug the solution process of your first example with as much detail about each step as possible.
$$
{{1}\over{f(x)}}{{df}\over{dx}} = {{x^3}}
$$
casting this to an integration problem:
$$
\int {{f'(x)} \over {f(x)}}dx = \int {{x^3}} dx
$$
now here's where things change from simply thinking about "multiplying" by a differential. in stead of using that (as mentioned before) problematic through process we'll use integration by substitution, but for a very special case.
What this process really means geometrically is using the infinitesimal breakdown of distances along the function itself as the measure for our calculated area (in stead of the distance along the real line).
Literally stating:
$$
du = \lim_{h \to 0} {{f(x)-f(x+h) \over {h}}dx}
$$
which when plugged into the Riemann integral becomes:
$$
{\int {{f'(x)} \over {f(x)}}dx} = \lim_{max(x_i - x_0) \to 0}\sum_{i=1}^{n}{{f(x_i)-f(x_0)}\over {f(x_i)(x_i-x_0)}}{(x_i - x_0))}
$$
$$
= \lim_{max(x_i - x_0) \to 0}\sum_{i=1}^{n}{{1}\over {f(x_i)}}{(f(x_i)-f(x_0))}
$$
by taking the observation that our limit can be changed to:
$$
= \lim_{max(f(x_i) - f(x_0)) \to 0}\sum_{i=1}^{n}{{1}\over {f(x_i)}}{(f(x_i)-f(x_0))}
$$
wihtout altering the meaning (this result is actually non-trivial but I won't get into that here) we have demonstrated that the integrals are equivalent.
This then results in the integral:
$$
\int {{1} \over {f(x)}}df(x) = \int {{x^3}} dx
$$
As a digression; often in calculus classes you're taught this using a variable as a stand in for your function, such as $u = f(x)$, and then do something like $du = f'(x)dx$ to make things easier on your sensibilites for the time (as using a function as a variable isn't usually as easy to grasp, and comes along with other issues). In this case I'll follow both concepts through so you can see how they connect.
The subsitution method with $u = f(x)$ and $du = f'(x)dx$ would then look like:
$$
\int {{f'(x)dx} \over {u}} = \int {{du} \over {u}}  = \int {{x^3}} dx
$$
and from here we either get (if I combine the constants for simplicity):
$$
ln(|f(x)|+c = {{x^4} \over {4}}
$$
or with the substitution:
$$
ln(|u|+c = {{x^4} \over {4}}
$$
where we need to put the f(x) back in for u (since they're equal) and get:
$$
ln(|f(x)|+c = {{x^4} \over {4}}
$$
either way.
From here it's just cancellations and algebra until you get your final result.
There are some important things of note here for a general problem of the type:
$$
g(f(x))f'(x) = h(x)
$$
Since the integral is actually some $ \int g(f(x)) df(x)$ if the integral of the function g fails to exist on the region of concern the solution cannot be found using this method. Somtimes by simply "cancelling" differentials, or "multiplying through" by them this gets obfuscated.
Answer: First question only: The differential equation can be rewritten as
$$\frac{f'(x)}{f(x)}=x^3.$$
Find antiderivatives of both sides.  To calculate $\int \frac{f'(x)}{f(x)}\,dx$, note that by the Chain Rule, $\frac{f'(x)}{f(x)}$ is the derivative of $\log|f(x)|$.
We conclude that $\log|f(x)|+C_1=\frac{x^4}{4}+C_2$ for some constants $C_1$ and $C_2$, which may be combined into one.
There was no multiplication by $dx$. Yet we get the same result as by the admittedly dubious procedure of multiplying by $dx$.  So at least the dubious procedure is harmless, it gives the correct result. So it can be thought of as a mnemonic device that helps us get to the right answer.
Remark: There is more to it than that, the process captures a certain useful physical intuition. And one can even make mathematical sense of naked $dx$.
Comment: Someone made a suggested edit that should really have been a comment. To that user: either leave a comment, or if that is impossible then leave an answer which someone will flag to be added as a comment to André's post. Cheers,

Methods to solve differential equations


Someone who pretends to be religious

Question: I am intrigued to know whether there is any particular word in English for an opportunist who tries to look like religious people in some religious countries and cultures.  Take "some rabbis in Judaism or many mullahs in Islam just for the sake of some financial gains or seeking political or positional favors.  Sometimes they do that solely to expand their circle of influence looking for further advantages.
Such a person does not observe most of their respective religious rules. They only try to be similar to the religious ones by appearance or the way they speak and so on.
For instance, they might grow beard and mustache in Islam and Judaism or wear some specific clothing which is a sign of believers and extremists in that particular school.
You can see the typical of such characters frequently, in some Asian countries like Iraq, Afghanistan, Iran, Turkey etc.
I am familiar with the words "hypocrite (n.) and hypocritical (adj.), however the problem is that these words encompasses a wider semantic area.
I need a narrower or finer word/expression/idiom which carries directly my intended message if there is / are such a notion(s) in English.
Comment: The problem is that in English speaking countries you generally can't tell someone's religion by their appearance or dress unless they actually are members of e.g. Islam or Judiasm. of course, being a 'member' is not always synonymous with firm belief.  You can't 'dress like' a Catholic or a Baptist, so there is not likely to be a specific word for this.
Comment: Try sanctimonious, and it synonyms.
Comment: "sanctimonious" is close, but you can be sanctimonious and genuinely religious. My understanding is that it means acting as if you are superior because you think you are better for being more religious than someone else.
Comment: Does the adj. "sanctimonious" encapsulate the notion of somebody how is not actually religious an solely strives being similar to religious people by appearance out of the reasons I mentioned @DrMoishePippik.
Comment: @PeterJennings - we had a sanctimonious neighbour that my father called a 'bloody holy Joe' and a 'creeping Jesus'.
Answer: You are correct that 'hypocrite', though used in the Christian scriptures to describe religious leaders of the day, has a much broader use and does not specifically refer to religious teachers. Further, there is nothing inherent in the word to suggest that the person does not believe what they teach, only that they fail to live up to it in some way.
However, the idiom 'a wolf in sheep's clothing' is of Biblical origin (derived from the text "Beware of false prophets, which come to you in sheep's clothing, but inwardly they are ravening wolves") where it is used specifically to describe false religious teachers (or false prophets) who deliberately conceal their true nature for malevolent reasons. Although the idiom has come to have a slightly broader use today, dictionary definitions nearly always note its religious origin, and it makes the most sense in this context. The very specific imagery of a placid sheep suits the 'pastoral' role that religious teachers are supposed to occupy, while a 'wolf' would be dangerous to real sheep, which are also used in Christian teaching to represent adherents.
Answer: Although not a single word or phrase you could describe such a person as acting like The Vicar of Bray. A clergyman who changed his religious stance to fit in with the changing doctrines during a time of religious upheaval.
Comment: Or [Tartuffe](https://en.wikipedia.org/wiki/Tartuffe) - the last paragraph of the 'History' section claims that the word is used in English, though Molière's plays aren't that well-known to English speakers.

Someone who pretends to be religious