LINQ - which layer should LINQ typically fall into, DAL?

Question: just wanted to gather different ideas and perspectives as to which layer should (and why) LINQ fall into?
Answer: LINQ = Language INtegrated Queries. This is the query extensions that allows you to query anything from databases to lists/collections to XML. The query language is useful in any layer.
However, a lot of people refer to LINQ to SQL as just "LINQ". In that context, a combined BLL/DAL makes sense when you're using L2S and that's where you do LINQ queries against your database. That does of course not exclude doing subsequent queries against the results from those same queries in new (Linq to objects) queries in higher layers...
Answer: it depends on what you want to do with linq. when using linq2sql i`d recommend the DAL, but Linq is more than just database access. you can use it to manipulate lists, ienumerables of business objects and so on... Linq itself can be useful everywhere in your application.
Answer: I consider your DataContext-derived object to your DAL layer itself, and LINQ is just a very flexible interface to it.   Hence I use LINQ queries directly in the Business layer.
Answer: Both.  DataContext is the DAL and, when using the designer, the auto-generated partial classes that map on to SQL objects (tables,views) can be considered part of your business layer.  I implement partial classes that implement some of the partial methods to enforce validation and security as needed.  Some business rules don't map directly on to DB objects and are handled via other classes.
Answer: I think if you are doing Linq to Sql, you should always do it in your DAL. However if you are doing Linq to Objects where you are just filtering, playing with different object you can do that is BL layer.
Answer: I think LINQ should be the very lower-level (DAL) and I think it should be wrapped into a BLL.
I know a lot of people like to use the partial accessibility of the models that LINQ to SQL generates but I think you should have clear separation of interests (see what I did there?).  I think if you're going to have business logic it needs to be decoupled completely from your data access logic.
I think what makes it tricky is the fact that you can keep chaining those LINQ extension methods anywhere you have a using System.Linq line in your code.  Again though I think LINQ belongs with the definition and should be at the lowest possible level.  It also makes TDD/Unit Testing much, much easier when you wrap the usage of LINQ in a BLL.
Answer: I use linq in the traditional 'data access layer' or in 'data access objects'.  This allows modularization of code, promotes data code in one place (vs cutting and pasting the same code a few different places) and allows a different front end to be developed with relative ease.
Answer: It depends on the architecture of your application, and it makes a huge difference how much the presentation model matches the data model. I agree with separating out business logic operations from the data objects and access methods created by LINQ. I also tend to wrap all data-level operations inside a manager class so I can make the data context an internal class.
Answer: I think the point of Linq is that it replaces your DAL.
The equivalent to your old DAL is all the auto-generated code behinf the DBML files + anything extra that Linq can't do added by you.


Percentage save issue on form submit

Question: I am working in drupal8.I have created five forms all belonging to a single content type.i have around 50 fields in this content type.I have ten fields in a single form.This form has to be filled by the applicant.For each form we have given 20% completion.If i fill one form i shld get 20% completed.If i fill next from i shld get 40% completed and so on.I have created my form and basic crud operations are done.i dont know how to give this percentage of completion.Plz can anyone suggest how this completion percentage has to be done.
Answer: The reason your current code isn't working is because your submit handler doesn't follow the correct naming convention (i.e. FORM_FUNCTION_NAME_submit) and you don't explicitly attach the submit handler to the form anywhere so it's not being run.
You can solve this by simply changing the nameof your submit handler:
function example_form_form1_submit($form, $form_state){

Or you could look at system_settings_form() which automates much of this process for you.

Percentage save issue on form submit


A number and its square

Question: Find a four-digit number which is equal to the four least significant (rightmost) digits of its own square.
Comment: If i understand this correctly you want us to give a number like 1111 and square it (which would make: 1234321) then the 4 right most digits (4321) should be 1111 again? (obviously 1111 doesn't work but it's a simple example)
Comment: @VincentAdvocaat Exactly.
Comment: So if i'm not a total fool the last number must always be 5 or 6 (xxx5 or xxx6) since those 2 are the only once to produce their same number onces squared (5^2 = 25 and 6^2 = 36). hmm interesting.

O great whilst typing this JLee came up with an answer, too bad.
Comment: This might have been better with a [no-computers] tag
Comment: except brute forcing is the only answer (so it seems) so that makes it a bit impossible with no computer..
Comment: The math was cute but I didn't feel like this was actually a puzzle, more a math problem.
Answer: The equation
$$x^2 = x \bmod 10^4$$
is true exactly if $10^4$ is a divisor of $x (x -1)$. This requires that the prime factorizations of $x$ and $x-1$ jointly contain $2^4$ and $5^4$. Since they are relatively prime, each of $2^4$ and $5^4$ must be divisor of one of them. A factor of both would be a multiple of $10^4$ and thus not 4 digits, so each number must be a multiple of one factor:

$2^4 \mid x $ and $5^4 \mid x-1$, or
$5^4 \mid x $ and $2^4 \mid x-1$

We can use the Chinese remainder theorem algorithm to find the corresponding residue classes

$x = 9376 \mod 10000$
$x = 625 \mod 10000$

The second doesn't correspond to any four-digit numbers, so the only solution is $9376$.
Answer: I think this is the only one:

9,376 * 9,376 = 87,909,376
Comment: it's an:  automorphic number, [wikipedia has an article about it](http://en.wikipedia.org/wiki/Automorphic_number) and it has an algorithm for finding out how many of those numbers there are in the given number space. though i don't know of something to make it easyer to find them
Comment: Yes, normally there would be two of them of a given length, but $0625$ fails due to the leading zero.
Comment: @VincentAdvocaat - Thanks for the link. Maybe I am a nerd, but I was expecting an ideal answer to incorporate how this is realized (i.e. the algorithm).
Comment: @Snowbody:  no, it is not a coincidence. When there are two $n$ digit automorphic numbers they sum to $10^n+`1$.  For example $25^2=625, 76^2=5776, 25+76=101$.
Comment: I am curious in what Kik was asking as well.  A program can easily get it but is there like a general formula / strategry that's associate with?
Comment: Is it just a coincidence that the sum of the actual answer and the spurious (three-digit) answer is 10,001?
Comment: @TheDarkSide i know what you mean, i get excited about math as well (sometimes). It can be really fun in cases like these.
Comment: @RossMillikan nice :) the wikipedia article said something about that but i didn't quite understand, now i do thanks :D
Comment: If 0625 is allowable then so is 0000, but it's not, so it's not :-).
Answer: Its 9376. I ran a brute force and calculated it using below program.
<code>#include<cmath>
#include<iostream>
using namespace std;
int last4digit(int n)
{
        int x = n / 10000;
        n -= x * 10000;
        return n;
}
int main()
{
    for (int i = 1000; i < 10000; i++)
    {
        if (i == last4digit(pow(i, 2)))
            cout << i;
    }
    system("pause");
    return 0;
}
</code>
Comment: So, this is getting downvoted while [an answer with even less explanation](http://puzzling.stackexchange.com/a/11969/4551) is at +10/-0?
Comment: Hmm, sort of unlucky that you answered late.
Comment: @xnor Well, at least the other answer showed _why_ 9376 works.
Comment: @randal'thor i edited and gave the solution to find it.
Comment: @KishanKumar Thanks for editing! :-)
Comment: It was my mistake to not include the solution before. Thanks for reminding. @randal'thor
Answer: My solution with no knowledge of the Chinese remainder theorem and no sophisticated thinking!
It must end in 5 or 6 (0² and 1² are of course equal to 0 and 1 but the 'tens' digit always fails)
Choose 5 or 6 and and let the first, second and third digits be a,b,c. I'll use 6.
Treat it as if abc6 were a proper decimal number and square it by long multipication, spacing the columns wide enough, though we only need the four rightmost columns (bc in the 'thousands' column will mean b×c thousands etc)
I'll put in more steps than I suspect are needed, for clarity:
<code>   a         b      c     6
  ~~~~~~~~~~~~~~~~~~~~~~~~~
  6a        6b     6c    36
  bc        c²     6c
  bc        6b
  6a
 ___________________________
 12a+2bc  12b+c²   12c  36     then tidy a bit

  2a+2bc+b 2b+c²+c 2c+3  6

Using ≡ to mean is equivalent to, mod 10;
and working columns right to left

2c+3 ≡ c
c+3 ≡ 0
c = 7         2c+3 = 17 so add 1 to next column

2b+c²+c+1 ≡ b
 b+57≡0
 b=3          2b+c²+c+1 = 63 so add 6 to next column

12a+2bc+b+6 ≡ a
11a+42+3+6 ≡ 0
11a+51 ≡ 0
  a+1 ≡ 0
  a=9

So answer = 9376
</code>
It is even easier for the other solution leading to 30 ≡ a at the end.
With a little care this technique can of course be used in other bases than 10, and any number of final digits.
<code>Update: This was a dangerous question for me; I tried it in base 60,
like the Sumerians used. Here's the six results
complete with squares, and translations into base 10.
With the sums at the bottom:

   44,45,56,16     33,23,57,41,44,45,56,16   966 9376    9349683222 9376
   50,22,13,21     42,17,10,28,50,22,13,21  1088 0001   11837442176 0001
   24,51,50,25     10,18,13,07,24,51,50,25   537 0625    2884361289 0625
   35,08,09,36     20,34,32,18,35,08,09,36   758 9376    5759862806 9376
   09,37,46,40     01,32,43,47,09,37,46,40   208 0000     432640000 0000
   15,14,03,45     03,52,05,10,15,14,03,45   329 0625    1082821289 0625

03,00,00,00,03  01,51,58,42,34,00,00,00,03

Notice that pairs add up to 01,00,00,00,00,01 as we might expect,
but also look at the last four digits of the translations.
I didn't expect that. Time for more thinking.
</code>

A number and its square


Data and Database modelling books

Question: I need a suggestion for books for my University. I have a subject called "Data and database modeling" but we lack of books. Our professor gave as barely understandable scripts. This is an official explanation of the subject:Curriculum:
Introduction of data structures used in database modeling. The data structures include data objects, associations between objects and rules for performing operations over objects.
Modelling of databases regarding user demands.
Basic database concepts.
Configurations and commands for certain real databases.
SQL commands for working with databases.
Course goals/Competences:
Data Modeling and design of data structures suitable for optimum operation of databases.
Using the basic set of SQL commands for working with databases.
Any suggestions are welcome :D
Answer: I highly recommend Database: Principles, Programming, and Performance, by O'Neill and O'Neill. Learned from that book for my first database course and loved it.
Answer: I worked as a data modeler at Siebel. One of the books that the Siebel data model is based upon is Data Model Patterns by David C. Hay. The book will not teach you how to build great data models. It is a collection of robust data models that are used in big systems used world wide.
The one book that I have used (in teaching) that focusses solely on data modelling is the text book "Data Modelling and Database Design" by Richard Scammel and Narayan S. Umanath.
Both of the above books are available on Amazon.com
Answer: A simple search at Amazon for "database modeling" will turn up several books. Any of their top choices would be suitable.

Data and Database modelling books


Can I get google to ban a spamming site from Adsense ?

Question: I've noticed a "site" that stole some of my content and they are displaying google ads. Not responding to my email. I'm quite certain that most of their content is stolen, either from other sites or from newsgroups. Whom should I contact at google so that they would hopefully deprive that site of their only source of income?
Comment: What a pitty,because of Google Adsense income,internet has started to be a rabbit.Most of blog sites have stolen articles and this is only to provide google adsense income. There is not anything to prevent this. My web sites' contents also have been stolen many other web sites.But Google knows which is the original conent and which is copy for the Google rank of these kind of web sites but it takes time.
Comment: on the contrary. Many people are now trying to bring high quality content to the web. Same incentive: traffic and the outlook of money!
Comment: @Lo-lsauer I think many people still do the bare minimum to rank for certain keywords.
Answer: I used Google to find this (emphasis mine):

If you've found a site violating the AdSense program policies, please
let us know. The information you provide will be forwarded to a
specialist for further review.
Some issues require specific information for an investigation to be
completed. Those issues include:

Copyrighted content: Distribution of my copyrighted content without my
permission

Unauthorized ad code on my site: Ad code was placed on my
site without my permission.

Ad complaints: Send feedback about a
specific Google ad displayed on a website.

If the violation you've noticed is related to AdSense, but doesn't fall into one of these
categories, then please use our violation report form. Alternatively,
you can report a site through the "Ads by Google" or "AdChoices" logo
which is displayed on each ad unit. Simply click "Ads by Google" or
"AdChoices" on the site you'd like to report, and then submit your
feedback on the resulting page.


How can I automatically insert fuel into an Alchemical Furnace?

Question: I have an enormous, golem-automated setup to feed crafting tables into a hungry node to power it up, but in order to keep the Automagy golem crafting tables running, I require Fabrico essence. I have an alchemical furnace that creates Fabrico from some of the crafting tables, and a golem feeding in more crafting tables, but I can't figure out how to feed fuel into the furnace. Both golems and hoppers just put things into the upper slot, instead of the fuel slot. Is there any way to load fuel into it?
Answer: I got an answer from the Thaumcraft thread on the Minecraft forums. You can have golems place fuel in an alchemical furnace by marking the bottom side of the furnace with the golem bell. The golem doesn't have to be able to actually access the bottom side, fuel can be inserted from any side, but the bottom has to be the marked side.


My trees are being blown too fast and my grass is not affected by my wind physics after a few seconds

Question: So I did a massive mistake with my tree and grass, and did not target this problem before rendering. The leaves on my tree are being blown too rigorously, and my grass stops being blown after 2~3 seconds. What do I do to fix this? Can somebody please fix this for me? I feel like it has something to do with the wind physics. (I cannot add a file as it is too large, so please bear with me).
Answer: As your file is not added so I cannot tell much but still i can give you some idea. I hope your grass is using a particle system and it it is true then you can just increase the strength of wind on grass instead of increasing it overall and for that just go to field weights in particle(Hair) settings and increase the wind strength to 5 - 10 or as high as you need.
Let me know if this works for you.
If not then comment it down and i will try to give you another fix


In Arkham Horror, if a monster surge exceeds the max allowable monsters, does the monster that caused the max to be exceeded get discarded?

Question: If I the outskirts is already at maximum capacity, and I have to add 5 more monsters because of a monster surge, do I empty the Outskirts and then add 4 monsters? More specifically, does the monster that put the outskirts "over the edge" get discarded (the alternative being he gets carried over to the next group of outskirts monsters)?
Answer: Yes. See this example from the official Arkham FAQ, p.12 (emphasis mine):

In a 3-player game, the  monster limit is 6  and  the  maximum number
  of monsters in the Outskirts is  5. There are 3 open gates on the
  board, 6 monsters in  Arkham, and 4 monsters in the Outskirts. During
  the  Mythos Phase, you draw a location that already has  an open gate,
  so you have to draw 3 more monsters.  You would first draw 2 monsters
  and place them in the  Outskirts. The Outskirts limit would be
  exceeded  upon  placing the second monster, so you would then increase
  the terror level by 1 and return the six monsters in the  Outskirts to
  the cup. Finally, you would draw the third  monster and place it in
  the Outskirts.
Comment: I realize now that I worded the question badly. I was actually asking whether the monster that makes the outskirts exceed the maximum allowed is then carried over to the outskirts after emptying it or whether the monster that tips the scales is sent away. I see from your quote that it is sent away. I'll look to clarify the question so people see this distinction from the question.


Question about comeager set in a Polish space

Question: I'm trying to understand a proposition of A. Kechris in chapter 8 of his  Classical Descriptive Set Theory, in which given a non empty metrizable separable space $X$ that is dense in a Polish space $Y$, we have to prove that if $X$ is comeager in $Y$ then $X$ is Choquet i.e. the second player has a winning strategy in the Choquet game on $X$. Of course, $X$ contains an intersection of open and dense subsets $W_n$ of  $Y$ , that also must be dense because $Y$ is Baire. What is the winning strategy for II? I put $V_n=U_n\cap W_n$ but I'm not sure that is correct.
Comment: Perhaps an indication of how the Choquet game goes might be of use (that is, where $U$s and $V$s come from).
Answer: Just a reminder: The Choquet game on $X$ has two players ($I$ and $II$) who alternatively choose open sets in $X$ (resp., $U_n$ and $V_n$ with $n\in\mathbb{N_0}$) subject to the condition $U_n\supseteq V_n\supseteq U_{n+1}$ for all $n\in\mathbb{N_0}$. Player $II$ wins a round if
$$
\bigcap_n U_n =\bigcap_n V_n \neq \emptyset.
$$
In this context, your proposed strategy won't work as it stands, but almost does. Assume $X= Y = (0,1) =W_n$ for all $n$ and $I$ plays $U_n=(0,\frac{1}{n})$. This example makes it clear that you should use the completeness of $\bigcap_n W_n$ somewhere.
Getting into the argument, $G = \bigcap_n W_n \subseteq X$ is Polish with the relative topology; choose a complete metric $d$ for it. Now the strategy for $II$ is to take $V_n\subseteq U_n\cap W_n$ such that $\overline{V_n}\subseteq U_n$ and $\mathrm{diam}(V_n)<2^{-n}$. Since $W_n$ is open and dense, we can ensure that each such $V_n$ will be nonempty; let $x_n\in V_n$. It is easy to see that $\{x_n\}_n$ is Cauchy in $G$, so it converges to $x\in G$. This $x$ must belong to
$$
\bigcap_n \overline{V_n} =\bigcap_n U_n,
$$
hence II wins this play.
Answer: As $Y$ is a Polish space, in particular $Y$ is completely metrizable, therefore $Y$ is Choquet. Also $\bigcap_{n\in\omega}W_{n}$ is a dense $G_{\delta}$ set in $Y$, it follows that  $\bigcap_{n\in\omega}W_{n}$ is also Choquet. Then using the winning strategy of Player II in the Choquet game played in $\bigcap_{n\in\omega}W_{n}$, we can build a winning strategy for Player II in the Choquet game played in $X$.


How can I know if fstrim was run when I put my phone on charging over night?

Question: Is there any logging where I can confirm if fstrim was run when I put my phone on charging over night?
Answer: A charging, idle device over night is not the only way to run fstrim, there are other ways, too.
Quoting from this old article about scheduled fstrim on Android:

The Android framework will send out a "start idle maintenance window" event that the MountService listens for, and then invokes vold to fstrim filesystems when a few conditions have been met – the device hasn't been touched for over an hour, no idle maintenance window event has been sent in 24 hours, and the device is either off-charger with 80% battery or on-charger with 30% battery.

But IdleMaintenanceService was removed in Lollipop, things have changed. On Pie, scheduled fstrim is triggered from StorageManagerService (1) to MountService (2):

if the device is alive at midnight + idle, fstrim gets run at the next available charging + idle time

* (3)
Mount service calls StorageManager which in turn calls Vold to do fstrim.
If the schedule is being missed because the conditions aren't met and fstrim has not run for the last 3 days (4), it will be forced during device startup if the device is restarted. SystemServer (5), PackageManager (6), StorageManager (7) and Vold (8) are involved.
In each case, the file /data/system/last-fstrim (9) (since Lollipop) gets updated (10), so you can check its timestamp (requires root) to find out when fstrim was last run.
If you want to do TRIM manually, use Android's commandline tool sm fstrim (requires root or adb shell). Previously this was vdc fstrim dotrim but added to Storage Manager in Oreo (11) and removed from vold in Pie (12).
In order to send FITRIM ioctl to selected filesystem(s) only, use the fstrim tool (requires root); a BusyBox applet.

What if you don't have root?
And you suspect that the scheduled fstrim is being missed for 3+ days, restart the device, fstrim will be forced (since Lollipop 5.1 (13)). Simple.
Apps can't TRIM without root; see this answer.

PS: HOW OFTEN TRIM SHOULD BE RUN?
Flash memory (including SSDs, eMMCs, SD Cards, USB sticks etc.) has a limited number of Program/Erase (P/E) cycles before it dies. But unlike HDDs, data can't be just overwritten on flash memory, it has to be erased first, which is achieved through garbage collection (GC).
Now if we do too much fstrim, this will cause frequent GC in the background consuming precious P/E cycles and hence reducing life. If we don't do fstrim at all, there could be unnecessary GC (of already deleted data), plus the write operations will get too slow with time because erasure will have to be performed before overwriting data, which has significantly higher latency compared to the program operation.
So we need a balance between both.
Also there are other factors e.g. whether eMMC controller supports over provisioning, how effective it is in background GC scheduling, wear-leveling and managing write amplification etc.
So unless you have the data sheet of your phone's eMMC and you are sure what you are doing, it's better to leave the fstrim to the OS. On PCs (14):

Running fstrim frequently, or even using mount -o discard, might negatively affect the lifetime of poor-quality SSD devices.  For most desktop and server systems a sufficient trimming frequency is once a week.

But this may vary depending on the situation.
RELATED:

Coding for SSDs
Why is TRIM not supported on encrypted "/data" partition?
Comment: I have a question. I understand that I shouldn't run trim too often but can "sm trim" work without root through adb?
Comment: Yes, because shell has MOUNT_UNMOUNT_FILESYSTEMS privileged permission granted by default, so must work without root. But there could possibly be other issues like a bad SELinux policy may not allow this. Also TRIM on encrypted `/data` partition is tricky.
Comment: Is there a way for non-root users to find out when TRIM was last run? I'm on a Pixel 6 Pro running GrapheneOS, if that makes things easier.
Comment: @MatthiasBraun you may find traces in `logcat`, `dumpsys`, `dropbox` etc. I've never tried though.


Examples of functions f(x,y)

Question: i need to find examples of functions $f(x,y):x,y $ belong to $R^2$
such that: $f$ is constant on the parabolas $y=c(x^2+1)$  c belongs to $R$. And the second one should be bounded on the unit circle, but not bounded on $x^2+y^2<4$. Any suggestions?
Answer:
If $f$ has to be constant on the parabolas $y = c(x^2+1)$ for a fixed $c$, then you need that $f(x,c(x^2+1)) = a$ for a constant $a$. A constant function would of course work, and a simple (non-constant) example would be
$$f: \mathbb{R}^2 \to \mathbb{R}: (x,y) \mapsto y -c(x^2+1)$$
If you want a non-constant function independent of $c$, you could use
$$f: \mathbb{R}^2 \to \mathbb{R}: (x,y) \mapsto \frac{y}{x^2+1},$$
which is well-defined since $x^2+1 > 0$ everywhere, and on the parabolas $y = c(x^2+1)$ it is constant, with its value being $c$.
In polar coordinates, this would mean that $f(r,\theta)$ is bounded when $r = 1$ but unbouded for the area $r < 2$. A simple example would then be
$$f: \mathbb{R}^+ \times [0,2\pi) \to \mathbb{R}: (r,\theta) \to \frac{1}{2-r}$$
which is bounded on the unit circle since it has the constant value $1$ there. But it is unbounded in the area $r < 2$ since
$$\lim_{r \to 2} \frac{1}{2-r} = \infty$$
In Cartesian coordinates, this function would be
$$f: \mathbb{R}^2 \to \mathbb{R}: (x,y) \to \frac{1}{2-\sqrt{x^2+y^2}}$$
Comment: For the first example i could've just said f=0 for all x,y and it would've been the same, isn't there an example without this c?
Comment: @CodeHoarder Indeed, constant functions would of course have done the trick. I've added an example of a non-constant function that does not depend on $c$ (but its constant value on the parabolas mentioned is $c$, though).
Comment: Thanks man, seems so obvious now haha.

Examples of functions f(x,y)


Is the same vCPE as SD-WAN?

Question: I am a little bit confused about both terms, since doing research they are being used interchangeably. Does someone can give an exact definition, or even better, examples?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: No, but they can be used together.
vCPE is literally just a virtualised CPE appliance - eg: instead of deploying independent Router, Firewall and WAN Accelerator physical appliances in a site, you would simply deploy a compute node (hypervisor) running virtual instances of each, the main benefit being that if you decide to add some other functionality in the future, there is no need to re-visit/ship to every physical site, you would simply spin up new functionality.
SD-WAN at the most fundamental level is orchestrated overlay networking for the Wide-Area Network.  In my mind, the major goal of SD-WAN is to present a single coherent Wide-Area network, regardless of service availability in each location eg: you can use a combination of fixed-line Internet services (from different providers), fixed-line MPLS VPN (from different providers), wireless services (from different providers) based on what is available in that locality, and SD-WAN will provide an overlay that hides this underlying complexity and fail-over.  Again, massively simplifying large roll-outs, WAN migrations and mergers & acquisitions.
Under the hood, most offerings are essentially just IPSEC VPN (think DMVPN/ADVPN rather than hub-and-spoke), but orchestrated from a central location, taking care of the orchestration of provisioning, routing and fail-over.
To come back to your question though, depending on the vendors, SD-WAN appliances could be deployed on vCPE (using a virtualised instance of the SD-WAN software), OR the SD-WAN Appliance could also host vCPE (as some run hypervisors themselves).

Is the same vCPE as SD-WAN?


How can I define which fields are searched?

Question: I am trying to adjust the fields that are being searched on the account. For example, when a user searches for an account via the global search, I only want Salesforce to search the Account Name and Parent Account Name fields. Is that possible?
Thanks in advance, Lily
Answer: Im not sure if you can filter the results directly but this might help.
After you perform the global search you will end up with your search results. Something like:

Once you focus in on the Account (Organizations), you will see a Customize option in the top right corner:

An option within Customize is Filter for all users. Here you can select the filter fields to include in this search layout.


disable Vimperator temporarily

Question: How can I disable Vimperator temporarily? For example, I'd like to disable Vimperator temporarily when I am using a web email app. Is there a command for it?
Comment: `` or `` key to disable all Vimperator keys temporarily, enable it by hitting the key again. This feature may be introduced into Vimperator after Jan 11 2013.
Answer: Use Shift+Esc to temporarily disable Vimperator. Press it once again to make it work
Comment: Any idea what the equivalent is for Pentadactyl?
Comment: @winchendonsprings Use **passkeys** command

`:set passkeys+=gmail.com:`

This will ignore the Escape key on Gmail site.
Answer: I am guessing you already know about Shift-Esc to temporarily disable vimperator. So I wrote how to disable vimperator based on your current location.
First, the solution:
autocmd LocationChange .*                             js modes.passAllKeys = false
autocmd LocationChange mail\\.google\\.com            js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/calendar    js modes.passAllKeys = true
autocmd LocationChange www\\.google\\.com/reader      js modes.passAllKeys = true
autocmd LocationChange mail\\.google\\.com/tasks      js modes.passAllKeys = false

This filters gMail, gCalendar, gReader, but not gTask.
The solution I gave is cascading approach where you define all websites to enable vimperator, then it selectively disables for each website. Thus, even though gTask uses the same parent site as gmail, it has vimperator enabled.
Now the explanation:
These commands go in your .vimperatorrc in the home directory. You can change the location of the .vimperatorrc by
source! *directory*

in .vimperatorrc file, but the default location is .vimperatorrc file in your home directory. (%userprofile% in Windows)
The alternative solution:
autocmd LocationChange .* js modes.passAllKeys = /mail\.google\.com/.test(buffer.URL)

*Notice the backslash to escape the dot.
The problem with this approach is that only the latest line of command with autocmd will take work. Meaning the last autocmd command overwrites the first. So you would end up resulting to boolean operation on the command, like this:
autocmd LocationChange .* js modes.passAllKeys = /(mail\.google\.com|google\.com\/reader)/.test(buffer.URL)

As you can see this can get complicated when you have many websites you want to filter out.
The documentation:
http://vimperator.sourceforge.net/help/vimperator/autocommands.xhtml
  Source of the solution:
http://code.google.com/p/vimperator-labs/issues/detail?id=406
Answer: you could use :ignorekeys command
ignorekeys add mail.yahoo.com
ignorekeys add mail.google.com

to disable all vimperator keybinding when on those domains.
Comment: What is the advantage of this over the other solutions?
Answer: You can use the keyboard-shorcuts for gmail/feedly with feedSomeKeys (a plugin for Vimperator).
How?

Get this and this files.
Copy both files in ~/.vimperator/plugins (if doesn't exist create it).
Add this lines in your ~/.vimperatorrc file:
:source ~/.vimperator/plugin_libly.js
:command! -nargs=+ lazy autocmd VimperatorEnter .*
:lazy fmaps -u='mail.google.com/mail' c / j k n p o u e x s r a # [ ] ? gi gs gt gd ga gc
Try it!
Comment: I can't add more than two links, so you have to google the gmail shorcuts. I recommend that clone the vimperator-plugin directory, so you can find one that like you: git clone https://github.com/vimpr/vimperator-plugins.git
Answer: With autocmd solution, it could be annoying that every time message "Executing LocationChange Auto commands for ..." appears.
In latest version of vimperator (3.8.3) this message is not displayed by default, only in verbose mode. But current version in Firefox Addons is 3.8.2, so we need to install it manually. Simple as:
git clone https://github.com/vimperator/vimperator-labs.git .
make xpi

Then install vimperator from downloads directory.

disable Vimperator temporarily


Overriding function of a deployed contract

Question: Suppose I have token contract which is already deployed into the network. I want to make change one of its function without redeploying it. How to do this? Is it possible to override its function?
Answer: You cannot directly change the code of a deployed contract.
Depending on the code of the function you want to override, you might be able to create a wrapper contract to simulate a change in the code. Whether this is possible depends on the details of the change you want to make.


How to create diagonal blurring and smoothing effect?

Question: How is the diagonal blurring and smoothing effect in this photograph achieved? I know it was taken on an iPhone (by photographer Karen Axelrad) with a shutter delay app. What post process creates such a look?

Answer: I took this photo on an iPhone using the SlowShutter app. It was processed in the iColorama and Brushstroke apps and then blended in SuperimposeX app.
Comment: A couple of links would be helpful.
Comment: Hi Karen! Welcome to Photo-SE! It's always great when photographers come in and answer questions about their work. =)
Answer: I notice 2 things about this image that stand out. It's not clear if they're the same 2 things you're seeing, but what I see is a slight diagonal blurring, and a smoothing effect. The diagonal blurring can be achieved in-camera by moving the camera during a long exposure. (In this case, "long" could still be a fraction of a  second, but enough to get just a little motion.) It could also be done in post using a Directional Blur (sometimes called "Motion Blur") filter. It performs a blur along a line.
The smoothing effect looks to me like a median filter. A median filter smooths out similar areas while preserving sharp edges.
Answer: If you don't mind command-line processing, Fred's ImageMagick Scripts may be helpful.
There are over 350 image-manipulation scripts there, including six that have "blur" in their name. They all come with embedded textual documentation, and the website has photo examples for many of them, too.
In particular, camerablur -t motion -r 45 filename looks like it might do what you want.
# USAGE: camerablur [-t type] [-a amount] [-r rotation] infile outfile
# USAGE: camerablur [-h or -help]
#
# OPTIONS:
#
# -t     type          type of blur; choices are: motion (or m) or
#                      defocus (or d); default=defocus
# -a     amount        amount of blur; either length of motion blur or
#                      diameter of defocus; float>0; default=10
# -r     rotation      rotation angle clockwise from horizontal for the
#                      motion blur; floats; -180<=rotation<=180; default=0
#


What does the horizontal bar indicate in the DMM display?

Question: What does the horizontal bar indicate and how to use it in my measurement?
Comment: That horizontal bar means your Fluke 87 is defective and you should send it to me, immediately. I'll replace it with a Regal DT830B right away! -- Not really. That's a joke. The horizontal bar there just means a "% of scale." You can see the "6" there? The 2.3 reading is about that % of the 6 V scale. You are in "auto-ranging mode." You really should read the manual. ;)
Comment: what have you observed about the bar?
Comment: But if you find RMS is too wonky, jonk will accept trade-ins to analog
Comment: @Sonder You should also buy an analog meter for such things. I'd recommend something cheap but good: a TekPower TP7040. There are advantages to having an analog meter for some cases (such as the one you may be talking about.) And the unit is quite cheap (about 1/20th the price of the Fluke you have.) To see why, set up a signal generator to provide a sine wave at \$1\:\textrm{Hz}\$ that varies from about \$3\:\textrm{V}\$ to about \$7\:\textrm{V}\$. Then try and use the Fluke 87 and then also the TP7040 on the signal. You'll see quickly why you want an analog, also. Worth a few extra to have.
Comment: @Jonk Sir, then it will help to read the voltage properly (average reading) if the votlage is fluctuating in Volts.. say jumping from 2 V to 4 V, for example.. am I right?
Comment: @TonyStewartSunnyskyguyEE75 I think Jonk should wire the shipping charges first .
Answer: That bar at the bottom of the screen simulates an analog meter - the length of the bar increases with increasing digital readings.  It is often easier to observe a varying voltage by looking at the bar than trying to interpret rapidly changing digits.
Answer: From the Fluke 87V datasheet page 11 point 18 :

The number of segments is relative
  to the full-scale value of the
  selected range. In normal operation
  0 (zero) is on the left. The polarity
  indicator at the left of the graph
  indicates the polarity of the input.
  The graph does not operate with
  the capacitance, frequency counter
  functions, temperature, or peak min
  max. For more information, see
  "Bar Graph". The bar graph also
  has a zoom function, as described
  under "Zoom Mode".
Comment: The +1 from me will be visible after I gather some points. Thanks.
Answer: The bar is a fast-responding 'analog meter', that can be useful for following variations in the input voltage, for instance when you're adjusting a circuit with a potentiometer in real time.
In the Fluke I had, the digital display updated once per second to 3200 count resolution, while the 32 step bar updated at 25Hz.
This was introduced shortly after DMMs were to counter the criticism that analogue meters were better when you had a varying input and could watch the needle swing in real time. Waiting a second for the digits, and then needing to think what they meant, makes tuning circuits unnecessarily awkward.
Comment: Your last paragraph is the best answer
Answer: I know this question has been answered, but I don't agree with the answer.
The horizontal bar shows you how much of your current range you have used up, ie. how much the voltage/current/whatever can change before the meter has to switch to a higher input range
Anyone who has spend hours upon hours using a multimeter will understand why this is usefull; sometimes when you are measuring for instance a voltage with a multimeter what you are measuring might be very close to the upper bound of one range, and so it can happen, at least with some older multimeters, that the range selection will start toggling between two ranges, which can be super annoying. If you are measuring something which you know has spikes that are larger than what you are trying to measure then the horizontal bar will give you an indication of whether the spikes that can occur will be likely to cause the multimeter to change range while you are measuring, letting you change to a higher range if what you are measuring is close to saturating the value of the horizontal bar..
Without the horizontal bar you can have no way of knowing, by just looking at the reading from the multimeter, how much of the current range you are using.
The bar is also useful in the case that you are using manual range, because it may tell you that what you are measuring is only using up a small part of the current range, ie. you are not getting the full resolution of the instrument, knowing this you can turn down the range to use up more of the range of the instrument for you measurement and hence get better resolution.
Several of the answers here claim that it is for DMMs to "compete" with analog meters. I very much disagree with that, DMMs are inherently faster than analog meters, although you might not be able to rapidly read the changing numbers on the display, there is a physical limit to how fast the nedle on an analog meter can move as well, and it is driven by a coil which futher limits its bandwidth. Besides, looking at the bar moving back and forth might let you know the voltage is changing, but not by how much, as you have no way of knowing how large a value a certain size of bar corresponds to. And besides; You're an idiot if your trying to measure a changing voltage (other than pure AC) using a multimeter rather than an oscilloscope.
Comment: Vinzent, I have often used a multimeter to measure changing voltage using a multimeter when an oscilloscope was not available and Im not an idiot.
Comment: @Transistor I didn't mean to offend anyone with that statement, you're obviously not an idiot for using what is available to you, I meant it more in the sense that if you intentionally use the multimeter rather than an oscilloscope because you think that bar is good enough for that job in general, then you're likely making a mistake.. that sayed some people choose to get offended, some don't.
Answer: Digital multimeters have measurement ranges like 0-200 mV, 0-2V, 0-20V, 0-400V etc.
Bar graph shows how near you are to the end of one range.
Comment: Maybe saying that "the bar graph shows an analogue reading relative to full scale" might be a better way of saying it.


What shouldn't be dumped into a basement dump sink?

Question: We have a dump sink in the basement that uses a pump system, much like a closed sump-pump, to force the water up into our main drain out of the house. Because the pump system holds a bit of water before it activates, I'm wondering if there would be any foreseeable issue with certain things going into the closed-pump system (i.e. last sips of soda, warm & flat beer, soapy water from hand-washing, any other common sink-functions) from the dump sink?
Comment: Sewer pumps are designed for specific uses and their ability to handle different liquids and solids varies hugely.   Read the documentation for your specific one.   The biggest enemies are fats that harden when slightly cooled (eg chicken fat, olive oil, soap), and fibrous materials (dental floss, tampon strings, corn husks, etc).   IMO for most residential basement pumps you shouldn't worry about the freshness of the holding tank.  Sure you can flush with water but unless the  tank is tiny you shouldn't.  Unless, of course, the instructions say you should.
Comment: @crip659  I agree and this should be an answer.  Also, OP should flush out system by running clean water down the dump sink after use.
Comment: I have one in my shop, it doesn't get used a lot, so every once in a while I'll dump about a half cup of bleach in it.
Comment: Soda, beer, and soap would probably turn quite nasty if left sitting for a few days.  Any solids, fat, and grease should be a no-no.  Giving a dose of disinfectant once in a while would not hurt.
Comment: @jay613  I consider this a better answer than my comment.  Go for it.
Answer: Sewer pumps are designed for specific uses and their ability to handle different liquids and solids varies hugely. Read the documentation for your specific one.
The most common enemies:

For all drains, not just pumped ones: Fats that harden when slightly cooled.  EG, chicken fat, olive oil.  If it's solid in the fridge but liquid when you pour it down the drain, the drain will suffer.
The combination of hair with congealed hair conditioner and soap.  This would be a particular problem to a sewer pump that is not designed for it, eg. if you use a bar sink pump for a shower.
Strong fibrous materials.  The most common offenders are dental floss and tampon strings.  There are large commercial pumps that can handle these but a lot of residential basement pumps even when designed for solid waste will choke on these.  Some cheaper pumps even require you to use cheap toilet paper to avoid the stronger fibers in the more expensive ones.
Certain strong cleaning agents.  Some pumps include instructions to avoid certain cleaning materials or to only use special ones, in order not to harm the pump parts.

As for beer etc, to answer that part of the question: IMO for most residential basement pumps you shouldn't worry about the freshness of the holding tank unless the instructions say you should. Sure you can flush with water but unless the tank is tiny you shouldn't.   It's part of the sewage system and should be expected to normally contain sewage.
Answer: I would mainly be concerned with hair in a basement dump sink.   If anyone using it has long hair I would strongly strongly suggest a basic drain filter.   I bought a magnetic one that I thought was a PITA but it was actually so easy to use that I didn't mind dumping stuff out once a week or so into a trash.

That being said you cannot put large items down (chunked mud, pasta, potato).   That is just a no and again why a strainer/filter will save you lots of headaches.
So....
1. Get a strainer that works well with your sink.   The amount of water and exit size will determine what you get.   Don't make your sump pump a strainer... they are very bad at doing this.
2. Flush the sink out after heavy/weird usage.   Do not let oils and dirt sit in sump.   Run water after each heave usage.   The worse kinds of things, the more and the hotter the water.   Just doing this could keep the system running 100% with little maintenance.   Forget 1-2 times and you will need a new pump.

What shouldn’t be dumped into a basement dump sink?


What present-day monarchs descend from Rodrigo de Borgia, a.k.a., Pope Alexander VI?

Question: I understand all enthroned and dethroned Catholic royal families (except for the Grimaldis) and even some Protestant German royal families like Hessen, Mecklenburg and the Prussian Hohenzollern descend from Pope Alexander VI — via his daughter Lucrezia — but I am not sure whether some other Protestant families currently reigning share this controversial and colourful ancestor.
Answer: PART ONE:  General discussion.
Here is the simplest way I know to research such questions:
Here is a link to the surnames list at the Genealogics website.
http://www.genealogics.org/surnames.php1
So one would select the latter B:
http://www.genealogics.org/surnames-oneletter.php?firstchar=B2
And then select the surname Borgia:
http://www.genealogics.org/search.php?mylastname=BORGIA&lnqualify=equals&mybool=AND3
And then select the Borgia person you want to look at - presumably Lucrezia Borgia born 1480, since you seem to state that she was Aexander VI's only child to have descendants among modern royalty:
http://www.genealogics.org/getperson.php?personID=I00002961&tree=LEO1
Then link on the tab to show her descendants.  You can choose how many generations to show, up to eight (the person and 7 generations of descendants) or even select show all descendants - which should be a very large file.
In the 7th generation Eleonore Gonzaga (1630-1686) should be a good lead to follow.  She married Emperor Ferdinand III and their great grandson Emperor Francis I married Maria Theresa and was the ancestor of the House of Habsburg-Lorraine.  If you can find any  members of the House of Habsurg-Lorraine who married into Protestant families then you can find Protestant descendants of Lucrezia Borgia.
In the 6th generation Anne Gonzaga (1616-1684) married a protestant, Edward, Count Palatine of Simmern (1625-1663), who converted to Catholicism.  Thus their Catholic descendants were ineligible to inherit the English throne.
So this is my suggestion for researching whether there are any Protestant descendants of Rodrigo Borgia.  I hope it helps you find out.
Wait, I just noticed that your question mentions some Protestant dynasties you think are descended from Rodrigo Borgia, specifying Hess, Mecklenburg, and the Prussian Hohenzollerns.
King Christian IX of Denmark, called "the Father-in-Law of Europe" because of all the royal marriages made by his children, married Louise of Hesse-Kassel (1817-1898)  If Louise of Hesse-Cassel was descended from Rodrigo Borgia then all the Protestant and eastern orthodox descendants of King Christian IX also are.
Added 03-16-2019.  The original question mentions three protestant Dynasties, the Hessen, Mecklenburg, and Hohenzollern dynasties, that were descended from Rodrigo Borgia.  However, those dynasties had many different branches.
Adolphus Fredrick II (1658-1708), the first Duke of Mecklenburg-Strelitz, doesn't seem to be descended from Rodrigo Borgia.  https://en.wikipedia.org/wiki/Adolphus_Frederick_II,_Duke_of_Mecklenburg-Strelitz2
Frederick II (1717-1785), Duke of Mecklenburg-Schwerin, doesn't seem to be descended from Rodrigo Borgia.  https://en.wikipedia.org/wiki/Frederick_II,_Duke_of_Mecklenburg-Schwerin4
Charles I, Landgrave of Hesse-Kassel (1654-1730) seems to have had no descent from Rodrigo Borgia.   https://en.wikipedia.org/wiki/Charles_I,_Landgrave_of_Hesse-Kassel#Ancestry3
Ernest Louis, Landgrave of Hesse-Darmstadt (1667-1739) seems to have had no descent from Rodrigo Borgia.https://en.wikipedia.org/wiki/Ernest_Louis,_Landgrave_of_Hesse-Darmstadt5
King Fredrick I of Prussia (1657-1713), of the House of Hohenzollern, doesn't seem to have had any descent from Rodrigo Borgia. https://en.wikipedia.org/wiki/Frederick_I_of_Prussia#Ancestry6
Christian-Ernest Margrave of Brandenburg-Bayreuth of the House of Hohenzollern (1644-1712), doesn't seem to have had any descent from Rodrigo Borgia. https://en.wikipedia.org/wiki/Christian_Ernst,_Margrave_of_Brandenburg-Bayreuth7
William Frederick, Margrave of Brandenburg-Ansbach of the House of Hohenzollern (1686-1723), doesn'tseem to have any descent from Rodrigo Borgia.  https://en.wikipedia.org/wiki/William_Frederick,_Margrave_of_Brandenburg-Ansbach8
The branches of Hohenzollern-Hechingen and Hohenzollern-Sigmaringen are Roman Catholic and not protestant.
If any later members of the houses of Mecklenburg, Hesse, and Hohenzollern were descended from Rodrigo Borgia, it would have to be through marriages with members of other dynasties.
PART TWO:  List of marriages of Borgia Descendants with Protestants.
As was said above:

King Christian IX of Denmark, called "the Father-in-Law of Europe" because of all the royal marriages made by his children, married Louise of Hesse-Kassel (1817-1898)  If Louise of Hesse-Cassel was descended from Rodrigo Borgia then all the Protestant and eastern orthodox descendants of King Christian IX also are.

Louise of Hesse-Kassel was the great great great granddaughter of Charles I of Hesse-Cassel who doesn't seem to have been descended from Rodrigo Borgia.  So if she had any descent from Rodrigo Borgia to transmit to her Protestant descendants it would have come from one of the wives in her ancestry.
https://en.wikipedia.org/wiki/Louise_of_Hesse-Kassel
As I wrote above:

In the 7th generation Eleonore Gonzaga (1630-1686) should be a good lead to follow. She married Emperor Ferdinand III and their great grandson Emperor Francis I married Maria Theresa and was the ancestor of the House of Habsburg-Lorraine.

So I tried looking at the descendants in 8 generations of emperor Francis I and Empress Maria Theresa.
http://www.genealogics.org/descendtext.php?personID=I00000016&tree=LEO&display=block&generations=89
A 7th generation descendant, Marie of Orleans, married Prince Valdemar of Denmark (1858-1939), their daughter was a Catholic and their sons were Lutherans.
A descendant of Emperor Francis I in 6 generations, Leopoldine of Brazil, married Prince Ludwig of Saxe-Coburg & Gotha (1845-1907) and had many children.
A descendant in 6 generations, Archduchess Margaret Sophie, married Duke Albreacht of Wurttemburg (1865-1939), head of the House of Wurttemburg.  Since different branches of the dynasty were Catholic or Protestant I forget whether this branch  is Protestant or Catholic.
A descendant in 6 generations. Maria Louisa of Bourbon-Parma, married King Ferdinand of Bulgaria (1861-1948).
A descendant in 7 generations, Princess Maria de las Mercedes of Spain, married Prince Iraklij Bagration-Muchransky (1909-1977).
A descendant in 7 generations, Archduchess Illona, married George, Count of Carlow and heir of Mecklenburg-Strelitz (1921-1926).
A descendant in 7 generations, Clothilde, Princess Napoleon, married Sergei, Count de Witt (1891-1990).
A descendant in 7 generations, Mafalda, Princess of Savoy, married Prince Philip of Hesse (1896-1980).
Her sister Giovanna, Princess of Savoy, married Boris, King of Bulgaria (1894-1943).
A descendant in 6 generations, Antonia, Princess of Portugal, married Leopold, Prince of Hohenzollern 91835-1905), and their descendants include the Royal family of Roumania.
And there are probably some more examples.
Answer: The (probably incomplete) data from Wikidata shows 12105 descendants of Alexander VI, among them 53 have "ocupation" "sovereign" or a subclass or it and 5 of those 53 monarchs are still alive (no date of death in Wikidata): the incumbent prince of Liechtenstein Hans Adam II, the incumbent king of the Belgians Philip I and his father the former king Albert II, and the incumbent king of Spain Philip VI and his father the former king Juan Carlos I.
Therefore, the answer is that if Wikidata is right, there are three present day monarchs descendants from pope Alexander VI: the monarchs of Liechtenstein, Belgium and Spain. The monarchs of several extinct monarchies (like those of Portugal and Italy) also descended from the pope Borgia.


Recent French national travelling to India without surrendering Indian passport

Question: I have recently acquired French citizenship and currently possess an Indian passport, which I am required to surrender. The necessary document for surrendering my Indian passport, the French nationality certificate, has a processing time of six months. However, I have a trip to India scheduled in three months. I am seeking guidance on how to manage this situation.
Comment: You might want to review [this earlier question, comments, and answer](https://expatriates.stackexchange.com/questions/12521/french-nationality-surrendering-indian-passport?rq=1).
Comment: Thank you, DavidRecallsMonica, for your reference. While I have reviewed the response you mentioned, it doesn't fully address my situation as it involves a person without a French passport, whereas I possess one.
Comment: Yes, that's why I didn't refer to the earlier question as a duplicate, but instead mentioned it for reference.
Answer:
The necessary document for surrendering my Indian passport, the French nationality certificate, has a processing time of six months.

This sounds like a catch22 situation.

I am seeking guidance on how to manage this situation.

Based on the 2017 comment of @user102008, having a french passport is conclusive proof of his having voluntarily acquired the citizenship of that country so that presenting the French nationality certificate may not be the only way to apply for a Surrender Certificate.
Since the Visa Services states that you must disclose all passports '(current/old) held by them', you must inform them of the  Indian passport one way or the other.
So apply for a Surrender Certificate, stating that you have not yet received the nationality certificate but require the Surrender Certificate for the visa application to avoid the application being denied.
Should they refuse, ask that the refusal be given in writing so that you submit that together with the visa application.
This will also show that you are acting in good faith to avoid using your Indian passport after becoming a french citizen.
Getting an OCI (Overseas Citizenship of India) card might also be a better option.

Citizenship Rules, Schedule III, #3:
The fact that a citizen of India has obtained on any date a passport from the Government of any other country shall be conclusive proof of his having voluntarily acquired the citizenship of that country before that date.

5) Passport Surrender and Renunciation:

The Indian Citizenship Act, 1955 does not allow dual citizenship. Holding an Indian passport / acquiring an Indian passport / travelling on an Indian passport after acquisition of foreign citizenship constitutes an offence under the Indian Passport Act, 1967, and attracts penalties. Indian nationals, who have already obtained citizenship of another countries  must renounce/ surrender their Indian passport immediately after acquisition of foreign citizenship.

Visa Services
VISA
Important points to note before you apply

When applying for an Indian visa, applicants are requested to disclose details of all passports (current/old) held by them. Failure to do so may result in rejection of their applications.

Sources:

French Nationality - Surrendering Indian Passport - Expatriates Stack Exchange
Embassy of India, France & Principality of Monaco : Visa Services
Embassy of India, France & Principality of Monaco : Passport Services

Surrender Certificate

Embassy of India, France & Principality of Monaco : Overseas Citizenship of India Services
Comment: @Jerof That is not the question you asked. Any answer to the question in your comment would be purely speculative.
Getting a OCI (Overseas Citizenship of India) card might be a better option.
Comment: @Jerof as I understand it (which is not very thoroughly) you are no longer an Indian citizen because you have acquired French citizenship.  If that is correct then your use of the Indian passport is fraudulent because it amounts to a false claim that you are an Indian citizen.  How likely you are to get into actual trouble for doing this is a separate question, but I reckon that the country you'd be most likely to get into trouble with would be India.
Comment: (+1) Good catch. One question is how the OP acquired French citizenship. I am not up to date on all the procedures, it used to be that you would sometimes receive a national ID card as a matter of course but I think you might now need to apply for it separately after learning of the decision (i.e. the publication of the *décret de naturalisation*) or attending the ceremony. They will also need a passport and that can take some time too.
Comment: Thank you, Mark Johnson, for your detailed response. You addressed traveling to India with my French passport. I'm interested in knowing if there are scenarios where traveling to India with an Indian passport is possible, assuming any required monetary penalties are paid.


If the distribution of dark matter is not uniform, why it is not attracted towards center of galaxies?

Question: The dark matter hypothesis was formed due to difference in theoretical and observed speed of the outer parts of galaxies. Therefore, there is more dark matter in the outer parts of the galaxy than in the center. But, if it interacts gravitationally, why it is not attracted to the center, remaining at the edge of the galaxy?
Comment: *Besides* the good answers below, even if DM would be out of center this, per sé, wouldn't mean no attraction. Even the moon orbits around us, right because there is attraction.
Answer: The usual idea of how dark matter (DM) is distributed in a galaxy is that it is densest in the middle and the density decreases with a slope between $\propto r^{-1}$ and $r^{-3}$. Note that this means that most of the DM mass is further out, but this is mostly because most of the volume is further out.
I suspect your main confusion comes from statements like 'DM is needed in the outer parts of galaxies'. What this means is that the local fractional amount of DM (compared to stars and interstellar gas) is larger in the outer parts of galaxies - in the centre there's still a lot of DM in terms of density, but the density of stars is much higher still, so the relative impact of the DM on the galaxy dynamics is small. There are some galaxies, however, notably dwarfs (objects with stellar masses less than a billion solar masses or so), whose dynamics suggest that the fractional contribution of DM is large everywhere, including at the very centre.
Answer:
Therefore, there is more dark matter in the outer parts of the galaxy than in the center.

It was the galaxy rotation curves that brought up the need for dark matter:

But, if it interacts gravitationally, why it is not attracted to the center, remaining at the edge of the galaxy?

The popularized explanation in the caption of the figure "by adding a dark matter halo surrounding the galaxy" leads to the misunderstanding.
The simplest answer is that it is attracted to the center, that is why it is on a rotational curve. The statistics of different masses and angular momentum create the shape and the density as matter is gravitationally attracted.
It does not mean there is no dark matter in the center of the galaxy shown in the plot, it just means that it is more diffuse and dominates at the tail while baryonic matter as denser and heavier dominates in the center.
There are models that assign normal  baryonic matter to the tail of the spiral, considered not very probable, and models with new stable particles to be found in high energy accelerators when the energies go higher. It is an open research question what type of matter the tail is made of, but not why it is seen at the tail. It is a statistical matter of density and masses.
Comment: @KyleOman  thanks, corrected
Comment: For the galaxy rotation curves to be explained, most of dark matter should be concentrated in the outer parts, and there is some at the center. But my question is why this dark matter at the outer parts having so much mass does not move to the center? Shouldn't it be closer to the center? Why it is at the outer parts?
Comment: That is why it is hypothesized to be a gas like density. Fitting it with Newtonian curves  means that attraction is taken into account, and it gives a measure of the density this dark matter should have to fit the observed rotational curves.
Answer: But, if it interacts gravitationally, why it is not attracted to the center, remaining at the edge of the galaxy?
I think the problem is that you're probably imagining that the dark matter is just sitting there, not moving, and so it seems strange that it hasn't long ago fallen into the center of the galaxy. But this is like asking why stars in the outer parts of galaxies haven't fallen into the center of the galaxy, or why planets and asteroids and comets in the outer Solar System haven't fallen into the Sun.
The answer is that anything interacting gravitationally will be moving on orbits. If the orbits are close to circular (like those of planets and asteroids in our Solar System, or some of the stars in the outer parts of galaxies), then they naturally stay away from the center. If the orbits are highly elliptical ("radial"), then they do travel in close to the center. But then they move back out again, and they spend most of their time in the outer parts of their orbits (like comets do in the Solar System). Simulations suggest that most dark matter particles should in fact be on rather elliptical orbits. So most of the dark matter spends most of its time at large distances from the center, even if individual particles sometimes travel close to the center.
Comment: Yes, but there is too much mass of the dark matter. If we make parallels with Solar System, then it is the same as Jupiter being in the Kuiper belt, which is counterintuitive. Mass of the baryonic matter is concentrated at center, while mass of dark matter is not
Comment: Don't you think that adding new type of matter is not necessary. Laws of gravity were never checked at huge distances. Modification of Newton's Laws or gravitational lens may be the answer?


Why Does Depth of Field Happen? Is there a simple explanation?

Question: I think if our eyes are good there are not many situations where we naturally percieve a shallow DOF. How is it that lenses create this? What happens for shallow DOF to happen in photos and on movies?
Comment: I've marked this as a duplicate because I'm pretty sure the other question answers it completely, even including the part about human eyes. Let me know if there's something not covered!
Comment: I think the shallow DOF happens to the human eye too, but since we have the most magnificent computer as brain and eyes that take more than one picture to form a... well picture. So IMHO the brain makes the picture and calculates the DOF away
Comment: @AlexandervonWernherr Human eyes do have shallow DOF. We don't see it because of constant refocusing and [saccades](https://en.wikipedia.org/wiki/Saccade). When we try to look, our eyes refocus before we have a chance to notice it wasn't in focus. It's actually worse than just shallow DOF. Resolution drops off significantly outside of a [central sweet spot](https://en.wikipedia.org/wiki/Fovea_centralis), and there is a [huge blind spot](https://en.wikipedia.org/wiki/Optic_disc) devoid of any photoreceptors. If the eye were a digital camera, most of us wouldn't buy it.
Comment: Thanks for your comments and answers. I am really wanting to find a very clear, simple explanation of the difference in the way DOF is recorded by cameras and the way we see.
Answer: Good question I think.
However, I don't agree with "if our eyes are good there are not many situations where we naturally percieve a shallow DOF". I can perceive a blurred background right now, over the top of my monitor, in the distance. If I look at the distance, it comes into focus—just like a camera can change focus. But the difference between a photo and what you see is that with a photo, you can closely examine the out-of-focus areas that the camera captured; with your eyes, you can't really closely examine out-of-focus areas, because your eye will naturally then just bring them into focus.
Comment: If you happen to live in the western US, there are some specific plants that can help you focus in on the out of focus areas of your vision.


What is a squall line and how it is created?

Question: How are squall lines created and what are they exactly?
If we encounter them how we deal with them?
I know that it is a narrow band of thunderstorms that is moving, but is there any other weather phenomena associated with it or no?
Answer: Thunderstorms can be associated with frontal weather movements, or can just form randomly away from frontal action by local convective activity.
A squall line is an array of thunderstorms triggered by uplift related to frontal movements instead of just randomly forming in a large air mass, basically in a line that is parallel, and in advance of, the cold front.
So the bottom line is, away from frontal conditions with a humid air mass and lots of sun, you can expect thunderstorms to form more or less randomly within the warm airmass. But when there is frontal activity where a cold front is advancing, you can anticipate multiple thunderstorms to form on the warm side of the front like a big commercial broom; a squall line.
As far as staying out of trouble and for flight planning, it might be possible to get from A to B VFR, where there are random thunderstorms not associated with a cold front, if the visibility is good enough to see the storms from a safe distance and they can be bypassed while maintaining good VFR conditions and staying at least 20 miles from the edge of the storm.
To be safe you need to have plenty of reserve fuel for diversions, and be ready to head for the hills if things aren't looking good. A hazy day with only 5 miles visibility and random cells lurking? You won't find me out there without weather radar in the plane.
And if you're planning to go from A to B, and there is front moving across your path, with lots of humidity and instability on the warm side, and you need to get across it, you can expect squall lines and you will be sitting on the ground until the front has passed and your trip is fully within the cold side.
It's always a good idea to be totally terrified of thunderstorms, and act accordingly, because the terror is justified.
Answer: Squall lines are just as you say, bands of thunderstorms moving in the same general direction. They are formed by convective activity, that is the sun heating the earth, which heats moist air which rises high into the atmosphere to form clouds.
As for other weather phenomena, tornadoes are relatively common in some areas as is hail.
As for how you deal with them you avoid them in light aircraft as they are hazardous. Even without the tornadoes and hail squall lines have high winds, wind shear and turbulence. Airplanes with weather radar and anti-icing may be able to find a way through, although caution is still required.
Comment: Find their way through, or, preferably above or around.


Is it possible to have a motor default to a certain position at the start of the code? I'm trying to use the motor as a servo, and it's annoying

Question: The motor is attached to a "door", which rotates to block off an opening. I have it coded to manually go back 1/4 of a rotation, and the distance sensor attached will send it forwards 1/4 of a rotation. However, if it gets triggered twice, then it has to be triggered another two times in order to get back to the default position. I would like to avoid this. I am coding on a laptop, and there is no block that I have seen that can do this. Is this possible, or did I just miss the block?
Comment: Please add the code you have issues with.
Comment: Done. I have edited the post.
Answer: Expanding on @zovits approach for a rubberband-based mechanical system: I'll suggest something like the following diagram, adding a rubber band between the bush and the belt wedge wheel:

That can technically be called a friction clutch. With something like that, it's possible to keep the motor turning more than needed: when the cyan liftarm hits the red corner beam, the axle will block and the rubber band will absorb the excess rotation (by means of slipping on the yellow bush).
In order to minimize wear&tear, you should adjust the rubberband tension so it provides just enough grip, but can slip easily.

A similar approach is to use 60c01 Technic, Gear 24 Tooth Clutch or 6542 Technic, Gear 16 Tooth with Clutch:

I don't own any such pieces, and therefore I don't know how well they stand wear&tear - I'd recommend a rubberband just for the ease of finding replacements.

Another approach is to use a linear actuator:

A technic linear actuator has a built-in clutch, so will absorb extra rotation as well. That means you can run motor more than needed to get them into a known state (either fully retracted or fully extended).
By building an assembly as shown above (and securing both the motor and the black axle, but letting the linear actuator swing around the motor's axle), extending the actuator will make the black axle rotate about 90 degrees. You'll need to adjust the system to get the desired rotation angle.
Comment: Thanks for the illustrations! Adding a clutch to enable driving up to (and over) an end position has not occurred to me but is indeed a good idea. In the sentence "Technic liftarms will absorb extra rotation" did you mean "Technic linear actuators" perhaps?
Comment: Sorry, my english skills seem to be still on holiday, and couldn't recall the word "clutch".  Also fixed the liftarm→actuator bit.
Answer: For an ordinary motor it is not possible, as the axle position can't be queried from the software. What you can do though is to write your software in a way to return to the starting position before ending the program (define a counter for the number of trigger events, increase it every time, then at an appropriate point apply the necessary amount of reverse movement).
Another possibility is to build in a mechanical system that returns the axle to a pre-defined position (with force from gravity or a rubber band) and set the motor in feathering mode to let it turn without resistance until the starting position is reached.
The most convoluted way is to build your own position encoder: set up a sensor (push button, colour sensor or ultrasonic) that can tell when the axle is in the starting position, then when resetting, turn the motor while querying the sensor until the starting position is reached.
Answer: Drive the motor at low power for some length of time in a direction until the door jams against some obstacle. Set the position sensor of the motor. Drive the motor to the desired starting position relative to the jammed position.
This violates one of the constraints of the questions, since this would run before you ran your code. However, it is simple.


How to output 3 objects as 3 seperate nodes in a g3dj file

Question: I have three obj files: a ship, a turret and a gun.
I want to import these back into Blender and output such that the g3DJ file contains three seperate "nodes" (as achieved by Xoppa of libgdx fame - probably using Maya).
All I get is one node with "children" having 3 "parts".
How do I achieve seperate "node" output?
Answer: Figured it out!
I was exporting from blender to a wavefront obj file and then using fbx-conv to convert to a G3DJ one: this gave one node with 1 children with 3 parts.
Now when I export to an fbx file and convert to G3DJ using fbx-conv I get 3 nodes as required.


Is zai4 + ... + li3 really a mistake?

Question: In my textbook there's an exercise in which I must decide if a sentence is correct. There's this: 在客厅里坐着一位老人. In the answers they say it's incorrect because "zai4" shouldn't be there. Is it really a mistake? I always thought "zai4" was optional in sentences like (zai4) + somewhere + li3/ shang4/ xia4/ zuo3 bian/ you4 bian/ qian2/ hou4.
Comment: 在客厅里坐着一位老人 is fine in day-to-day usage.
Answer: 在客厅里坐着一位老人.
The 在 is redundant because of the 里, as 客厅里 already says "In the living room..." and adding the 在 would be saying "in the living room" twice.
So, 在客厅里坐着一位老人 would be saying -- "At the living room in which sits an old man"
Comment: 在客厅坐着一位老人 is uncomfortable to me. Somehow strange...
Comment: How about 在树上坐着一只老猴子?
Comment: 上 here sound the replacement of 里 in original example.
Comment: Yes, you are right. I'll edict my answer accordingly.

Is zai4 + ... + li3 really a mistake?


How can i download an image file with  tag?

Question: I am currently trying to download an image file from an attachment object. I am able to download the file with the following code {!att.Name} but the file always comes without the extension. Any solutions?
Comment: What is the value of `{!att.Name}`? When looking at it in a `System.debug` log, does it have the file extension?
Comment: No it doesn't, it shows only the file name. And when i try to rename it its overwrited with the original name.
Answer: As far as I know the download attribute is now supported by all the major browsers and should work. I tried doing
<apex:page standardController="Attachment" docType="html-5.0">
    {!Attachment.Name}
</apex:page>

Seems to be working as expected.
What could be happening for you

Probably extenstions are set to be hidden in the OS ?
Generally files are saved with the extenstion in the name, might be something wrong with your file that you were testing with, try using another file
Comment: I have my OS set to show extensions, so that's not the problem. The second point seems to be the problem, i'm trying a workaround but with no success. When i try to rename the file it doesn't work. Supposedly the param that the download attribute receives is the name that the downloaded file comes with, but it comes with its original name (without the extension).
Comment: Try using some other image may be like https://jpeg.org/images/jpeg-home.jpg ?
Comment: With the extension the path to the file can not be found. If i manually change the name of the file and add the extension, the download works just fine. But if there would be a way for me to change this name in the a tag it would save me a lot of time. I think that it is overwritten by a definition in the browser. Is there anyway i can work around this definition?


Default database IDs; system and user values

Question: As part of our current database work, we are looking at a dealing with the process of updating databases.
A point which has been brought up recurrently, is that of dealing with system vs. user values; in our project user and system vals are stored together. For example...
We have a list of templates.
1, <system template>

2, <system template>

3, <system template>

These are mapped in the app to an enum (1, 2, 3)
Then a user comes in and adds...
4, <user template>

...and...
5, <user template>

Then.. we issue an upgrade.. and insert as part of our upgrade scripts...
<new id> [6], <new system template>

THEN!!... we find a bug in the new system template and need to update it... The problem is how? We cannot update record using ID6 (as we may have inserted it as 9, or 999, so we have to identify the record using some other mechanism)
So, we've come to two possible solutions for this.
In the red corner (speed)....
We simply start user Ids at 5000 (or some other value) and test data at 10000 (or some other value). This would allow us to make modifications to system values and test them up to the lower limit of the next ID range.
Advantage...Quick and easy to implement,
Disadvantage... could run out of values if we don't choose a big enough range!
In the blue corner (scalability)...
We store, system and user data separately, use GUIDs as Ids and merge the two lists using a view.
Advantage...Scalable..No limits w/regard to DB size.
Disadvantage.. More complicated to implement. (many to one updatable views etc.)

I plump squarely for the first option, but looking for some ammo to back me up!
Does anyone have any thoughts on these approaches, or even one(s) that we've missed?
Answer: I recommend using the second with the modification that you store the system and user values in one table. GUID is quite reliable in this manner.
Another idea: use any text-based ID (not necessary GUID), which you give for the system values and is generated by a random string or a string based on some kind of custom logic for the user values.
Another idea: use the first approach, but extend the table with a flag which shows if a value is system or user. Maybe this is the easiest. Ok, you have to write some kind of mechanism to update the correct system value, but it can be done easily.
Answer: +1 for Biri's text based ID - define a "template_mnemonic" text based column and make it the primary key. This will be a known value when you insert it as you, the developers will have decided on it (or auto-generated it) and you will always be able to reference a template by its mnemonic regardless of how many user specified templates there are. It also allows users to have a meaningful naming convention for their templates.
Answer: I have never had problems (performance or development - TDD & unit testing included) using GUIDs as the ID for my databases, and I've worked on some pretty big ones. Have a look here, here and here if you want to find out more about using GUIDs (and the potential GOTCHAS involved) as your primary keys - but I can't recommend it highly enough since moving data around safely and DB synchronisation becomes as easy as brushing your teeth in the morning :-)
For your question above, I would either recommend a third column (if possible) that indicates whether or not the template is user or system based, or you can at the very least generate GUIDs for system templates as you insert them and keep a list of those on hand, so that if you need to update the template, you can just target that same GUID in your DEV, UAT and /or PRODUCTION databases without fear of overwriting other templates. The third column would come in handy though for selecting all system or user templates at will, without the need to seperate them into two tables (this is overkill IMHO).
I hope that helps,
Rob G
Answer: Maybe I didn't get it, but couldn't you use GUIDs as Ids and still have user and system data together? Then you can access the system data by the (non-changable) GUIDs.
Answer: I don't think that GUID should make any problem.
If you want to avoid it, then use a flag:

ID int
template whatever
flag enum/int/bool

Flag shows whether the actual value is a system or a user value.
If you would like to update a system value, then ask only for system values ordered by ID, and it will show you actual order of insertion (you should have a bigint or something for ID to make sure that it doesn't get full and it doesn't get the deleted IDs back to work). With this list the x. record is the x. inserted system value.
Answer: I think there is a better third solution.
It strikes me that you're storing two different things in the same table and that you might be better off creating 2 separate tables one for user templates and one for system templates. You might then be able to create a view over the two tables to make them appear as a single object to your application.
Obviously I don't have full knowledge of your application and this may be impossible for you for any number of reasons but I think it's a neater solution than GUIDs and way safer than ranges of IDs (seriously don't do ID ranges it'll bite you one day)


Does Turkish Airline transfers baggage

Question: I am traveling for the first time to a different country with Turkish Airlines.
I have a flight from New Delhi to Bordeaux,France with layover at Istanbul.
So will the baggage be transferred by them, or I will need to collect my baggage and get to the other flight?
Both the flights are same i.e, Turkish Airlines.
Comment: You bought the whole flight from New Delhi to Bordeaux as one ticket, right?
Answer: If you bought the flight in one ticket, the bags will be transferred automatically for the layover in Istanbul, Turkey.
Even if airlines are different, if you bought it in one ticket, they will connect.
However, if you purchased two tickets, you likely have to go out and recheck the bags. But I had a different experience in KLIA airport. I was allowed to go to transfer desk airside and they was able to connect my luggage through onward flight, without any issues and no fees was collected from me.
Comment: Hey! Anish thanks for your answer, but what if the airlines are different??

Does Turkish Airline transfers baggage


Undo "sudo google-chrome --no-sandbox"

Question: In order to fix some other unrelated issue I wanted to run chrome as sudo. The Terminal output told me to run the above-mentioned command. Besides that not being helpful I get an error "Cannot open profile" and some other things each time I open chrome, even via the graphical icon or a plain google-chrome in the terminal. How can I reverse this?
Comment: See [Why should users never use normal sudo to start graphical applications?](http://askubuntu.com/questions/270006/why-should-users-never-use-normal-sudo-to-start-graphical-applications) - your chrome profile has likely become owned by root and you will need to `chown` it back
Comment: I should add that the layout now looks somewhat different and chrome also does not load my extensions or starting page, but can read my history
Answer: So in the post @steeldriver linked (in comments) I found the solution:

Assuming there are no files in your home directory that you want to be owned by any other user or that you want to have any other group membership (for sharing), you can run:
sudo chown -R $USER:$USER ~

If you have any files where you need to preserve the group owner, you can run
sudo chown -R $USER ~

Credits - (user Eliah Kagan)
I didn't need the latter, but now everything is fine again.

Undo "sudo google-chrome --no-sandbox"


Pascal's law and the variation of hydrostatic pressure

Question: In the case of the hydraulic lift (pictured) according to the pascals law we say that the pressure on $A_1$ is the same as $A_2$. In here do we assume that the $d_1$ value involved is so small that the pressure variation has no effect?
Comment: What do you mean by pressure variation?
Comment: @DDD4C4U I meant the variation of pressure with depth.
Answer: First, the "pressure variation" is actually called "hydrostatic pressure."
According to Wikipedia, Pascal's Law "states that a pressure change at any point in a confined incompressible fluid is transmitted throughout the fluid such that the same change occurs everywhere." The hydrostatic pressure is actually still there. The pressure at the bottom of the hydraulic lift is a bit greater than the pressure at the top because the bottom has to support the weight of all the fluid above it. What Pascal's Law means is that the additional force, which increases the pressure, is distributed evenly to all parts of the fluid.
Therefore, the absolute pressure $P$ is different in different parts of the fluid, but the increase in pressure $\Delta P$ is the same throughout the fluid.


Chain rule in multivariable calculus

Question: I am studying notes from seminar and I don't quite understand some steps. We were evaluating implicit function $f(x,y)=e^{xy}+\sin y +y^2 =1 $ at point $[2,0]$. After checking the conditions we reached the conclusion that such function $y= \varphi(x)$ exists. And now comes the problem, I don't know how the derivative of such function is taken. I know there is chain rule $$\frac{\partial h}{\partial x_k}(\vec{a})=\sum_{j=1}^{p}\frac{\partial f}{\partial y_j}(\vec{b})\frac{\partial g_j}{\partial x_k}(\vec{a}).$$ But I am still struggling with the application of this rule. In this case that for $f(x,\varphi(x))=1$ we would get $$\frac{\partial f}{\partial x}\cdot1+\frac {\partial f}{\partial y}\cdot \varphi'(x)=0.$$ How did the number 1 appear there and same with $\varphi'(x)$? The second derivative is even more overwhelming for me.
Answer: Consider the general case. You have $f: \mathbb{R}^2 \to \mathbb{R}$ with $f(h(x),g(x))$. This can be viewed as a one-variable function $y: \mathbb{R} \to \mathbb{R}$, therefore $y(x) = f(h(x),g(x))$. Differentiating: $$\frac{dy}{dx} = \frac{\partial f}{\partial x_1} \frac{dh}{dx} + \frac{\partial f}{\partial x_2} \frac{dg}{dx} = \frac{\partial f}{\partial x} h'(x) + \frac{\partial f}{\partial y} g'(x),$$ where I've briefly denoted the first coordinate by $x_1$ and the second by $x_2$. When you take $h(x) = x$ you get $h'(x) =1$, obtaining that expression.
Comment: good! thank you for very detailed explanation, I appreciate the fact that you showed it me generally so I understood the concept.
Comment: thank you, I am trying to process it and apply it for the second derivative, just a quick question, what happened to the right side when the function is in my case $f(x,\varphi(x))=1$? I just take derivative of the right side first with respect to x and then y, so I get 0+0=0?
Comment: @D.N I'm sorry, I don't think I understand but I'll try. Still using the general expression, what the equation $f(x, \varphi(x)) = 1$ is saying is that $y(x) \equiv 1$, therefore $f(h(x),g(x)) \equiv 1$. When you differentiate both sides you get the above for the left side and zero for the right side, because differentiating a constant yields zero.
Comment: I am sorry my question is confusing, but basically you answered what I wanted to know. I think I am starting to understand, now can you check if I got it right for the second derivative? $(\frac{\partial f}{\partial x})'=(\frac{\partial f}{\partial x})'+(\frac {\partial f}{\partial y} \cdot\varphi'(x))'=\frac{\partial^2 f}{\partial x^2}+\frac{\partial^2 f}{\partial x \partial y} \varphi '(x)+\frac{\partial^2 f}{\partial y \partial x}\varphi'(x)+\frac{\partial^2 f}{\partial y^2}\varphi'(x)+\frac{\partial f}{\partial y}\varphi''(x)$
Comment: Almost. For the term $$\frac{\partial^2 f}{\partial y^2}$$ you need to multiply by $\varphi'(x)$ again. It is $$\frac{\partial^2 f}{\partial y^2} (\varphi' (x))^2.$$ Although we are assuming these functions are $C^2$, notice that $$\frac{\partial^2 f}{\partial y \partial x} = \frac{\partial}{\partial y} \left( \frac{\partial f}{\partial x} \right), $$ that is, you differentiate first in $x$ and second in $y$. Consider accepting this answer if it helped you. =) Best wishes.
Answer: If I rpoperly understand your question, you have $$f(x,y)=e^{xy}+\sin y +y^2 =1$$ This obviously define an implict relation between $x$ and $y$; so, $y=\varphi(x)$.
Now, comes the problem of the derivative. What you must write is the total derivative of $f(x,y)$ (which is zero). For this, you need to compute $f'_x$ and $f'_y$ and then $y'_x=-\frac {f'_x} {f'_y}$.
In your case, $f'_x=y e^{x y}$, $f'_y=x e^{x y}+2 y+\cos (y)$. At $[2,0]$ which is along the curve, you then have  $f'_x=1$ and $f'_y=3$; so, at this point, $y'_x=-\frac {1} {3}$.
Is this clarifying things to you ? If not, just post.

Chain rule in multivariable calculus


How is a transaction not present in 2 or more solved blocks?

Question: If node A picked 10 unconfirmed transactions to solve in a block and node B picked the same 10 transaction in A plus another 10 transactions to solve. If node A finished solving the block informed all nodes and placed the block on the chain, what happens to the same transactions being mined by Node B?
Answer: When node B gets informed about block A being mined he would start working on a new block that does not conflict with the first one.
If block B happens to be mined around the same time as block A there would be a fork. All nodes in the network that hear about both blocks will keep both branches and will wait for the conflict to be resolved.
The miner that mines the next block will have to place his new block on top of one of the branches. When that happens and the new block gets broadcasted, all nodes will pick the branch with the most work and the other branch will become orphan.
Comment: Thanks for your answer. So block B will get discarded as soon as A is added to the chain. There can only be one block resolved every 10 minutes.
Comment: @DavidVella No, there can be multiple blocks in a 10 minute period but they cannot contain the same transactions.This is true for any blocks. Each transaction can only be in one block.
Answer: Since node B didn't find a block, nothing it does has any effect. As miners find out about the block mined by A and confirm that it is valid, they'll start working on a new block to come after that block. They'll include some subset of the transactions that can be validly included in a new block after the block mined by A.
Transactions already included in the block mined by A are not valid in a block after it because their inputs no longer exist. Transactions that try to consume those same inputs (if there are any) would also no longer be valid. Any transactions still valid (whether or not B tried to include them) might get included in the candidate blocks that miners work on after that.
Effectively, every time a valid block is found, miners start over working on finding a new block to go after it. They have to recompute which transactions to include in that new block. If they include a transaction that's now invalid, any block they mine will be invalid. If they fail to include valid transactions that pay high fees, they'll reduce their income should they find a block. So miners are incentivized to try to pack the blocks they find with valid transactions that pay high fees relative to the block space they occupy.
Comment: Thanks David S, I think you last paragraph sums it up for me. When a block is solved all miners will go and fetch new valid transactions to put into the block they are about to mine. Therefore it is practically impossible to have 2 blocks solved successfully by 2 miners at the same time and they happened to share some valid transactions in their blocks. Only one block will be chosen to be linked to the chain, the other must be thrown away even if it was successfully mined at the same exact time.
Comment: @DavidVella Right. Every block includes a reference to the block before it, so they can't both exist in the same chain regardless of whether they have overlapping transactions or not. Eventually, one or the other of them will be embedded in the longest chain.


Which is right? "In last section" or "in the last section"

Question: Should I use"In last section" or "in the last section"?
Also which one is correct when "section" is plural. "In last sections" or "in the last sections"?
Comment: You left out the context, so how could we know?
Answer: "in the last section" and "in the last sections" are correct.
Singular nouns in English always call for an article, either "the" or "a", except when they are proper nouns, i.e. names, or have an adjective that indicates only one, like "one", or a possessive adjective. Maybe a few other special cases that I'm not thinking of.

I said hello to the man. (article needed)
I said hello to Bob. (proper noun -- no article)
I said hello to one man. ("one" substitutes for an article)
I said hello to my friend. (possessive -- no article)

The plural example you give is a little different. In general plurals do not require articles. But they do when we are identifying a specific group. In this case, you are identifying not just any sections, but the "last" sections.

The book is divided into sections. (general case, plural, no article)
I read the sections about France. (specific sections, article required)
I read sections about France. (I didn't necessarily read all the sections about France, but the sections I read were about France, so it's not specific, no article required)

Including or not including an article with a plural is often a judgment call. It can indicate interpretation or emphasis.


Two installations of Qt on OSX?

Question: My setup (OSX 10.13.6) appears to have two installations of Qt5: one in /Library/Frameworks (/Library/Frameworks/QtCore.framework, /Library/Frameworks/QtGui.framework, etc.), but I also have one installed by brew at /usr/local/Cellar/qt/5.13.0. Is it a good idea to have Qt at two locations? Is it a good idea to remove the one at /Library/Frameworks and keep the one brew installed?
Answer: Often had two versions of a particular app installed (usually in the standard apps location).
Did this with Excel - never had an issue. Also with Qt at one time.
I just made sure the newest one was the most recent install for any libraries necessary.
Comment: Is there a way to upgrade the one in `/L/F`? I'm not even sure if it's Qt5.
Comment: @JohnM. have you tried the System Prefs upgrade? select just that app...
Answer:
Is it a good idea to remove the one at /Library/Frameworks and keep the one brew installed?

No it isn't a good idea because some previously installed applications (and not standard MacOS ones) are using this library. And these applications won't be compatible with the brew version which is usually more recent and more secure than this older one, but with different interface (ex.: f(x,y) → f(x,y,z)) and behaviour.
On the other hand, the one installed by brew will be used to compile and  run any application installed with brew.
It is a very good protection that brew chosed on purpose not to overwrite the system versions of important libraries. This is a sign of a well conceived package manager, a professionnal tool.
Comment: /LF is not Apple's system library all those are in /System/Library - this one was probably installed by installing Qt directly from a download from QT (or a badly packaged app - well nowadays - for OSX 10.0 this would have been correct)

Two installations of Qt on OSX?


Do I need to update the wiring in my bathroom to replace the gfci receptacle?

Question: I upgrading each of my receptacles to tamper resistant. The house was built in 1970. In the lower level bathroom it has a 15 amp gfci circuit receptacle and a 15 amp light switch.
According to Nec, bathroom today need 20 amps separate receptacle. Do I need to rewire it to comply?
What does the code say about older homes or can I switch out the 15 amp gfci bathroom receptacle with another 15 amp gfci?
Comment: Replacing the device (outlet) doesn't require rewiring to the new code. There are old homes that the wiring has been upgraded that still have knob and tube wiring in the walls and that is still legal.
Comment: To clarify it is acceptable in an older home to replace a 15 amp gfci with another 15 amp gfci in an older home (grandfather). I don't have to run a separate 12 gauge wire to the panel and place a 20 amp cuircuit breaker and a new 20 amp gfci instead.
Comment: Yes, You can replace the old GFCI or upgrade a non GFCI outlet to a new one without updating the wiring.
Answer: Bathrooms frequently have high wattage appliances such has high-wattage hair dryers or space heaters.  And just because YOU don't have one of these, you might eventually have a guest that brings their own.
Plan for success, and comply with the code.  And make sure and get a good name brand GFCI, as there are Chinese knockoff's out there that are known to be bad.  I was having problems with my GFCI's in a new home, and when I pilled one out chd looked up the UL listing code, I discovered that the UL number was fake, and my new home had a half dozen fake gfci's... replacing them with properly certified Leviton's solved my gfci issues...
Of course complying with the code could mean you have to run a new wire, if your existing wire isn't to code.
My rule of thumb is "things are in the code for /good/ reason, and electrical is one area never to skimp on..."  If you skimp, you can cause a fire or death...  Don't do it!
Sure, you may be grandfathered in, so what?  the code is for safety, and many many lives are lost to grandfathered old wiring.  Just having an old outlet can cause a fire.  I'm a firm beliver of periodically replacing outlets that are subjected to heavy loads.  A hair dryer, space heater, microwave, toaster, window unit, etc...  All of these draw maximum current through the plug.  As the plug ages resistance goes up.  The resistance generates heat under max loads.  That heat softend the metal contacts, so that they have less spring pressure, as well as more surface corrosion.  With time the contacts can become bad enough to start getting hot, and eventually starting a fire in the wall, a fire that may take some time to notice until it is too late.
The bathroom outlets are among the ones most subject to current related wear, the next are in the kitchen, and everywhere you plug in the vacuum cleaner, or potentially a space heater.  All of those outlets should be replaced every 10 years or so if they get routine use.  The fact you have old wiring under an old code set is your first clue that your wiring is old enough to need upgrade/replacement for safety.
Comment: Didn't know that receptacles should be replaced every 10 yrs. is tamper resistant truly child proof or should you still get covers?