Strange behaviour of eager take

Question: Naturally lazy
D:\>6e "my @bar = 'a', 'b', 'c'; sub foo( @b ) { my $bar = 0; gather loop { print "*"; take ($bar, @b[$bar]); $bar++; last if $bar > 2; } }; .print for foo( @bar )"
*(0 a)*(1 b)*(2 c)

So far, so expected. Now, let's be eager.
D:\>6e "my @bar = 'a', 'b', 'c'; sub foo( @b ) { my $bar = 0; eager gather loop { print "*"; take ($bar, @b[$bar]); $bar++; last if $bar > 2; } }; .print for foo( @bar )"
***(3 a)(3 b)(3 c)

Why on earth are the numeric values all "3"? As if, I don't know, the closure vanished in a puff of illogic. take-rw doesn't cut it, either.
D:\>6e "my @bar = 'a', 'b', 'c'; sub foo( @b ) { my $bar = 0; eager gather loop { print "*"; take-rw ($bar, @b[$bar]); $bar++; last if $bar > 2; } }; .print for foo( @bar )"
***(3 a)(3 b)(3 c)

I can mitigate
D:\>6e "my @bar = 'a', 'b', 'c'; sub foo( @b ) { my $bar = 0; eager gather loop { print "*"; take-rw ($bar + 0, @b[$bar]); $bar++; last if $bar > 2; } }; .print for foo( @bar )"
***(0 a)(1 b)(2 c)

But why do I have to?
Edit: So, questions boils down to,
>6e "my $bar = 0; .say for gather { take ($bar,); $bar++; take ($bar,) }"
(0)
(1)

>6e "my $bar = 0; .say for eager gather { take ($bar,); $bar++; take ($bar,) }"
(1)
(1)

It is still unexplained, why there is a difference in behaviour in eager vs. lazy case.
Comment: The reason the lazy case works is because you don't notice that the old values changed out from under you, because they are already printed.
Answer: Holli has accepted the answer that quoted two of Brad's comments. I deliberately kept that one terse.
But you're reading this.1 So I'll go in the opposite direction with this answer.
($bar,...) is a list containing $bar, not $bar's value
The behavior shown in the question really is all about containers vs values, and how list literals store containers, not their values1:
my $bar = 0;
my $list = ($bar,);
say $list[0];       # 0
$bar = 1;
say $list[0];       # 1

The laziness vs eager aspect is just things doing what they're all supposed to do. Emphasizing this first point may be enough to inspire you to focus on containers vs values. And maybe that'll lead you to quickly understand what went wrong in Holli's code. But maybe not.1 So I'll continue.
What happens in the lazy case?
A lazy list waits until a value is demanded before attempting to produce it. Then, it just does the necessary work and pauses, yielding control, until it's asked to produce another value at some later time.
In Holli's code the for loop demands values.
The first time around the for loop, it demands a value from the lazy expression. This turns around and demands a value from the gather'd expression. The latter then computes until the take, by which time it's created a list whose first element is the container $bar. This list is the result of the take.
Then the .print prints that first list. At the moment of printing, $bar still contains 0. (The first increment of $bar hasn't yet happened.)
The second time around the for loop, the inner control structure enclosing the take (the loop) is re-entered. The first thing that happens is that $bar gets incremented for the first time. Then the loop exit condition is checked (and fails), so the second time around the loop starts. Another list is created. Then it's taked.
When the second list is printed, its first element, which is the $bar container, prints as 1, not 0, because at that point, having been incremented, $bar now contains 1.
(If Holli had written code that held onto the first list, and printed that first list again now, after having just printed the second list, they'd have discovered that the first list also now printed with a 1, no longer a 0. Because all the taked lists have the same $bar container as their first element.)
And likewise the third list.
After the third list has been printed, the for loop demands a fourth go at the gather. This re-enters the loop at the statement after the take statement. $bar gets incremented for the third time, to 3, and then the last if $bar > 2; condition triggers, exiting the loop (and thus the expression being gather'd and ultimately the whole .print for ... statement).
What happens in the eager case?
All the gathering is completed before any of the printing.
At the end of this, the for construct has a sequence of three lists. It has not yet called any .print calls. The third time around the loop in the gather has left $bar containing 3.
Next, .print is called on each of the three lists. $bar contains 3 so they all print with 3 as their first element.
Solving the problem by switching to an array
I think the idiomatic way to deal with this would be to switch from a list literal to an array literal:
[$bar, @bar[$bar]]
# instead of
($bar, @bar[$bar])

This works because, unlike a list literal, an array literal treats an element that's a container as an r-value2, i.e. it copies the value contained in the container out of that container, rather than storing the container itself.
It just so happens that the value is copied into another new Scalar container. (That's because all elements of new non-native arrays are fresh Scalar containers; this one of the main things that makes an array different from a list.) But the effect in this context is the same as if the value were copied directly into the array because it no longer matters that the value contained in $bar is changing as things proceed.
The upshot is that the first element of the three arrays ends up containing, respectively, 0, 1, and 2, the three values that were contained in $bar at the time each array was instantiated.
Solving the problem by switching to an expression
As Holli noted, writing $bar + 0 also worked.
In fact any expression will do, so long as it isn't just $bar on its own.
Of course, the expression needs to work, and return the right value. I think $bar.self should work and return the right value no matter what value $bar is bound to or assigned.
(Though it does read a little strangely; $bar.self is not $bar itself if $bar is bound to a Scalar container! Indeed, in an even more counter-intuitive twist, even $bar.VAR, which uses .VAR, a method which "Returns the underlying Scalar object, if there is one.", still ends up being treated as an r-value instead!)
Does the doc need updating?
The above is an entirely logical consequence of:

What Scalars are;
What list literals do with Scalars;
What lazy vs eager processing means.

If the doc is weak, it's presumably in its explanation of one of the last two aspects. It looks like it's primarily the list literal aspect.
The doc's Syntax page has a section on various literals, including Array literals, but not list literals. The doc's Lists, sequences, and arrays does have a List literals section (and not one on Arrays) but it doesn't mention what they do with Scalars.
Presumably that warrants attention.
The Lists, sequences, and arrays page also has a Lazy lists section that could perhaps be updated.
Putting the above together it looks like the simplest doc fix might be to update the Lists, sequences, and arrays page.
Footnotes
1 In my first couple versions of this answer (1, 2, I tried to get Holli to reflect on the impact of containers vs values. But that failed for them and maybe hasn't worked for you either. If you're not familiar with Raku's containers, consider reading:

Containers, the official doc's "low-level explanation of Raku containers".
Containers in Perl 6, the third of Elizabeth Mattijsen's series of articles about Raku fundamentals for those familiar with Perl.

2 Some of the details in Wikipedia's discussion of "l-values and r-values" don't fit Raku but the general principle is the same.
Comment: I am very aware of all of this. Read the question again. Here we have gather/take that produces different values depending on wether you iterate it lazily or eagerly. That's not normal. I tend to think Liz is right and this is a rakudo bug.
Comment: Not completely. Edit.
Comment: Laziness means storing lvalues doesn't make any difference; Eagerness means storing lvalues does make a difference

Ok. But why? Where in the docs does it say that?
Answer: In Raku most values are immutable.
my $v := 2;
$v = 3;

Cannot assign to an immutable value

To make variables, you know actually variable, there is a thing called a Scalar.
By default $ variables are actually bound to a new Scalar container.
(Which makes sense since they are called scalar variables.)
my $v;
say $v.VAR.^name; # «Scalar»

# this doesn't have a container:
my $b := 3;
say $v.VAR.^name; # «Int»

You can pass around this Scalar container.
my $v;

my $alias := $v;
$alias = 3;

say $v; # «3»

my $v;

sub foo ( $alias is rw ){ $alias = 3 }

foo($v);

say $v; # «3»

You can even pass it around in a list.
my $v;

my $list = ( $v, );

$list[0] = 3;

say $v; # «3»

This is the basis of the behaviour that you are seeing.

The thing is that you don't actually want to pass around the container, you want to pass around the value in the container.
So what you do is decontainerize it.
There are a few options for this.
$v.self
$v<>
$v[]
$v{}

Those last few only make sense on Array or Hash containers, but they also work on Scalar containers.
I would recommend using $v.self or $v<> for decontainerization.
(Technically $v<> is short for $v{qw<>} so it is for Hash containers, but there seems to be a consensus that $v<> can be used generally for this purpose.)

When you do $v + 0 what you are doing is creating a new value object that is not in a Scalar container.
Since it is not in a container, the value itself gets passed instead of a container.

You don't notice this happening in the lazy case, but it is still happening.
It's just that you have printed the current value in the container before it gets changed out from underneath you.
my @bar = 'a', 'b', 'c';
sub foo( @b ) {
  my $bar = 0;
  gather loop {
    print "*";
    take ($bar, @b[$bar]);
    $bar++;
    last if $bar > 2;
  }
};

my \sequence = foo( @bar ).cache; # cache so we can iterate more than once

# there doesn't seem to be a problem the first time through
.print for sequence; # «*0 a*1 b*2 c»

# but on the second time through the problem becomes apparent
.print for sequence; # «3 a3 b3 c»

sequence[0][0] = 42;
.print for sequence; # «42 a42 b42 c»

say sequence[0][0].VAR.name; # «$bar»
# see, we actually have the Scalar container for `$bar`

You would also notice this if you used something like .rotor on the resulting sequence.
.put for foo( @bar ).rotor(2 => -1);

# **1 a 1 b
# *2 b 2 c

It's still just as lazy, but the sequence generator needs to create two values before you print it the first time. So you end up printing what is in $bar after the second take.
And in the second put you print what was is in it after the third take.
Specifically notice that the number associated with the b changed from a 1 to a 2.
(I used put instead of print to split up the results. It would have the same behaviour with print.)

If you decontainerize, you get the value rather than the container.
So then it doesn't matter what happens to $bar in the meantime.
my @bar = 'a', 'b', 'c';
sub foo( @b ) {
  my $bar = 0;
  gather loop {
    print "*";
    take ($bar.self, @b[$bar]); # <------
    $bar++;
    last if $bar > 2;
  }
};

my \sequence = foo( @bar ).cache;

.print for sequence; # «*0 a*1 b*2 c»
.print for sequence; # «0 a1 b2 c»

# sequence[0][0] = 42; # Cannot modify an immutable List

# say sequence[0][0].VAR.name; # No such method 'name' for invocant of type 'Int'.

.put for foo( @bar ).rotor(2 => -1);

# **0 a 1 b
# *1 b 2 c

Comment: @Holli It is only about containers and values.
Answer: Per @BradGilbert:

It is only about containers and values.
The reason the lazy case works is because you don't notice that the old values changed out from under you, because they are already printed.

See Brad's and raiph's answers for further discussion.

Strange behaviour of eager take


Fixed points of continuous mappings of non-complete metric spaces

Question: It's a rather easy exercise to construct a non-complete metric space $X$ such that any continuous mapping $f:X\to X$ has a fixed point. However, I'd like to have a reference to such an example.
Answer: For instance, section 4 of the paper
Suzuki, Tomonari; Takahashi, Wataru. Fixed point theorems and characterizations of metric completeness. Topol. Methods Nonlinear Anal. 8 (1996), no. 2, 371–382 (1997); MR1483635
contains such an example.
For more information see Converse to Banach's fixed point theorem? at MathOverflow,
Contraction mapping in an incomplete metric space at math.SE,
and related pages pointed out at these sites.


scripting support in a C# application

Question: what is the simplest and fastest way to support simple scripting in a .Net application?
I search a lot but only find many things with practical no documentation or outdated since years.
I only need to transfer a simple .Net Object to the script and get a bool result from it.
Comment: Then expose your types as com objects, and let people use vbs, and call it a day.
Comment: You want to allow others to write scripts for your application, or do you want to call a script from your application?
Comment: nothing that involves custom scripts is ever simple.
Comment: allow users to interact with objects from the program
Comment: @whatsisname Once it's COM, doesn't necessarily have to be VBA, pretty much anything that can consume COM can use it.
Answer: It depends on your precise needs. Two ways I can think of:

Use a language like Python which is interoperable with C#, and call the Python script from C#. Actually, you can even make things simpler by just calling an executable, passing to it an XML or JSON data, and wait for XML or JSON response.
If you need to use C#, then compile C# on the fly, just like LINQPad does. Is it possible to dynamically compile and execute C# code fragments? is a good starting point. Loading the code in a sandbox (in a different AppDomain) is also a good idea if you need to provide enough security and don't trust the code which can be written by the user.
Answer: I think the simplest way would be to use one of the .Net scripting languages that already exist, like IronPython or IronRuby.
For example, with IronPython you can write your script code in Python, execute it from your C# application and then process the results from the script.
The code could look like this:
var engine = Python.CreateEngine();
var scope = engine.CreateScope();
scope.SetVariable("value", 43);

var code = @"
# overcomplicated just to show it's really Python
def areEqual (value1, value2):
    return value1 == value2

areEqual(value, 42)";

Console.WriteLine(engine.Execute<bool>(code, scope));

Another option would be to use the scripting capabilities of Roslyn, but that's not production ready yet.
Answer: Another scripting language you should consider is PowerShell.  There's a fully working example of an application that exposes some of its internal objects to a script environment here.
This is the description of the application from the book (emphasis mine):

The reference application for this chapter, Beaver Music, is a very simple music album management system. It supports create, read, update, and delete (CRUD) actions for albums. Beaver Music has the functionality you'd expect—a couple of dialogs for adding and changing album information, and you can delete albums as well. What we want to focus on is the PowerShell Console button (shown in Figure 5-1), a WPF application that has the PowerShell engine embedded in it. As noted earlier, PowerShell is surfaced as a console, a scripting language, and an API; the custom PowerShell console uses this surfaced API in conjunction with the Beaver Music application so it can be scripted and automated. This works similarly to the way Microsoft Excel can be automated with the embedded Visual Basic for Applications (VBA) scripting language.
Answer: You could build a temp class and invoke a method on that
var template = @"public static class Temp
{{
  public static bool Run()
  {{
      return {0};
  }}
}}";

var script = "1 < 2";

var source = string.Format(template, script);

var csc = new CSharpCodeProvider(new Dictionary<string, string>() { { "CompilerVersion", "v4.0" } });
var parameters = new CompilerParameters(new[] { "mscorlib.dll" }, "temp.dll", true);
parameters.GenerateExecutable = false;
var results = csc.CompileAssemblyFromSource(parameters, source);
var type = results.CompiledAssembly.GetType("Temp");
var method = type.GetMethod("Run");
var result = (bool)method.Invoke(null, null);
Console.WriteLine(result);

But you really have to trust people who write the scripts. Just add parameters to the Run method to pass your object.
Answer: Fastest and simplest?  I really hope this isn't that, but as a really last resort, you can use the .NET Emit method to create hand crafted CIL code that you generate dynamically in your program.
If your scripting requirement is really trivial, then this is probably a month or two's work.  You can work out the CIL instruction set from using a reflector to look at how the compiler translates your C# code into CIL, and then 'borrow' these code fragments.
Comment: I hoped there is something out there I didn't find...
Comment: I had to use CIL about 2 years ago for dynamically implementing a proxy class that implements a supplied interface marked with attributes to identify the key parts of the interface we needed to proxy.  It was some fairly intense work, and not to be undertaken lightly, but it was effective.
Comment: Using CIL is practically the opposite of simple scripting.
Comment: True, but as a real last resort but it does allow you to present a script window to your user, to convert their script (in what ever script language to allow them to use) into CIL and then to load that into your process and execute it.

scripting support in a C# application


Who knows what this brown fruit with one date-like pit is called?

Question: It has a slightly thick skin like an apple, semi-dry and grainy texture, with a slight apple flavor, about the size of a large grape, with one pit, reminiscent of that of a date.
Comment: Those look like [jujubes](http://en.wikipedia.org/wiki/Jujube)
Comment: I'd call them delicious looking :)
Comment: I agree with @sourd'oh - the fruit and the foliage look exactly like jujube. However, every time I had the fruit it has been much riper, brown and mushy.
Answer: Those look like jujubes (not to be confused with the candy). They're also known as Chinese dates, and are frequently found dried.
Comment: Thank you everyone for your help. I have discovered the Jujube!
Answer: These are jujubes.
We find them mostly in the  Mediterranean region starting from like 500 m height(I have one of these tree in my garden).
You should just be careful if there is no holes made by worms in there, then you souldn't eat it. It's not poisonous but it will probably taste bad. To know, you bite it in the middle to check.
It grows during the end of august and start of september.
It's not too sweet unless it's dried up.
They are red when grown and green when not. Some are both: part green, part red.
Answer: i'm from india and we use this fruit for festivals,widely known here.
we called it as indian Jujube.
This also known as Ber.
 Chinee Apple, Jujube, Indian plum and Masau is a tropical fruit tree species belonging to the family Rhamnaceae.
Answer: Hope its not too late an answer but they are called Masawu here in zim and am having some right now. They have a slimish feel in the mouth sort of like okra slime but tasty sweet to sour depending on the tree. worms love them too so if you mind look out for them. If you are like me anything that eats fruit is edible.
Comment: I'm giving you an upvote, but note the Internet says that Masawu is just another name for Jujube, which has been suggested a few times. http://thesovereignstate.org/indigenous-fruits-of-zimbabwe-3/
Comment: And swe's answer mentions "masau" which looks like a slightly different spelling of your "masawu"
Answer: I'm from Turkey and it's a widely known fruit here.

We call it "iğde",
English dictionary calls it:

"oleaster(kitchen)"
"eleagnus(botanical)".
Comment: The fruits do in deed look right. However, from the leaves in the photo above I would not agree with you. The leaves look very much like typical Rhamnaceae leaves ... which would support sourd'oh's jujube theory.
Comment: Yes, I had the idea that it might be an oleaster but pretty sure now that its not. Because oleaster are sweet and they dont have an apple flavour. Im joining the jujube camp.
Answer: It's a lotus, or to be specific: Diospyros lotus More commonly known as date-plum. (Hence the pit as you noticed).
If you taste them, they have a chalky texture with hints of sweetness.  They usually have a great aroma and smell.  They are also good dried with tea.


Sharp bound on off-diagonal entries of matrix with 1's on diagonal to make matrix invertible

Question: Suppose $A$ is an $n \times n$ matrix with all 1 on the diagonal. What is the sharp bound $\epsilon(n)$ so that $A$ is invertible if all off-diagonal entries of $A$ have absolute value less than $\epsilon(n)$?  Obviously $\epsilon(n) > 0$ exists, because as all off-diagonal elements go to zero, $A$ approaches the identity matrix which is invertible.
Answer: Let $S$ be the set of non-negative real numbers $r$ for which if $|a_{i,j}|\lt r$ for all $i\neq j$, then $A$ is invertible. We have that $S\supset \left(0,\frac 1{n-1}\right]$  (because in this case $A$ is diagonal dominant, hence invertible). We can't hope more (take $a_{i,j}:=\frac 1{n-1}$; then $A$ is not invertible).
Comment: Thanks, I guess what I'm missing is how this notion of "diagonal dominant" implies invertibility. Otherwise the question would be fairly obvious, as soon as we realize $A$ is not invertible when $a_{i,j} = 1/(n-1)$ for $i \neq j$.
Comment: I also tried setting off-diagonal elements to $1/2$ for a $3 \times 3$ matrix with 1 on the diagonal, and I got that the matrix was invertible? (determinant = $1/2$) I think maybe the off-diagonal elements should be set to $-1/(n-1)$? Then the sum of the rows is $0$ so $A$ is not invertible.


What is the difference between strong normalization and weak normalization in the context of rewrite systems?

Question: In the context of rewriting systems, how does strong normalization differ from weak normalization?
Comment: The article you linked literally answers your question.
Comment: It would likewise be a kind gesture of the asker to explain in sufficient detail what would be expected from an answer, rather than expecting others to read his mind.
Comment: I know it does, but I was having difficulty realising how the two kinds of normalization play together, which @chi kindly solved below. It is sometimes good practice (and a token of empathic thinking) to answer to the need behind the question than only take the question in its literal form.
Comment: @quicksort Some people are worse than others in reading the crux of a simple question. Downvote and move on please.
Comment: So do not make it harder for them. quicksort is right, it would be nice to reveal the expectations. Just because the mind reading succeded this time it will probably not be the case the most of the time. No downvote, sorry.
Answer: Weak normalization means that any term has a terminating rewriting sequence, i.e. admits a finite amount of rewritings which lead to a normal form (no more rewritings from that).
Strong normalization means that any term can never be rewritten infinitely many times. Any maximal rewriting sequence eventually reaches a normal form (hence it is finite).
For instance:
$$
    S \rightarrow (SS) \qquad
    S \rightarrow A
$$
is weakly normalizing (given any term, we can rewrite every $S$ into an $A$, after which normal form is reached) but not strongly normalizing ($S \rightarrow (SS) \rightarrow ((S S) S) \rightarrow \cdots$).
It is immediate to prove that strong normalization implies weak normalization.


Declination of adjectives after einigen

Question: I learned that after words like "einige, mehrere, etc." the following adjectives also have the same declination. However, I got corrected when I said "mit einigen meinen Freunde" to "einigen meiner Freunde". Why is it "einigen meiner" and not "einigen meinen"?
Answer: Maybe it helps to look at the English-language equivalent:

with some of my friends

As you may know, mit (English: with) inflects what follows it to the dative case (einige --> einigen). And of can be expressed in German with its counterpart von, for example:

Von meinen Freunden [sind manche weg].

As with mit, von inflects the following noun phrase to the dative case. Concatenating mit and von like so

Mit einigen von meinen Freunden [habe ich gesprochen].

is grammatical German but considered inferior style, especially in writing. (Some people may disagree and consider the double dative acceptable.)
Instead, you would drop the preposition and inflect the noun and its possessive pronoun to the genitive case, i.e., meiner Freunde (and not meinen Freunden, which is dative case). This rule supersedes the otherwise correct rule that you learned about matching the declination.

UPDATE:
I am reliably informed that I erred in the "bonus" part of this Answer.
In response to my own question, "But what if you stick in an adjective?"

With some of my good friends

I had offered

Mit einigen meiner guten Freunde

That was correct. However, I erred in identifying "guten" as dative plural. It is in fact genitive plural, the same genitive plural as "meiner" and "Freunde". My mistake shows how tricky identifying the case of individual words can be when different cases can be letter-for-letter identical and only functional analysis will differentiate them.
Answer: What happens in your example is that meine turns Freunde from an indefinite group (some friends) to a definite group (all my friends). The same thing would happen if you used diese, jene etc. instead of meine. Applying einige (or mehrere) to a definite group makes no sense, therefore meine Freunde is put into the genetive case and the whole term einige meiner Freunde means (with maximum explicitness) some members of the group which consists of all my friends or just some of my friends.
The same happens in English, where you can say some friends or some of my friends but not some my friends. I could not find an example on the fly where German does not behave analogously to English concerning this.
Comment: Why is "some members of the group which ..." the literal translation of  "einige meiner Freunde". "Some of my friends" is. Why make it sound more complicated than it is
Comment: @Emanuel: You are right. However, I wanted to be this over-explicit to avoid any misunderstanding. But *literally* was definitly the wrong term to describe it.
Comment: I like this answer better. Since English and German are connected, I never stopped to look why there was an 'of' between 'some' and 'friends'.

Declination of adjectives after einigen


Irreducible Representation by Restriction

Question: Let $H$ be a subgroup of a finite group $G$.Given an irreducible representation $\pi$ of $G$,we may decompose its restriction to $H$ into irreducible $H$- representations.Show that every irreducible representation of $H$ can be obtained in this way.
My initial idea was to use induced representations,but later I wanted prove this result without appealing to that concept.I am stuck with this problem for quite some time.Please help.Thanks.
Answer: I'm not really sure why you'd insist you don't want to use induced representations here; Frobenius reciprocity means it's the natural approach, and this is an immediate corollary of Frobenius reciprocity...
But OK. Suppose there is an irreducible representation $\sigma$ of $H$ which isn't contained in the restriction of an irreducible representation of $G$. Then $\sigma$ doesn't occur in the restriction to $H$ of the regular representation $\Bbb{C}[G]$ of $G$, which contains a copy of $\Bbb{C}[H]$, and hence of $\sigma$, so you're done.
Comment: Can you please elaborate your last line a bit?
Comment: There's a canonical embedding $\Bbb{C}[H]\subset\Bbb{C}[G]$ (given by taking coefficients to be zero for basis elements in $G$ but not in $H$), and restriction of $\Bbb{C}[G]$ to $H$ corresponds simply to restricting the action from $G$ to $H$, so $\Bbb{C}[H]$ is a $H$-submodule of $\Bbb{C}[G]$.
Comment: Where have you used the fact that the given representation is irreducible?


Holdout vs K-fold

Question: I am working with 15k image dataset for binary classification. This is a patient-based medical image dataset. Is it enough to use a randomized holdout strategy (train, validation, and test)? Should I use k-fold cross-validation (test and train(10-fold))? Which is best for this amount of image dataset.
TIA
Answer: The benefit of k-fold is that it gives you a better idea of how your model will generalise in the real world.
If you plan to make a model that is useful in the real world I recommend using a k-fold cross validation approach (or a leave p out approach if you have time), so that you can construct some nonparametric confidence intervals for your model.
In each fold you can split the training data into training and validation if you need a validation set, e.g. for early stopping.

Holdout vs K-fold


Topology and Quantum mechanics

Question: I have a very simple question. Can we know about the topology of the underlying space-time manifolds from Quantum mechanics calculations? If the Space-time is not simply connected, how can one measure the effects of this from calculating transition amplitudes in the path integral formalism?
Comment: Great question!  I wonder if you wanted to generalize it slightly by saying "if the spacetime is not simply connected", since this also covers the interesting case where the spacetime is in one piece but has holes in it?
Comment: I think there have to be two cases here: (1) non-simply-connected spacetimes without closed timelike curves, and (2) those with. Transitioning from one to the other, you get a closed light-like curve, which according to Thorne causes bad things to happen.
Comment: Related: http://physics.stackexchange.com/q/5773/2451
Comment: There is a great question IMO on this site, I can't seem to find it, where the OP asks if one can deduce the space-time structure by computing commutators a bunch of times by making measurements in a lab.  Since the commutators vanish for space-like separation, one could deduce the light-cone.
Answer: Let us for simplicity consider non-relativistic quantum mechanics of a particle on a spatial, $3$-dimensional, connected (possibly curved, possibly non-simply connected)  manifold $M$ in the path integral formalism. Then the Feynman propagator
$$\tag{1} K({\bf q}_f, t_f; {\bf q}_i, t_i)~\sim ~ \int_{{\bf q}(t_i)={\bf q}_i}^{{\bf q}(t_f)={\bf q}_f} \!{\cal D}{\bf q}~ e^{\frac{i}{\hbar}S[q]} $$
in principle carries detailed information about the full manifold $M$, since we should sum over all histories in the path integral (1). For instance, if the manifold $M$ is not simply connected, then the overlap (1) will depend on path-histories that are not homotopic.
How the information about the manifold $M$ can be extracted from only knowing the Feynman propagator $K({\bf q}_f, t_f; {\bf q}_i, t_i)$ is an example of an inverse scattering problem.$^1$
--
$^1$ Note that these hearing-the-shape-of-a-drum-type problems may not always have unique solutions for the manifold $M$.
Answer: Here is an experimentalist's answer:
One is continually checking calculations, using the full Quantum Mechanical toolkit,  with the   the data, looking for deviations as hints for new physics beyond the Standard Model. The g-2 of the muon , for example, starts showing some difference between data and theory, not yet statistically significant.
The standard theoretical toolkit assumes simple connections for space time. Thus, any deviations from "classical" calculations are open to interpretation by new theories, which could include not simply connected space time. These new models would have to incorporate all the present agreements and justify the putative new deviations from the SM.
Here I am answering your " Can we know " question. If we see deviations from the classical calculation we can know that something has to give. If it is connectivity of space time somebody has to calculate its effect.

Topology and Quantum mechanics


Problem bleeding Shimano XT brakes

Question: I have a problem bleeding Shimano XT brakes:
The oil can come down if I open the system at the bottom, and the oil drips down. But once I connect the syringe, put the little plastic cup screws on the top, then I cannot pump the oil toward the top.
I have done several tests, tried to undo the bleeding screw at the bottom on the caliper of increasing turns (1/4, 1/2, 3/4...until the oil comes out from the screw sides (too unscrewed).
I have as well tried using a différend bleeding screw, and the oil pass through nicely.
I have opened and cleaned the master cylinder at the lever, so I know all is good.
All I can think is it is a hose and oil/pin problem.
What do you think?
Ever seen anything like this?
I should mention that I have worked as a bike mechanic for the past few years...
Thanks
Paolo
Comment: You can post a picture by clicking [edit] and then clicking the picture icon to upload, or while editing by pressing Ctrl+G
Comment: please post a photo of the caliper and/or the model number (eg BR-M785)
Comment: Sorry Joe, how do I post a picture?
Answer: The lever reservoir has a tiny hole to let fluid and air pass in/out of the system. This hole gets closed off by the master piston when the lever is pulled.
I've seen similar behaviour to yours once before when the brake had been reassembled (reach was too tight or too loose I forget), such that the master piston was out of place and the breather hole was closed off, preventing me from pushing fluid up from the caliper end. Fluid seemed to flow down ok but that was probably merely residual in the hose. I experienced the same problem as you describe and tried the same steps focusing on the caliper end first before realising what had happened. Bike owner confirmed messing with the lever before having initial problem.
Caveat: this was on a cheaper/simpler brake, BL-M315 and the reach adjustment on yours might not have the same effect, but I would try resetting the reach adjust to see if it has an effect.
HTH
Comment: You're welcome, worth looking into if only to rule it out but your clear write up sounded like a familiar tale. presumably it's one of your fleet bikes and anyone could have messed with it without telling you the full story..!
Comment: I am going to try and fix it next days. Thanks for your suggestion.
Comment: Thanks, this is actually an interesting and helpful comment. Thank you
Comment: Unfortunately I had bought the brake set 2nd hand to put on my hardtail, but clearly this did not happen since  the brake did not work, did not have enough oil and was impossible to bleed.

Problem bleeding Shimano XT brakes


How to control your iPad with your Mac remotely?

Question: I would like to know, is there a way to control your iPad with your Mac remotely (be able to see and manipulate iPad's desktop on your Mac)? I know that with the TeamViewer or other programs you can control your Mac with your iPad but not vice versa.
Comment: Technically a dupe of https://apple.stackexchange.com/questions/52730/any-way-to-remotely-control-or-at-least-view-an-ipad-without-jailbreaking but this question has far more views.
Answer: It is not possible to remotely control the screen of an iPad unless you jailbreak and install a VNC server as MattDMo suggested. This is because the security model in iOS does not allow an app to reach outside of its sandbox to control other apps or the springboard home screen. Apple does not provide any remote control functionality at the iOS level either. There is no way to do what you are asking for without jailbreaking.
Mobile Device Management (MDM) solutions do not allow remote control of the screen on iOS either. MDM can push configuration profiles to control settings on an iPad, or prompt the user to install an app from the app store, but they can't control the screen. Airwatch offers a screen control option, but this only works on platforms that support it (not iOS). I work with several MDM vendors, including Airwatch, and this is not possible because Apple does not make this functionality available in iOS.
Comment: Great summary; to potentially save others a trip to acronymfinder.com: MDM = Mobile Device Management.
Comment: ***"..and this is not possible because Apple does not make this functionality.."***
Comment: And Apple has less APIs than products
Comment: If it's not possible then how does SeeTest do it:  https://youtu.be/K3eAxRGYYlU ?
Comment: @AleksandrLevchuk It wasn't possible at the time of writing. Some of the newer answers might explain...
Answer: There's a tool (made for testing purposes) with the ability to do that, first released on July 18, 2014: iOS Gateway

Enjoy!
Comment: How does this work and is the accepted answer http://apple.stackexchange.com/a/104799/237 wrong?
Comment: I don't know how they do behind the scenes but It works So It should be wrong accepted answer. Just plug your device and open this tool. Nothin' fancy
Comment: Have you used it a quick view of their docs on that screen seem to imply it runs scripts on the IOS device not remotely controls it
Comment: The tool is kind of VNC. They have an IDE to write scripts that tell the IOSGateway tap to specific location. I have been using it for 3 years to remote ipad plugin to my mac at home from my office.
Comment: So does it all you to "be able to see and manipulate iPad's desktop on your Mac" as the question asks?
Comment: Yes, it absolutely can do that.
Comment: @user151019 Please see my edit.
Answer: There are a couple of options. iKeyboardRemote is an app that claims to do just what you want, and is free. However, after installing it, it seems like it's limited to pressing the home button, looking at Pictures, and playing music.
A second option is to jailbreak the iPad and install the VNC server Veency through Cydia. You can then use a VNC viewer like the one from RealVNC to connect.
Comment: It looks like there's an enhanced version of iKeyboard that gives you (more) keyboard access on iOS, but you have to pay for it: https://itunes.apple.com/us/app/ikeyboard/id441439411?mt=12
Answer: You can remotely control your iOS device's screen using one of many Mobile Device Management solutions, such as AirWatch for example. However, these are enterprise-level tools that are typically used in the workplace. There is no easy way to do this as a home user, unless you enroll in such a program.
You can also jailbreak your iPad and install a VNC server.
Comment: Since your location is listed as UK, I thought I would also add that it is considered legal under the Copyright and Related Rights Regulations 2003 law.
Comment: Thank you, but I would be more interested in legal solutions for home users.
Comment: Jailbreaking is legal under the DMCA in the United States. However, if you do not want to jailbreak, then the answer is "no".
Answer: Here's one (extremely limited) way that I can think of:

You can mirror the iPhone screen using QuickTime, which will allow you to see the screen.
Then, for a $9.99 fee, you can control the keyboard of your device using 1Keyboard.
Comment: Welcome to Ask Different!  Please don't give link-only answers.  We're looking for answers that provide explanations as to why it answers the question as well as why it's the best answer.  Links can change over time and then we'll lose the question-answer context.  See [answer] for info on what makes up a good answer.  - From Review -
Answer: You can try Reflector to mirror iOS devices on Mac.
According to this tutorial, you can use their 7-day free trial to wirelessly mirror (but not control) it, assuming the devices are on the same WiFi network.
Comment: Answers on Ask Different need to be more than just a link. It's okay to include a link, but please summarize or excerpt it in the answer. The idea is to make the answer stand alone.
Comment: Unfortunately, OP would also like to be able to **control** the device.


How do you pronounce ACoA?

Question: How should I pronounce ACoA - the acronym standing for Adult Children of Alcoholics?
Answer: When you say an acronym you should spell out each letter individually.
The only exception to that is when the acronym is well-known enough that there can be no confusion, for example NATO, FIFA or CERN, or when there is an accepted pronunciation (such as "Fannie Mae" for FNMA) or when the initialism forms an already-accepted word.
Some organizations like to decide on the pronunciation of their acronym, and it may be that ACoA has a preferred pronunciation, in which case you should follow that. But if you see an unfamiliar acronym written out, and have to pronounce it, just say the letters.
Comment: I thought an acronym is when you say a series of capitalisations as if it *was* a word rather than spelling each letter out, in which case it is just a 'capitalisation'? E.g. LASER is an acronym and TNT is not...
Comment: [Acronym can mean both](http://dictionary.reference.com/browse/acronym). Usage decides whether an acronym is pronounced as a word, or spelled out. If it's not accepted as a word, spell out the letters.
Comment: Well- every day is a school day :) And by "capitalisation" I did, of course, mean 'initialism'... Doh!
Comment: +1. Would be good if you could add a source who promulgates the "spell it out unless usage dictates otherwise" advice.
Comment: Thank you for your useful mini-lecture on acronyms :) I just wanted to make it clear that ACoA is not an organization though. It is a concept used by psychologists-practitioners.
Answer: One possibility is ah-ko-ah, but clarity of meaning is key here. If there's a standard usage, then I would suggest following it; I also imagine, however, that some people whose parents were alcoholic might resent being "reduced to a label".
Comment: Perhaps I haven't made myself clear, but the standard usage was what I wanted to ask about. English is not my native language and I don't live in an English speaking country. I fully agree that people should not be "reduced to a label" and I haven't made this "label" up. The concept is based on a theory that people brought up to alcohol-addicted parent(s) share certain characteristics and known transnationally. One may agree with it or not. I just needed to know how to pronounce it... I certainly didn't mean to offend anyone nor "reduce to a label". Thanks for your answer :)
Comment: Oh, no offence - just an aside.  I'm prone to rambling when it's the end of an overly-hot summer's day. :-)
Answer: According to two videos I found on YouTube, speakers typically enunciate each letter of A,C,o,A individually.
I cannot think of any other way of pronouncing it either.
Comment: Link-only answers are [not answers](http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers/8259#8259). Please summarize the material found in those videos directly in the text of your post here.
Comment: Thank you very much for you answer! :) That's what I thought but I wasn't sure since English is not my native tongue and I haven't thought of YouTube myself :) Thanks again.
Comment: Sure! I'll do it. Thank you for providing that information.
Comment: @SaraKaley: No problem!

How do you pronounce ACoA?


How to detect when the raspberry pi is in motion

Question: I'm very new to robotics so bear with me. I'm looking for a way to detect when my raspberry pi is in motion. More specifically, I'm looking to attach a raspberry pi to my motorcycle and have it send a text when the motorcycle starts and stops moving. I'm an avid programer so the sending a text is not a problem but when I look up how to detect motion all I get is results for PIR sensors detecting when somthing moves in front of it. I'm looking into accelerometers and gyroscopes but I'm not sure if this is the right way to go. Any point in the right direction is appreciated.
Answer: A power hungry Raspberry Pi is NOT the way to go, look into Arduino and perhaps a "tilt switch" to reduce the power consumption with the magnitude of hundreds.
This will give you a indication that the bike is experiencing bumps or shakes. The "Accelerometer and Gyroscope" that is proposed uses I2C interface and the same interface is also present on Arduinos.
The benefit is also that a Arduino is resilient to power lost and that is a weakness that Raspberry Pi has.
There is GMS modules like SIM800, but that is something that I understand that you are quite aware of, so I will not dwell on that topic.
Ref.:
https://learn.adafruit.com/tilt-sensor
https://www.youtube.com/watch?v=PMUZqr5iSjw
http://www.learnedu.us/learn.php?file=ard_basics
Note: There is a feature called "Deep sleep" where you could put a Arduino into deep power saving mode and then wake it up with the tilt switch. I use the same concept for alarm devices and then they can use small batteries independent of the bikes power source. There is also a deep sleep feature that it can wake up every "time interval" and perform a task. The time interval could be seconds/minutes/hours.
Comment: Yup! I'm hoping how I could get it to work would be when the IMU detects the bike is moving it tells the GSM to send a text then the GSM goes back to sleep. GPS would be used if the IMU detects a crash and would send a text along with the location. Therefore GPS would only have to be used when the bike is on motion. I'm hoping this doesn't draw too much power but we'll just have to find out. Thanks for the help!
Comment: Thanks! I decided to go with the Ardunio Nano 33 IoT as it has a 6 axis IMU integrated along with Bluetooth so I can send data to my phone. I'm looking at this https://www.adafruit.com/product/2687 to handle the GPS / Cellular connection. The problem now is I don't quite know how to power everything...
Comment: In the case of supplying the solution from the bike battery (12volt) you should look for a "Step down converter" och "buck converter". But some cautions look into deep sleep/sleep walking and try to disable power hungry features as WiFi, mobile module (Adafruit FONA 3G). I have done some similar projects and there I cut the power to the GSM module until I needed it. Remember more features = more power is consumed!


Why are shaivas so rude to Vishnu?

Question: I see so many toxic shaivas blame EVERYTHING on ISKCON, even tho very little of us are iskcon and most are Sri Vaishnavas. Shiva worships and loves Vishnu and vice versa. If we as a religion can't come United how do we defend for our rights against other religions?
Comment: @SanatanaDhara I'm not cherry picking at all. Being ignorant to a situation that is very present and common and labeling it as an "isolated event" is very one sided if you. Most shaivas do this.
Comment: Also, Iskcon has really indulged in quite serious nindā of Śiva, Rāma, etc., so the accusations of it being a devanindaka aren't baseless. Since, some leaders and spokespersons of the organization behave like that, the followers indirectly bear the blame too, even though not all of them might be Śivanindaka.
Comment: @TanaiKoduru Derogatory things exist in ALL sects without exception. I have seen Sri Vaishnavas tell stories of Shiva getting humiliated and defeated by one of the Alvārs, Mādhvas having stories of Shiva getting humiliated by Vayu avatāra Vaishnavottama Bheema and so on...thereby putting Shiva not just below Vishnu but even Vishnu's devotees!. So it's not just something exclusive to ISKCON. If one keeps focusing on the derogatory aspects of the rival sects, there's simply no possibility of attaining the unity which you espouse in the question.
Comment: It's just Newton's 3rd law i guess. Toxicity give rise to toxicity and respect give rise to respect. It's same for all, be it, Shaivas, Vaishnavas, Shaktas, every human beings.
Comment: There are some Śaivas who do nindā of Viṣṇu, just like there are some Vaiṣṇavas who do nindā of Śiva. There are some (not all) Śrī Vaiṣṇavas & Dvaitins, who really do nindā of Śiva. But not all Śaivas/Vaiṣṇavas do nindā of Viṣṇu/Śiva. It's not fair to say that all Śaivas do nindā of Viṣṇu, just like it's not fair to say all Vaiṣṇavas do nindā of Śiva. Those who do nindā of either, commit pāpa (regardless of who their iṣṭadevatā is). I personally have no problem in accepting that Śiva and Viṣṇu are non-different in svarūpa and that they reside in each other's hṛdaya.
Comment: If you go by the history, it is quite evident that Vaishnavas have gone very harsh against Shaivas. Starting from converting temples to deities and nullifying the practices. ISKCON as an Abrahamic cult deserves the blame it gets.
Comment: Too generalized conclusion labeling an entire sector that way. Better get a reference and particular case/situation. This doesn't mean you can cherry pick an isolated event and use it as a standard.
Comment: @User29449 if you look through history shaivas have been harsh too, They destroy vaishnava temples like the child's have and edit the shaivas puranas to insult Vishnu. And also ISKCON isn't even part of Vaishnavism, it is its own thing. Us Sri Vaishnavas don't even like ISKCON. Stop labeling all Vaishnavas as ISKCON. Especially when ISKCON makes only 14% of us. Most of us are Sri and ramananda Vaishnavas.
Comment: @TanaiKoduru when you say "Shaivas" in your title with no sense of measure, in that case its called Generalizing. And when you do that its show you as a Stereotypes oversimplified generalizations about groups of people. You are welcome reach out to your school/collage English teacher and have them read your post and this comment since you are having difficulty in comprehension. You also have AI too if you have issues finding a English teacher. Good luck
Answer: DISCLAIMER - Shaiva POV ahead. Ignore if you disagree

Do Shaivas reject the fact that Shiva worships Vishnu?
No, Genuine Shaivas do not reject the fact that Shiva worships Vishnu. However as per Shaiva matam, that is only due to his own bhaktavatsalata.
As the brihaNNAradIya purAnam states, Shiva despite himself being the Supreme lord and the Origin of trImurtIs (brahmA,Visnu,kAlAgni rudra) is still a devotee of his own devotees.

भक्ताय निजभक्तानां भुक्तिमुक्तिप्रदायिने ।।विवाससे निवासाय विश्वेषां
पतये नमः ।। २२७ ।। त्रिमूर्तिमूलभूताय त्रिनेत्राय त्रिशूलिने
।।त्रिधाम्ने धामरूपाय जन्मदाय नमोनमः ।। २२८ ।।
देवासुरशिरोरत्नकिरीटारुणितांघ्रये ।।कांताय निजकांतायै दत्तार्द्धाय
नमोनमः ।। २२९ ।।
Obeisance, obeisance to the one who is a devotee to  his own devotees, to one who is the bestower of worldly enjoyment  and liberation, to
the lord of all worlds, to one who is without  garments and to one who
is the final resort.
Obeisance, obeisance to the origin of Trimurtis (the  three deities of
Brahma, Visnu and Rudra) to one with three  eyes, to the light of
three lights (sun, moon and fire), to the  remover of the cycle of
births.

~ brihannAradiyapurAnam - purvArdham - Adhyaya 91
(The above stutih is also found in several tantra sAstras such as the sAradatilaka.)
Since Keshava is the foremost devotee of Shiva, Hence Shiva at times acts like a Vaishnavottama to worship Vishnu as his foremost devotee.

नास्ति शैवाग्रणीर्विष्णोर्नास्ति रक्षा विभूतितः ।। नास्ति भक्तेः
सदाचारो नास्ति रक्षाकराद्गुरुः ।। ५६ ।।
There is no greater Shaiva than Vishnu

~ SkandapurAnam-mAhesvarakhandam-arunAchalmahatmyam-2-Adhyaya 4

10007060c क्षान्त्या भक्त्या च धृत्या च बुद्ध्या च वचसा तथा 10007061a यथावदहमाराद्धः कृष्णेनाक्लिष्टकर्मणा 10007061c तस्मादिष्टतमः
कृष्णादन्यो मम न विद्यते

~ BORI Mahabharatam
However The truth as per Shaiva matam is, Shiva doesn't worship just vishnu, In reality he worships all his (true) devotees, proportionate to their grade of devotion.
In reality though, Shiva worships no one.

शङ्कर उवाच -
ध्याये न किञ्चिद्गोविन्द न नमस्येह किञ्चन २४७। नोपास्ये कञ्चन हरे न
जपिष्येह किञ्चन ।
किन्तु नास्तिकजन्तूनां प्रवृत्त्यर्थमिदं मया २४८। दर्शनीयं हरे ते
स्युरन्यथा पापकारिणः ।
तस्माल्लोकोपकारार्थमिदं सर्वं कृतं मया २४९। ओमित्युक्त्वा हरिरथ तं
नत्वा समतिष्ठत ।
अथ ते गौतमगृहं प्राप्ता देवगणर्षयः २५०। सर्वे पूजामथो चक्रुर्देवदेवे
पिनाकिने ।
O govinda! I don't meditate on anyone & I don't salute anyone, Oh
hari! I don't do upāsya on anything, nor I do japa, but for the sake
of the improvement/enhancement of nonbelievers I've shown thus
otherwise they will be sinners. Hence for the benefit of the world, I
have done this all.

~ padmapurAnam/pAtalakhandam/ch 144
~ brihannAradiya/pUrvArdha/ch 79

All worship Rudra but Rudra does not worship any one. Yet due to his
favourable attitude to his devotees sometimes he worships himself.

~ SivapurAna, kotirudrasamhitA, ADHYaYA 42
The points above have been taken from the books of Srouta Saivacharya, Mudigonda Nagalinga Sastry

Is it correct to indict only Shaivas for Not following Hari-Hara abhedam?
This perspective while may seem offensive to those with a harihara-vAdi outlook, is no different from the vaishnavite perspective which states that Vishnu doesn't worship shiva in reality, he only worships his own self /antaryami who resides within Shiva. Or that he worships shiva merely for the sake of keeping a boon as said in some of the Vainavapuranani. So if the Vaisnavas are correct by following their perspective as given in their sAstras, saivas too are correct in their own perspective which is laid down in their own Sastras.
Moreover, The Questioner, in the process of indicting Shaivas for not following Hari-Hara Abhedam, seems to have overlooked the fact nearly all Vaishnavacharyas (that inculdes gaudiya, srivaishnava, madhva, nimbarka, vallabha) themselves have rejected the concept of Harihara Abhedam/Trimurti sAmayam and Advocated for the sole supremacy of srImannArAyana.

Śrī Caitanya Mahāprabhu continued, "To say nothing of ordinary living
entities, even Lord Brahmā and Lord Śiva cannot be considered on the
level of Viṣṇu or Nārāyaṇa. If one considers them as such, he is
immediately considered an offender and atheist.A person who considers
demigods like Brahmā and Śiva to be on an equal level with Nārāyaṇa is
to be considered an offender, a pāṣaṇḍī.' "

~ Chaitanya Charitamrita . Madhya. 25.79-80

Therefore, other views such as the following:— " The gods of the trinity  (Brahma, Vishnu, and Siva), are of equal greatness"; " The
three gods of  the Trinity are only one ", "Iswara is above and beyond
the  Trinity " " Either Brahma or Rudra among the Trinity is the
Supreme Lord "—these views stating equality, identity, the exis
tence of an entity superior to all the three of the Trinity and the
supremacy of a different member of the Trinity, are against the
pramanas. That Brahma, Rudra, and the like are created beings
subject to karma may be seen in the following passages:— " The*
purusha or person created by Him (Narayana) is called Brahma  in the
world". " Having caused the dissolution of the worlds  before, you lay
on the waters of the great ocean and created me at  first by your Maya
(will).", " Brahma's name 'is Ka and I, Isa  role over all embodied
beings. We two were born from your  limbs. Therefore you are called
Kevava (Ka and Is'a)" Further  Brahma says, " I was 'born from His
graciousness for some  reason and you, from His wrath, for some other
reason, in one of  the earlier creations." The very words of these
rival gods, which  are, so to say, a deed of release written with
their own hands,  declare this truth. That Brahma and Rudra are
subject to karma  and attained their high status, because of having
worshipped the  Lord of all with special rites...

~ Srivaishnavacharya Vedanta Desikan (Rahasya Traya)
Furthermore in the Tattvateeka, commentary to Sri Ramanuja's Sribhasya Desika rejects the idea of non difference between the trinity.

परमपुरुषोक्तिः ईश्वरोत्तीर्णताव्युदासाय | अर्थात्
त्रिमूर्तिसाम्योत्तीर्णतादिपक्षापोहः |
The term 'paramapuruSha' is to refute the idea of a transcendental
Ishwara, which extends to the refutation of the idea of Trimurti
saamyam, that is, holding the Triad of Brahma, Vishnu and Shiva as of
the same status, non-difference and an Ishwara who transcends the
three.

Do Shaivas Not Worship and Respect Vishnu?
To Answer this question, there are Various grades of Shaivas. One type includes Samanya and Mishra shaivas who worship Vishnu and Shiva, while Veera and Shuddha shaivas reject the worship of all Devas other than Shiva including Vishnu.

Saivacharya Sripati Padita also mentions mishra pAshupatas in his sutra bhasya by citing a verse from the Kurma purana. As per this citation, the Mishra Shaivas / Pashupatas literally do Panchayatana/Panchdevata Upasana of Shiva, Vishnu, Surya, Ganesha and devi just like modern day Smartas do.
Now As to why Veera Shaivas reject all other than Shiva? It is because just as Vaishnavas follow the words of Vaishnava shAstras, Shaivas too follow the words of their own Shaiva Shastras.

शिव एको ध्येयश्शिवंकरः सर्वमन्यत् परित्यज्य
Shiva alone is to be meditated upon, casting aside everything else.

~ Atharvashikha upanishad (Atharva Veda)

एक एव शिवो नित्यस्ततोऽन्यत्सकलं मृषा । तस्मात्सर्वान्परित्यज्य
ध्येयान्विष्ण्वादिकान्सुरान् ॥ ३० ॥
Shiva alone is imperishable, all others are perishable. Hence, casting
aside Vishnu and other devatas shiva alone is to be meditated upon.

~ Sarabhopanishat
(Both the Above Upanishads have been cited by Saivacharyas)
This idea of rejecting the worship of all the Gods other than one's chosen diety is found even in the Vaishnava sampradayas, where it is termed as 'ekAntika bhakti'.

In his treatise "Viveka-dhairya-ashraya" Vallabhacharya says that
Anyasya bhajanam tatra, svato gamanameva ca; Prarthana-karyamatrepi,
tatonyatra vivarjayet.
Meaning:
> 1. One should worship no other gods or goddesses but Shri Krishna
2. One should never go, on one"s own accord, to other gods and goddesses with or without a purpose to have Darshana etc.
3. One should never pray to any other gods or goddesses to grant anything.

Similarly Sri Vaishnavacharya Vedanta Desikan too states in his Rahasya traya sara-
ADHIKARA 11: PARIKARA VIBHAGA ADHIKARA
(The Accessories or Angas of Prapatti)

This chapter deals with the accessories or Angas for performing
Prapatti. They are:-
(1) Aanukulya Sankalpam: Resolve to act only in accordance with the
directives of the Lord and which would , therefore, be pleasurable to
him. This includes- Following the duties enunciated for the Varna and
Ashrama (i.e) Nitya and Naimittika karmas Respecting the devotees of
the Lord (Bhagavatas and Acharyas) with the same ardor as while
respecting the Lord himself.
Exceptional and Unconditional devotion to Sri Narayana only to the exclusion of all other deities.

ADHIKARA 18 : APARADHA PARIHARA ADHIKARA

(4) Even major sins except what is stated in (5) below will be excused
by the Lord by inflicting a light punishment in exercise of his
patience, love and compassion towards the Prapanna.
(5) The only heinous and unpardonable sins which will nullify the
effects of Prapatti are: (a) Disrespect to Bhagavatas and Acharyas
and (b) Adherence to deities other than Bhagavan.

A very learned contemporary scholar of the Ramanuja school, Sri Velukkudi
Krishnan, during one of his tours to the USA and Canada, while addressing
his hosting groups, made this advice: 'You may be asked in society by
others to visit Shiva temple by saying 'are we not visiting Vishnu
temples?'. But you should not pay heed to such entreaties.'   And he
related the incident from the life of Ramanuja: While walking on a road
there was a heavy downpour. Someone from a Shiva temple called Ramanuja to
come inside for shelter from the rain. Ramanuja refused saying that just as
a chaste woman would not go to another man, he would not step into a Shiva
temple.

So, Just because devatas other than shiva are rejected for the sake of one pointed devotion to shiva does not mean it is out of hatred. Recently, In the Rama Mandira inauguration in Ayodhya several members of the Veerashaiva community of Jangamwadi matha, Kashi  visited the Rama temple and conveyed their well wishes for the success of the inauguration.
Comment: +1. Very good and balanced answer.
Comment: It is a good answer, but still some aspects of Shaiva presentation of Vishnu can be considered insulting like Shiva killing Vishnu Avataras.
Comment: @Haridasa Analogous depictions of Shiva too occur in the Vaishnava Tantra-Agama literature, they just don't get talked about as much

Why are shaivas so rude to Vishnu?


Cause of centripetal acceleration in a ring

Question: Suppose a ring is rotating in space with an angular velocity $\omega .$ Then each element of the ring is having an acceleration of $m\omega^2 r$ ($r$ is the radius of the ring) but what force is causing this acceleration in each element? The acceleration is inward so the force should also be inward but there is nothing to provide this force . The neighbouring elements can only provide a tangential force on a particular element, this force will not have any component along the radius so this can not be the reason for the centripetal acceleration. So how are the elements accelerating and moving with a constant angular velocity ?
Comment: your assymtion that neighbouring aprticles only contribute with tangental force is not true. There will be a small componenet of transverse force are not all lined up linearly.
Comment: @MikaelFremling's is basically already the answer.  The tension in the ring will adjust itself exacly such as to provide the corresponding component towards the center.  You only need to do an actual calculation if you want to determine the magnitude of that force.
Comment: @MikaelFremling : You mean that the tangential forces on the particle from both the neighbouring particles will have some radial components too ?
Comment: The ring is curved, so yes.  (Try to draw a diagram for a segment with angle $d\vartheta$.)
Comment: @VarunChandra Precicely. Added an answer where i elaborate on this.
Answer: When there is curvature, tensile forces (in a ring, in a string, ...) will give rise to a net force as shown in the following sketch:
Answer: Expanding on the comment, here is an answer.
Getting all the microcosmic force correct is a bit outside of the scope of this answer, so let me answer the question with a toy model instead.
Assume $N$ particles on a ring, attached to each other with perfect springs. The force of the springs is then $F=kx$ where $x$ is the displacement from equilibrium. We assume we start in equilibrium, by the way.
The angle in a corner of or circle will be $\theta=\pi\cdot(N-2)/N=\pi-2\pi/N$. This means that the force from the springs to the left and right of a particle will not cancel completely.
Assume now a small displacement of a particle (for whatever reason) by a distance $x$ along the direction of one of the springs. The compression of the other spring will then be almost $x$ (not precisely though since the two springs are not parallel). The spring force response is therefore $F=kx$. This force will have a  and a parallel component
$$F_p=kx\sin(\theta)=kx\cos(2\pi/N)\approx kx $$
but also a transverse component
$$F_t=kx\cos(\theta)=kx\sin(2\pi/N)\approx 2\pi kx/N $$
It is this transverse component that gives the centripetal acceleration needed to keep the ring spinning.


What triggers are needed to fire a YN568ex III for canon 80D?

Question: I have a Canon 80D and a Yongnuo 568EX III. I'm thinking to buy a remote flash trigger for the setting, but not sure what will work. I read about Yongnuo YN622N Kit, but I'm not sure it will work with my setting specifically? TIA
Comment: YN622N is for Nikon. You would need a YN622C transmitter and receiver.
Answer: You have a few choices. Optical or radio? TTL & HSS or manual only? Built-in or add-on?
Radio
Assuming you want to use wireless radio control, rather than wireless optical control (and you do), your easiest choice is probably the YN622 system. You could also use the manual only Yongnuo YN560/RF605/RF603 system, but you'd give up some of the advanced capabilities of the YN568EX III such as TTL. Just to make matters more complicated, The YN622 and YN560 systems are partially, but not fully cross-compatible. YN622 items made since the beginning of 2015 can be set to receive signals from YN560 transmitters, but YN622 items can not transmit YN560 signals. YN560 receivers can not receive YN622 signals.
If you choose the Yongnuo YN622 system of triggers, you need the Canon versions of the YN622 series of transceivers and transmitters, such as the YN622C II or YN-622C-TX. Anything with an "N" instead of "C" in the model name is for Nikon cameras.
The YN622C II is a transceiver. That is, it has both a 2.4GHz radio transmitter and a 2.4GHz radio receiver. You can use one on your camera as a transmitter and another attached to your flash as the receiver. The transceivers also have a hot shoe on top as well as a hot foot underneath, so you can put the transmitter's hot foot into the camera's hot shoe and then attach another flash on top of the transceiver if you also want an on-camera flash. (I tend to use a flash bracket with on-camera flash, so I can use a transmitter without a hot shoe and control the flash attached to the bracket via radio, though sometimes an off-camera hot shoe cord works better for flashes on brackets attached to the camera.)
The YN622C-TX is a 2.4GHz radio transmitter only. It can transmit just like a YN622C II transceiver, but can't receive anything via radio. It also has a screen and more buttons that make it easier to change settings and see what settings you have selected. You can use one YN622C-TX on your camera and one YN622C II attached to your YN568EX III flash as a receiver.
If you've only got the single Yongnuo YN568EX III at this point, you might also consider getting a Godox 2.4Ghz transmitter (there are a number of different models available) as well as a Godox X1RC receiver to attach to your flash.  You'll only need a Godox receiver for non-Godox flashes, like your YN568EX III or any other Canon compatible flashes. Most Godox flashes have built-in receivers for the Godox 2.4GHz radio system. Many Godox hot shoe mounted flashes also have built-in radio transmitters that can control other Godox 2.4GHz devices. So when using a Godox flash or transmitter on the camera, Godox flashes will have built-in radio receivers inside the flash.
The reasons I would recommend using Godox instead of Yongnuo:

Godox has the same radio system and protocol for all of their 2.4Ghz flashes, all the way from their smallest manual only speedlights to their largest battery-powered monolights, and everything else in between. Yongnuo has two different major protocol systems (YN560/RF605/RF603 for manual flashes and YN622 for E-TTL flashes) plus they make another line that clones the Canon RT system.

In my experience, Yongnuo radio triggers are very reliable within their limitations (YN622 transmitters can't control YN560/RF605/RF603 flashes/receivers, etc.), but their speedlights are not. If you use several Yongnuo flashes for any kind of paid work, you better have a spare or two with you, because eventually you'll need it. If you do anything that is remotely thermally challenging, like using HSS for more than an occasional pop here and there, you'll eventually have one crap out on you at the most inopportune time.

In my experience Godox and Flashpoint (Adorama's in-house version of Godox
products) flashes are more reliable than Yongnuo flashes, even though their cost is competitive with Yongnuo when one considers the internal Li-Ion batteries supplied with many of Godex's flashes are as good as using an external battery pack with AAA battery powered flashes.

If you go with Godox you'll not have to worry about changing radio systems if you want to move to more powerful lights. You will also be able to use your speedlights and other Godox lights together at the same time using only one transmitter. Godox (and other, rebranded versions of Godox products, which all work together even if the different parts have different branding on them) is the only manufacturer at this time that has a single radio system for small portable speedlights all the way up to powerful mains powered studio flashes and powerful Li-Ion battery powered portable monolights.

In the United States, Godox devices are rebranded for Adorama's in-house Flashpoint nameplate. In the UK and Canada, Pixpro and StrobePro are rebranded Godox nameplates. Some (but certainly not all) Neewer flash products are rebranded Godox products. At one time Cheetah sold some rebranded Godox products, but started moving away from that in 2017. There are others in Europe who sell Godox products under various nameplates as well.
Optical
If you're willing to put up with the disadvantages of optical wireless communication, you can simply use the pop-up flash of your 80D to control an off camera EX flash, such as the YN568EX III. You'll probably soon discover that the limitations are too confining, though.
Some of the disadvantages with using optical wireless communications instead of radio communications:

Distance limitations. Most optical systems, especially when using a weak built-in popup flash as the controller, are much more range limited than radio systems.
Positioning limitations. Most of the optical controllers only cover an area about as wide as a 24mm lens on a FF camera. If the remote flash is further to the right or left it may not receive any optical signal, even if it is only a few feet from the camera! Radios transmit in all directions from the camera.
Line-of-sight requirements. In addition to being in the "cone" of light transmitted by the master, off camera flashes must have a clear line-of-sight to the master with the optical receiver on the flash pointed in the direction of the master. This inhibits being able to place optically controlled flashes inside modifiers, placing them behind objects in the scene, etc. Radio systems are not limited to line-of-sight and can even be used on the other side of walls and other obstructions (although the obstructions may reduce the range somewhat).
Difficulty with bright ambient light. Especially outside under sunlight, the power of optical wireless control is very limited. Again, especially with a relatively weak built-in popup flash, the master just doesn't have much power to cut through the bright sunlight and the receivers can't detect the weak signal from the master over the very bright sunlight. Radios work just as well in bright sunlight as they do in a dark studio.

About the only advantage optical control using the 80D's built-in popup flash has over radio control for you is that you don't need an on-camera radio transmitter attached to your camera's hot shoe. (But you'll probably soon discover that you'll need a more powerful on-camera optical master attached to your camera's hot shoe to get the optical system to work the way you want, if it will even work then.)
For these reasons, it is probably better to start by just choosing a radio system and then stick with that system. Optical control of off camera flash is fast becoming old technology that is only included in current products to allow them to work with cameras and other flashes that were made before the use of radio communication became more prevalent to control off camera flashes.
Comment: Thanks! Michael! Another question: Pros and Cons for buying 2 transceivers or 1 transceiver and 1 transmitter? Any suggestions? TIA
Comment: @Simon The highlights are in the answer: an easier, visual interface with a screen and more buttons for the TX versus a hot shoe on top for the TX/RX.
Answer:
I have a Canon 80D and a Yongnuo 568EX III. I'm thinking to buy a remote flash trigger for the setting, but not sure what will work.

Well, for starters, your 80D's pop-up flash can be a "smart" optical master to the YN568EX III in Sc mode.  All the Yongnuo "EX" named models can be off-camera receivers in the Canon optical system for remote controlling flashes.  The 80D's pop-up flash (or any flash) can also remotely fire the YN568EX III in S1/S2 mode, but S1 and S2 are manual and cannot adjust any settings on the flash or use TTL/HSS.
However, optical triggering requires line of sight, and can be overpowered by very bright ambient conditions.  So, it works well in a studio setting. Less well on location in bright sunlight.  Which is why radio is preferred.
If you want radio triggering, any set of radio transmitter/receiver units that work to communicate Canon TTL/HSS should work with the YN-568EX to give you the same function remotely you'd have with the flash on the camera hotshoe.
You could use Yongnuo's 622C triggers (622C, 622C-TX); Godox's X system (X2T-C, XPro-C and X1R-C receiver); Phottix Odin II triggers, etc. etc. But keep in mind that most 3rd-party flash gear is reverse-engineered against OEM (brand name) gear, and that 3rd-party+3rd-party can sometimes have weird compatibility issues you wouldn't see with, say, a Canon 600EX-RT.
Personally, I would recommend looking at Godox's system. It's very popular, low-cost, and expandable.  Unlike Yongnuo, Godox's system encompasses both the manual and TTL gear; offers many bigger than speedlight options, and cross-brand TTL/HSS support. So, if you ever switch systems from Canon to Nikon, Sony, Fuji, Olympus/Panasonic, or Pentax, your off-camera lights will still be useful.
And unlike your YN-568EX III, a $110 Godox TT685-C has a built-in radio transceiver, which is more convenient and robust than using an add-on radio trigger.


"Error: Items not allowed (keepout area..)" KiCAD

Question:
I have got this erorr. What should i do?
Answer: You have placed vias and tracks within a keepout area, i.e. an area where specific features are not allowed. Keepout areas are polygons that can be set to prevent the placement of any combination of footprints, vias, tracks, pads, or copper fill within their borders.
Keepout areas are either part of footprints, or placed manually by you using the keepout area tool:

You'll need to review your design, see where the error arrows are pointing, and ultimately either reroute your traces or reconfigure/remove the keepout area. If the keepout area is a part of a footprint that you sourced from somewhere else, check the datasheet for the component and ensure that you are, in fact, allowed to run traces or vias through that area.
Comment: I did, thanks to your comment. I appreciate you for pointing it out, @MiNiMe!
Comment: Notice that the keepout can also be edited.
Comment: True. In this case the evidence strongly points to a keepout zone though. And I see Matt already addressed what I commented: "reconfigure/remove the keepout area"
Comment: @MiNiMe If it's a board-level keepout. If it's a footprint level keepout, it can only be edited by editing the footprint.


How do I remove the header & footer from a PDF?

Question: How do I remove the header & footer from a PDF? I was successful in opening the PDF in PDF Viewer Plus, selecting crop, all pages, .25" top and bottom. This removes the viewing of the text, however the text is still embedded in the document. When I try to use a screen reader, it still reads the headers and footers even though they are not visible. How do I remove them completely? I tried to print to PDF but it created an 80 MB image based PDF and lost all text information. I need to keep the text. I tried PDF Scissors also and it too just hid the text, which was still in the file.
Comment: Are we talking about the Nuance PDF Viewer Plus ?
Comment: Can you add a full screenshot of one of the pages?
Comment: @Buscar웃 Yes, Nuance makes it.
Comment: Use Adobe Acrobat and set the crop box.
Answer: Open PDF in PDF Viewer Plus > Save as XPS > Open XPS in 7-Zip > Extract to folder > Open document\Pages\1.fpage in Notepad++ (is XML) > File/Global search & replace the header and footer > Create .zip file with 7-Zip > Rename to .xps > Open in PDF Reader (XPS not an option but it will open it anyways with wrong title bar) > File > Save As > Document_Fixed.pdf > Open in Foxit Reader > Engage screen reader > Voilá!
Update: Saving as XPS will position each individual word on the page, and the resulting screen reader rendition is a jumble of individual words in quick succession with all cadence and sentence structure lost! It is impossible to listen to.
Instead, in Foxit > File > Save As > TXT > Open in Notepad++ > Search & Replace '---- Page 1----' using regular expression and replacing with blank > Search & Replace header/footer > Save > Open in Open Office Writer > Fiddle with page margins and font size to approximate original PDF > Saves as document_fixed.PDF > Open in FoxIt > Engage screen reader > Voilá!
Answer: I can only guess here since it was not specified, that you are using the Nuance PDF Viewer Plus.
Nuance PDF Viewer Plus has limited editing capability.
You best choice is to export the pdf to word, modify it there and save as pdf.
Comment: My version (12 SE I believe) doesn't support exporting the PDF to MS Word. It only supports saving as XPS. But once I have it as XPS, I see no way to convert it back into PDF (text).
Comment: Consider this https://nuancepdf.com/PDFReader/Download.aspx
Comment: Thanks! They never mailed me the converted Word doc after I uploaded, but I did find PDF Reader could open XPS and save as PDF. My solution: Open PDF in PDF Viewer Plus, Save as XPS, Open XPS in 7-Zip, Extract to folder, Open document\Pages\1.fpage in Notepad++ (is XML), File search & replace the header and footer, Create .zip file with 7-Zip, Rename to .xps, open in PDF Reader (XPS not an option but it will open it anyways with wrong title bar), File, Save As, Document_Fixed.pdf, Open in Foxit Reader, Engage screen reader, Voilá!
Comment: Please not Word. Acrobat is the tool to use.
Answer: Do 2 step:

Convert pdf file to word. You can open Microsoft Office Words, then open pdf file by MS Words to convert file to word.
Edit footer then save file as pdf again.


Constructing a Bijection to Demonstrate Countably Infinite Set

Question: I'm looking to prove that $\mathbb{Z} \times \mathbb{Q}$ is countably infinite by constructing a bijection $f: \mathbb{Z} \times \mathbb{Q} \rightarrow \mathbb{N}$. I understand that I can demonstrate $\mathbb{Z} \times \mathbb{Q}$ is countably infinite by showing that $\mathbb{Z}$ and $\mathbb{Q}$ individually are countably infinite, and thus it follows that their Cartesian product is countably infinite. However, I was more curious how one would construct a bijection to prove this, since by definition one must exist.
Answer: The existence of a bijection $b: \mathbb{N}\times\mathbb{N}\rightarrow\mathbb{N}$ - say, the Cantor pairing function - is the thing to understand. If $A,B$ are countable, then we have injections $i,j: A,B\rightarrow\mathbb{N}$; we can use $b$ to "glue them together" to get an injection $m:A\times B\rightarrow\mathbb{N}$, given by $$m:A\times B\rightarrow\mathbb{N}:(x,y)\mapsto b(i(x),j(y)).$$ If $i$ and $j$ are each bijective, then $m$ is a bijection.
Exercise: check the various claims I've made in the previous paragraph!
So the point is that once you've picked your pairing function $b$, and your bijections $\mathbb{Z}\rightarrow\mathbb{N}$ and $\mathbb{Q}\rightarrow\mathbb{N}$, you've already got all the ingredients needed to give a bijection $\mathbb{Z}\times\mathbb{Q}\rightarrow\mathbb{N}$. It is worth noting that there's no reason to expect the resulting bijection to be nice - indeed, is there even a nice bijection between $\mathbb{Q}$ and $\mathbb{N}$? (OK fine, that's totally subjective, but my point is that we shouldn't hope for an easy-to-write-down example of the type of bijection we know must exist.)
Answer: It is not hard to construct explicitly an injective function $f\colon
\mathbf{Z}\times \mathbf{Q}\to\mathbf{N}$.  For this we will use base 13 representation of elements in the codomain. We need symbols (digits) to represent numbers 10, 11 and 12. Let us agree to use $t, e, w$ for that purpose.
Now take an element in the domain, e.g., $x=(-7, 308/17)$ we define $f(x)$ as below: stripping away the parentheses $x$ is  the string of symbols:  $-7, 308/17$. Now in this replace minus sign by $t$, comma by $e$ and slash by $w$ getting $f(x)=t7e308w17$. This expression is a number in base 13 (hence a non-negative integer). As two different strings of digits represent two different integers we see that $f$ indeed is an injection to non-negative integers.
Answer: If you have formulas for bijections $\mathbb N \mapsto \mathbb Z$ and $\mathbb N \mapsto \mathbb Q$, then the proof that $\mathbb Z \times \mathbb Q$ is countable will give you a formula for a bijection $\mathbb N \mapsto \mathbb Z \times \mathbb Q$.


How does the width or depth of a container of water affects the speed of an object (e.g. a toy boat) travelling on it?

Question: How does the width or depth of a container of water affect the speed of an object (e.g. a toy boat) travelling on it?
Answer: Try thinking along these lines:
When the object moves forwards, water has to move backwards, to make a new "hole in the water" to be occupied by the object, and to fill up the "hole" where it was before.
If there is only a narrow space between the object and the walls, the water has to move backwards faster than the object is moving forwards.
You might want to try googling for "virtual mass" in fluid flow, which is another way of thinking about the same effect.
Answer: Look up laminar flow and notice that resistance increases with velocity gradient (difference in velocity over separation). The further away the walls the lower the velocity gradient (the higher the separation).
Comment: @grace - the question says "an object travelling in water" and I take that to mean an object immersed in water, not above it. You can [edit] the question to make it clearer.


How can I mirror a noise modifier?

Question: How can I mirror this noise modifier so that I get a loop animation?
Answer: F-Curve modifier Cycles > Repeat Mirrored ...

... but - Instead of F-Curve's Noise modifier you can use Noise texture in Geometry Nodes to offset location. To loop noise use Empty (or any other object) to control texture location and ensure start end Empty location match.

Like now this Empty animation generates visible back & forth motion. For nicer endless loop effect let Empty follow Curve Circle.

How can I mirror a noise modifier?


How to raise an exception in VB.NET

Question: How should an exception be raised in VB.NET?
Comment: I google this question every time I have to write this code.  Glad it's here.
Comment: @JonathonReinhart: I don't think there is anything wrong with having a definitive answer to a question like this on this site.
Comment: Sure. But it blows my mind that after the X years this site has been in existence no one has asked this question. As astander mentioned below, it's probably because it is so trivial and easily answered elsewhere.
Answer: You would throw a new exception.
Have a look at Throw Statement (Visual Basic)

The Throw statement throws an exception that you can handle with
  structured exception-handling code (Try...Catch...Finally) or
  unstructured exception-handling code (On Error GoTo). You can use the
  Throw statement to trap errors within your code because Visual Basic
  moves up the call stack until it finds the appropriate
  exception-handling code.

EDIT
By request and from the link
<code>Throw New System.Exception("An exception has occurred.")
</code>
Comment: @JonathonReinhart, understood. If this was a duplicate, then close it as such, if not it should be answered, correct?
Comment: I apologize, and rescind my downvote. How can this question not exist on StackOverflow?!
Comment: @JonathonReinhart, I think it might actually be that trivial that it might be the lesson after "Hello World". X-)
Comment: I think you might be right. Add an example and I will (still surprised) upvote :-)
Comment: is it possible to manage an exception from the caller function? Ex: Function A call Function B. I force function B to raise an exception but i want to manage it in the try catch of function A.

How to raise an exception in VB.NET


Identify Superman novel: journey into space with Lex Luthor

Question: The novel revealed Superman to be brilliant. Lex lost his hair in a science accident. Lex journeyed into space in a spaceship whilst Superman flew beside him.
Comment: Did it involve Lex telling Superman that he had conditioned Superman to always respond to Lois whenever she was in distress?
I seem to remember a story about the two of them flying into space, near the end of Lex's life, where they talked about their history as adversaries.
Comment: @Alistair86 That was "Luthor's Gift", a short story I assume was written before the novels *Last Son of Krypton* and *Miracle Monday* because it gives a somewhat different reason for Luthor's baldness.  *Last Son* is the right story.
Comment: @KyleJones Thank you! I couldn't remember the name, it's been bugging me for ages.
Answer: Sounds like the Elliott S Magin novel Last Son of Krypton. From Wikipedia:

Lex is a childhood classmate of Clark Kent in Smallville, a scientific genius who blames the then-Superboy for ruining his greatest experiment—the creation of artificial life (in fact it is Lex, celebrating his achievement with a smoke, who starts the fire in his lab). It is at this time that his hair is also burned off. Lex is never again able to replicate his results and holds a lifelong grudge against Superman as a result.
Lex as an adult spends much of his time in prison, but in this story it is described as largely by choice; Lex has the capacity to escape nearly at his leisure, but finds that solitude gives him time to work on his scientific theories and finds dodging manhunts tedious. He learns of a secret document written by his idol Albert Einstein, and breaks out for the express purpose of stealing it, using a hologram of himself as a distraction; however, when he cannot translate it (it is actually written in Kryptonese), turns to an expert linguist who turns out to be a disguised alien who also wishes to steal the documents. Luthor then forms a reluctant alliance with his archenemy Superman to chase the alien to a distant world, using Lex's one-man faster than light starship which he has kept hidden for years in plain sight as a modern art sculpture. When the mysterious alien's greater plans are revealed, Lex must work with, and even save the life of, Superman in order to protect the entire galaxy from the would-be warlord.
Comment: I think this is it! Fantastic. Thank you.
Comment: Followup: Could this be the same one I read back in the early 80s(?) where they both went to a third type of sun (I don't recall the color), where superman was even stronger yet. I remember Lex trying to lift Supe's unconscious head by the hair, and the hair cutting through his hand like piano wire.


What unit does $\Delta x$ have in the uncertainty principle?

Question: Can somebody tell me how the units work out in Heisenberg's principle equation?
Mass in $kg$ and velocity in $m/s$ cancel partially with Planck's constant, so what kind of unit is given to $Δx$ to balance the units?
Answer: $(m) \cdot (kg \cdot \frac{m}{s}) \ge J \cdot s = (kg \cdot \frac{m^2}{s^2}) \cdot s$
So, the unit is $kg \cdot \frac{m^2}{s}$ on both sides.
Answer: The position-momentum uncertainty relation is: $\Delta x\Delta p\geq \frac{\hbar}{2}$. Here $\Delta x$ is the 'uncertainty' aka standard deviation of observing a quantum particle at a given point. The standard deviation is defined as $ \Delta x = \sqrt{\left\langle x^2\right\rangle-\left\langle x\right\rangle^2}$. Here x has the dimensions of length and we can then see that $\Delta x$ also has the dimensions of a length. As the uncertainty in momentum is defined in much the same way we see that $\Delta p$ has the dimensions of momentum: $\frac{\text{mass}\cdot\text{length}}{\text{time}}=
$. Now $\hbar$ has to have the dimension $ \frac{\text{mass}\cdot\text{length}^2}{\text{time}}=\text{energy}\cdot\text{time}$ or else we wouldn't have a physically or mathematically sensible inequality.


OpenVPN Server Port Forwarding

Question: I'm sorry if this question was asked already, but I didn't even know how to search for it, so if you already have a solution, please be kind enough to reply with a link.
So a friend of mine has a 4g connection as their internet connection without a public IP address and they wanted to access a samba share remotely. I have a vdsl connection with a public IP address and I run an OpenVPN server on a raspberry pi, so they asked me if they could use my VPN to use my private IP address to connect to their samba share. I can't figure out how to do this but I really want to help my friend out. Thanks in advance to anyone who can help.
Answer: you can do what you asked for, here is some instructions to achieve it.
it is a matter of port forwarding, so you first have to control what internal IP address you give to your 4G client, you can do this by using openssl key, and setup a special profile with a dedicated address attached to this special key using the ccd directory and making a file named after the key in that directory.
that is, in your openvpn server.conf just add
client-config-dir ccd

if your client key name is samba4Gshare then create a file /etc/openvpn/ccd/samba4Gshare
and put in it some dedicated IP address (for example if your openvpn internal lan is 192.168.2.0/24)
ifconfig-push 192.168.2.6 192.168.2.5

So 192.168.2.6 will be the dedicated IP for your samba4Gshare and 192.168.2.5 will be used internally by openvpn for connections with this client.(be aware that openvpn by default use some /30 internal subnets so you have to segment your internal LAN in some /30)
Then you setup an openvpn client on your samba share using this openssl key so your client connect to your openvpn server and got the dedicated IP address.
once the client connect with its dedicated key and it has this special fixed IP address, if you use iptables/netfilter you can just forward connections from your raspberryPI IP with DNAT in table nat/PREROUTING to the samba share openvpn dedicated IP address.
At this time, you may be able to see the share from your RaspberryPI IP address using a client in your local private LAN.
After that, last part is to forward a port from your VDSL to your raspberryPi so you can use this port to access your samba share from the public IP of your VDSL. As a matter of fact you need to ajust route on your samba share so the connections that came from your openvpn links get back to the same ways to the requester. it may require some MASQUERADE or dynamic route based on port if your samba share has different route to reach internet or your openvpn segment.
For instance if you MASQUERADE on your openvpn server it may works correctly directly out of the box, but your samba share may not see what real IP is requesting the share, because for this share every request seems to come from your openvpn server. It may not be very secure to not control the area that is allowed.
VDSL(Pub IP)-->RASPBERRY(Private IP)-->SAMBA(openvpn IP)

where --> mean port forward.
if you give detail on what are your internals IP and router I can give you samples commands.
regards and good luck.

OpenVPN Server Port Forwarding


Guidance on creating overlapping dot patterns

Question: Is there a way to create an overlapping and integrated dot pattern like this in illustrator without it looking amateurish, like one layer stacked on top of another?
Comment: I wouldn't use Illustrator or any vector image editor for this. Better to use a raster image editor. You could convert an image to CMYK, and use that as a basis to create halftones for each color channel using the halftone filter - the screens are all at the same angle.  Then you could move the channels a few pixels left/right/up/down to give that slight miss-matched effect, maybe delete the yellow channel, and recolour the magenta channel as red. [see a rough example](https://imgur.com/RaIoDEE) - if you can allow for other software like Photoshop, I could add this as an answer.
Comment: The shown dot patterns resemble how different tones are made in printing. It can be used as artistic effect in graphis programs and it's called half-toning. The already mentioned Astute Phantasm does it with vector dots. Illustrator's own half-tone pixelation creates a raster image which look unsharp when zoomed in. Inkscape has free vector half-toning. BTW. The pro look doesn't come from perfectly sharp vector dots, it's poured from the well between one's ears.
Comment: Actually, to me, the example looks a bit "amateurish" as the patterns of the three colors all have the same *angle*. If it is to emulate printed halftone dots, they should have three different angles. Do you intend to use the graphics on screen or print? If it's for print, are you going to print with three spot colors? If you print this kind of pattern with CMYK, it might look strange that each of your dots in reality consists of smaller dots.
Answer: Astute Graphics Phantasm plug in, with its Halftone option, would make this easier. (Note the plug in is not free, but I believe there's a limited trial or demo available.)
I'm not meaning to imply it will be a simple thing to create the sample image. It will take some work. The plug in merely makes creating the varied size and color halftone-like dots in specific ways easier than what Illustrator has to offer out-of-the-box, so to speak.
This answer is using an older version of the Phantasm plug in (CS6). Functionality may be better in more recent versions.

Start with a shape that has some sort of gradient to white in it. I chose to use a Gradient Mesh. Then merely call the plug in and adjust settings.

You can then expand the appearance after using the plug in and you are left with "dots" of various colors....

Zoomed view:

For the particular image in the question. I would create a few different color to white meshes, and then stack them on top of one another, rather than using the multi-colored gradient mesh used for this example. As long as the settings for the plug in remain consistent across different meshes (especially the DPI setting), the dots should relatively line up across multiple meshes per the sample image.

Disclosure: I have no affiliation with Astute Graphics. I benefit in no way should someone purchases anything from Astute Graphics. However, in the past, I have received free software from Astute in exchange for my opinion.
Answer: Sometime later.
I found an interesting webpage that makes vector halftones from an image.
https://halftone.xoihazard.com/

There are a lot of parameters: different grids, dot shapes, angles, sizes, separation, thresholds...
You can export an SVG for free.

To answer the question some steps would be:

Use a raster texture, like a cloud

Make different versions of it, for example playing with the levels, and export them into different JPG files.

Use the tool and to have different versions.

Import them together to a vector program, and change the colors.


Why an acid form h3o+, not h3o

Question: When a lone proton bonds onto an H2O molecule in an acid, why doesn't the proton bond with a pair of the lone electrons in H2O and satisfy its electrons needs by having 3 single bonds? Why is it still charged?
Answer: Okay let's look at the H2O molecule first. The oxygen atom has 6 protons and each of the hydrogen atoms have a proton. Hence the H2O molecule has a total of 8 positively charged protons. Oxygen has 6 valence electrons and each of the hydrogen's have 1 valence electron, directly involved in covalent bonding with the oxygen atom. Hence the H2O molecule has a total of 8 negatively charged electrons. As the number of protons = number of electrons in the molecule, the molecule has no overall charge. When a lone proton forms a dative covalent bond with a lone pair on the oxygen atom of the H2O molecule, there are now overall 9 protons and still the same 8 valence electrons in the molecule. Hence due to the imbalance between protons and valence electrons in H3O, there is an overall positive charge on the molecule, hence why it exists as H3O+ when a lone proton (no electrons) bonds with H2O.
Comment: Why doesnt the OH- molecule kick out a valence electron so it will acheive electrical neutrality. It looks like the ions are driven by a tendency to satisfy the octet rule, over the tendency to balance electrical imbalances.
Answer: There aren't any free protons floating around it water. They are attached to water molecules or acid molecules. If a positively charged proton is transferred to a neutral water molecule (from another water molecule or from an acid molecule) then clearly that molecule becomes positively charged.
Now how is the new proton bonded to the water molecule? If you consider it to be ionically bonded then you are assuming the oxygen is hanging onto its electrons (at which it is pretty good) in which case the proton retains its positive charge. But if you assume, as you seem to be suggesting, that the bond is purely covalent, then the bond would be formed by sharing the electrons equally between the proton and the oxygen. In this case you would indeed write $\ce{H_3O^\oplus}$  i.e. the positive charge becomes a formal charge on the oxygen.

Why an acid form h3o+, not h3o


How is the code stored in an executable?

Question: I read that an executable stores the code in different sections. For example, a separate section for data etc. Is this generic across different platforms such as Win or MacOs or Linux?
Some insight into it would be really helpful.
Answer: You are correct in that an executable has several sections or segments: Not all of them, however, are code.
There is usually one segment for code - in ELF and PE, this is usually called .text. Additional ones exist to store dynamic linkage data, hard coded strings, read only data, global variables, etc.
To see these for yourself, rather than Wiki and Google , try hands on:
In Windows: You have a tool called DUMPBIN.EXE , part of visual studio. If you can't get your hands on that, use Dependency Walker (which is freely downloadable). This will parse PE and PE32+ (that is, 64-bit) files
In Linux: Use objdump -x , or readelf (both are pretty much the same, though with slightly different options) for ELF files.
In Mac: Use otool -l to see the load commands (which show you the sections and the segments) in Mach-O files.
Using either or all tools will hopefully get you a better idea of how things work.
Hope this helps,
TG
Answer: Windows uses Portable Executable format.
*nix generally uses Executable and Linkable Format. Previously some used  SOM, a.out, ECOFF, XCOFF, COFF, and some others.
OS X and iOS (and NeXT, history fans) uses Mach-O.
PowerPC systems still support Preferred Executable Format which was used with earlier Mac OSs, and some forms of BeOS.
Maybe start with http://en.wikipedia.org/wiki/Comparison_of_executable_file_formats