why is changing the style in code with Delphi 10.2.3 incomplete? it worked ok with Berlin

Question: using Delphi 10.2.3.Tokyo i opened the MobileControls sample that comes with Delphi and changed the target to iOS 64bit.
Then put 2 StyleBooks on it. Double clicked the first and loaded iOSJet.style. The Form gets dark.
Then double click the second StyleBook and load iOSSterling.style.
Then i put a button on the form and on click event i typed:
<code>if Form1.StyleBook = StyleBook1
   then Form1.StyleBook := StyleBook2
   else Form1.StyleBook := StyleBook1;
</code>
Finally i compiled and deployed the app to my iPad. The form shows dark (as it should). Clicking on the button changes the style, but not for all components - the background stayes dark.
I closed the app and ib the IDE changed the style of the form to StyleBook2 = the form changed completelly from dark to white (light gray), all components including the backgound.
Then i ran the app on my iPad and it showed all white.
Clicking on the button changed the style to dark, but again the background stayed white.
It appears that with Tokyo the backgground is not affected by a change of style - it stayes as it was with the style at start of the app.
I'm looking for a workaround as this was working perfectly with Delphi 10.1.2 Berlin.
Answer: it is a bug in Tokyo - here's the link to Bug report and HowTo make it work:
https://quality.embarcadero.com/browse/RSP-17771


Custom made flutter Icon

Question: I am developing a flutter application, for which I need to put my own logo as a Bottom Navigation Bar Icon. I have my own .svg file as well as an image file(png, jpeg, etc) of my logo, but I don't know how to use it as Icon in the bottom nav bar(BNB) with other material Icon.
For now, I have 4 icons in BNB and want to place the App Logo icon in center of BNB.
Note: I am building the app for android as well as ios platform.
enter image description here
Comment: You'll get the most out of stack overflow if you show what you've tried. Copy your code here, so that others can help you. If you're just looking for a tutorial, there are plenty online (eg https://resocoder.com/2019/08/15/flutter-custom-icons-automatic-manual-way-icon-font-or-svg/).
Comment: please add the error on your question description. Also you need to make sure that the asset image is declared in pubspec.yaml
Answer: Take a look at this package: https://pub.dev/packages/flutter_svg
Or use https://www.fluttericon.com/ to make your own "native" icons.
Answer: using package flutter_svg, put the widget inside yout items list in BottomNavigationBar
    BottomNavigationBarItem(
          icon: SvgPicture.asset('assets/images/logo.svg',
          height: 40.0,
          width: 40.0,
          color: Colors.black,),
    title: Text('Some Title'))

Comment: I tried this approach and the code is throwing errors.
1. the value of const list literal must be constant
2. The constructor being called isn't a const constructor
Comment: remove the const keyword. can you just show the code in your description.?
Answer: SVG to Icon font family
You can use icon_font_generator to convert from SVG icon to icon font family.

Firstly, make sure to copy SVG icon to your project and follow the structure which can be found package doc.
To generate icon code, run these commands (it required node js):

$ flutter pub global activate icon_font_generator
$ export PATH="$PATH":"$HOME/Tools/flutter/.pub-cache/bin"
$ icon_font_generator --from=icons --class-name=Iconly --out-font=lib/src/icon_font/iconly.ttf --out-flutter=lib/src/widgets/icons.dart

This will generate following files:
lib/src/icon_font/iconly.ttf
lib/src/widgets/icons.dart

Final pubspec.yaml file:
dev_dependencies:
  icon_font_generator: ^1.0.0

flutter:
  fonts:
    - family: Iconly
      fonts:
        - asset: lib/src/icon_font/iconly.ttf

Usage:
var icon = const Icon(Iconly.outline2User);

NOTE:  there might be wrong rendering for complex SVG file.

Custom made flutter Icon


Borel $\sigma$-algebra definition question

Question: So I am studying measure theory and I have found myself struggling to fully understand the concept of the Borel $\sigma$-algebra in depth. We know that the Borel $\sigma$-algebra is the smallest $\sigma$-algebra containing all open sets. The part that I cannot clearly grasp is the word smallest. The way we can generate a Borel $\sigma$-algebra is take all the open sets and take all possible set operations between them. Won't this always produce a unique $\sigma$-algebra of sets? How can a $\sigma$-algebra be larger? Can anyone provide an intuitive example? Thank you in advance!
Comment: Sigma algebras are supposed to tell you 'what you're able to measure. So a sigma algebra thats ``larger'' than other sigma-algebras is one that can measure more stuff. It's just a superset of other sigma algebras. For instance, the set $\{a,b,c\}$ admits these sigma algebras: $$\{\{\},\{a,b,c\},\{a\},\{b,c\}\}$$ and just the power set: $$\{\{\},\{a,b,c\}, \{a,b\}, \{b,c\}, \{a,c\}, \{a\}, \{b\}, \{c\}\}.$$ You can easily verify they're both sigma algebras, but the powerset is larger than the other.
Comment: You may want to read the first few pages of Lee's Topological Manifolds, which gives a nice, light but precise idea of what we mean when we call a set `open.'
Comment: If you take **all** subsets of $\mathbb R$, that is a $\sigma$-algebra which is larger than the Borel $\sigma$-algebra; it contains all of the Borel sets and various other sets.
Answer: Lets consider $\Omega=\{1,2,3,4\}$
$\sigma(\{1\})$ is the smallest $\sigma$-algebra which contains $1$.
So we must take any other elements of $P(\Omega)$ such that the conditions for being a $\sigma$-algebra are fulfilled.
It does clearly contains $1$. Also $1^C=\{2,3,4\}$. And $\Omega,\emptyset$.
So we have $\sigma(\{1\})=\{\Omega,\emptyset,\{1\},\{2,3,4\} \}$. Indeed this is a $\sigma$-algebra. Also we got this set for taking as much elements of the power until our conditions are fulfilled for the "first time".
An example for a $\sigma$-algebra with is not the smallest one but is containing $\{1\}$ is:
B:=$\{\Omega,\emptyset,\{1\},\{2\},\{1,2\},\{3,4\},\{2,3,4\},\{1,3,4\} \}$.
Clearly $\sigma(\{1\})\subset B$
Answer: Say we are doing this on the real line $\mathbb R$.  Let $\mathcal G$ be the collection of all open sets.  We are interested in $\sigma$-algebras $\mathcal F$ such that $\mathcal F \supseteq \mathcal G$.  There may be many such $\sigma$-algebras.  For example, the power set $\mathcal P$, consisting of all subsets of $\mathbb R$ is one.  But that is the largest one, we want the smallest one.
As a comment noted, this largest and smallest are in the sense of set inclusion.  The Borel $\sigma$-algebra $\mathcal B$ satisfies $\mathcal B \subseteq \mathcal F$ for any $\sigma$-algebra $\mathcal F$ such that $\mathcal F \supseteq \mathcal G$.  That is the sense in which $\mathcal B$ is smallest.
Comment: just need to clarify something: in the second paragraph, we should also have $\mathcal B \supseteq \mathcal G$, right?
Answer: if you agree that the borel $\sigma$-algebra isn't neccessarily all the subsets of the topological space, then you might also agree that $P(X)$ (or $2^X$ in a different notation, the power set) is a larger $\sigma$-algebra. Larger means more sets in the $\sigma$-algebra.
Also note that the generated $\sigma$-algebra by the open sets, which is the borel $\sigma$-algebra, is the intersection of all $\sigma$-algebras containing the open sets - which is smaller than any other $\sigma$-algebra by the sense of being a subset.


How to create an empty file from command line

Question: How can I create an empty file from the command line?
Answer: Use the touch command:
The touch utility sets the modification and access times of files to the
current time of day. If the file doesn't exist, it is created with
default permissions.

Example:
touch newfile

Comment: You can use `touch newfile.txt` or some other extension, too (if you need to specify the extension).
Comment: But if `newfile` already exists and isn't empty, then `touch newfile` will leave you with a *nonempty* file.  Maybe not what you wanted.
Comment: @CamilleGoudeseune I think If `newfile` already exists, `touch` command will just **update the timestamp of file** (which is what command exactly for) without editing the contents of file.
Comment: @gotqn for python touch newfile.py and for ruby newfile.rb ?
Comment: You don't have to think that;  it's true!  But it's not what the question asked.
Answer: > newfile

Will also create an empty file. If the file does already exist, it will be truncated (emptied). To keep the file contents, use >> for appending as in:
>> file

Even if the file exists, the contents will be untouched.
Edit: If you don't have any content to type, this one is faster:
user@host$ :> newfile
user@host$ :>> new_or_existing_file

Note. : is the command here. It is not part of the prompt.

If you want to create as root
: | sudo tee thefile

To not truncate existing file:
: | sudo tee -a thefile

Comment: Now that's new. Is it bash-specific?
Comment: I don't think so. Any shell which allows redirection of output stream to a file should support this. This will truncate the file if it already exists. touch is safe to use if you don't want to empty it.
Comment: Wow now I think this is called cheating the system
Comment: I understand that `:` is a null command, but could you explain why `: > file` is faster than `> file`
Comment: @GypsyCosmonaut because you don't have to press `Ctrl+D`
Answer: cat /dev/null > file1.ext

the exact way there is also another way
echo "" > file2.ext

The difference is file1.ext will be zero bytes and file2.ext would be one byte. You can check this by
ls -l file*.*

Comment: No, 'echo "" >' does not create an empty file, it creates a file containing a newline. If you for some reason want to use echo to create an empty file you will have to use 'echo -n "" >', or simply 'echo -n >'
Answer: Using vim editor you can also create an empty file.
vim filename

Then save
:wq

Comment: Well, in this case not any text editor but `vim`.
Comment: This is not from the command line. Perhaps if you post a vim one-liner.
Answer: The command
echo -n > file

creates an empty file, if your version of echo supports the -n switch.
Or you could use printf
printf '' > file

Comment: printf gave me a permission error even as sudo
Answer: In general, creating any regular1 file on Linux involves  open(2) ,openat(2), and creat(2) system calls (and specifically with O_CREAT flags). That means if you call any command-line utility that does these system calls, you can create a new empty file.
Most commonly new filename is created with something like this:

touch /tmp/new_file
: > /tmp/new_file
true > /tmp/new_file
> /tmp/new_file ( bash shell only )

touch is a standalone utility. Its original purpose is to update the access and modification time of a file, however if the file does not exist - it will be created. Note also that a filename - is treated specially, so if you do want to create a file that is named literally -, you'll have to enclose that into single or double quotes.
By contrast, > is a shell redirection operator for stdout stream.  The > operator  specifically calls the openat() system call with  O_WRONLY|O_CREAT|O_TRUNC  flags. That means, if the filename does not exist - it will be created, and if it does - the data will be truncated (and therefore gone, so > should be used with care). In most shells nowadays true or : is a built-in , so  doing : > /tmp/new_file is going to be more efficient, although marginally compared to touch /tmp/new_file.
But of course it does not stop there. As mentioned, anything that can perform open(), openat() and, create() syscalls will create a file. Hence, we can do:

true|dd of=/tmp/newfile
truncate --size 0 /tmp/new_filename.txt
cp /dev/null /tmp/null_file
true|tee /tmp/some_other_file
mktemp or tempfile ( for creating temporary files that do not need to exist between reboots !)

Of course, all the above mentioned utilities do not exclusively create files. But they perform the necessary syscall and that allows us to adapt the commands.

Of course, at the level of programming or scripting we may want to create a file as well, especially for efficiency purposes (because calling external commands such as touch from a Perl script or Python will require additional resources).
Python one-liner:
$ python -c 'import sys,os;f=sys.argv[1];os.utime(f,None) if os.path.exists(f) else open(f,"a").close' myfile.txt

We can make it shorter with this:
$ python -c 'import sys,os;f=sys.argv[1];'$'\n''with open(f,"a"): os.utime(f,None)' mysecondfile.txt

And in Perl:
$ perl -e 'open(my $fh,">","/tmp/perlfile")'

1 Other types of files such as hard/soft links,character or block special devices, directory,named pipes, or sockets require entirely different syscalls.


RSA Security -textbook question

Question: One of the attacks on plain RSA involves a sender who encrypts two related messages using the same public key.
Formulate an appropriate definition of security ruling out such attacks.And show that any CPA-secure public-key encryption scheme satisfies
your definition.
What does formulating an appropriate definition of security mean?
It is a question from introduction to modern cryptography textbook
Answer:
What does formulating an appropriate definition of security mean?

In the context, that's defining a criteria/experiment allowing to define/test if an encryption scheme succumbs or not to the same kind of attack as the one hinted for plain RSA (which I guess is the Franklin-Reiter related message attack).
Coming with the experiment defining CPA security would formally be an acceptable answer, but the next part would then be totally trivial:

show that any CPA-secure public-key encryption scheme satisfies your definition.

Thus, I guess it really is asked a criteria/experiment that uncovers the hinted weakness of plain RSA, but is somewhat different from (perhaps simpler than) CPA security, and may accept some encryption scheme that is not CPA-secure.
It is not easy to come up with a precise criteria/experiment matching that. Beyond understanding the extent of what's wrong with plain RSA, perhaps the exercise really is about making one grasp CPA security, and get that despite its apparent complexity, it is sort of a local optimum between simplicity and effectiveness at screening out poor encryption schemes.

RSA Security -textbook question


Extract particular value from NDSolveValue

Question: How do I extract values from NDSolveValue at particular point: for example how do I extract the last point?
Answer: the result of NDSolveValue is an interpolation function. Example.
sol[x_] =
 NDSolveValue[{  y''[x] + y[x] == 0 , y[0] == 0, y'[0] == 1,
   WhenEvent[y[x] == 0, "StopIntegration"]}, y[x], {x, 0, 20}]

you can do sol["Methods"] to see a bunch of descriptve data available:

{"Coordinates", "DerivativeOrder", "Domain", "ElementMesh",
  "Evaluate", "Grid", "InterpolationMethod", "InterpolationOrder",
  "MethodInformation", "Methods", "OutputDimensions", "Periodicity",
  "PlottableQ", "Properties", "QuantityUnits", "ValuesOnGrid"}

Grid holds the actual evaluation points, so the last point is:
 end=sol["Grid"][[-1,1]]

3.14159

in this case since we didn't know the domain in advance its useful to set the range for Plot:
 Plot[sol[x], {x, 0, end}]

here is a plot of the actual solution points:
ListPlot[Transpose[{Flatten[sol["Grid"]], sol["ValuesOnGrid"]}]]

Answer: If all you want is the last point, there's an even easier method. Using george's example:
NDSolveValue[{y''[x] + y[x] == 0, y[0] == 0, y'[0] == 1}, y[20], {x, 20}]
   0.912945

and you can see that the value at x == 20 is returned at once.
If you're using WhenEvent[] for event detection, you can use the second argument to throw a result at once:
Quiet[Catch[NDSolveValue[{y''[x] + y[x] == 0, y[0] == 0, y'[0] == 1,
                    WhenEvent[y[x] == 0, Throw[{x, y[x]}]; "StopIntegration"]},
                   {}, {x, ∞}]], NDSolveValue::noout]
   {3.14159, 1.00614*10^-16}

and you get the point where the integration was stopped, without needing to produce the usual InterpolatingFunction[] output.


How to detect if my mouse position is within a rectangle c#?

Question: I am trying to write an application to draw schematic diagrams which contain rectangles, lines and circles. Now I want to add another functionality to drag a rectangle to different position. The problem I am facing is to detect whether I have clicked within a rectangle or not. I know there is a function like Rectangle.Contains(Point). To use such method I need to use a for loop to check against each rectangle. If I have a large number of rectangles present, then its not wise to use this method. Is there any other way to do this task.
Answer: You need a computer graphics textbook, this and similar problems are often discussed.
If memory serves me, make sure the point is below the top edge of the rectangle, above the bottom edge, left of the right edge and right of the left edge.
Regarding testing a bunch of rectangles in a loop. Consider having a circle that each rectangle fits in, a bounding circle. First test to see if the point is farther from the origin of the circle than the radius of the circle. If so there is no need to test the rectangle, its a miss. OK, that was a very theoretical answer. In reality calculating the distance from the point to the origin can be a very expensive calculation, it involves a square root, it may be faster to do the four comparisons of the point in rectangle check. Again if memory servers me, we don't really care what the distance from the origin is only if it is greater than the radius. So only partially perform the distance calculation, omitting the final square root, and compare against the square of the radius. Of course you still need to experiment and profile to make sure this bounding circle check is faster than just doing the regular point in rectangle check and you need to make sure you will have sufficient misses to offset the hits where you will end up doing both the bounding circle and rectangle checks.
Answer: You need to use a spatial index to find quickly in which rectangle the mouse is. I suggest a R-tree, here is the theorical part:
http://en.wikipedia.org/wiki/R-tree
And the c#,implementation:
http://sourceforge.net/projects/cspatialindexrt/
Create an rtee, add your rectangles then call the rtree.nearest method with the mouse coordinate to know the rectangles containing the mouse cursor. You can play with the distance parameter.
Hope it helps,
Anben Panglose.
Answer: I would go about dividing the display region into a quadrant.
Then place the rectangles into top-left, top-right, bottom-left, bottom-right grids.
Placing them means, creating a list for every quadrant and placing the rectangles in it.
Once the point is clicked, determine which quarter it belongs to and search in those rectangles only. This approach reduces your linear search by 4 times.
Remember that you need to also take care of overlapping where the point can belong to many rectangles. Here the z-order of your rectangles matter. So while the list is maintained for a quadrant, it should be sorted with it's z-order as a key.
Hope this helps.
Answer: May be something like this?
 public bool isRectangelContainPoint(RectangleF rec, PointF pt)
    {
        if (pt.X >= rec.Left && pt.X <= rec.Right && pt.Y <= rec.Bottom && pt.Y >= rec.Top)
            return true;
        else
            return false;
    }


Why do businesses frequently keep one half of double doors locked?

Question: This leads to a bottleneck of people going in/out because there's only a single point to enter or leave. Not to mention potential stampede situation in the event of a fire. Is this just something we all see others doing so we figure, "Why not"?
Comment: This topic has a very long thread at the straight dope: http://boards.straightdope.com/sdmb/showthread.php?t=642772 where tens of reasons are brought forward.
Comment: maybe because of the air-conditioning
Answer: Here are some potential reasons:

Security: It can be easier for staff to monitor who enters and leaves a store with a reduced number flow of customers entering the business.
Safety: To affect the draft flowing through a building. Have you ever had the experience of a door in your house slamming, because of a draft? A business owner may want to protect from a violently swinging door. An undesired draft could also have an effect on energy usage.
Not a regular door: Some double doors are installed for special use scenarios, such as needing to bring in a large piece of equipment, or needing to be open during an emergency. As part of these doors may be intended to only be used every so often, they do not operate like regular doors. Often time these kind of door will have latches that go into the top and bottom of the door frame. If unlocked some of these doors would just swing around. Due to this one of the two doors would remain locked.
Forgetfulness - Sometimes people just forget to check to make sure all the doors are unlocked.

Regardless, having one locked door in a set of double doors is not user friendly. The building  and its entrances should be designed so that all general use doors can be used. One thing a better building or door design won't help is forgetfulness on the part of the building attendant/staff.
Here is an example of a double door design that I think affords approrpirate usage:

By making one of the two doors larger, it communicates to users that this is a utility door, and that you probably shouldn't try and open it. Another way of helping users understand that one of two double doors isn't intended for regular use is to remove the door's handle and push plates.

There are many other other work-arounds, but the list could go on and on.
Comment: *"From what I've read..."* Have you got a link to this?
Comment: I reworded the first line of my answer. The list of potential reasons were summarized from a variety of sites & forums. As with broad questions, there isn't really one solid answer for this one, thus a more general (and un-referenced) list.
Comment: Broad questions should be closed, not answered. And, thus, it was.
Answer: This makes several things easier for the business:

The second door usually doesn't have a lock and key.  Rather it has a mechanism on the side of the door (usually both top and bottom) that needs to be engaged and disengaged.
Employees usually have experience with locks and keys, but often not with double door locks.  They often have to be shown how these locks operate.
This makes the opening and closing procedures more complicated.  You need employees on hand that can operate the second door for both.

Businesses are especially leery of the closing time procedure.  They don't want to leave a door unlocked all night accidentally.   As such, many business owners instruct that the extra door just remain locked.
Here is an article that complains about this from a usability standpoint in a situation where pull and push is not clear as well:

I've seen it many times before where double doors have handles on and one is locked:

You try pulling the left door with no joy
You try pulling the right door with no joy, believing both are locked you look puzzled
Then you notice the "push" sign on the doors. You push the one on the right, (which is the one that really is locked) with no joy
Then push the one on the left and hey presto, you're out!

Business owners often don't think that the time and security risk to deal with the extra door is worth it compared to small frustration of the occasional customer.  This could be an example of the business owner and employees not experiencing this frustration themselves because they get used to which door to use.
Many businesses try to lessen the impact of this on their customers by posting signs about which door to use.  For example here is a humorous one from Funny Den:

From a usability standpoint, maybe double door locks could be redesigned.  Ideally, the turn of a single key would lock or unlock both doors simultaneously.
Comment: And as the single-key solution would be a doddle to design and implement, including locking at at least three points on the opening edge of both doors, I wonder why it's not common.
Answer: My girlfriend works in a shop where they have both double door open all the time, regardless of the weather.  It's pretty much all to do with sales.  There have been a number of studies done over the years, and my gf has done some studies of her own, that shut doors provide an obstacle for people. And weirdly - as much as it's only a door - that obstacle is enough for people to not casually wander in.
My gf shut the doors on a day she knows is normally a busy day - her sales almost halved.
The amount of casual 'wander in and lets just have a look' shoppers dropped dramatically, as did people with 'extra baggage' (e.g. prams, buggies, strollers etc), or weirdly, people in groups of 2 or more.
There may be other reasons cited, security, air flow etc - and they may all be valid reasons, but by far and away - it's a sales thing.
Think of the phrase "My door is always open", or "He's got an open door policy".   Everything meant to be welcoming is where the door is always open for you, no obstacle.  Lazy, but true.
Comment: This doesn't address the issue in the question - why one door is left unlocked and the other left locked.


Can you activate the abilities of a creature once its been destroyed?

Question: My question is about Zacama, Primal Calamity or any creatures with abilities that are activated using mana. If such a creature is destroyed, can you activate its abilities as an instant after it's been destroyed.
Comment: Welcome to the site! I edited your question to fit the style of this site by removing parts that are not needed; you can add them back down here as a comment if you want. I also replaced "mana abilities" by "abilities that are activated using mana" since "mana abilities" has a specific in-game meaning which is different from what you meant.
Answer: No, you cannot activate an ability once a creature has been destroyed; when a creature is destroyed, it is moved to the graveyard immediately without players getting priority, so there is no chance to activate any abilities, and Comprehensive Rule 113.6 makes it clear that abilities function only on the battlefield (unless some specific exceptions apply):

Abilities of an instant or sorcery spell usually function only while that object is on the stack. Abilities of all other objects usually function only while that object is on the battlefield.

What is possible (and common) is to activate the ability in response to the spell or trigger which would destroy the creature going onto the stack, but before it resolves.
Comment: Minor correction; a destroyed creature is not moved to the graveyard as a state based action. Rather, the way you carry out the instructions to destroy a creature is to put it into the graveyard.
Comment: As a complement to what Gendolkari said, when a creature is dealt lethal damage, the way it actually dies from that damage is that a state-based action destroys it. So very often, when a player wishes to destroy a creature, they make it happen through a state-based action. But using a spell or ability with the word "destroy" just destroys a creature immediately, workout any SBA.
Answer: While Philip's answer is basically correct (barring some what might as well be invisible differences to your typical player) I fear there is a misconception here that should be addressed, and is indeed touched on at the end of his answer.
Say for a moment Bob has his Zacama on the battlefield and Alice casts Murder targeting the Zacama. A novice player may throw up their hands and say "Welp, I don't have a counter spell so bye bye Zacama!" when in reality they can choose to activate any activated ability (unless it specifically says it's only at sorcery timing) or cast any instant from their hand.
Imagine you have a stack of notecards with your actions for the game. It starts empty - no notecards. Alice puts her notecard on the stack "Alice casts Murder targeting Zacama". She can actually put as many notecards on the stack with all her different actions. She can choose to activate abilities of her own creatures, tap lands, play instants. When she's satisfied with her actions, the next player (which in a typical game is just the opponent, in this case, Bob) gets to do the same. Bob can activate abilities of his own, again putting his notecard on the stack "Bob activate's Zacama's first ability targeting Alice's Grizzly Bear with 3 damage". When he's done, it goes to the next player, which here is simply Alice again.
This process can repeat many times and, in some multiplayer games (or even high level two-player games) can get quite complicated as players are responding to each other's spells. Normally, it doesn't get too out of hand because most of your abilities have a cost, either a tap or mana, and eventually people run out of those resources and can no longer respond.
When no one chooses to respond to the most recent action by putting their own response action on top, the game takes the top notecard and follows the instructions. Then the process of "do you want to take an action" goes around the table again (starting with the player whose turn it is.) If someone does, great, the process repeats. If it doesn't, the top notecard comes off and is followed by the game.
This concept of little notecards on a stack is actually a fundamental part of how the game works - they even call it "the stack" in the rules. In fact, "Any time you could cast a sorcery" is defined as "any time that stack of notecards is empty and it's your turn".
In case that was all too confusing, the very important thing here is that just because Alice has cast her Murder spell does not mean the creature is destroyed. All players (including Alice) have a chance to respond to Alice casting the Murder spell before it is "resolved".
So while you're asking if the abilities can be activated right after it dies, the answer is no, no it cannot. But the real question is can you activate the abilities right after someone tries to kill it, and the answer is yes, yes you can - as soon as they are done activating their instants you can respond.
(And, I'll add that it is almost, almost always only one spell or ability going on the stack. Very very few times to people respond to their own spells or abilities, because if you're going to do something to screw up their plans they would prefer to not waste their resources on two parts of their combo before you do - they'd rather give you a chance to respond and if you're going to foil their plans you do and then they proceed to the second part of their plan.)


Video and game lags after rooting S3

Question: I recently rooted my phone, and am now using Paranoid and I love it. However, whenever I play videos and games it lags really noticeably. This never happened before I rooted my phone. I'm using Samsung Galaxy S3 and have tried using Seeder with no luck. Can I fix this poor performance?
Comment: Goto the forum site for your ROM. See if they have a fix or a workaround. It might be a performance settings problem (ie. wrong processor/governor setting or other). But you'll have read to see what other Paranoid users say.
Answer: This is probably a bug in the custom ROM you've installed. You should report it to the developer of the ROM, and either wait for it to be fixed in an update, or use a different ROM.

Video and game lags after rooting S3


What will happen if a conductor is introduced instead of a dielectric medium in parallel plate capacitor?

Question: If a conductor like copper is placed between two plates of a parallel plate conductor,neither touching any of them, what will happen to the capacitance of the capacitor?
Answer: Suppose you have a parallel plate capacitor:

So we have a capacitance:
$$ C = \frac{\varepsilon_0 A}{d} $$
and a charge $Q$ on the plates given by:
$$ Q = CV $$
Suppose we now insert a sheet of copper in between the plates as you describe:

The electrons in the copper plate are free to move, so they flow towards the positive plate and you end up with two capacitors with an increased capacitance:
$$ C' = \frac{\varepsilon_0 A}{d'} $$
The combined capacitance is obtained by using the equation for two capacitors in series:
$$ \frac{1}{C_{tot}} = \frac{1}{C_1} +\frac{1}{C_2} $$
So in this case the new capacitance is:
$$ C_{tot} = \frac{\varepsilon_0 A}{2d'} $$
And since the copper sheet has a thickness greater than zero $2d' \lt d$ and therefore when you increase the copper sheet the capacitance increases.
Comment: so, is there a difference when we use a dielectric medium and a conducting medium with no contact with the plates of the capacitor?


JavaObjectModel. What is it?

Question: Simply stated : What is a Java Object Model. I want to create one for a XML file. I am sure it is different than the Java Application. SO what is it.
Obviously, i tried google but to my surprise didnot get any specific or clear answer.
Comment: If you don't know what it is, why do you want to create one?
Answer: I guess an Object Model is some java POJO whose properties reflect the structure of the xml file you are parsing.
A "simple" way to achieve this transformation is to use JAXB.
Answer: Any model is essentially the way you represent data. So your Java Object Model is your data represented as Java Objects. An XML Model would be your data represented as XML. JSON is your data represented as JavaScript "Objects", etc.
Answer: An object model is a set of classes (with their properties and methods) used to represent a particular collection of information. A Java object model is simply an object model in which the language used to describe those classes is Java. If you want to create a Java object model for an XML file, then you need to analyze what information is held in your XML file and design Java classes to represent the same information. There are tools that can automate this process, though the representation they come up with will not always be optimal.

JavaObjectModel. What is it?


What are some existing techniques for pose estimation angle normalization?

Question: So I am currently building a model which does a certain type of action recognition, which I am implementing as a two-stage, end-to-end system. The first stage is a pose estimation model, and I want to take the outputs from this model and use some type of sequence classification model (to be determined what architecture specifically, not important for question) for outputting the type of action. However, this is essentially based on the changes in the relative positions of different segments from the pose estimation model, which are variable to the angle that the input video was shot at. So, as I see it, I will need to either gather a much larger amount of data to generalize across angles, make sure every input video is from roughly the same angle, or normalize the pose estimation data by essentially rotating it.
The way I'm thinking about this is I could

train another network which could rotate the input video beforehand (there is some research on this, and I could potentially generate some of the training data myself by using perspective transforms), or

figure out some type of mathematical model which will give me the angle based on segment relationships to either train data for (1) or to derive some sort of transform based on this model to convert the estimated segment positions to a standard view

I was wondering if there is any other existing techniques I haven't been able to think of or anything like that which would help me out. Any help greatly appreciated, thanks!
Answer: So I think what I am going to try to do is use 3D pose estimation with a mesh model instead, as having the 3D structure shouldn't need normalization inherently, remaining the same no matter the angle of the input footage.
Will report on results.


Getting location information of Android phones connected to a wifi access point

Question: I am trying to get the location information of Android phones connected to a particular wifi access point/hotspot which is another Android device. I know how to obtain location information for a particular Android device using the Location API as well as the signal strength information of the access points in vicinity. Actually I am trying to send the location information of all the nodes connected to the hotspot. For that maybe I need to open different sockets. After that based on that information I have make some decisions. Can anyone give me a good approach to solve this.
Answer: You can't get location direction from WiFi hotspot (actually WiFi spot itself doesn't know where it's located).
http://en.wikipedia.org/wiki/Skyhook_Wireless
there are databases which contains mapping between WiFi hotspot MAC address and locations. So, your application should get info about WiFi hotspot and after go to one of this databases.
To know more about that u can refer this one http://developer.android.com/guide/topics/location/strategies.html


Workflow was canceled by System Account

Question: I am not using impersonation.  I have been able to create and run many list workflows. Now however, when I create a simple workflow on a List that has other workflows running fine, just one that says "Log testing workflow" in the log, it "Fails on Start".
Answer: SharePoint Designer workflows run as System Account but with their permissions trimmed down to impersonate those of the user that initiated the workflow.
We faced a similar issue to yours in our SharePoint environment and identified that it was due to workflows being fired automatically by System Account.  To get around this, we created an administrative account in our environment called 'DOMAIN\SP_Workflow' and opened/re-saved/published the failing workflows while logged in under this new account.  After making this change, the previously failing workflows started as expected.
Comment: I know this has been a long time but I get that kind of issue too : Running Standard 2010 Approval Workflow on a Library, getting randomly this group of messages "Workflow failed on start" and "Workflow canceled by System Account" -which one, I have no idea.. I tried to deactivate Wkfw feature on the parent site collection, then to recreate a wkfw with the farm account, and I still get randomly these messages ... Could you help me please ?
Answer: From what I understand, workflows will not start automatically under a system account. Try running it with another account.
Workflows do not start

Workflow was canceled by System Account


DD img different MD5's?

Question: We have a smart media card with a linux install on it that we need to duplicate. We created an img with DD and then used dd to write the img back to a couple of new smart media cards. We have compared the MD5 checksum of both the original and the new copies and they are different.
Here is what we used:
dd if=/dev/sdb of=myimage.img
dd if=myimage.img of=/dev/sdb
dd if=/dev/sdb of=newimage.img
Anyone have any ideas of why these come out different?
Answer: If the cards are different sizes, dd'ing the smaller image to a larger card will not "fill it up", and zeros will remain at the end of the card. An image made from this card will be different than the original image.
It's also always possible that data was mis-written, mis-read, or otherwise corrupted in-transit.
Answer: The card capacities differ?
Running 'ls -l myimage.img newimage.img' might tell you something.
Running 'cmp -l myimage.img newimage.img' might tell you something.
Answer: If you mounted /dev/sdb in between it would be an answer. If I remember correctly ext2 and ext3 have a "mount counter".

DD img different MD5's?


Does happiness have any effect on anything in fallout shelter

Question: I don't like to see my vault dwellers be unhappy. Does it affect anything that I should be worried about? Give me suggestions on how to make their happiness go up.
Comment: A suggestion: remove the part asking for suggestions to up happiness, and post a seperate question simply asking how do I raise a vault dwellers happiness.
Answer: Happiness impacts on your daily Vault Overseer review.
Every 24 hours, you recieve a rating, based off the general happiness of your dwellers.
Higher happiness ratings will reward more bottle caps.
Answer: Over all Happy Dweller make production faster.
If you's average rate of happiness is 90-100% you will have the benefit of Food, Water, Power + 10% reduce in production time .
This benefit will be reduce 1% for each 10% of average happiness.
The easiest way to booth the happiness is to "get laid". The dweller who "get laid" will have 100% of happiness.
There are some reasons that make your dweller unhappy include: lack of food, have a dead body in the room. If you remove these factor the happiness will raise again.
Comment: It reduces production time? I always looked at it increased production rates. So when you collect resources, you gain a percentage more than you normally would.


Upgrading the brakes on a Giant Anyroad 2 2015

Question: I am looking to buy some used Giant Anyroad 2 2015. The groupset is already upgraded to Shimano 105 2x11, with cassette 11-34t. Crankset are Tiagra. Everything look fine, except the brake, which still using SRAM Avid BB5. Based on some review, SRAM Avid BB5 is having bad review. So I think, i need to upgrade the brake at least to SRAM Avid BB7. But I'm not sure because the Avid BB5 are using 140mm rotor, can I use SRAM Avid BB7 using these rotor, or I should upgrade to 160mm rotor and do I need adapter to upgrade the brake. Need some input.
Comment: You can always upgrade later.

Reviews are good at telling you what other people think (or, in some cases, have been paid to think). Sounds like some people have been unhappy with the brakes so that's something to keep an eye on. Reviews should not drive purchasing decisions without personal experience.

Get some saddle time on any new (or new to you) bike and decide what does and does not work the way you want and then base your upgrade decisions on your own experience.
Comment: ok, i'll be doing that for a while and see where it goes
Answer: You can directly change for BB7 without needing new rotors.
If you want 160mm rotors with BB7, you would need new caliper mount adapters. Changing to 160mm rotors will give you slightly more stoping power, but whether it's worth it, is completely subjective.
It's pretty straight forward to do. Once you get the bike, you can ask a specific question about it.
Answer: I actually own a 2015 Anyroad Comax frame that I built up so I have some feel for what works on the bike.
On the front I have 160 mm rotors with BB7 road calipers (don't get the mountain as they will have the wrong pull ratio for road levers).  You will need an 20 mm adapter from SRAM, Shimano adapters will not work. 140 mm rotors on the front, with mechanical disc brakes leads to very soft braking, even with compressionless brake cable housing (another recommended add on).
For the rear leave the 140 rotor and just upgraded the caliper.  BB5s burn through pads, are hard to adjust (they have no inner pad adjuster) and are substandard for anything but the occasional slow speed ride.
Having a smaller rotor on the back actually balances out the braking forces better so that you are not locking up the rear as easily (the front wheel has most of the traction under braking). Mountain bikes are spec'd with different rotor sizes, not sure why this is avoided by manufacturers for road/gravel bikes.
As for the shifters, 105 is a solid groupo, no change needed. Tiagra cranks are keepers as they shift well, their only short coming is the lack of bling and some extra weight.


For any distributions, are mean of the sum of the same distributions equals the sum of the means of the distributions?

Question: I have some distributions with the same distribution, for example, Gaussian distribution or Beta distribution. My question: is the mean of the sum of these distributions equals to the sum of the means of these distributions?
Answer: Yes. Mostly. By the property called linearity of expectation, the mean of the sum of random variables is the same as the sum of their individual means.
This is true so long as there are finitely many random variables going into the sum and so long as their means are finite. Also true in some other cases, see comment below.
Comment: IMHO, you cannot say this for all situations: According to Fubini-Tonelli theorem, there are some conditions to be met for this interchange. See, for example, MITZENMACHER 2005 Probability and Computing: randomized Algorithms and Probabilistic Analysis, page 23.
Comment: @ErdoganCEVHER Thank you for your comment, I have expanded a bit.


Where to put personalized recommendations feature?

Question: I would like to add a Personalized recommendations feature to my E-comm website. Should I add it as a floating,fixed button on the side? Is that considered something users are annoyed by? If I shouldn't, which method is recommended for Personalized recommendations
Comment: Hi Nirupama - can you add some more context to this? What does your current website look like? What is the design of the button you're thinking about implementing?
Answer: Multiple factors come into picture especially for ecomm sites,
Consider following points when referring to what you call 'Personal Recommendation'
How much agressive you want to be
-> If you want to make your user's to first checkout products that you recommended based on their past purchase than put it at the top. But make sure that you have good algorithms that display relevant product for that
-> You can put it at the left or right side as 'Are you looking for',  'You might be interested in', "You might like this' But limit it to only 3-4 products display and add something like 'See more' at the bottom which will display more products.
-> You can put it at the bottom as 'Recommended for you' within the slider like < >
But at the end it's also depends on your website design.
Answer: It also depends on what you sell or advertise.
Some personal experience...
One web shop with a very large range of products (Amazon) prominently displayed, over the course of a few months, a very specific recommendation (gay porn). The first time this happened to me while I was researching technical literature, for my team members on the job, at my workplace. No idea on why Amazon thought I would be interested in gay porn (I am defiantly not), but the recommendation was there. Now, don't get me wrong: I am not homophobic, just plain hetero, but an advertising for porn is not the coolest thing to have on the screen at work. Regardless of the relevance or irrelevance of the pick.
It does not need to be gay porn. Are you a fan of Science Fiction writer Charles Stross? In that case, Amazon might recommend Saturn's Children, most probably the U.S. cover version. Some people might get the wrong idea when they see that cover suddenly popping up on your screen... Many U.S. customers specifically ordered the British edition, in order to be able to read the book in public without getting funny looks from bystanders. Unlike my "gay porn experience", this cover is rather tame, but still considered "too much" by some persons.
So, if your product range could cause embarrassment on the customer's side, don't pop up your recommendation at the top of the page right at the start. And give the user to quickly scroll away from anything possibly offending. Not like a full-screen popup which requires you to locate and hit a tiny close button to get rid of some "personal hygiene recommendation" or whatever.
Answer: The priority of the merchandiser should always be to make the list of recommended items available to the user without interrupting the natural flow of the eye. The term available is emphasized because it should be there as a part of the composition of the page without unwanted artificiality, that the user shouldn't feel like it is being forced onto them.
A sudden popup with a so called "recommended item" on the face while browsing the catalog would do more harm than good when the overall experience is taken into account. The practical way to make this clear to you would be to think of the current patterns available to us. Since we are interested in E-comm websites here, lets take the prime example of e-commerce giant Amazon.

Among the plethora of available items and daily deals (Image: consider the smartphones section and the laptop section), Amazon managed to show this particular user (a test subject for this scenario) deals on hard disk drives. Now for an external party looking onto the very same web page, nothing particular is worth mentioning. But for a returning user who has recently browsed the hard drive section of the site, a section featuring the items that he/she is interested in, subtly merged, but adequately distinctive, would definitely be interesting.
A dedicated side panel (with a floating button) could also work, but the cognitive approach suggests us not to impart the notion that an activity is forced onto to the user.
Your best bet would be to add the items within the browsing space, in a way that it goes with the regular flow of the display progression.
Good luck!
Answer: Stick with Convention
Taking two top examples, see Amazon and Netflix below(Netflix isn't exactly Ecomm, but it's certainly a site optimized around personalized consumption) it's fair to say that delivering personalized content as a main and prioritized component of the page, is a technique worth considering.
Avoid Technical Issues
Designing a personalized recommendation section into the main structure of your page is going to be more robust in the long run, or at least, will be less likely to give issues e.g. on mobile devices than your floating button solution.

Design your personalized recommendation section into the main structure of your page.
Comment: Thanks Dennis. You have given clear description. But still my manager is asking me to put on top of the homepage as a hyperlink. Where user can see immediately. Once the user logs in and purchased some thing in the site. The next visit he will get the " Recommendation for you as a hyperlink at the top header of the home page. Link will be present in all the pages where it can grab user attention. Please suggest.
Comment: @NirupamaPrasanna Sounds like your manager is going to determine what happens here. As a manager he or she obviously know the right answer to every problem ; )  If you can't push back against your manager, then you don't really have an option but to do what s/he says.
Answer: Personalize at the beginning
Wherever your users start their journey is where you want to hit them with recommendations. That's usually the homepage, though there may be many depending on the way you route users. Catching the customer early in the visit can prevent them from running off on unproductive paths and ultimately bailing in frustration.
Don't over do it
Realistically, you don't usually want to go nuts with the recommendations. Unless you get Amazon's repeat order rate or you only have five products, there's a good chance you don't really know what your customer wants. With that in mind, you'll still have lots of real estate on the page devoted to other "standard" promotions.
Expand on demand
But what if you're really on to something and the user just loves your reco's? Why not let them explore a bit more? Provide a link from the lander and something in the footer or top nav where the user can jump to an expanded list of recommendations.
Local recommendations
Personalized recommendations depend on a lot of traffic from one user and a solid algorithm cross-referencing and forecasting against that data. But at the product or category level you're likely to have more data across your customer base. In addition to the personalized listings on the lander, you can promote recommendations on the product page or in the cart (depending on it's contents).
Answer: Recommendation must always be provided keeping in mind that you might not be entirely correct in suggestions. Amazon does a very bad job as it keeps suggesting long list of products over he entire page.

Now not only does an e commerce site needs to provide recommendations based on user's past search but also promote it's current deals.
Here's is what i suggest:
Collapsing different categories into one.

Above design allows me space to show more deals, more recommendation along with better clarity for user to choose option.
Answer: I guess recommended feature should be placed at the bottom of the page but should be sticky in Cart Page why I mean to say that, customer shop the things and if he/she is interested in buying another item, will for sure scroll here and there so in that case, it will be benefited for website. and at last when they are done with payment and processing recommended for you option should be there because can force at that time as good marketing tricks


Managing Custom Client Releases

Question: As an alternative to this question what is the best way to manage custom versions of software for a particular client?
Most of the differences between client releases is changes to the user interface to customize the software to look like it is owned by the client. More often then not, this is a simple logo change. Occasionaly the color scheme will change as well. But there are occassions where features will be enabled or disabled based on the client. What is the best way to keep all of these releases up to date and make them easily available to the users of a particular client?
At this point we have five different clients and each has their own build of the software and their own installer (complete with their logo in the installer). This is becoming a pain to manage, and it will only get worse as more and more clients start using our software.
So assuming the linked question isn't the way to go, what is the best way to manage these releases?
Answer:
"This is becoming a pain to manage,
  and it will only get worse as more and
  more clients start using our
  software."

The only way to really solve this part is to make sure your software has an architecture that supports the customizations as a layer on top of your core product.  Ideally, they would simply be runtime configuration options (colours, logos and enable/disable are perfect for this).  If you get (or want) a very large number of clients, push the configurability right into the core product and enable the clients to do the customizing themselves.
When updating, you build (and test) the core product once, and build the custom versions by simply linking to (referencing) the already-built core product as a library.  You could have each client in a separate build, or you could have a single build process that generates updates for all the currently-maintained client builds (the latter is probably better for a larger number of clients).  If you have a "vanilla" version, you could build that as part of the core or along with the client versions, it would depend on your particular case.
Depending on your technology, it might be possible to have the customization layer be built independently from the core product.  In this case, client rebuilds will rarely be necessary (perhaps only for certain significant changes) -- you can simply link to the updated core product at runtime.  For deployment to the client, you would only need to deploy the updated core, if you have a deployment method that supports this.
It's hard to say more detail without knowing your platform, but you've graciously kept this question agnostic.
Answer:
Separate the common and the custom parts in your source tree. This can eliminate the great majority of merges, depending on your testing and release policies. There is always a way to abstract out and customize a build resource, even if your build process has to invoke script to rewrite some file.
Judicious use of branching in a good Source Code Management system. These aren't called "Configuration Management" systems for nothing. They are the tools optimized for precisely this task, so you're probably not going to get anything better without building on top of one.

Subversion is good at setting up multiple branches, but last I checked it could only do the 3-way merge on a single file at a time. Perforce is awesome in this department because it tracks your branching history on a file-by-file basis and uses this to automate merging of whole sets of changes between whole branches. It really is the cat's pajamas here.
Git and darcs may have similar power, but I haven't used them. They seem to be based on the idea that each working checkout tree will have a copy all changes ever since the beginning of time. That sounds impractical to me since I need to keep some large and changing SDKs under SCM control.
Answer: Arguably, the only difference needs to be a branch of whatever release you have, with the customer-unique changes in it.  So for example:
<code>/project
   /trunk
   /branches
      /release-v1
   /customer-branches
      /release-v1-google
      /release-v1-microsoft
 ....
</code>
Where your client releases are branches of your customer releases.  Since these branches won't ever get rolled up into trunk or another release branch, don't pollute the regular development /branches tree.
Comment: We currently use a very short development cycle so there are often "releases" on a weekly basis. Wouldn't think entail merging between all of those branches on a weekly basis then? It seems like it's a lot to manage.
Answer: I guess it depends on the level of customization you need for each client, but could you make your base app "customize" itself based on a config file?, so you could have the trunk being the full app and then have special config files for each customer that control the look & feel, as well as features that are enabled, and your release process would take the correct config files to deploy in your installers.
Seems that if you are always delivering custom(ish) versions of your app for each client, it would be worth the time to extend the app in this way.
Answer: I set up a header file called branding.h which contains a bunch of #ifdefs like the following example to change whatever bits need changing. In Visual Studio, it is easy to set up multiple builds with the appropriate client symbol defined.
<code>#if defined BRAND_CLIENT1
#  define COMPANY_NAME  "Client 1"
#  define PRODUCT_NAME  "The Client 1 Widget App"
#  define LOGO_FILE     "res/logoClient1.ico"

#elif defined BRAND_CLIENT2
#  define COMPANY_NAME  "Client 2"
#  define PRODUCT_NAME  "The Client 2 Super Widget App"
#  define ENABLE_EXTRA_MENU
#  define LOGO_FILE     "res/logoClient2.ico"

#endif
</code>
This is all assuming C++ of course.

Managing Custom Client Releases


Repairing 2 long cuts in vinyl flooring

Question: I need to repair 2 long cuts in the vinyl flooring in my kitchen. The 2 cuts are near each other and probably take up about 8 inches in length. Everything I've read has talked about patching but I'm not sure I could (or should) cut a square of this length for repair. We don't have any original flooring left from the previous owners. We plan on changing out the flooring but that won't be for at least 2 years. Would repairing the cuts as if they were small cuts work or do I need to cut a big patch to fix?
Answer:
Pry up some of the cut so you can apply a fresh adhesive
Apply some vinyl flooring adhesive (preferably in caulk tube form since you don't need much) to the floor
Press the flooring down and wipe up any excess adhesive
After letting the adhesive cure, apply seam sealer to the edges to make the floor seamless

Repairing 2 long cuts in vinyl flooring


Stress-energy tensor: Its relation to force?

Question: I am slightly confused about the relationship between the stress energy tensor and the force on a boundary. From what I have read the stress energy tensor can be written as:
$$ \Bbb{T}=\begin{pmatrix} u & \vec N/c\\ \vec N/c & \tilde \sigma\end{pmatrix} \tag{1}$$
where $\tilde \sigma$ is the stress tensor. Now consider a boundary of normal $\hat n$, from fluid mechanics I know that the force acting on this boundary is given by:
$$\vec t=\tilde \sigma \hat n\tag{2}$$
And thus I would expect the force in relativity to be given by:
$$ \vec t=(\Bbb{T})_{ss}\hat n \tag{3}$$
where the subscript $ss$ denotes the space-space part. Consider an ideal fluid in a box centered on the origin and with sides parallel to the coordinate planes. The stress-energy tensor for such an ideal fluid is (in its rest frame):
$$\Bbb{T}_{IF}=\begin{pmatrix}\rho c^2 & 0 & 0 & 0\\ 0 & p & 0 & 0 \\ 0&0&p&0\\ 0&0&0&p\end{pmatrix}\tag{4}$$
Which would predict a force on the side of the box with normal (into the box) of $-\hat e_x$ (i.e. the side which lies at $+$ve $x$) of:
$$\vec t=-p \hat e_x\tag{5}$$
I.e. the boundaries of the box feel a force into the box itself-which is clearly wrong. What is going on here? i.e. how do we actually find forces on boundaries in special relativity and why does (3) not hold?
Answer: In continuum mechanics the interpretation of $\sigma$ is the folliwing. Consider a finite portion $C$ of continuum and a point $p$ on the boundary $\partial C$ (a closed regular surface)  of that finite portion. Suppose that $n$ is the outward  unit vectors at $p$ normal to $\partial C$. Then  $\sigma(n)$ is the surface density of force acting  on $C$ at $p$ due to the remaining external part of the whole body.
For a perfect fluid, this force enters the portion $C$ throught $\partial C$, if the pressure is positive. All that means that the correct correspondence between relativity and continuum mechanics is  $$T_{ij} = -\sigma_{ij}$$
for $i,j =1,2,3$ (where I am using the metric $-+++$).
Answer: Here is my take on the situation (with thanks to Valter Moretti for his answer.) In this answer summation is not implied by repeated indices.
In continuum mechanics the stress tensor can be defined as follows:

Stress Tensor: The tensor, $\sigma$, for which $\sigma^{ij}$ is the force per unit area in the $i$ direction acting on a surface with normal in the $j$ direction. ($i, j \in \{1,2,3\}$)

Whilst in relativity the stress-energy tensor can be defined as follows:

Stress Energy Tensor: The tensor, $T$, such that $T^{\mu \nu}$ is the flux of the $\mu$th component of 4-momentum through a surface of constant $x^\nu$. ($\mu, \nu \in \{0,1,2,3\}$)

I will not address the meaning of this definition since a descent explanation is given here. I will however, demonstrate how we can relate the space-space component of $T^{\mu \nu}$ to $\sigma^{ij}$. We consider a surface of constant $x^i$ (assumed to increase to the right) as shown in the figure below and take the case of a stream of particles density $n$ all moving at the same constant velocity $u$.

The momentum flux through this surface is going to be:
$$T^{ii}=mnu^2$$
However the the force per unit area acting on the right hand side surface (that with normal in the direction of increasing $x^i$) is given by:
$$\sigma^{ii}=-mnu^2$$. Analogous arguments hold for other components giving us:
$$(T^{\mu \nu})_{ss}=-\sigma^{ij}$$
This explains the sign error in my question above.


How to increase range of disc brake pistons?

Question: Recently swapped over my disc brake pads, but discovered that the pistons lightly scrape the rotor when not braking, and when I am braking it doesn't make much of a difference and it allows me to pull my lever all the way to the handlebar. Shimano Deore brakes btw
Comment: You need to bleed the air out of the brake system. See this video https://www.youtube.com/watch?v=DsqlEYJeLQU
Comment: Before you bleed the system, take the pads out again and try pushing the pistons back manually (head of a flat screwdriver, gently, can be effective). Sometimes the pistons get stuck and need pushing back. Could be this will make no difference and you'll need to bleed the system anyway, but if this works, it only takes a couple of minutes.
Answer: If you can pull the lever all the way to the handlebar while not getting much braking force, then it is very likely that you somehow got air into the system somewhere, and you need to bleed the entire brake system.
Perhaps when you were changing the pads, you pulled the brake lever while the pads were removed, which would allow the pistons to come out too far ?  That would let air into the caliper, which would lead to the symptom you described.


How to get distance to different POI around lat/lon?

Question: I have about 150k lat/lon points with osmid located around Worldwide. These points was exported from planet.osm and I need to get a distance to different nearest POIs(cities, seas, infrastructure objects and etc) for each lat/lon. I`v make script that make a Overpass QL requests to overpass-turbo.eu (openstreetmap api) but It seems that will take about 250 hours to get all information and not suitable :) Can somebody suggest a better way?
Comment: Please edit the question with the important details - just click edit below the question. What area are the sample points in? How big is that area?
Comment: Please edit the question with the important details - just click edit below the question. No more warnings.
Comment: crosspost: https://help.openstreetmap.org/questions/45350/how-to-make-overpass-ql-query-from-local-osmpbf
Comment: Perhaps download the POI data to something local (e.g spatialite). It would help if you can provide more detail on exactly what you're doing and the area of your sample points. At least show the query.  If you are really planning to do 150k queries in less than 10 days, you're probably abusing the service: http://wiki.openstreetmap.org/wiki/Overpass_API#Introduction says 10k / day is reasonable.
Comment: Hi, thanks for the answer. I need get distance to nearest city, infrastructure objects, seas/oceans/lakes and etc. here is the overpass ql:

    [out:json];
    node(1325598475);
    node
    (around:30000)
    ["place"~"village|town|city"];
    out skel qt 100;

By the way I have openstreetmaps nodes ID.
Comment: My points located around the worldwide
Answer: Just found a few another solutions maybe it will help somebody:

Wolfram Cloud have a nice web editor where you can upload your data
and make some coputations including with geo data.They have some
usefull methods such as GeoNearest
https://reference.wolfram.com/language/ref/GeoNearest.html There is
a free acess with some limitations. By the way to find information
using Wolfram for list with 150k points It seems will cost me a lot
Another usefull free tool is QGIS http://www.qgis.org/ru/site/ it
have Distance matrix. I will extract data from planet.osm with
"tags" for example city/towns and etc and then calculate distance in
QGIS.
Answer: overpass-api may be used to extract data, but such processing as described here should (must?) be done outside it.
QGIS or a custom script are initial ideas.


Can you gain health besides drinking a health potion?

Question: In World of Warcraft, you can sit and it allows the character to gain health faster. Is there anything like that in Torchlight 2?
Answer: There are no passive, out-of-combat health regeneration (w/o skills) like in WoW.
Instead there are many other ways to generate/recover health.
You can gain health from:

Armor and weapons with Life Steal (X Health Stolen per Hit) or Health Regen (+X Health Per Second) item mod. There is also the rare item modifier - Fully Heal Self.
Use an Active skills such as the Engineer's Healing Bot, the
Embermage's Death's Bounty, the Outlander's Stone Pact, Berserker's Shadow
Burst. There are also passive skills that can heal your character, like the
Engineer's Charge Reconstitution and the Berserker's Blood Hunger.
Equip and use spell scrolls, such as Heal Self, Heal All, or Draining Touch. Pets can learn spells, too! The have 4 slots just like you character (I personally prefer to give it summon spells). It frees up some of hot bar slots and mana. (Thanks Dycker)
Pet items can also have the modifier "X Health steal to master on Hit"
Comment: You might want to add that your pet can learn spells too, like heal all. This frees up our mana and doesn't take a spot on your hot bar. Also the Outlander ability; Stone Pact, recovers X health for 3 seconds. Also there are some pet items that have "on hit: master recovers X health"
Comment: Are there still health shrines?
Comment: @Arkive Yep, I've seen a couple.
Answer: Yes.
Certain enchanted items provide health regeneration benefits.
Also, the engineer class has the Healing Bot first-level skill. This summons a small robot that heals both you and your fellow party members.
Comment: I use the Shadow Burst skill on my Berzerker to get health back, and I would guess there are probably many other skills that return health to the user as well.
Answer: Yes, there are other ways besides health potions to gain HP, but
No, there is no bonus regeneration for being "out of combat" like WoW, and nothing like WoW's food that refills your health slowly for a lower price.


How to dismiss a ViewController while the navigationItem's searchBar has focus

Question: I updated my app to handle the new iOS 11 search behavior for search bars under the navigation bar:
- (void)viewDidLoad
{
    [super viewDidLoad];

    UISearchController *searchController = [[UISearchController alloc] initWithSearchResultsController:nil];
    self.navigationItem.searchController = searchController;

    // Those are optional, but that's what I want my UI to look like
    searchController.hidesNavigationBarDuringPresentation = NO;
    searchController.obscuresBackgroundDuringPresentation = NO;
    self.navigationItem.hidesSearchBarWhenScrolling = NO;
}

I also have a button on my view, which when tapped will dismiss the current view controller:
- (IBAction)dismiss:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

The problem is: if the searchController's searchBar has focus (ie. is the first responder) when the user taps the button, the view controller is not dismissed.

On the first tap on the button, the searchBar loses its focus and the keyboard hides (as if [searchBar resignFirstResponder] had been called);
On the second tap, the view controller is finally being dismissed.

How can I make the first tap on the button dismiss the view controller immediately (removing the searchBar's focus as a side effect)?
Answer: Swift 4.2
self.searchController.dismiss(animated: false, completion: nil)
self.dismiss(animated: true, completion: {
   ///
})

Answer: The solution to dismiss the view controller immediately is to use the UISearchController isActive property:
- (IBAction)dismiss:(id)sender
{
    self.navigationItem.searchController.active = NO;
    [self dismissViewControllerAnimated:YES completion:nil];
}

Answer: In my scenario I have a UITableViewController with a search bar as overlay. The search results are in a separate UITableViewController. Now I wanted to dismiss the overlay while the search results are shown. @Guillaume Algis your solution worked perfectly for me as well.
Syntax in Swift 4:
    self.navigationItem.searchController?.isActive = false
    self.dismiss(animated: true) {}

Answer: All the above methods cause updateSearchResults to be called with an empty string.
Depending on your implementation this may lead to reloading of the tableview which may be detrimental to the user experience.
The following works around this issue for me:
self.presentingViewController?.dismiss(animated: true, completion: nil)

Answer: In my case, work around is:
UIView.setAnimationsEnabled(false)
searchController.isActive = false
UIView.setAnimationsEnabled(true)

then you can dismiss viewController by delegate or directly.


Fourier series of single tone modulated wave

Question: When a single-tone continuous modulating signal modulates a sinusoidal carrier, isn't the modulated wave periodic? If so, can't we apply fourier series and determine the harmonic frequency components instead of finding the frequency components using fourier transform?
Comment: just curious, If you have lost control of your account see [I accidentally created two accounts; how do I merge them?](http://physics.stackexchange.com/help/merging-accounts).
Comment: Are you talking FM?  Are you trying to compute the modulated signal directly from the frequency content using a fourier series?  I don't think this will be easy.
Comment: Would http://dsp.stackexchange.com be a better home for this question?
Answer:
When a single-tone continuous modulating signal modulates a sinusoidal
  carrier ... can't we apply fourier series and determine the harmonic
  frequency components

$\cos(\omega_m t) \cdot \cos(\omega_ct) = \dfrac{\cos[(\omega_m + \omega_c) t] + \cos[(\omega_m - \omega_c) t]}{2}$
Isn't the frequency content evident by inspection?
Comment: This isn't FM, this is mixing.
Comment: Indeed it isn't FM.  The phrase "modulate a carrier", without qualification, most likely means AM and that is what I assumed.  Why do you assume FM?
Comment: @AlfedCentauri mostly because there are 3 forms of modulation AM, FM and PM.  FM and PM are similar in spectrum so odds are with me.  And no one really does anything with AM anymore because it has poor immunity to noise.  If you're doing something involving fourier transforms you're probably well beyond the simplicity of AM.
Comment: @AlfedCentauri I shouldn't say no one uses AM anymore.  In conducted communication systems with clean channels AM gets used often.  However in any case with a poor channel (radiated for example) AM suffers heavily from noise interference so FM is preferred.
Answer: If the type of modulation you are talking about is FM, then the spectral content depends on its modulation index (M or $\beta$).  The full equation for the output is (for a sinusoidal input only):

The term inside the cosine is not easy to isolate.
With some algebra it can be separated out using bessel functions:

So you can see that this signal has frequency components at $f_c + n*f_m$.  Where n is $-\infty$ to $+\infty$.  Shocking isn't it?  The Bessel Function $J_n\{\beta\}$ tends to approach zero at large values of n, but it is counter-intuitive to see all this frequency content.
So a simple sine wave modulation at frequency Fm can produce a variety of spectra depending on its modulation index (M or $\beta$) which is a ratio of the change in frequency deviation ($\Delta$f) to the maximum frequency of the modulated signal ($f_{m(max)}$).  See the plots for different values of M for the same modulating tone at frequency $f_m$ where $M=\frac{\Delta f}{f_m}$

In reality, Carson's Rule is applied to limit the spectral content to about 98% of all the energy.  This bandwidth is double the frequency deviation plus the maximum frequency of the input modulation content.

So to answer your question the spectral content is not necessarily directly related to the modulated signal spectra with FM.  It's periodic, sure, but there is a lot of content.  If you knew the exact modulation parameters you could try to work backwards and estimate the modulated input based on relative amplitudes and spectral frequencies.
Answer: Yes, it's periodic, as long as the frequencies of the modulating signal and the carrier are related by a rational ratio. For example, if the period of the carrier is 3 seconds and that of the modulator is 2 seconds then the signal will be periodic with a period of 6 seconds. In such a case you can use Fourier series to find the spectrum if you want. But if the carrier's period is $\pi$ seconds and the modulator's is 2 seconds then the signal will never quite repeat, and so you can't use Fourier series. I suspect that using Fourier series will generally be messier and more difficult than using a continuous Fourier transform anyway.
Comment: You meant any rational ratio, right?
Comment: @LubošMotl yes - by "integer ratio" I meant "ratio between two integers", but rational ratio is clearly a better way to put it.


How frequent is the use of 'Appropriation' in American English compared with British English?

Question: How frequently is the word 'Appropriation' used in American English?  In what contexts might young people commonly hear it?
Comment: Would it be impolite to suggest that his sister may be better known in America - Miss Appropriation?
Comment: [Comparison Ngram](http://books.google.com/ngrams/graph?content=appropriation%3Aeng_gb_2012%2Cappropriation%3Aeng_us_2012&year_start=1800&year_end=2000&corpus=18&smoothing=3&share=)
Comment: @AndrewLeach I never knew! Added to my question about corpus comparisons.
Answer: Today appropriation is probably most often to be found in the context of critical and cultural studies, designating an artist's conversion of established artistic elements to new uses.
Before the 1980s, however, the word was usually used of money: either the conversion of someone else's money to one's own use, or the act of a legislature assigning revenue to specific uses or categories of use. Those uses are still very much alive.
"Young people" covers a lot of territory; but I imagine that primary- and secondary-school students would only encounter this word in the latter sense. And they'd be most likely to encounter it (and the verb appropriate) colloquially as an ironic euphemism for theft.
As for "how often" it's used: see Andrew Leach's Google Ngram. It's not rare, but it's not a term that comes up often in conversation. It's probably used as-often-as-it-is-needed-and-a-little-bit-more.
Answer: Young people who follow domestic U.S. politics will almost certainly have heard or read the term appropriation in connection with the two very powerful Committees on Appropriations of the U.S. Congress (one in the House of Representatives and the other in the Senate). As the Wikipedia article on the House Appropriations Committee points out,

The constitutional basis for the [House] Appropriations Committee comes from Article one, Section nine, Clause seven of the U.S. Constitution, which says

No money shall be drawn from the treasury, but in consequence of appropriations made by law; and a regular statement and account of receipts and expenditures of all public money shall be published from time to time.

The wording of the U.S. Constitution was adopted by the Constitutional Convention in 1787. Nineteen years later, Noah Webster's Compendious Dictionary of the English Language (1806) offered this definition of the verb appropriate:

to set apart for a certain purpose, or for one's self

In contrast, Merriam-Webster's Eleventh Collegiate Dictionary (2003) lists three distinct definitions of the verb:

1: to take exclusive possession of: annex 2: to set apart for or assign to a particular purpose or use 3: to take or make use of without authority or right

Definition 3 of the verb appropriate expresses a meaning almost diametrically opposed to that of the older definition 2: The appropriation it describes is more akin to plundering than to lawful requisitioning or allocation. Nevertheless, use of the verb appropriate in the definition 3 sense is fairly common in the United States today, as is use of the noun appropriation based on the definition 3 verb. But whether members of a particular group of young people understand it in that way (or at all) is another question entirely.


Why the π in ἀπιεῖ?

Question: I wanted to pick a -μι verb to use as a paradigm to memorize for Homeric and koine, so I thought I would use ἀφίημι. I looked up the present-tense conjugation on U Chicago's morpho utility, and then noticed that the third person forms have π rather than φ, ἀπιεῖ. What is going on here? Is this a regular stem change, similar to the aorist of -ω verbs, or some other regular thing, or is this verb just irregular?
Comment: It sounds as though this is a case of 'You get what you pay for.' It could be giving dialectical forms that don't have the aspiration (and that accent with circumflex on the ultima), or it could be giving forms of ἄπειμι for some reason. You'd be far better served by consulting the conjugation charts in a reputable textbook or grammar.
Comment: Is this utility a free online tool? If so, a link would make it easier for others to find it.
Comment: Thanks! It's unfortunately pretty common to be unable to link to specific pages in an online dictionary or morphological analyzer.
Answer: The forms with π are Ionic, which is a dialect that drops word-initial aspiration. It does not normally turn φ into π, but in this case the φ is a result of the π of the preposition ἀπό interacting with the initial aspiration of ἵημι.
The normal active present indicative third person singular in Attic is ἀφίησι(ν) or ἀφιεῖ.
Comment: The circumflex is due to conjugating the verb as if it were an epsilon contract verb. See Smyth para. 746: http://www.perseus.tufts.edu/hopper/text?doc=Smyth+grammar+746&fromdoc=Perseus%3Atext%3A1999.04.0007
Comment: Actually regarding the circumflex on the ultima for the second form both of the textbooks I have in front of me have it but neither explains where it comes from. One does say there's considerable confusion between it and the (in my view expected) paroxytone attested. If someone else knows more about that I'd be glad to hear it.
Comment: Interesting. I only ever learned the Attic form as ἀφίησι(ν) (though I did learn ἀφιεῖς as an alternative 2nd person singular form). Certainly, at first glance, Smyth appears to suggest that ἀφιεῖ is only dialectical (attributing it to Homer, Herodotus), but I haven't looked closely at all his notes.

Why the π in ἀπιεῖ?


How do I copy CD to my Android cellphone using Lubuntu 18.10?

Question: How do I copy an audio CD to my Android 8.1.0 cellphone using Lubuntu 18.10?
Answer: Here's what I did to get it working:

connect the phone using the provided USB cable.
verify it opens PCManfile and check it's listed via 'lsusb'.
sudo apt install sound-juicer
sudo apt install lubuntu-restricted-extras
reboot computer (steps 3-5 are #ubuntu ioria's instruction)
copy tracks from CD to computer with Sound Juicer, adding CD information to musicbrainz as needed.
search 'USB' in phone settings, tap to open settings page, change option from 'charge' to 'transfer files' to enable write permissions.
create a directory on your phone from within pcmanfile to store files (i chose the SD card)
copy-paste files between pcmanfile folders to copy tracks to your phone.
check to see if there's some 'safely remove' eject-external-drive feature on taskbar; disconnect cable from phone after all files have copied if not.
Navigate to the 'Files' app on phone by default. Navigate to the folder, change the listing setting to see filenames, and tap on file to play.
Consider installing better software to play files.
Comment: Good job! +1 for you.
Answer: You need to extract files from your CD and copy them on your cellphone.
For extracting, I personally use Asunder, which is available in Lubuntu repository and pretty simple to use.
For copy, you'll need to connect your phone to your computer with Bluetooth or USB cable.
Comment: I connected the phone via USB but I do not have permission to write to the pcmanfm folder that opens for it. How do I copy files to it?
Comment: When you connect the phone, you should have an option that pops up on your phone in the notification area. I don't have the exact wording in English, but basically you can choose between "Power supply only", "File transfer" and "Multimedia device". The "multimedia device" is the right one for you. Once done, you should be able to copy your music files :-)


How can I create a Google account without it being saved to my device?

Question: I want to create a Google account on my computer, but I don't want it saved to my device. For example, when I come on the place to log into my Google account, I don't want it to have my email address there, ready. I want to just type it in. Can I create a Google account without it being saved to my device?
A million thanks in advance,
Shay
Answer: Sure you can do that. You have to switch to incognito browsing on your browser.
Every browser has incognito. On Opera mini, it is called private browsing.
For Chrome, click on the three horizontal lines at the right-top side of the browser and select new incognito tab.
On Opera, you can switch to private browsing by clicking on the tabs icon then select Private.
I hope this helps.


Error: Unknown Directive .type func, @function

Question: .data
x: .long 2
r: .long 27

.text

.globl _start

_start:
        pushl x
        movl $0,%eax
        call func
        addl $4,%esp
        movl %eax,r
        movl r,%ebx
        movl $1,%eax
        int $0x80

.type func, @function
func:
        pushl %ebp
        movl %esp,%ebp
        movl 8(%ebp),%eax
        cmpl $0,%eax
        jle if
        jmp else
if:     movl %ebx,%eax
        jmp endif
else:   addl %eax,%ebx
        subl $1,%eax
        pushl %eax
        call func
        addl $4,%esp
endif:  movl %ebp,%esp
        popl %ebp
        ret

Above you see the program i am trying to run. I boiled it down to one last error which i can't seem to find the answer to.
The error message sound as following:
test.s:19:1: error: unknown directive
.type func, @function
^

I compiled it on a Macintosh 10.9.1 using gcc -m32 test.s and ggc -c test.s.
I browsed Google looking for answers, but i can't seem to find any. It is the AT&T syntax.
Comment: have you tried the other syntax `.type  STT_` as in .type func STT_FUNC
Answer: This directive simply isn't used by the Mach-O assembler. It You should omit it. There are some other differences here.


When should I "send mail by queue" with the SMTP module?

Question: On the SMTP module configuration page at <code>/admin/config/system/smtp</code>, it offers the option to Send mail by queue (Mails will be sent by drupal queue api.).
When would I want to check this box?  What are the advantages and disadvantages?
Answer: TL;DR: send the email by queue if you are sending larger number of emails at once, or if your SMTP server takes longer time to process a request (for whatever reason).
Below is a brief overview of the main pros/cons.
Pros

Better handling of large volume of emails. Email sending task will be split into batches, and Drupal will process them in smaller chunks during cron runs. This is better because your server might time out or become unresponsive for visitors if you are trying to send 500 emails at once.
If the same task is split into multiple batches, it will be easier to process them, and regular visitors will not experience as big decrease in performance.

Cons

Requires more frequent cron (or a custom script that will process the batches), which translates into more used resources at all times. You might see certain decrease in performance if the site is processing email batches and there are a lot of users online simultaneously. This of course depends on many factors (number of emails you are sending, frequency of your cron, speed at which remote SMTP server processes the requests, number of visitors on your site, complexity, and so on).
See Elysia Cron module for fine tuning the cron implementations of all modules on your site. It will help you use less resources during each cron run, because you will be able to choose how often will cron of certain modules be run.

In some cases this can result in slower email delivery. If you have a large number of emails to deliver (e.g. 100k newsletter subscription list), last user in the queue will receive the message significantly later than the first one. Also, all emails requested to be sent during that time, will be delayed as well.
Answer: The previous two answers discuss the pros/cons of queuing email when sending large batches. There are different pros/cons when non-batch emails are sent (e.g. triggered by a user registration event).
The questioner doesnt say which version of the SMTP module they're using, but the current 8.x-1.0-beta3 doesnt have the option to queue (sadly). Nevertheless, the pros and cons of queuing that seem evident to me are:
Pros: If the SMTP server cannot be reached, for any reason, and there's no queue, then the email simply doesnt get sent (and an error is returned). If there is a queue, then sending will be re-tried later, and, hopefully, the email will eventually get sent.
Cons: If there's a queue, the part of the application that wanted to send the email doesnt know when (or even if) the email actually got sent. When you have a queue, you also have to have something that monitors the queue and raises an alert if there's a problem.
Answer: We also did this to control the rate of email flow.
As well our SMTP server is a little slow, and errors sometimes for an unknown reason during the authentication phase, upon which we would need to retry until the email sent.  By using the queue the user doesn't have to wait, instead we return a confirmation screen to them immediately, and then let the smtp queue and retry errors on queue take care of sending the email later.
Note you don't need to run the whole cron, you can just run the command drush queue-run smtp_send_queue, and it should send your emails.


What does code P0401 mean?

Question: I own a  2006 Malibu Maxx 3.5, last night a neighbor replaced my air filter, and after I went no more than two miles  the check engine light went on . I will add that the filter was dirty but nowhere near what I saw while I was researching the problem. I do have a fixed, put on and got a code of P0401, exhaust gas recirculation flow insufficient, does that have something to do with the filter being changed and I am also adding very quickly, My ex-husband is a mechanic and lives far away, I am trying to do the little things on my own and hope this is an easy one . also I noticed the filter has two different patterns,which side should be on the bottom metal mesh or pleated filter? Looked in daylight and I see the box where the filter goes ,attached hose and I guess the sensor that pluggs into the side .hope that helps.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: You likely have a dirty EGR valve, dirty EGR pipe/line, gasket (see here for a listing of the parts).  These parts total about $100, labor $60-$100.  If you ignore the CEL, your head temperatures will run high and you'll wear out the engine prematurely.
There's nothing wrong with the air filter installation.  It's not uncommon for a check engine light and codes to appear after changing the air filter.  The improved air flow of the new filter changes the dynamics of the sensors so that they work properly.
It's best to buy the parts you need, then call ahead and ask mechanics specifically the cost of their labor.  You will sound like you know what you are doing and will not get ripped-off.  No ex-husband needed!

What does code P0401 mean?


How likely is for the head of some University/Institution to ask other professors for further details related to the candidate?

Question: I am thinking of applying at several Biology PhD programmes and for this I need several recommendation letters. Have you experienced the situation where the head of the targeted Department asked the person that recommended you further details about you, even though the letters already contain references to your work/behaviour in the lab? How much does the content of the letters count?
Any shared experience will be greatly appreciated!
Answer: Letters of recommendation often end with

"...If you need further details do not hesitate to contact me on...",

and this is not a useless formality. If committee members have some questions about the candidate, they are very likely to email or telephone the person who wrote the recommendation and ask them. The content of the letter matters greatly, but it is even more important that the person who signs under the letter actually knows you well.
This is the main reason why a general and vague letter does not make you much good. Sadly, some professors are too busy to write the letter themselves, and they sometimes ask their students to prepare a letter which they are happy to sign. Be vary of this line, as the busy professor is likely to forget your name the next minute you step out his door, and therefore will not be able to provide details on you if asked. This also diminishes the effect of the recommendation, if not negates it.
Answer: There is a common process these days, that recommendation letters are sent using a service specific to that task.  Using the service solves several problems:  one of which is the student that asks for multitudes of recommendations (each of which is a huge time-sink for the professor) and second, the "chain of control" problem, which is, "did the student handle or have contact with the recommendations somewhere along the line?"
So yes, it is entirely possible that the professor sent a somewhat generic letter, and it's entirely reasonable and typical for someone at a graduate program where there is REAL interest, to elicit further detail.


Typical values of Amplitude and Phase Imbalance (IQ Imbalance) in 802.11ax (Wifi 6)

Question: I want to simulate the IEEE 802.11ax waveform and include the IQ impairment and its mitigation.
What is a reasonable/expected value of the Amplitude and Phase Imbalance coefficients?
Please specify the units, linear or dB and degree or radians.
Answer: There's no such thing as a an expected imbalance in a communications standard. That's a property of the radio device, not of the standard!
In my humble experience, receiver imperfections vary a large deal – within the same class of devices across generations and manufacturers, and within the same device with different firmware configuration even.
That's not that surprising: IQ imbalance is typically removed using programmable units in OFDM baseband receivers (and there's also superheterodyne receivers for OFDM, though you don't usually find them in Wifi devices; but I wouldn't rule them out, especially in least-cost devices), and the way you program these makes a difference. IQ imbalance typically gets "calibrated out" when you tune to some faraway frequency after a prolonged amount of time, and depending on how intensely you do that, your tuning-and-recalibration routine takes longer or shorter.
How much you'll want to combat IQ imbalance depends on how much it distorts your signal – in OFDM systems like 802.11ax, that's mostly noticeable as ICI; but since your frequency stability, Doppler, SNR and synchronization error lead to ICI anyways, there's a natural limit for how low you need to suppress IQ imbalance before it stops paying off.
Also, receiver imperfection are related to manufacturing accuracy and factory trimming, and hence a cost- and binning aspect.
So, sorry. I'm not aware of a set of handy numbers I could give you.
Idea: However, if you use a training symbol that only uses the odd half of subcarriers, and then another training symbol that uses the even half of subcarriers, you should get something that is either purely imaginary or purely real in the time domain. You can then estimate IQ imbalance by comparing channel coefficient estimates of adjacent channels. I don't know how reliable that is, it will be worse the more your channel is frequency-selective.


Why real-world output of my classifier has similar label ratio to training data?

Question: I trained a neural network on balanced dataset, and it has good accuracy ~85%. But in real world positives appear in about 10% of the cases or less. When I test network on set with real world distribution it seems to assign more positive labels than needed tending to balanced proportion as in training set.
What can be the reason of such behavior and what should I do solve it?
I'm using Keras and combination of LSTM and CNN layers.
Comment: Would you elaborate the clause *But in real world positives appear in about 10%*. By positive you've meant positive labels or something?
Comment: @Vaalizaadeh, yes positive labels, so basically one category is less represented in real world.
Answer:
What can be the reason of such behavior?

A classifier only tries to capture the features-label relationship as accurate as it can, it does not learn nor does it guarantee that the ratio of predicted labels to be close to the true ratio. However, if sampled classes (even balanced) are good representatives of true class regions and classifier finds good decision boundaries, the closeness of ratios will happen naturally. Therefore, the explanation is that the sampled negative class is not a good representative of its true occupied regions, meaning some regions are not sampled well, and/or classifier is finding bad decision boundaries. Here is a visual illustration (drawn by myself):

In the case of good training set, predictions resemble the real-world ratio (2:1), even though model is trained on a balanced set (1:1). In the case of bad training set and/or bad decision boundary, predictions are completely incompatible (1:2) with the real-world ratio (2:1).

What should I do to solve it?

If the problem is related to bad negative representatives

Use more negative samples in the training set, i.e. imbalanced training (you can nullify the effect of imbalanced samples with class weights), or
Train with balanced classes but change the decision threshold (a post-training solution). That is, instead of assigning instances with output > 0.5 to positive class, use a harder-to-pass threshold like output > 0.8 to decrease the number of positive predictions.

If the problem is related to classifier performance, we should come up with a better classifier which is an open-ended endeavor.

However, in my opinion, you should not select models based on the ratio of positive predictions. You should ecide based on a metric like macro-f1 (or any other one). Therefore, by using a validation set, a model that produces more positive samples and has a higher macro-f1 should be preferred over a model that produces less positives but has a lower macro-f1.
EDIT:
As @BenReiniger pointed out in another post, a hidden assumption here (specially in the sketch) is that classes are "clearly separable". This assumption becomes more justified in higher dimensions. As an example, dogs and cats are clearly separable based on their images (high dimensions) compared to their length (one dimension).
Comment: I like that illustration!  Source?
Comment: @BenReiniger Thanks Ben! I drew it by paint.
Comment: @Esmailian, I would like to say that this is something that applies to many of your illustrations. They look like something out of a write-up in a blog. You are a natural teacher :)
Comment: @SimonLarsson Thanks man!
Answer: Esmailian's answer is great, another possible solution is intercept correction, it is more commonly used in logistic regression, but the principal will apply here as well,
see here or here, there's a lot of material on it online...