車をぶつけられる & 車にぶつけられる

Question: Who can help with the difference of 車をぶつけられる & 車にぶつけられる?
In my own understanding, the former means somebody else's car ran into the narrator's car but the latter means the narrator was hit by a car. I'm not sure if I understand it rightly.
Answer: On "車をぶつけられる ", this time normally "your" car has damage in it by the collision when you don't control the car yourself. In other words, you are not directly involved in the collision, say indirect collision to you, so you might be mentally affected but not physically.
On "車にぶつけられる", this time normally "you" are directly hit by a car. You have the direct collision between you and car body. It could be used for the collision between your belongings and car if you are asked what objects hit your belonging.
Comment: 「車をぶつける」「自転車をぶつける」「卵をぶつける」の受身形「車にぶつけられる」「自転車にぶつけられる」「卵にぶつけられる」。何故「卵」は駄目なのか思案中です。車と車の運転手、自転車と自転車の運転手、卵と卵の投げ手とがぶつかったときに一体であるのかどうかの違いでしょうか。
Comment: @mackygoo その場合の"卵にぶつけられる"は喉に生卵を割った時の殻が引っかかるとか、極端な解釈は卵のせいで食中毒になったとかなら大丈夫じゃないでしょうか?"ぶつけられる"の解釈次第ですけれども。
Answer: Your understanding is partially fine, that is 車をぶつけられる and 車にぶつけられる are same meaning, but they make differences on the context. So, we need to compensate some words to distinguish them.
[1] 車をぶつけられる
One of the meaning of (私は)車をぶつけられた is, as you say, somebody else's car ran into the narrator. However, we can also see 車をぶつけられる as follows:
(私の家に)車をぶつけられた。 / A car hit my house by someone.
(友人によって)車をぶつけられた。 / My friend drove my car and hit something.
[2] 車にぶつけられる
(私は)車にぶつけられた normally means the narrator was hit by a car, but this also has other meanings.
(私の)車にぶつけられた。 / Something hits my car.
(私は)車にぶつけられた。/ I was pushed and bumped into the car(not a car accident).
Answer: 車にぶつかった。Bumped into a car.
車をぶつけた。Hit the car (into something/someone else). The object of ぶつける is the thing that hits something, and に marks location of impact. It's weird for English speakers, I know. E.g.やくざの男が俺をその木にぶつけた。I think of this as being a causative verb, even though it's not, strictly speaking.
車にぶつけられた。Hit the car (as location. I was made to hit/run into the car by someone/something). そのやくざの男に木にぶつけられた。
車がぶつかった。A car hit (something, maybe me?).

車をぶつけられる & 車にぶつけられる


Outlook 365 for desktop add-in not working

Question: i have converted a outlook 2010 addin project into outlook 365(for desktop), after that when it reach below line
Private Sub ThisAddIn_Startup() Handles Me.Startup
        Try
<code>    Dim Application As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application 'EXCEPTION LINE
</code>
then immediately throws exception as like below
{"Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 8000ffff Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))."}
I read the topic Why am I receiving exception from Office's Outlook library? but, in my case its not resolved the issue.
experts please advise me.
Answer: You are already inside outlook (ThisAddin class), so you do not need to create a new instance of the application. What you need is to get a pointer to the existing one.
I do not code in VB.Net but the C# equivalent would be:
<code>    this.Application;
</code>
I am assuming you want to mimic what is present in the code you are pointing to and want to send an email then I would write it like this:
<code>public void Email_Send()
{
    O.MailItem message = this.Application.CreateItem(O.OlItemType.olMailItem);
    message.To = Receiver;
    message.CC = Sender;
    message.Subject = Subject;
    message.Body = "This is an automated message sent at " + DateTime.Now.ToString("HH:mm:ss") + " about " + Body_Topic + System.Environment.NewLine + Body_Content ;
    message.Send();
}
</code>


How to apply Theorem 4.3-3 in the proof of Theorem 4.5-2 in Kreyszig's functional analysis book?

Question: Here's Theorem 4.3-3 in Introductory Functional Analysis With Applications by Erwine Kreyszig:

Let $X$ be a normed space and let $x_0 \neq 0$ be any element of $X$. Then there exists a bounded linear functional $f_0$ on $X$ such that
  $$ \Vert f_0 \Vert = 1 \ \ \ \mbox{ and } \ \ \ f_0(x_0) = \Vert x_0 \Vert.$$

Let $X$ and $Y$ be normed spaces, both real or both complex, and let $T \colon X \to Y$ be a bounded linear operator. Let $X^\prime$ and $Y^\prime$ denote, respectively, the dual spaces (i.e. spaces of all the bounded linear functionals) of $X$ and $Y$.  Then the adjoint operator of $T^\times$ of $T$ is defined to be the operator $T^\times \colon Y^\prime \to X^\prime$ as follows: for each $g \in Y^\prime$, we define  $T^\times g \colon= f \in X^*$, where $X^*$ denotes the space of all the linear functionals defined on $X$ and
$$f(x) \colon= g(Tx) \ \mbox{ for each } \ x \in X.$$
Now Theorem 4.5-2 in Kreyszig states

The adjoint operator $T^\times $ of a bounded linear operator is linear and bounded with $$\Vert T^\times \Vert = \Vert T \Vert.$$

It is clear to me how $T^\times$ is linear and bounded with $$\Vert T^\times \Vert \leq  \Vert T \Vert.$$
Now Kreyszig starts off the proof that  $\Vert T^\times \Vert \geq \Vert T \Vert$ as follows:

Theorem 4.3-3 implies that for every nonzero $x_0 \in X$ there is a $g_0 \in Y^\prime$ such that $$\Vert g_0 \Vert = 1 \ \mbox{ and } \ g_0( T x_0 ) = \Vert T x_0 \Vert.$$

This is evident if $T x_0$ is non-zero.
But how does the last conclusion hold if $x_0 \in X$ is non-zero, but $T x_0$ equals the zero vector in $Y$?
Of course, Theorem 4.3-3 applies only to non-zero elements of $Y$.
Answer: If $T=0$, then the adjoint $T^\times$ is also equal to zero and the inequality is trivial. If $T \neq 0$, there exists $x_0$ with $Tx_0 \neq 0$. Theorem 4.3.3 is then applied to $Tx_0$.


How do "game maker" tools like Blitz3D create .exe files?

Question: There are several applications like Blitz3D or other kinds of game construction tools that compile scripts or other game data to a single executable file. How do they do that?
Answer: Different tools approach that in different ways, but the way Blitz3D does it is to wrap the code and an interpreter into a bundle. Then when you run the exe, that launches the interpreter and passes in the bundled code. It's pretty much the same as how, say, Python works when using py2exe.
In many game development tools, the code that is bundled along with the executable is simply raw text that the interpreter parses. However some take a bytecode approach like Java, where the source-code is turned into an intermediate form that the virtual machine uses. I think Unity uses this latter approach but I'm not sure.
Off the top of my head all game development tools I can think of that package executables are either based on this approach of a core interpreter/virtual machine and then packaging it with the code, or are libraries that you compile in Visual Studio or whatever.
Comment: Is the second approach is faster than the first?
Comment: There are pros and cons, but the main thing to bear in mind with regards to speed is that all the really speed critical code (eg. rendering routines) is in the interpreter and thus the speed of the interpreted code isn't as important. The interpreted code simply calls a function like loadMesh() and the interpreter does the rest. It's the exact same situation as using a scripting language embedded in a game engine; indeed, there are frequent debates on Blitz3D's forum about whether or not it is a "game engine".
Answer: Program flow, variable handling and the like are compiled into pure machine code, whereas the high-level commands are implemented as C++ library functions which are called from the runtime library compiled into every Blitz-generated executable. Non of the Blitz Basic family is interpreted like Python.
Comment: I'm not sure what you mean by "implemented as C++ library functions which are called from the runtime library", but either that's just a fancy way of saying the user's code is interpreted by the core engine, or you are simply mistaken. Several years ago there was a short-lived product called CoolBasic that worked by replacing the user code in a Blitz3D exe (it was shut down of course because this was hacking of questionable legality); that wouldn't have worked if the user's code was compiled into the runtime.


Ubuntu 12.04 Cannot adjust brightness on Dell Inspiron 15: the suggested solution to change the grub fails

Question: Dell Inspiron 15 (Inspiron 3521). The graphic card is the integrated Intel graphic card: Intel® HD Graphics
Screen is: LED Backlit Display with Truelife and HD resolution
Install Ubuntu 12.04 downloaded in Sep. 2013.
If I use the function key Fn+F4/F5, it shows the brightness bar. But there is not effect. The brightness stays the same.
I googled.
One suggested solution to use grub:
acpi_osi=Linux or acpi_backlight=vendor,
You know there are many variants.
Then I restarted my laptop: after the menu, it is stuck there.
Then I can only force to turn off the laptop, and restart to choose the recover mode. Ubuntu will start. Brightness still cannot change.
I change the grub setting back. Now the laptop can start correctly.
Of course, brightness adjustment does not work.
The second suggested solution is to install xbacklight.
It cannot work.
I used
xrandr -q | grep " connected"
xrandr --output LVDS1 --brightness 0.8
it seems to work. But I think it adjusts not brightness, but contrast. So actually it looks not good.
Then what should I do?
Now I do not want to use the newly bought Dell laptop any more. Or I switch to Window? Oh, I like Ubuntu!
Answer: You can use this app if anything else does not work.


Repentance on disrespecting Parents

Question: Assalamualaikum I am 15 yrs old boy and I am sad to say that I Disrespect and do not talk nicely with my mother, I feel very bad whenever I do so , But Mine and my mother relationship is in such way that I cant say sorry to her , I know Allah forgives all sins, I want to repent But I cant say sorry to her What can I do??
Answer: Wallkumwasalam brother, Make dua for her and put her in your prayers, Before you want to say anything bad to her or get angry remember Allah swt and , may Allah forgive you and put you in the highest rank of Jannah.
Comment: Ameen , JazakAllah Brother May Allah Guide us all to right path and forgive all our sins and put us in the highest rank of Jannah

Repentance on disrespecting Parents


How to avoid multiple OCWs duplicating work?

Question: We are running 2 OCWs each in separate instances and we have an extrinsic which mutates a storage in runtime which is done twice from the 2 OCWs but we want only one OCW to sign. How to do that?
For example, if we want to increase a value in storage by +1 each hour, it is doing +2 since 2 OCWs are running. How to solve this?
Answer: It sounds to me that you are using offchain workers incorrectly. They should not be thought of as trusted applications which can modify your runtime's state or behave in expected ways. In fact, you should expect that every malicious user in your network is running their own custom version of your offchain worker and abusing it in every way possible.
Thus, the interface between your offchain worker and your runtime, usually an extrinsic, should have the appropriate checks to ensure that any offchain worker call is appropriate. In the case of updating a value every hour, probably you should keep track of the timestamp / block number where the last update happened, and check that the next update does not happen sooner than you expect.
Answer: So the idea of OCW's is that it will do some off-chain "work" and ultimately submit a transaction that will call a public function in the runtime to get the result of that work on-chain.
OCW's do have direct access to read runtime storage.
OCW's also have a separate storage of their own which can be used as a basis to "strategize" multiple OCW threads running at the same time.
You may have two nodes with the CLI flag opted in for OCW's, that does not mean you need both OCW's doing work after every block import. You can have logic that if certain conditions are met, only then execute the OCW logic. You can use a combination of listening to events, checking OCW local storage for some value, checking if a threshold was met, etc.
Here are a couple examples:

Using OCW local storage to create a grace period off of block number
Creating a threshold based on block number

Also keep in mind:

It's not guaranteed for offchain workers to run on EVERY block, there
might be cases where some blocks are skipped, or for some the worker
runs twice (re-orgs), so the code should be able to handle that.

Source


What is abbe's rule in optics?

Question: I have read wikipedia but can't really understand what they mean to say. The usual explanations are given in terms of Fourier optics, which I don't yet have the background for. Can anyone explain it with an illustration, or give another high school level explanation? I've a high school physics background.
Comment: Hi Sanjukta - I've changed your question quite a bit, because it is a good one and hopefully will stop its being closed. Please check that it is still OK. As for me, I tend to think as the Wikipedia article does - and this is the usual way it is explained. There must be a more physical explanation, so I'll need some time to ponder one.
Comment: @WetSavannaAnimalakaRodVance Fine, I'll remove it.
Comment: I think this paper can be very helpful: https://aapt.scitation.org/doi/10.1119/1.5036939
Answer: Departure from Abbe's sine condition is a concept used in lens design to characterize aberrations or lack of sharpness of the image made by a lens, as mentioned in the Wikipedia article.  The traditional use of this condition does not require higher mathematics, but the subject may easily get confusing, because it consists of many different parts of optical theory.
Let us start with paraxial optics which is a simplified version of geometrical optics. Aberrations are defined as departures from the predictions of paraxial optics.   Here all rays from an object point converge to a single point image, real or virtual.   Principal planes is another concept from paraxial optics.  These planes are defined as the specific  object and image planes where the  magnification is unity. This means that if we put a luminous point in the first principal plane at a certain distance from  the axis of the lens,  we will find that the lens will make an image of this point in the second principal plane at the same distance from the axis.  Next, let us select a ray parallel to the axis and compute its path through the lens to the image.  If we extend the starting and final pieces of the ray, we find that they cross at the second principal plane.
Departing from paraxial optics to geometric optics proper, the principal planes are no longer planes, but curved surfaces, their  shapes are fixed, being given by the design of the lens.   We now want to make a sharp image of an object at a certain distance.  If the principal surfaces are spheres, centered on the object and the image,  Abbe's sine condition is fulfilled for this object distance, and we obtain an image free from the aberration called coma.
Coma is an aberration that makes the image of a luminous point, (not at the center of the field of view), look like a small  comet,  pointing either towards or away from the center of the field.  Since the image is spread out radially from the center of the field, one can ascribe this to a change of  magnification along the comatic image.  It turns out that there is a connection between the sine condition and magnification, therefore we also have the connection between the sine condition and coma.
Coma is a troublesome aberration for various reasons, and should be corrected if possible.  Freedom from coma is also a condition for the use of Fourier optics.
Sometimes the sine condition makes it possible to predict the presence of coma without any computation.  A flat Fresnel lens has coma because the rays are bent at the flat surface which is not a sphere centered at the image.  This could be remedied by using a spherical substrate for the Fresnel lens.  The same reasoning holds for a flat holographic lens.  A parabolic mirror has coma because the rays are reflected at the parabolic surface which is not a sphere.  A spherical mirror will also have coma because the spherical surface has a radius that is twice the focal length.
Answer: This article on abbe sine condition has a full explanation but in short It relates the angle of the input marginal ray with the angle of the output marginal ray.  It is used by optical engineers to reduce aberrations like coma.
Comment: Hello! It is preferrable to include the relevant information from links instead of posting just them - in case the link breaks, the answer would otherwise become useless. Maybe you can [edit] it to sum up the linked article? Thanks!

What is abbe's rule in optics?


(Anti-) Holomorphic significance?

Question: What are holomorphic and anti-holomorphic components? Why don't we call them complex components and their conjugates? What is holomorphic coordinate transformation?
Answer: $\newcommand{\dd}{\partial}\newcommand{\Reals}{\mathbf{R}}\newcommand{\Cpx}{\mathbf{C}}$The $z^{\beta}$ are emphatically not holomorphic coordinates in general. "Holomorphic" refers to overlap maps being holomorphic, i.e., satisfying the Cauchy-Riemann equations, not merely to the coordinates being complex-valued.
In more detail, fix an identification of $\Cpx^{n}$ and $\Reals^{2n}$, say $z^{\beta} = x^{\beta} + iy^{\beta}$, and identify
$$
(z^{1}, \dots, z^{n}) \leftrightarrow (x^{1}, \dots, x^{n}, y^{1}, \dots, y^{n}).
$$
Define the complex-valued differential operators
$$
\frac{\dd}{\dd z^{\beta}}
  = \frac{1}{2}\left(\frac{\dd}{\dd x^{\beta}} - i\frac{\dd}{\dd y^{\beta}}\right),\qquad
\frac{\dd}{\dd \bar{z}^{\beta}}
  = \frac{1}{2}\left(\frac{\dd}{\dd x^{\beta}} + i\frac{\dd}{\dd y^{\beta}}\right),
$$
and their dual one-forms $dz^{\beta} = dx^{\beta} + i\, dy^{\beta}$, $d\bar{z}^{\beta} = dx^{\beta} - i\, dy^{\beta}$.
A $C^{1}$ function $f:\Cpx^{n} \to \Cpx$ is holomorphic if $\dfrac{\dd f}{\dd \bar{z}^{\beta}} = 0$ for all $\beta$, and is anti-holomorphic if $\dfrac{\dd f}{\dd z^{\beta}} = 0$ for all $\beta$, i.e., if $\bar{f}$ is holomorphic. A smooth mapping $f:\Cpx^{n} \to \Cpx^{n}$ is holomorphic if each component function is holomorphic.
Holomorphic maps constitute a (rich but) thin subset of all smooth mappings. Among their many nice properties, a holomorphic mapping $F$ is complex analytic (representable by a convergent power series in a neighborhood of each point), and is locally invertible near a point $p$ (i.e., is a local biholomorphism at $p$) if and only if its derivative $dF(p)$ (which is a complex-linear mapping) is invertible (non-singular).
The chain rule guarantees a composition of holomorphic maps is holomorphic, so the set of local biholomorphisms forms a pseudo-group. (Loosely, forms a group, modulo fine print about composability.) It therefore makes sense to speak of a "holomorphic structure" or a "holomorphic coordinate system" by declaring two $\Cpx^{n}$-valued coordinate systems to be compatible if the change of coordinates (a.k.a. the overlap map) from one to the other is holomorphic. This notion of compatibility is an equivalence relation; particularly, compatibility is transitive.
Anti-holomorphic maps are conjugate-analytic in an obvious sense, and are locally invertible at $p$ if and only if their Jacobian is non-singular. The derivative of an anti-holomorphic map is not complex-linear, however, and a composition of anti-holomorphic maps is not anti-holomorphic. Consequently, there is no notion of an "anti-holomorphic structure" or "anti-holomorphic coordinate system": The corresponding notion of "compatibility" is not transitive.
Loosely, "holomorphic" and "anti-holomorphic" are not "dual" or "perfectly symmetric" concepts; the distinction between them is not arbitrary. That said, the definition ultimately rests on a choice of complex square root $i$ of $-1$, and arguably such a choice is arbitrary. But this choice is fixed by the time one even asks about complex differentiability.
Comment: thanks Andrew for the answer. Very elaborate. I still have a question about the transformation. Yesterday, as I was looking deeper into my notes, I saw this:
The 'splitting' of an index b into $\beta$ and $\bar{\beta}$ is not preserved by general transformation of complex coordinates $z'^{\beta} = f ^{\beta}(z, \bar{z})$, but it is preserved under the special class of 'holomorphic' cordinate transformations $z'^{\beta}=f^{\beta}(z)$. So, accordingly, I am wondering about two things. (I will write them in a new comment)
Comment: 1)I you have written in the beginning of your answer that this has nothing to do with being complex-values, why is there a repeated tendency to compare between transformation of complex coordinates and holomorphic coordinate transformation?
2) I still haven't really understood what do we mean by holomorphic coordinate transformation.
Comment: For 2 (and possibly for 1), my [answer](http://math.stackexchange.com/questions/1268745/how-exactly-does-frac-partial-f-partial-barz-work/1268821#1268821) to a question about $z$ and $\bar{z}$ versus $x$ and $y$ may be of interest. Formally, $z^{\beta}$ and $\bar{z}^{\beta} = z^{\bar{\beta}}$ may be treated as independent variables, alternative to the real variables $x^{\beta}$ and $y^{\beta}$. A holomorphic map depends only on the $z^{\beta}$, not on the "conjugate" variables.
Comment: Oh right.. i see.. so, is there any reason behind the fact that a holomorphic map depends only on $z^{\beta}$ and not on the conjugate variables?
Comment: That's the definition of "holomorphic": $\dd f/\dd \bar{z}^{\beta} = 0$, i.e., "$f$ is constant with respect to $\bar{z}^{\beta}$".
Answer: You can talk about homomorphic and antiholomorphic functions, but a general complex-valued smooth function will not be the sum of a holomorphic function with an antiholomorphic one (for example, $|z|^2$ on $\mathbb{C}$). Also, the constant functions are both holomorphic and antiholomorphic.
On the other hand, complex-valued smooth $1$-forms do decompose into holomorphic and antiholomorphic components. In local coordinates $(z_i)$, the holomorphic $1$-forms are spanned by the $dz_i$, with smooth (not necessarily holomorphic) coefficient functions, and the antiholomorphic forms by their conjugates. Of course, you should check that this definition is independent of the choice of (holomorphic) coordinates.
I do not know why you would call the holomorphic components "complex," because they are no more complex than the antiholomorphic components. Usually, they would be called forms of type $(1, 0)$ or $(0, 1)$, because this generalizes to higher differential forms, and a "holomorphic $1$-form" is typically required to have holomorphic coefficients.
It is an instructive exercise to check if a holomorphic coordinate transformation is just a holomorphic map with a holomorphic inverse or not. Does the domain and/or codomain have to be an open subset of $\mathbb{C}$?

(Anti-) Holomorphic significance?


Difference between Color Space > Non-Color and Linear for normal maps

Question: I've opened a normal map in my Image Texture, the node was set to Color Space > Linear, and it doesn't seem to make any difference with Non-Color. Without going into too many details, can someone confirm? Thanks:

File:
Comment: This looks like a discution type of question from the main post. From the Title itself look like something like this https://blender.stackexchange.com/questions/144854/blender-2-8-image-texture-node-and-color-space Change your light source to see the difference, put a copy side by side and change the color space for one
Comment: thanks Emir but the post doesn't really answer, it says normal maps should be Non-Color, ok that's what I've always been told but Linear doesn't seem to make any difference?!?
Comment: Is it possible that your normal map was already in the linear color space, and that's why you didn't see any noticeable difference between the "Non-Color" and "Linear" color space settings?
Comment: the image i share is just an example, in my case I just created a black image (32 bit float), baked a normal map, and used it as a normal map. Then I noticed that the Image Texture was set to Linear. When I switched it to Non-Color it didn't seem to change anything, therefore my question
Answer: In most cases they are essentially the same and so is Raw. My tests showed no difference between the three. You have to make sure there is no gamma correction, which is done to improve visible images. The old dogma stems from back in the days when the image texture node did not have linear color space. However, to be on the safe side, I'd suggest you keep using non-color data, because:
Linear:
Blender's native linear space meaning there is no gamma mapping, using Linear Rec. 709 chromaticities and a D65 white point.
Non-Color and Raw:
Color space used for images which contains non-color data (e.g. normal maps).
https://docs.blender.org/manual/en/latest/render/color_management.html#ocio-config
Comment: OK thanks a lot for the answer


What is the difference between the | and || or operators?

Question: I have always used || (two pipes) in OR expressions, both in C# and PHP. Occasionally I see a single pipe used: |. What is the difference between those two usages? Are there any caveats when using one over the other or are they interchangeable?
Answer: Just like the & and && operator, the double Operator is a "short-circuit" operator.
For example:
if(condition1 || condition2 || condition3)

If condition1 is true, condition 2 and 3 will NOT be checked.
if(condition1 | condition2 | condition3)

This will check conditions 2 and 3, even if 1 is already true. As your conditions can be quite expensive functions, you can get a good performance boost by using them.
There is one big caveat, NullReferences or similar problems. For example:
if(class != null && class.someVar < 20)

If class is null, the if-statement will stop after class != null is false. If you only use &, it will try to check class.someVar and you get a nice NullReferenceException. With the Or-Operator that may not be that much of a trap as it's unlikely that you trigger something bad, but it's something to keep in mind.
No one ever uses the single & or | operators though, unless you have a design where each condition is a function that HAS to be executed. Sounds like a design smell, but sometimes (rarely) it's a clean way to do stuff. The & operator does "run these 3 functions, and if one of them returns false, execute the else block", while the | does "only run the else block if none return false" - can be useful, but as said, often it's a design smell.
There is a Second use of the | and & operator though: Bitwise Operations.
Comment: and `or` is not short-circuiting?
Answer: || is the logical OR operator. It sounds like you basically know what that is. It's used in conditional statements such as if, while, etc.
condition1 || condition2

Evaluates to true if either condition1 OR condition2 is true.
| is the bitwise OR operator. It's used to operate on two numbers. You look at each bit of each number individually and, if one of the bits is 1 in at least one of the numbers, then the resulting bit will be 1 also. Here are a few examples:
A = 01010101
B = 10101010
A | B = 11111111

A = 00000001
B = 00010000
A | B = 00010001

A = 10001011
B = 00101100

A | B = 10101111

Hopefully that makes sense.
So to answer the last two questions, I wouldn't say there are any caveats besides "know the difference between the two operators." They're not interchangeable because they do two completely different things.
Comment: *"It's used to operate on two numbers"* This is an inaccurate/incomplete description. `if (true | false)` is perfectly valid in C#.
Comment: This helped me understand how someone was using bitwise OR operator to merge filters in Mongodb C# driver. https://gist.github.com/a3dho3yn/91dcc7e6f606eaefaf045fc193d3dcc3#combine-filters
Comment: @arkon, If you go bitwise, 1 is true and 0 is false. So, these booleans might actually be taken as zero and ones. You can't do "str1" | "str2" can you?
Answer: One is a "bitwise or".

10011b | 01000b => 11011b

The other is a logic or.

true or false => true
Comment: `|` can be used on `bool` types as well without short circuiting.
Comment: For anyone not familiar with bitwise operators, the result example is obtained because each bit row from each column is tested against the other using OR comparison. https://learn.microsoft.com/en-us/cpp/c-language/c-bitwise-operators
Answer: Good question.  These two operators work the same in PHP and C#.
| is a bitwise OR.  It will compare two values by their bits.  E.g. 1101 | 0010 = 1111.  This is extremely useful when using bit options.  E.g. Read = 01 (0X01) Write = 10 (0X02)  Read-Write = 11 (0X03).  One useful example would be opening files.  A simple example would be:
File.Open(FileAccess.Read | FileAccess.Write);  //Gives read/write access to the file

|| is a logical OR.  This is the way most people think of OR and compares two values based on their truth.  E.g. I am going to the store or I will go to the mall.  This is the one used most often in code. For example:
if(Name == "Admin" || Name == "Developer") { //allow access } //checks if name equals Admin OR Name equals Developer

PHP Resource: https://www.php.net/language.operators.bitwise
C# Resources: http://msdn.microsoft.com/en-us/library/kxszd0kx(VS.71).aspx
http://msdn.microsoft.com/en-us/library/6373h346(VS.71).aspx
Comment: FWIW, Technically, in C# `|` is a **logical or** when applied to **booleans**. As your linked reference states. In practice, the end result is the same as if it were a bitwise operator, because the bitwise values of `true` and `false` are such that a bitwise or of their values produces the exact same result as a logical or does. That is `(int)(bool1 | bool2)` == `((int)bool1) | ((int)bool2)`.
Answer: & - (Condition 1 & Condition 2): checks both cases even if first one is false
&& - (Condition 1 && Condition 2): dosen't bother to check second case if case one
                                   is false
&& - operator will make your code run faster, professionally & is rarely used
| - (Condition 1 | Condition 2): checks both cases even if case 1 is true
|| - (Condition 1 || Condition 2): dosen't  bother to check second case if first
                                   one is true
|| - operator will make your code run faster, professionally | is rarely used
Comment: `rarely used`? All depends on what you want or need to do.
Comment: Great! Short and sweet, I would remove the "| is rarely used" and "& is rarely used" because, as Emaborsa said, its really depends on what you want or need to do.
Comment: *Is rarely used* means *is rarely the appropriate operator,* because in all possible cases an "or" operation should short-circuit.
Comment: I rely on bitwise operations quite heavily. These specific operators are also useful when dealing with flags. You're mistaking *people rarely use them* with *I rarely use them*.
Answer: Simple example in java
public class Driver {

  static int x;
  static int y;

public static void main(String[] args)
throws Exception {

System.out.println("using double pipe");
    if(setX() || setY())
        {System.out.println("x = "+x);
        System.out.println("y = "+y);
        }

System.out.println("using single pipe");
if(setX() | setY())
    {System.out.println("x = "+x);
    System.out.println("y = "+y);
    }

}

 static boolean setX(){
      x=5;
     return true;
  }
 static boolean setY(){
      y=5;
      return true;
  }
}

output :
using double pipe
x = 5
y = 0
using single pipe
x = 5
y = 5

Comment: Why would you give a java example for a question that doesn't even mention java?
Answer: The single pipe, |, is one of the bitwise operators.
From Wikipedia:

In the C programming language family, the bitwise OR operator is "|" (pipe). Again, this operator must not be confused with its Boolean "logical or" counterpart, which treats its operands as Boolean values, and is written "||" (two pipes).
Answer: By their mathematical definition, OR and AND are binary operators; they verify the LHS and RHS conditions regardless, similarly to | and &.
|| and && alter the properties of the OR and AND operators by stopping them when the LHS condition isn't fulfilled.
Answer: For bitwise | and Logicall ||
OR
bitwise & and logicall &&
it means   if( a>b | a==0)
in this first left a>b will be evaluated and then a==0 will be evaluated then | operation will be done
but in|| if a>b then if wont check for next RHS
Similarly for & and &&
if(A>0 & B>0)
it will evalue LHS and then RHS then do bitwise & but
in(A>0 && B>0)
if(A>0) is false(LHS) it will directly return false;
Answer: The singe pipe "|" is the "bitwise" or and should only be used when you know what you're doing. The double pipe "||" is a logical or, and can be used in logical statements, like "x == 0 || x == 1".
Here's an example of what the bitwise or does: if a=0101 and b=0011, then a|b=0111. If you're dealing with a logic system that treats any non-zero as true, then the bitwise or will act in the same way as the logical or, but it's counterpart (bitwise and, "&") will NOT. Also the bitwise or does not perform short circuit evaluation.
Comment: '|' can also be used on `bool` types without short circuiting.
Answer: The | operator performs a bitwise OR of its two operands (meaning both sides must evaluate to false for it to return false) while the || operator will only evaluate the second operator if it needs to.
http://msdn.microsoft.com/en-us/library/kxszd0kx(VS.71).aspx
http://msdn.microsoft.com/en-us/library/6373h346(VS.71).aspx
Comment: That's not what bitwise means.
Comment: If you actually read those articles, you would have seen that they are referring to bitwise operators


The new leaves near the stem of my Dracaena are turning black

Question: Why are these turning black.. they were green when I got this plant a few weeks black. Also the tips of some of the leaves are turning brown..please help.. I am new to this.. I am watering after checking the soil is dry
Answer: The brown tips indicate it is getting too dry between waterings. I have not seen black leaf stumps but I occasionally pull the brown stumps off , maybe they would turn black if left.
Answer: The black leaves at the bottom are normal. They were once protective sheaths for new growth and are no longer needed. You can remove them.
Dracaena are one of the types of plants that are especially sensitive to the fluoride in tap water. That causes brown leaf tips. Watering the plant with distilled water will solve that problem.
Other things that cause brown leaf tips are improper watering and too low humidity.
You should allow the top 1-2 inches of soil to become dry to the touch between watering.
You can raise the humidity around the plant by grouping it with other plants (all plants give off moisture through respiration). Another way is to place a small dish filled with rocks and water near the plant. The evaporation of the water will raise the humidity around the plant.


Bar Linkage - Inverse Kinematics

Question: I am trying to make a linkage assembly using inverse kinematics. I have two arms parallel to each other which are to rotate with one another, while a link connects the two and is to stay parallel to the ground. When I rotate the linkage, the IK flips at 180° of rotation. How do I ensure the connecting link stays parallel to the ground while the two rotating arms are locked in rotation? I've attached a video for reference. Thanks!
https://1drv.ms/v/s!AqKAv0U30ygKhSG67bzjTSVed0mK?e=xVM6FR
Answer: The IK solver generally seeks to minimize the rotation of every bone involved in the chain, from either their rest orientation or from their orientation prior to the evaluation of the IK.  When your angle passes through 180 degrees, the IK's first bone changes direction in order to minimize the rotation required of the second bone.
We can change this behavior by changing the rest orientation of the IK chain:

By rotating the resting IK chain, the second bone in the chain no longer has a preference for any particular direction relative to the first bone, and any rotation is going to be distributed evenly between both bones.
It's not strictly necessary that this be built into the actual rest pose of the bones.  This can be achieved by giving the chain bones pose mode rotation instead.  This is easiest to do numerically, after changing the bone rotation mode to an Euler mode.
However, your overall goal-- "the two rotating arms are locked in rotation"-- is not best served by IK here.  Instead of IK, we can use a copy rotation constraint on one bone and a damped track on the other bone:

The bone that was the first bone in the IK chain now copies the world space rotation of our control, shown in the properties viewport; the bone that was the second bone in the chain now damped tracks the tail of our control.
Comment: Thank you so much for your thorough response! Working great now

Bar Linkage - Inverse Kinematics


Custom checkout and SSL secure on every elements

Question: My Magento store has a custom checkout.
We are currently trying to turn this checkout in https.
Everythings' gone well, but the fact that non checkout specific elements (such as menu and footer pictures) are not turned in https, so that the browsers send alerts.
Is there a specific base URL method or something that would turn all elements of the page in https ? It seems that Magento does it seamlessly on the standard theme...
Answer: If you are using images in your header and footer they must specify that they need to be secure else they will just use the standard base url e.g for a secure image
<code>$this->getSkinUrl('images/logo.png', array('_secure'=>true));
</code>
Remember, the header and footer get cached so they can't just be implemented on a certain page. You will need to specify them as secure all the time.
Another solution is to have a separate header and footer for checkout (which we always do) that uses the secure code above. Having checkout specific headers and footers is good for usability and minimizing abandonment.


Clone SXA OOB component javascript

Question: I am using Sitecore 9.1 and SXA 1.8, I need to clone "component-search-results-count.js" in base theme to extend some functionality to the OOB "Search Result Count" component.
How can I do that?
Answer: The way I do this is to create a copy of the JavaScript file, in this case component-search-results-count.js and add that to my theme, or create a custom base theme.
As for the base theme, I normally make a copy of it, for example, the Components Theme, then I use my copy as the base theme for my sites theme, instead of the OOTB version. This means I can then remove any files that I override without touching the OOTB base theme.
The reason, I add the files to the theme instead of just modifying the ones in my copy of the base theme, is so that I can easily use Creative Exchange to import the modified files. Creative Exchange does not import any of the files in the base themes.
Of course, you can always just remove the files from the OOTB Base Theme, but then you would have to make sure that you replicate that on each upgrade.
Comment: thanks, I think it is good approach of copying base theme. But i have a confusion here If I want to create a copy of the JavaScript file and add that to my theme how i make sure that copy file is used not OOTB file in base theme.
Comment: Remove the base theme from your sites theme

Clone SXA OOB component javascript


Applying raw torques to joints in Gazebo simulation

Question: I have a 7dof arm that I want to simulate, and the experiment requires me to be able to apply torques to the 7 servomotors (actuators) in the simulation. I would like to know how I can set up "actuators" in simulation so that I can apply torques to using a ROS topic.
So far, I have been able to add torque sensors to my URDF and monitor torques using sensor topics, I want to do the exact reverse of this where I can publish to set topics and have the torques be applied to the Gazebo simulation.
Answer: Have a look at the apply joint force example sdf.
Comment: Did this answer your question?


web-based consoles and special characters

Question: I sometimes handle virtual-machines in VMware vCloud Director console or in Digital Ocean web console. Both work in browsers. I have also managed some RSA adapters on IBM servers which use Java plug-in in web-browser. The problem is, that often various key-presses(for example Ctrl+k)/characters(for example Shift+7) do not reach the (virtual) server or (virtual) server receives false keycodes and one needs to use onscreen keyboard in virtual server if this is available. I guess there is no workaround and it depends solely on the developer of this web-based console or even the operating system where browser runs?
Comment: Dunno if it will help, but there might be some useful information in Chrome's [`hterm/SSH` app's README](https://chromium.googlesource.com/apps/libapps/+/master/nassh/doc/faq.txt). With a Chrome browser you can open a tab/app in a separate window with *`More tools > Create application shortcuts`* and in the separate popouts that result the regularly intercepted browser shortcuts are passed through to the application. I dunno how/if that would apply to Firefox, though.
Comment: Have you tried `echo -e` and then designating the actual character that you want to send to the terminal? `echo -e '\07'` for sending an ascii bell to the terminal for example. This would simulate a CTRL-g
Answer: The poor folks writing a web based terminal for a kvm/ip product are almost certainly not going to have an unqualified success. There are too many challenges in the way even if you ignore unicode issues and just focus on the american market. I am going to ignore the video/mouse issues as they are mostly solved (except for movies/games with high frame rates) and focus on the keyboard.
My first keyboard was ascii. It had 8 bit parallel ribbon cable that connected it to a z80 machine. This for the most part worked well, the z80 used ascii for everything and since the shift key does not have an ascii code it went on its merry way never knowing or caring if you pressed the shift key. The shift was solely the responsibility of the keyboard as was the control key (no alt or meta keys) and the fact that there was no difference between ctrl t and shift ctrl t bothered no one, it was the keyboard's responsibility to just send ascii. All of my early keyboards just sent ascii whether it be parallel or serial. This worked fine as long as you did not want to send an umlaut or anything else that could not be encoded in ascii.
Now the IBM PC was different it had the ability to change what character set it used. (I believe that this practice may have been in use somewhere else prior to this, but this was my first exposure to a keyboard that did not talk ascii.) The PC had a three layer keyboard model which is still in use to this day although slightly changed. It used scan codes, key codes, and character codes. the scan code is a pure hardware abstraction. The keys were numbered in layout order no relationship to any standard outside of IBM. and each key had a press code and a release code. These press and release codes were called scan codes. The scan codes were then mapped into keycodes (which release events used the same key code as press events but were handled differently) and to character codes Which was by default ascii, but could be changed if you needed european languages. These days unicode has mostly replaced ascii, but the layers are mostly unchanged if spread thinner as most windowing environments provide key events for keypresses that don't have character codes. Now the challenge is to undo all that and what the web browser puts in as well.
Comment: This is an awesome answer. I wanted to keep reading...
Comment: I was going to write more , but I got interrupted.
Comment: hildred... I had interpreted the above comment to indicate there was more yet to come...? Was I wrong? That would be disappointing.


/e/ OS location service jumps between correct and fixed wrong location

Question: I have /e/ OS 1.18 installed on my phone.
Ever since I've started using /e/ OS, occasionally my phone would pick a semi-random* fixed location and then alternatingly pass on either my real location or the randomly picked one to apps using the location service.
*By semi-random I mean that it is usually relatively close to me (generally no further than 100km) and usually in a plausible place (a public road, square, railway station...) but otherwise wholly inexplicable.
In the past I had some luck with clearing cache & storage of the System App called Nominatim Geolocator (or similar) – this would fix the problem for a few weeks – but in my current version of /e/ OS I cannot find this app anymore.
In the Advanced Privacy settings, I chose to expose my location and IP address, but this did not help. Neither did clearing cache & storage of Advanced Privacy, nor disabling Advanced Privacy as the mock location app via the developer options.
What can I do to permanently get rid of this problem?
Answer: It sounds to me that your GPS hardware is not working reliably.  When Location Services is on, it tries its best, using GPS, Cell Tower etc.  In this case its using the Cell-tower location.
Comment: Is there a way to disable usage of cell tower location and force usage of GPS coordinates?


Encrypting folders with flash drive key?

Question: Is there any way to have a flash drive encrypted and it will only open with one computer that has the key in it?
Answer: Install a program like PGP, and save your public and private keys to your hard drive - specifically in your own login account. Encrypt the drive. When you try to decrypt it, it will require your private key. Don't copy the keys to any other source. Many dual-key encryption methods are good for this purpose.
For the PGP example, there are whole disk versions of PHP that use key and passphrase.
More info on that topic can be found here:
"PGP Whole Disk Encryption can encrypt the thumb drive so that it is only usable on computers with the proper keys." http://symantec.com/connect/blogs/doing-more-pgp-whole-disk-encryption


Given a number $n \in \Bbb{N}$. In how many ways can $n$ be written as $\prod_{i=1}^{k}n_i$ such that $n1|n2|\ldots|n_k|n$?

Question: I came to this problem in a question a few days ago. I have not found any duplicates so I assume there are none. In fact, the proposed problem is equivalent to "How many abelian groups are there with order $n$?". First of all I tried to solve the problem where $n=p^a$ with $p$ prime. Looking at some examples like $p=p^{i}p^{i.j}p^{a-i-i.j}$ I came to the conclusion that each solution corresponds to the sizes of a partition of a set with $a$ elements (in the example the partition sizes are $(i,i.j,a-i-i.j)$, and vice versa. Then I tried some solutions where $n=p^aq^b$ where $p$ and $q$ prime and coprime. For every solution we write the exponents of $p$ and $q$ in the factors of the decomposition in a matrix where the rows are these exponents per factor and the columns correspond to the exponents of $a$ resp. $b$. An example Let $n=72$ then a solution is $72=12.6$ (I reversed the order on purpose). This would give rise to a matrix of the form $\bigl( \begin{smallmatrix} 2 & 1 \\ 1 & 1 \end{smallmatrix} \bigr)$, because $12=2^2.3^1$ and $6=2^1.3^1$. In the same way the decomposition $72=6.6.2$ corresponds to the matrix $\bigl( \begin{smallmatrix} 1 & 1 \\ 1 & 1 \\ 1 & 0 \end{smallmatrix}\bigr)$. The only conditions on these matrices is that the sum of the first column is $3$, because $2$ occurs with exponent $3$ in $72$, that the sum of the elements of the second colum is $2$ and that the elements of each column are non increasing. I suspect that, if I order these partitions by decreasing size I can fill in for the first column any list of sizes of a partition of $3$ elements, and any list of sizes of a partition of $2$ elements in the second column. This would imply that there are $3.2=6$ abelian groups of order $72$. If my suspicion is right then for any number $n=p_1^{e_1}p_2^{e_2}.\ldots.p_k^{e_k}$ there are $\prod_{i=1}^{k}P(e^i)$ abelian groups of order $n$ with $P(a)$ the number of partitions of $a$ elements.
Answer: If you write "as the product of k numbers", and you found the answer for $p^a$, then I'd say the answer for $p^a q^b r^c$ would be the product of the answers for $p^a$, $q^b$ and $r^c$.
If you exclude trivial answers where $n_1 = 1$, then the largest k would be the largest of the prime exponents in the factorisation. So all you need is f (a, k) = "number of ways to write a as the sum of k non-decreasing non-negative integers"; you factor $n>1$ into the product of powers of primes $p_i^{a_i}$, let K = largest of the $a_i$, then for each $1 ≤ k ≤ K$ calculate the product of $f (a_i, k)$ over all i in the factorisation, and add the products.
Comment: I don't understand what you mean by "then the largest k would be the largest of the prime exponents in the factorisation". can you give an example?
Comment: (+1) Concise answer that represents the givens of the problem.
Answer: The following remarks  establish an exact formula for  these chains in
terms of the cycle index of  the symmetric group on $v$ elements, with
$v$ being the  maximal exponent of a prime  in the prime factorization
of $n.$
Suppose $$n  = \prod_{q=1}^m p_q^{v_q}$$ is the  prime factoriation of
$n.$ Now if we consider the  exponents $w_1, w_2, w_3, \ldots, w_k$ of
$p_q$ dividing $n_1, n_2, n_3, \ldots, n_k$ then we must have
$$w_1\le w_2\le w_3\le\cdots\le w_k
\quad\text{and}\quad \sum_{j=1}^k w_k = v_q.$$
The  number  of such  $k$-tuples  can  be  calculated with  the  Polya
Enumeration Theorem (PET) and has the species equation
$$\mathfrak{M}_{=k}
(\epsilon + \mathcal{Z} + \mathcal{Z}^2 + \mathcal{Z}^3 + \cdots).$$
This translates to the generating function equation
$$[z^{v_q}] Z(S_k)\left(\frac{1}{1-z}\right).$$
It follows that the count $P_{n,k}$ of such tuples/chains is given by
(this is the promised exact formula)
$$P_{n,k} =
\prod_{q=1}^m [z^{v_q}] Z(S_k)\left(\frac{1}{1-z}\right).$$
This includes  chains that have a  prefix of a string  of one factors,
which we  are apparently not counting here.  These inadmissible chains
among  the chains  counted by  $P_{n,k}$ have  the property  that they
correspond  bijectively  to the  chains  from  $P_{n,k-1}.$ Hence  the
desired value $Q_{n, k}$ is given by
$$Q_{n,k} = P_{n,k} - P_{n, k-1}.$$
Here are some examples of the cycle indices that are used:
$$Z(S_3) = 1/6\,{a_{{1}}}^{3}+1/2\,a_{{2}}a_{{1}}+1/3\,a_{{3}},$$
$$Z(S_4) = 1/24\,{a_{{1}}}^{4}+1/4\,a_{{2}}{a_{{1}}}^{2}
\\+1/3\,a_{{3}}a_{{1}}+1/8\,{a_{{2}}}^{2}+1/4\,a_{{4}}$$
and
$$Z(S_5) = {\frac {{a_{{1}}}^{5}}{120}}+1/12\,a_{{2}}{a_{{1}}}^{3}\\
+1/6\,a_{{3}}{a_{{1}}}^{2}+1/8\,a_{{1}}{a_{{2}}}^{2}\\
+1/4\,a_{{4}}a_{{1}}+1/6\,a_{{2}}a_{{3}}+1/5\,a_{{5}}.$$
It  is  not  difficult to  see  that  the  maximum  $k$ such  that  an
admissible chain for $n$ exists is the maximal exponent call it $v$ of
a prime $p$  in  the  prime  factorization  of  $n.$  (This  was  also
observed by the  first responder  above.)  The  chain  is  obtained by
distributing $v_q$ copies of  $p_q$ into the $v$ slots  starting  from
the right, with divisibility being determined from the left. The value
in a slot is the product of the primes that have been distributed into
it.

It follows that  the total number $T_n$ of  admissible chains is given
by
$$T_n = \sum_{k=1}^v Q_{n,k}
= \sum_{k=1}^v (P_{n,k} - P_{n,{k-1}})
= P_{n, v}
= \prod_{q=1}^m [z^{v_q}] Z(S_v)\left(\frac{1}{1-z}\right).$$
This gives the sequence
$$1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 5, 1, 2, 1, 2, 1,\\
1, 1, 3, 2, 1, 3, 2, 1, 1, 1, 7, 1, 1, 1, 4, 1, 1, 1, 3, 1, 1, 1,\\
2, 2, 1, 1, 5, 2, 2, 1, 2, 1, 3, 1, 3, 1, 1, 1, 2, 1, 1, 2, 11,\ldots$$
which is OEIS A000688
where we find that indeed it  counts the number of Abelian groups as
surmised by the OP.
The Maple  code for  these including a  verification of the  values of
$Q_{n,k}$ by brute force (routine Q_ex) is as follows:

with(numtheory);
with(combinat);

pet_cycleind_symm :=
proc(n)
local p, s;
option remember;

    if n=0 then return 1; fi;

    expand(1/n*add(a[l]*pet_cycleind_symm(n-l), l=1..n));
end;

pet_varinto_cind :=
proc(poly, ind)
local subs1, subs2, polyvars, indvars, v, pot, res;

    res := ind;

    polyvars := indets(poly);
    indvars := indets(ind);

    for v in indvars do
        pot := op(1, v);

        subs1 :=
        [seq(polyvars[k]=polyvars[k]^pot,
             k=1..nops(polyvars))];

        subs2 := [v=subs(subs1, poly)];

        res := subs(subs2, res);
    od;

    res;
end;

P :=
proc(n, k)
    option remember;
    local pv, p, ind, gf;

    ind := pet_cycleind_symm(k);
    gf := pet_varinto_cind(1/(1-z), ind);

    p := 1;

    for pv in ifactors(n)[2] do
        p := p*coeftayl(gf, z=0, pv[2]);
    od;

    p;
end;

Q :=
proc(n, k)
    option remember;
    P(n,k) - P(n, k-1);
end;

T :=
proc(n)
    option remember;
    local pv, mx;

    mx := -1;
    for pv in ifactors(n)[2] do
        if pv[2] > mx then
            mx := pv[2];
        fi;
    od;

    P(n, mx);
end;

chooserep :=
proc(data, sofar, k, res)
    if k=0 then
        res[sofar] := 1;
        return;
    fi;

    if nops(data) > 0 then
        if nops(sofar) = 0 or data[1] mod sofar[-1] = 0 then
            chooserep(data, [op(sofar), data[1]], k-1, res);
        fi;
        chooserep([op(2..nops(data), data)], sofar, k, res);
    fi;
end;

Q_ex :=
proc(n, k)
    option remember;
    local res, tupl, divchoose;

    res :=0;

    divchoose := table();
    chooserep(sort(convert(divisors(n) minus {1}, list)),
              [], k, divchoose);

    for tupl in [indices(divchoose, 'nolist')] do
        if convert(tupl, `*`) = n then
            res := res+1;
        fi;
    od;

    res;
end;

Addendum. One possible improvement of Q_ex would be not to collect all chains and then check them for admissibility and instead check admissibility as they are generated. The code looks the way it does because it started with the Maple command choose as its paradigm.


Wire transfer from India to US

Question: I would like send/lend money from US account to My brother-in-law's Indian account(international wire transfer) for 30 lakhs. This will be no interest loan to him. My brother-in-law needs this money for buying house.He will be returning money back to me after 3 months.
Can my brother-in-law wire back money to my US account from his Indian account after 3 months?
I assume that some CA certificate would be needed
What is exact process for this ?
Answer: The simplest way is you transfer the funds into your NRE account in India. From the NRE account transfer the funds to your brother-in-law and show the purpose as Loan. From 2012 onwards RBI has simplified things under FMEA and your brother-in-law can deposit/repay the loan back into the NRE account.
Once the funds are in NRE account you can repatriate then whenever you like. This entire process requires less paperwork.
The option you have suggested is also fine, however your brother-in-law needs to engage the services of a CA and he will authenticate the purpose of remittance to the Bank. Based on this certificate the Bank will transfer the funds outside of India.
Comment: May be I am wrong, but I thought deposits to NRE account in rupees is not allowed.
Comment: @KintKant You are right, generally deposits to NRE account should come outside of India [currency does not matter]. There are exceptions when certain types of deposits can be done locally.

Wire transfer from India to US


What are the names of the 2 types of beacon a phone and an AP send

Question: As I understand it your phone (Android) sends out beacons to ask local access points if they are one of its preferred networks.
Access points also send out beacons announcing they are there.
What are the specific names given to these two types of beacons?
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 your own answer and accept it.
Answer: According to this source, the signals your phone sends out are called Probe Requests and the signals the Router/AP sends out are called Beacon Frames.
Answer: An end-station would send beacons for an Ad-Hoc network, but not to a WAP. You should really get the scoop directly from the IEEE 802.11 Wireless LAN Standards, but Wikipedia has a description of the management frames which IEEE 802.11 uses:

Management frames allow for the maintenance of communication. Some
  common 802.11 subtypes include:

Authentication frame: 802.11 authentication begins with the Wireless    network interface card (WNIC) sending an authentication
  frame to the    access point containing its identity. With an open
  system    authentication, the WNIC sends only a single authentication
  frame,    and the access point responds with an authentication frame
  of its own    indicating acceptance or rejection. With shared key
  authentication,    after the WNIC sends its initial authentication
  request it will    receive an authentication frame from the access
  point containing    challenge text. The WNIC sends an authentication
  frame containing the    encrypted version of the challenge text to the
  access point. The    access point ensures the text was encrypted with
  the correct key by    decrypting it with its own key. The result of
  this process determines    the WNIC's authentication status.
Association request frame: Sent from a station it enables the access    point to allocate resources and synchronize. The frame
  carries    information about the WNIC, including supported data rates
  and the    SSID of the network the station wishes to associate with.
  If the    request is accepted, the access point reserves memory and
  establishes    an association ID for the WNIC.
Association response frame: Sent from an access point to a station    containing the acceptance or rejection to an association request. If
  it is an acceptance, the frame will contain information such an
  association ID and supported data rates.
Beacon frame: Sent periodically from an access point to announce its    presence and provide the SSID, and other parameters for WNICs
  within    range.
Deauthentication frame: Sent from a station wishing to terminate    connection from another station.
Disassociation frame: Sent from a station wishing to terminate    connection. It's an elegant way to allow the access point to
  relinquish memory allocation and remove the WNIC from the association
  table.
Probe request frame: Sent from a station when it requires information    from another station.
Probe response frame: Sent from an access point containing capability    information, supported data rates, etc., after receiving
  a probe    request frame.
Reassociation request frame: A WNIC sends a reassociation request    when it drops from range of the currently associated access point and
  finds another access point with a stronger signal. The new access
  point coordinates the forwarding of any information that may still be
  contained in the buffer of the previous access point.
Reassociation response frame: Sent from an access point containing    the acceptance or rejection to a WNIC reassociation request frame.
  The frame includes information required for association such as the
  association ID and supported data rates.
Comment: TL;DR Access Points send *beacons* (per standard, 10 per second). Clients send *probes*.


openFrameworks + ofVideoPlayer image tearing

Question: I'm using ofVideoPlayer and for some reason there is some flicker/tear the moment of the transitions between the videos. I've tried to change the video format, i added ofSetVerticalSync(true);and it stills gets that error.
How can i fix this?
Answer: I had a lot of struggle with Openframeworks and Tearing.
Basically, it depends a lot on your Hardware.
You may install drivers to force the graphic cards vsync.
It is more true if you run OF with Linux OS.
Answer: If you are on windows certainly look into the graphics cards settings panel and experiment with different settings for vertical sync.
If you are on on OSX there are some other video players you might want to test.
http://forum.openframeworks.cc/t/ofxavfvideoplayer/12770
Recently I have had the best results with the HAP codec and the hap player. It loads super quick and supports alpha channels. I would definitely try that.
https://github.com/bangnoise/ofxHapPlayer


Catch the window.open from javascript

Question: I have a web page into a html iframe, the web page has a javascript function to open links, that function use the window.open method to open a new window.
I cannot modify the javascript function (the page is made with mapguide), so I want to catch that call outside of the iframe to put the content of the new window into an ajax modal frame, instead of open a new window, is this possible?
Comment: If the frames are from the same domain and port, you can override the window.open function to do something else you want.
Comment: I forgot to mention I'm making my web page in asp.net, c#
Answer: While I would not recommend this in general, you can overwrite the definition of the window.open function in the iframe, assuming your page and the iframe are in the same domain to avoid XSS security errors.
HTML:

javascript in the parent window:
var frame = document.getElementById('myFrame');

if (frame) {
    frame.contentWindow.open = function (url, windowName, windowFeatures) {
        // do whatever you want here (e.g. open an ajax modal frame)
    };
}

Comment: I've tried this, but after execute the 'frame.contentWindow.open' line I get: 'frame.window is null or is not a object'; I'm running this on internet explorer 8, this is my code:  var d = document.getElementById("ifr"); //my frame
 if (d) {
        var ifropen = d.contentWindow.open;
        d.contentWindow.open = function (url, windowName, windowFeatures) {
            alert(windowFeatures);
            return orgOpen(url, windowName, windowFeatures);
        }

        d.window.open("http://stackoverflow.com");
    }
Comment: @NatyBizz you are missing a `;` after you assign a new function to `d.contentWindow.open` and you have an extra `;` in your call to `d.window.open`.
Answer: I'll assume the 'mapguide' content is served from a different domain than the page containing the iframe.
If that's the case, you'd need to "proxy" the 'mapguide' content -- i.e: your iframe will need to load the mapguide content from another script URL (I'll assume PHP for this example) on your server, whose code would fetch the 'mapguide' software from wherever it really comes from. This part is easy, and the server-side code might look like this:
<?
    $content = file_get_contents('http://mapguide.domain/path/to/contents');

    // alter content here

    print $content;
?>

The iframe src attribute should point at the PHP file on your server which contains that code (instead of the 'mapguide' server).
If the 'mapguide' content contains HTML links, loads CSS/JavaScript files, or does AJAX calls, then you'll need to have your server-side code rewrite those URLs to refer back to your server. That part is not very easy, and really depends on how complicated the 'mapguide' JavaScript is.
So after the comment above that says alter content here, you'd need to do some awful regexp replacements on (or parse and re-generate) the HTML contained in $content, with the goal of changing every single URL to pass through your "proxy" PHP script and be loaded from the appropriate place on the 'mapguide' server.
If you manage to pull all of that off, then your iframe will be server from the same domain as your containing HTML page and so the outer page's JavaScript will be able to replace the window.open function of the iframe -- to prevent the popup, or do whatever you want instead -- as @jbabey says in another answer.
All of this presumes that the 'mapguide' content doesn't come with a user agreement and/or copyright policy which forbids "scraping" (automatically copying) their (the 'mapguide' content's authors') content.
Answer: Here's a similar snippit I've been working on... it was tricky getting the contentWindow right, but maybe this provides some insight?
//get a reference to the iframe DOM node
var node_iframe = document.getElementById("myiframe");

//get a reference to the iframe's window object
var win_iframe = node_iframe.contentWindow;

//override the iframe window's open method
win_iframe.open = function(strUrl,strName,strParams){

    /* create an object (to substitute for the window object) */
    var objWin = new Object;

    /* save the open arguments in case we need them somewhere */
    objWin.strUrl = strUrl;
    objWin.strName = strName;
    objWin.strParams = strParams;

    /* create a blank HTML document object, so any HTML fragments that
     * would otherwise be written to the popup, can be written to it instead */
    objWin.document = document.implementation.createHTMLDocument();

    /* save the object (and document) back in the parent window, so we
     * can do stuff with it (this has an after-change event listener that
     * pops a YUI Panel to act as a kind of popup) -- NOTE: the object in
     * the parent window that we're saving this to has YUI Attribute installed
     * and listens to changes to the objPopupWindow attribute... when it
     * gets changed by this .set() operation, it shows a YUI Panel. */
    parent.MyCustomClassObjectWithYUIAttributes.set('objPopupWindow', objWin);

    /* return the object and all its members to whatever was trying to
     * create a popup window */
    return objWin;
    };//end override method definition

Catch the window.open from javascript


What is the difference between request, response and server?

Question: What is the difference between request, response and server?
Comment: who subtract my score just now? why?
can you give me a reason?
i'am just a freshman in stackoverflow.com!
Comment: I suppose people are downvoting you because this is a very general question without much context about what you really want/need to know. It is the kind of thing someone without any knowledge of computers would ask.
Comment: haha ,maybe you are right,i just want to test this website's function.
i think this is a special website.
Answer: Request : From Client to Server
Response: From Server to Client
Server: Receive Request and Send Response
Client: Send Request and Receive Response
Comment: simple answer and simply understand it
Answer: A client (web user) makes a Request to a Server which processes the Request and determines the appropriate Response
Answer: Server: Machine that provide something for client.
Focus at Server,
Request is message that arrive to server for request something.
Response is message that send from server to client for give thing that client what.
anyway REQUEST/RESPONSE means you can know it with common sense.
See also:
http://en.wikipedia.org/wiki/Request-response
Answer: The 1st answer (Ramesh Soni's answer) is simple and concise. I also wanna share a useful terms distinction that's relevance to this.
What's the difference between request and query???

First of all, query and request can both be nouns and verbs. E.g:

I requested a refund.
We received a request for a refund.
I queried the price.
We received a query about the price.

To request something is to ask for something, an object or a favour etc. A request is a polite demand. To query is to ask about something i.e. you are wanting information. A query is a question.
Also, QUERY is an inquiry(Query and inquiry are synonyms)
They are both requests but the difference is that the QUERY is a precise request. In informatics, if you need information about something you need to send a specific request with precise information.

"I queried information about user account Maxim Pavlov" = "I need to know about this website users. In particular, I need to know if there is any Maxim Pavlov registered on this site".

If you are Arabic, best translations in Arabic would be, request = طلب and query = إستعلام)
Comment: Please refrain from copy paste from google. https://www.italki.com/question/311940?hl=en
Also please avoid adding redundant information or add answers to questions that have not been asked.
Comment: For the sake of your reputation, I would friendly recommend you to modify your answer to something that is useful and original, before it gets downvoted.


subversion hook template for access control on windows

Question: I set up a subversion server with bitnami stack for subversion on windows XP operating system. It was for local network and i would like to control steal lock and break lock abilities in accessing the repo. I changed pre-lock.tmpl and pre-unlock.tmpl to executable but it still is not working yet. It worked well when i tested it on linux system for bitnami stack. When i peeked into the template script, the script is for linux system. Can i get the script to work on windows XP?
Answer: The hook scripts in Windows are Batch files, not .EXE executables.  The hook scripts should be changed to <name>.bat, e.g. pre-unlock.bat
Code the .bat file just like you would any other Windows CMD.EXE script.


Power Steering leaks oil on my 98 Honda accord 2.3L

Question: power steering oil leaks and makes noise when I turn the steering wheel. Can anyone suggest what it could be?
Answer: It could be the power steering reservoir or the steering rack or anything between the 2. A mechanic would visually inspect for the source of the leak. If he can't initially find it, he would clean around all lines and components and use dye to locate the source. He would then bleed the system and make sure the pump is good. Find a reputable shop and have it inspected. You don't want to have a sudden steering loss.


My Marie gold plant is drying up

Question: I brought a Marie gold plant and I kept it in sunlight ,I water it twice a day ... But it seem that leaves and buds are drying up .. I even cut a dry leaves a week before ...but still it continues drying...I can see that the buds are flowered soon such that they are even small.
Comment: Do you mean marigold (though your plant looks a little tall to be one of those) or a different plant? what soil is in the pot and how big is the pot (can't see all of the pot in the image)?
Comment: The soil looks dry.  A larger pot would be much better to provide moisture control. I think even once a day water requirement means the pot is too small.
Answer: After reading through the comments and a little research I have learnt that a Marie Gold is an actual plant. Apologies I thought it was a typo at first. It is not a true Marigold but is a good companion plant similar to marigolds.
From the images it would appear that the soil is very dry. Do you have any stones or pebbles below the soil to store water in, this could help. I usually but a layer of stones below the soil when I plant flowers.
Could you try placing the plant pot on a saucer or tray of water to help keep the soil moist.
Answer: Your plant is dehydrated beyond its thirst. Marigolds are native to tropics, and they thrive in moist and warm and humid environment. Your issue is a either of two or both:-
1.) Underwatering.
2.) Cultivating marigold on higher altitudes where the excess cold and dry weather can cause the plants to dry out by transpiration.
Also, try moving it indoors in a place where direct sunlight will fall through it and it benefits from heat. Thus, it'll be insulated from excess cold and dry weather as also will be subject to high humidity indoors.
Bonus point: More sunlight = more carotenoids= darker orange hues on marigolds, oranges, mandarins and so on.

My Marie gold plant is drying up


Why is Rakusen v Jepsen cited in that order?

Question: Rakusen v Jepsen is a high profile Rent Repayment Order (RRO) application case, in which the Applicant's name typically comes before that of the respondent when the case is referred to. In this one, Rakusen is the name of the landlord (ie respondent party), yet their name seems invariably to be cited in front. Why is this?
Answer: Rakusen was the appellant at the Court of Appeal. Many, but not all, appellate courts adopt the norm of listing the appellant as the first party in the style of cause, even if they were the respondent or defendant in the underlying matter.
This style decision can vary between courts within the same country and can even differ between courts within the same appeal hierarchy. E.g. in Canada different provinces do it different ways, and not all of them match the Supreme Court's style.
Comment: I guess the question then is, why didn't the parties switch back again when Jepsen appealed to the Supreme Court?  That would be the practice in the US, but not in the UK, it seems.
Comment: The rationale may be that the non-appellate decision carries zero to none affect to anyone other than the parties (and other than res judicata, law of case and collateral estoppel). May be the appellate level is considered for purposes of case law the starting of the case. Once started the appellate avenue the case remains in that "original" name — just speculating here though.


I can't figure out how to make PNG file with UV map

Question: I've am finishing up my model. But I want to paint the textures on it, but I don't understand how do I extract image with unwrapped object appearing on image so I would have some kind of guidelines on where should I paint
Answer: First, you should try the latest version of blender (2.81 at the moment), then just go the the UV menu (in the UV Editor) and select "Export UV Layout" : you 'll be asked to choose a file name, image type AND a resolution so you can paint on it in an external paint program.

But If you want, you can also just go the Texture Paint mode, create an empty texture Map and directly paint on your model ! Have Fun !


How do I get my pictures back from my lost phone?

Question: I lost my phone today and the data is turned off, but is there any way of tracking it even without the data? or getting my photos back?
Answer: The short answer is no to both questions, you're probably out of luck.
Long answer:
To locate your Android device with the Google tools, meaning Android Device Manager, your device must have a working data connection of some kind to function and Location Services enabled. This would give the ability to locate the phone and lock or wipe it at your option, or give the current holder of the device a means to contact you to possibly return the device.
As far as the photos go, if you were not actively syncing them to an online service such as Google Photo using the Google Photos app, or a similar competitive application and online service, then unless you can physically get the phone back in your possession, you will not be able to recover them.
This is another case of "an ounce of prevention is worth a pound of cure". Unfortunately, the average Android user has no knowledge of how these things work or how to prepare for the worst case scenario like this.
You could setup a device lock with screen message in Android Device Manager, and if somehow the current holder of the device happens to turn on the data service, it will sync with Google and immediately activate, giving you a possible option to retrieve the device. If you have it setup in ADM, when this occurs you will receive an email indicating the feature was activated and a location it occured (assuming Location Services are enabled as well).


How to set distance between 2 objects?

Question: Is there any add-ons where I can adjust the distance between 2 objects accurately? I am not asking about measurement but location objects w.r.t to each other.
For ex:
Comment: Do you mean closest points on surfaces, or object origins?
Comment: Object Origins will do. I will be working with hard surface modeling so it will be all boolean.
Comment: Could you provide more details? At first though, no addon is needed for that.
Comment: I am from CAD background. So, trying to get my head around placing things accurately. I have edited my questions with an image so you will know what I mean. If blender can work with accuracy, my life will be easier ton times!
Answer: You can just use a Limit Distance constraint for that. Simply add the constraint in the Constraints properties and set the target to your other object. Set Distance to the distance you require and Clamp Region to 'On Surface'. This will constrain your object to remain on the surface of a sphere projected around the target object.
Comment: Ok. I will try this method. I used to use grid snapping and place them step by step. I found it cumbersome. But any other thing which can help on the fly? I mean as soon as I place and pick up centers of 2 object then I can start dimensioning?
Answer: You can proceed in two steps: rotate the object the angle you want, then move it along its axis.
For a better visualization, you can activate "show axis", here we want to move the monkey from the cube:

From that rotate the angle you want: R and use the mouse and eventually set the value manually in the operator panl.
Then move along the axis G then XX (twice) to move along local axis, and again you can also set the value manually.

To keep them in the same configuration when moving, select one then shift select the second and use CtrlP.
Comment: This worked well :) Can you help me by elaborating the last line? I mean same configuration in the sense?
Comment: I meant, stay at the same relative positions/angles. You can move the parent and the child will follow.
Comment: Ok. Got it (y) Thank you again :)

How to set distance between 2 objects?


Custom script not loading for user groups

Question: I have a script that adds an RSS-button to my discussion list. This script is added to the masterpage (seattle.html) as a ScriptLink. If I or one of my colleagues who have full access to the SharePoint site open the masterpage the button is added correctly, however if one of the other employees with contribute permissions open the site the button not only doesn't appear but the script doesn't even get loaded, I checked that using the script inspector from chrome. I get the same behavior if I include the script in the masterpage using . I have checked the element permission for specific persons and it says they have contribute as permission. Any help to get that script running would be appreciated.
Answer: Make sure the master page is checked in, published as a major version and approved. This is a common symptom where full control users see something that regular users do not when it comes to master page customizations.
Depending where the script is located, that might need to be checked in as a major version, published, and approved too.
Comment: +1 Usually the key is publishing it as a major version... I always forget that step!
Comment: That was a good point. I checked it now, it was not checked out to me, but i guess it was not published as major version (at least in the gallery in the context menu i could select `publish as major version`), gonna test it tomorrow with my coworkers.


Screening Test: Cancer Probability

Question: A Canadian male has recently had a Prostate Specific Antigen (PSA) test as to determine if he has prostate cancer. The false-positive rate of a PSA test is $15$%. If he does have prostate cancer, PSA test will be positive $81$% of the time.
Because this male is showing symptoms that are consistent with prostate cancer, it is assumed that the chance he has prostate cancer prior to taking the PSA test is $0.13$.
Part (a) What is the probability that the PSA test will yield a positive result?
Part (b) If the PSA test gives a positive result, what is the probability that he does not have prostate cancer?
Part (c) Suppose the PSA test result is negative, indicating that he does not have prostate cancer and his symptoms are a result of something else. What is the probability that he does have prostate cancer?
I've managed to figure out a), just by adding the probabilities of a positive by drawing a tree. However i'm stuck on the conditional probability part. If I let $A$ be the event that the patient has cancer, and $B$ be the event of a positive test, my attempt for b) was $P(A'|B)$ = $P(A' \cap B) / P(B)$, But I think i'm doing the calculation wrong. Any help would be appreciated
Answer: Let $A$ be the event that the patient has cancer, and $B$ be the event of a positive test.
Then
$$
P(A'\mid B)=\frac{P(A'\cap B)}{P(B)}=\frac{P(B\mid A')P(A')}{P(B)}=\frac{P(B\mid A')P(A')}{P(B\mid A)P(A)+P(B\mid A')P(A')}
$$
by Bayes' rule and the law of total probability. We are given that
$$
P(A)=0.13;\quad P(A')=0.87;\quad P(B\mid A')=0.15;\quad P(B\mid A)=0.81
$$
from which you can compute.
Comment: Do I use the same approach for c? I'm not sure how to get $P(B')$.

Screening Test: Cancer Probability


Torque for receptacles and light switches

Question: When connecting wires to the screw terminals on receptacles or light switches, what torque should they be tightened to if no torque is indicated either on the device itself or in its installation instructions? For example, the instructions for Leviton's receptacles and switches just say to "firmly" tighten them.
Comment: @JohnCanon -- I suspect they're asking because they actually have a torque screwdriver and want to put it to good use :)
Comment: I believe 2020 NEC amended the torque requirement to send you to a "best practices" torque table somewhere.
Comment: Tight enough so that you could undo it with a firm twist, but your grandmother would have difficulty.
Comment: @Harper-ReinstateMonica -- I believe that's only for things that don't have a tightening torque provided already
Comment: Tighten until it just barely starts to hurt your palm or feels like the screw head is about to slip/strip; whichever comes first.
Answer: Generally, 14 inch-pounds is safe, although you can go somewhat higher if you wish
UL 498 (i.e the standard for receptacles in the US) calls out a tightening torque of 12-14 inch-pounds for wire binding screws (depending on size) in Table 123.3 as part of the Terminal Strength Test, and repeats that 14 inch-pound figure for 12AWG wire in 113.13 for the Terminal Temperature Test.  Given that you're generally dealing with duplex receptacles, and those almost always support through-wiring, 14 inch-pounds is a reasonable figure as 113.4 requires their terminals to be temperature tested with 12AWG wire if they aren't based on a 20A design, and most are based on a 20A design anyway.
Likewise, UL 20's terminal retention tests (found in clause 5.30) repeat those figures in Table 16, and Leviton's own specifications for their residential receptacles call out 14-18 inch-pounds of torque.
Comment: Interesting that Leviton has a torque spec, but doesn't put it anywhere that an installer would be expected to see it.
Comment: The best part is when the little paper installation instructions say to check the website for the torque specs. Instead of just printing them on the instructions.


What does Derek Parfit mean by "I ought to regard having a Replica as being about as good as ordinary survival"

Question: Having trouble with this one. What does it mean and what might be some reasons leading to this conclusion. The relevant text is "What We Believe Ourselves To Be"
Comment: replica is able to fulfill our projects. but a replica properly thought, unless they are metaphysically identical, experiences pleasure etc. in my place, so all forms of hedon must be as good *for me* independent of whether or not i experience them. i.e. the argument seems bogus. and it might even be bogus if we're not hedonists: some experiences that the replica has that i don't might alter me in some valuable way that is not strictly pleasurable (which is not to say that replica is not as good as survival for everyone else involved). it seems to illegitimately hinge on all value being moral
Comment: i have read a book or so on him, sorry!
Answer: Welcome, James
1. Parfit and the non-reductionist view of personal identity
Parfit rejects the idea that personal identity - continuity and survival over time - involves the continued existence of any irreducible persistent entity such as the Cartesian Ego. On the contrary, personal identity is reducible to continuities - similarities between Derek Parfit at time t1 and t2, t2 and t3 and so forth. Madell elaborates:

IN chapter 11 of his Reasons and Persons (Clarendon Press, 1984)
   Derek Parfit develops what he regards as a central argument against
   the Non-Reductionist view of personal identity. This is the view
   that personal identity is strict, and not analysable in terms of
   physical and/or psychological continuity. On this view personal
   identity involves, in Parfit's words, a 'further fact' in addition to
   any such continuity, even a 'separately existing entity', such as
   a Cartesian ego. Parfit's Reductionist view, by contrast, is just that
   personal identity through time involves nothing more than such
   continuities, and of these psychological continuity and connectedness is much the more important. On this view, what we call
   (however loosely) 'personal identity' is essentially a matter of
   degree. (Geoffrey Madell, 'Derek Parfit and Greta Garbo',  Analysis, Vol. 45, No. 2 (Mar., 1985), pp. 105-109: 105.)

To anticipate : a replica of oneself has a similarity to oneself and so could be a stage in one's future identity. But there is a time condition on which my relation to a Replica means that my death 'though better than ordinary death, is not nearly as
good as ordinary survival'. See 2, 'The branch line case' below. So it cannot be straightforwardly said, without qualification, that for Parfit 'I ought to regard having a Replica as being about as good as ordinary survival' even if at one point he does unguardedly make this claim.
2. The branch line case
The key to Parfit's meaning is to be found in what you will already know as 'the Branch Line case':

In the Branch Line case, Parfit imagines a "scanner" that, at the press
   of a green button, destroys and analyzes his entire body, including his
   brain. The scanner is linked to a "replicator" that assembles a molecule-by-molecule copy of him on Mars. He then imagines that the scanner is
   upgraded to a model that leaves his original body intact, so that there are
   duplicate versions of him, one on each planet. Finally, he imagines that
   the upgraded scanner has damaged his heart and that he will consequently die within a few days. Having received this dire prognosis, he
   speaks with his replica on Mars by interplanetary videophone:

Since my Replica knows that I am about to die, he tries to console
     me with the same thoughts with which I tried to console a dying
     friend. It is sad to learn, on the receiving end, how unconsoling these
     thoughts are. My Replica then assures me that he will take up my life
     where I leave off. He loves my wife, and together they will care for my
     children. And he will finish the book that I am writing. Besides having
     all of my drafts, he has all of my intentions. I must admit that he can
     finish my book as well as I could ...
If we believe that my Replica is not me, it is natural to assume that
     my prospect, on the Branch Line, is almost as bad as ordinary death.
     I shall deny this assumption. As I shall argue later, being destroyed
     and Replicated is about as good as ordinary survival.

Parfit later explains his view of the case as follows:

It may be slightly inconvenient that my Replica will be psychologically
     continuous, not with me as I am now, but with me as I was this
     morning when I pressed the green button. But these relations are
     substantially the same. It makes little difference that my life briefly
     overlaps with that of my Replica.

...

If the overlap was large, this would make a difference. Suppose that
     I am an old man, who is about to die. I shall be outlived by someone
     who was once a Replica of me. When this person started to exist forty
     years ago, he was psychologically continuous with me as I was then.
     He has since lived his own life for forty years. I agree that my relation
     to this Replica, though better than ordinary death, is not nearly as
     good as ordinary survival. But this relation would be about as good if
     my Replica would be psychologically continuous with me as I was ten
     days or ten minutes ago.

...

Parfit does not explain why the survival of a forty-year-old replica would
   be less desirable than that of a replica produced within the past ten
   minutes. He seems to imply that the survival of the forty-year-old replica
   would be less desirable because he has "lived his own life for forty years"
   and would be less likely to carry on the life that will be cut short at Parfit's
   death. At the replica's creation forty years ago, he might have finished
   the book that Parfit was writing then, but he now lacks the beliefs,
   desires, and intentions that would enable him to finish the book that
   Parfit is writing now and will not survive to finish. Parfit's judgment in
   this case thus illustrates his view that what matters in survival is the
   continuation of that in oneself or one's life which one finds important.

3.The time condition

Parfit concludes his discussion of the Branch Line case with the
   admission that his judgment is counterintuitive:

... I admit that this is one of the cases where my view is hardest to
     believe. Before I press the green button, I can more easily believe that
     my relation to my Replica contains what fundamentally matters in
     ordinary survival. I can look forward down the Main Line where there
     are forty years of life ahead. After I have pressed the green button, and
     have talked to my Replica, I cannot in the same way look forward
     down the Main Line. My concern for the future needs to be redirected.
     I must try to direct this concern backwards up the Branch Line beyond
     the point of division, and then forward down the Main Line. This
     psychological manoeuvre would be difficult. But this is not surprising.
     And, since it is not surprising, this difficulty does not provide a sufficient argument against what I have claimed about this case.

Reading this passage, one wonders why a difficulty should have to be
   surprising in order to be philosophically significant. One rather suspects
   that Parfit's talk of "redirecting" his concern up one "line" and down the
   other - talk of a kind that appears nowhere else in Parfit's discussion -
   reveals an important feature of self-concern, a feature that will help to
   explain the rationality both of wanting to have future selves and of caring
   about their fate.

(J. David Velleman, 'The Identity Problem',  Philosophy & Public Affairs, Vol. 36, No. 3 (Summer, 2008), pp. 221-244: 225-7.)


Separating Chlorophyll didn't work

Question: I tried to extract chlorophyll from spinach by blending up some spinach and water and straining out the green juice, then heating the juice.  I've done it before, but this time, it wouldn't separate. Does it not work if you overheat it?  I brought it to the boil and I'm wondering if that was the problem.
Comment: I have never done it, what was expected to happen and what happened instead? Also, when heated a lot, chlorophyl undergoes chemical changes, I don't remember if the new chemical is still considered a form of chlorophyl or not, but it becomes dull yellow-green instead of bright green.
Answer: This author says to avoid overheating or boiling the green juice.  I suspect that your end product is actually clumps of chloroplasts not chlorophyll.  Overheating or boiling the chloroplasts could destroy their delicate membranes and allow the chlorophyll molecules to mix into the liquid.  It is not water soluble though, so you may be able to collect it using something like filter paper instead of a mesh strainer.
Boiling can also lead to conversion of chlorophyll to phaeophytin, a olive-green pigment.

Separating Chlorophyll didn't work


Creating led sequence without microcontrollers

Question: I'm new to electronics and I can work only with transistors. I'm trying to create a circuit that performs action like this:
Let's say I have 10 LEDs. When I supply power first LED lights, 0.5 sec later second LED lights and 0.5 sec later third LED lights and so on. But all the LEDs keep lighting during others light.
I want to know if it's possible or not. If possible please give a link to such a tutorial.
Thanks all for help.
Answer: It is possible using 10 bit Johnson counter with 2 Hz clock frequency, but it repeats the cycle after the last LED turns on (10th bit).
Comment: repeating  the cycle after the last led is so good :) thanks for your answer! i will try it. But sorry i can't vote your answer up :(
Answer: I would take a 555 square wave generator output from here 555 Oscillator Tutorial and drive shift register clock input from here The Shift Register. Shift registers input should high all the time.
Answer: The answer I personally use in my circuits:
Use a sawtooth voltage (i.e. from simple BJT sawtooth generator) and a ADC with LED driver (LM3914 comes to mind, can drive 10 LEDs, no resistors needed) - you only require 1 IC and LEDs to do the visual part, but you can easily change the behaviour of the LEDs by changing the voltage ramping (sine, tri) and frequency.
Also, you'll get a fully functional ADC/VU meter/voltage meter in the meantime, free of charge.


Disable 'New' Button

Question: I have a requirement on a partner community, where I have a Flow to create records on an object name 'Forms'. But I have a list view on the same page where a 'New' button need to hide or disable based on profile. It is not possible in object setting since I have to create records through flow. But I don't want some profile user to create by pressing 'New' Button. How do I accomplish this use case.
Thanks for your help
Answer: The solution here is to:

Remove the "Create" permission for the community user from the permission set(s) and/or profile
Ensure the flow runs in System Mode so it ignores the user's CRUD and FLS permissions.

The latter is achieved by opening the flow in the Flow Builder, clicking the cog (1) and clicking "Show Advanced" button (2 appears), then select a different How to Run the Flow option:
Comment: It works. Thanks.
Comment: I have one more question. On my Partner Portal, I have a 'Forms' list view. When I press the item in list view, it open the detail but I can't see anything under the 'Related' item. What should I do. It is only happening on the above mentioned 'Forms' object. Please note that this 'Forms' object has a "Record types"
Comment: Hi @VinuVarghese best if you raise that as a separate question in SFSE.
Comment: I did separately

Disable 'New' Button


How to erase multiple polygons from another polygon?

Question: I am trying to erase around 200 county road shapefiles from a state boundary.  The files become too large to work with when the roads are merged into one state roads file.  How can I iterate the erase process so that all the roads are removed from my one state shapefile, instead of manually erasing each road one after another? Note, I have buffered the roads so that they are no longer polylines. I am using Arcmap 10.2.2.
Comment: Merge roads into single feature class, using county extent as environment extent. Use erase tool if license advanced, alternatively union merge with county and delete anything where merge_fid=>0
Answer: I use the Dissolve Tool (Data Management Tools -> Generalization -> Dissolve) to eliminate the polygon borders of multiple polygons within a larger polygon.
I typically dissolve zip code boundaries (polygons) that are within a county shapefile (polygon).
Comment: The road shapefiles are seperate from the county polygon.  I want to remove the road polygon from the shapefile of the polygon, which would leave gaps where the roads would have been. Dissolving won't do that.  Also this does not answer what I am asking.  I want to know if there is a way to continually run an "erase" so that my 200 road shapefiles are removed from my one county polygon, so that I do not have to manually erase 200 shapefiles.


Website configuraiton for SEO Optimization

Question: In order to promote our product in the various search engines, we've changed our index.html
to redirect to ourapp.example/product/index.html and moved all our HTML code to ourapp.example/product/index.html
Is that the right approach?
Also, is there a canonical place to put files sitemap.xml and BingSiteAuth.xml?
Comment: Why did you move your `index.html` file to `/product/index.html`?
Answer: Always use 301 redirection if you're moving your file locations. That will preserve & pass on page-ranking in Google and will redirect all your hits to the new pages.
Answer: For your first question, I probably wouldn't have done that. Here's a good read that covers many facits of that type of thinking http://www.seomoz.org/blog/should-i-change-my-urls-for-seo
As far as your second question, the root is the default location.
Answer: Why did you do that? In order to promote your product in various search engines? What are you talking about? File names and the keywords in links do have value, but the word products is worthless! Also, why are you pointing to your products page and then to your homepage? Your site should be ourapp.example/index.html, not ourapp.example/products/index.html?
The placement of your URLs does not matter when it comes to ranking or indexing, and your index page should always be directly after your domain name. Yeah, dude, you aren't promoting anything with that! "products" is not a file, its a directory as you have it stated! Google doesn't care about your directories, they mean nothing. You don't "promote" with file or directory names. If you want Google to be able to tie your content to users search queries then you need to give good descriptive names to your actual files themselves. If your webpage is about "iphone apps for music" then state this in the file name itself like this: iphone-music-apps.html. Also, use only hyphens, do NOT use underscores. Hyphens are seen as word separators while underscores are seen as all one word. For instance, iphone_music_apps.html would be considered all one word!
It does not matter how you list your content, directories are pointless other than to organize your sites content.
Canonical? Did you specify a preferred URL in your Google webmaster account?
Comment: About underscores and hyphens (dashes): https://blog.codinghorror.com/of-spaces-underscores-and-dashes/