What formal properties should resolution of singularities have?

Question: If I were going to propose a new construction as a "replacement for resolution of singularities", what properties would my replacement have to have?  [I am going to do no such thing -- this is purely speculative.] Is there a shortish list of theorems such that any construction verifying the properties on the list would thereby deserve to be called a resolution of singularities?
Answer: Here are some properties of resolution of singularities that I use often:

The map is an isomorphism (or some version of very nice) over the smooth locus is important.   EDIT:  This usually shows up because I want to make statements about properties of the singular locus itself.  One common application of this is that any smooth variety can be embedded in a smooth complete variety (do any embedding, and then resolve the singularities).  A sufficiently good version of (3.) also should imply this (ie, if the resolution procedure commutes with open immersions).
The pre-image of the singular locus (or some specified subscheme) is SNC, aka simple normal crossings (or at least something very well understood). EDIT:  Two is used for vanishing theorems certainly, but it also tells you in many cases when you can stop.  Sometimes, especially when you are given a specific subscheme $Z \subseteq X$, the data the resolution provides without the SNC hypothesis is incomplete, but after one does further blowing up and arrives SNC case, no new data can be obtained by further resolution.  Also, the embedding statement from (1.) then becomes ``you can embed any smooth variety in a smooth complete variety where the boundary divisor is a SNC divisor''.
Some version of functoriality is important.  EDIT:  There is of course the formal versions of functoriality out there (ie, compatibility with smooth maps, various equivariant forms, etc...)  There are also important implicit forms too.  Often you have a map of varieties and you need to have resolutions of their singularities that also have a map between them.  In this case, you usually can't use functorial resolutions on both, but after you do one, you can often then know what has to be done in the other (ie, resolve the singularities of one, then resolve the indeterminacies of the map, then resolve the singularities of the other).  Sometimes the fact that resolutions can be described by blow-ups helps in this context.
Comment: Thanks, Karl.  Can you say anything more specific about why/how you use these?  Is (2) mostly for doing calculations with some vanishing theorem or another?
Answer: It seems to be important that the resolution of singularities be a proper map.
Comment: Properness is used in many applications where cohomology of the
resolution is compared with cohomology below. Also without
some such condition existence is trivial.
Comment: Thank you, Leonid.  Would you mind saying something more about why properness is important from your point of view?  Is there some particular piece of information that it's needed to convey back and forth from the resolution?
Answer:
It should exist in all characteristics, even mixed characteristic!

This sounds somewhat cheeky, but I was fairly serious. To algebraists, and the OP is one last time I met him, a purely ring-theoretic statement which can largely only be verified in char. $0$ feels more incomplete than to a geometer.
This is a main reason why the use of resolution of singularity is restricted in attacking some of the open questions in commutative algebra: often the hardest case is mixed characteristic, and if you are extremely lucky and smart you can reduce it to a statement in char. $p>0$, then you are dead!
Because of the above reason, I would mention that de Jong's alteration  has found some spectacular success in commutative algebra (so one can  replace birational by surjective and generically finite). A main example is Gabber's proof of the non-negativity part of Serre's conjectures on intersection multiplicities (see number 1 here for an expository account) .
Comment: A lot of other people aside from algebraists would want this to.
At the moment, as far as I know, the mixed case is only known in dimension $2$. There is a nice proof  by Lipman, Ann. Math. 1978,
which you probably already know about.
Comment: edit: to -> too
Comment: Still am one, Long.  :)
Comment: @Donu: thank you for the nice reference. @Graham: good to know, I am glad (-:
Answer: I'm guessing quite a few users would want the resolution construction to be equivariant.


Where to find the garage where you can sell Wang cars in San Fierro

Question: Right after you buy the car dealership you get a mission, and after that mission there's an ending scene where you can get a car and bring it to a garage so you can sell them at your shop. Where is this garage?
Answer: There are two ways to sell vehicles in GTA:SA
First Method
You unlock missions where you're tasked with stealing certain vehicles. These are marked in the map as if they were regular missions. There are four of them (Zeroing in, Test Drive, Custom Fast Track and Puncture Wounds). After completing these missions you unlock Wang Auto as an asset (that generates revenue passively - although you do have to collect the income in person). After finishing each mission another car is placed at the showroom, which you can take whenever you want
Second Method
After finishing Cesar's missions in San Fierro garage you unlock the Import/Export missions. At Easten Basin docks there's a chalkboard noting down a list of vehicles that you can deliver in exchange for money. After delivering a vehicle you can import the same vehicle type in exchange for some money. There are three lists in total, unlocked after finishing the previous list.

It's worth noting that neither of them require you to actually store vehicles at your garage, apart from some missions where you end them at or pass through the garage. It is possible that you're talking about mod-shops, since in some missions you do have to alter the vehicle before being able to deliver it. If that is indeed the case, there is one next to Wang Cars (TransFender) and there is one on Western San Fierro (Wheel Arch Angels). There are no other mod shops in San Fierro, although there are more across the map (Consider consulting GTA Wiki for a full map)
Answer:
Where [do I] find the garage where you can sell Wang cars in San Fierro

The Wang Cars showroom is on the same street as the garage. Keep driving a bit to the north and you should find it.
Comment: Except, you don't actually sell the vehicles there
Comment: The Title and Body makes the question hard to answer, but the user specifies "garage" and says after a mission. Because you don't go to Wang Cars during all of the related missions (Zeroing In, Test Drive, Customs Fast Track, Puncture Wounds) the user might not know the location of the showroom or forgot about it.


Undo command in Minecraft

Question: I would want to know if there is a sort of "undo" command in Minecraft (no mods) that undo one action at the time. For example, the player pressed a button that started a huge redstone system or he detonated one TNT that detonated other TNTs.
Answer: No, there is no built-in undo system.
However, if you are prepared for it, you can use the /clone command. You'll want to clone the part of the map (periodically) you are working on to another, far away area. Then, if you want to "undo" this, simply reverse this cycle, and clone the "backup" area into the "work" area.
Tip: Make sure not to clone from the building area constantly, because that destroys the whole purpose of this. Make sure you clone it every so often; maybe every day-night cycle?
Comment: If you want to know how to do this in more depth, feel free to ask another question.
Comment: Wow, that was quick. However, what you are telling me here is in sort of one my failed project (it required the /testforblocks command you can check the question here:http://gaming.stackexchange.com/questions/262125/testforblocks-system-problem )
Comment: @Kimatuy Ah, I see. But you really shouldn't need `/testforblocks`. Since you should only "backup" the area every so often, that should create no lag. If you backed it up whenever someone places a block, then the two fields would be identical, including right after the player detonates TNT in that area. If both areas are destroyed, what's the point of having the backup?
Comment: Yeah, you're surely right. But what I want my system to do is to detect if there is a change in the area, and if yes, change it back. Of course, there will be an "edit mode" system, so that we can change the build. But when not on, the /testforblocks command should be able to know that he will have a different build to check. This is my question, or more my project question.
Comment: @Kimatuy Ah, I see. Please look at my comment on your other question, I might be able to help you there.

Undo command in Minecraft


How does dual wielding affect skills which depend on "weapon DPS?"

Question: Is the right-hand weapons DPS used? Is an average taken? Is it the min or max of the two?
Answer: For a complete explanation, please look at my answer to this post.
When you only have 1 weapon equipped (no offhand) then the damage will be completely determined by the dps of that weapon.
When you have 1 weapon and 1 shield equipped, the damage will be the same as if you didn't have the shield equiped (so the same as above).
When you have 2 weapons equipped, the damage will be completely determined by the dps of your right-hand weapon. However, since you have 2 weapons equipped it will give you more damage than if you have just 1 weapon equipped, say, as a  sort of bonus. I believe the amount of 'bonus' to be equal to floor(dps of righthand weapon / 10), however I couldn't do many tests on that statement so it's best to take it with a pinch of salt.
So: always equip your highest dps weapon in your right hand and depending if you want more dps or more survivability you can choose a weapon (any weapon, stats don't matter *) or shield as offhand.
*except if that weapon gives you bonuses such as dual-wield modifiers, %damage, ...!
Comment: While that post is *awesome*, you should probably give at least a brief summary of the part relating to dual-wielding here.
Comment: True, i'll edit my post in a bit :)
Answer: Just open character stats and look up your Weapon damage.
Its calculated from that.
So your offhand also counts.
Two handed weapons often have better +% to certain damage types and more slots.
Dual wield offers more dps but damage overall can be lower in certain cirumstances so experiment.
But high end dual wands are better than high end two handed staff.
Still its much easier to find good staff than to find TWO good wands :)
Comment: It is not based on Weapon Damage and the offhand is in no way calculated in the damage output. (unless you pickup dual-wield modifiers, but this is still an indirect way)
Comment: Still it adds % to damage modifiers from offhand and any on the hit bonuses it offers
So most of the time dps is slightly higher, especially on skills which actually uses equiped weapon as origin point
Comment: Correct, that's what I meant with the part between brackets :)


Sending a certificate with Android?

Question: I've been using CURL and php to send the following:
<code>$ch = curl_init($url);
curl_setopt_array($ch, array(
    CURLOPT_POST => count($postfields),
    CURLOPT_POSTFIELDS => $postfields,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => 2,
    CURLOPT_VERBOSE => true,
    CURLOPT_SSLCERT => 'C:\mycert.pem',
    CURLOPT_SSLCERTPASSWD => 'mypass',
    CURLOPT_SSLCERTTYPE => 'PEM'
));
</code>
I've not included the postfields to keep it brief.
This works very well. However after much googling I can't find a simple way to do this using HTTPClient. I just want to include a certificate with the POST.
TIA
Answer: You need to create a trust store containing your certificate.
My blog post at http://blog.chariotsolutions.com/2013/01/https-with-client-certificates-on.html contains a little more than you need (it includes supporting self-signed client and server certs), but should give you everything you need.
Comment: You should avoid making link-only answers, as your link could become unavailable or move to a different address, and this answer will stop being relevant.

Other than that, nice post, it does cover a lot.
Comment: Thanks GBG, I'll give that a whirl. Looks to be a good tutorial.

Sending a certificate with Android?


clm function package ordinal "Hessian is numerically singular: parameters are not uniquely determined"

Question: I'm modeling ordinal data using the clm function from the ordinal package in R. For that I have 4 variables, 2 ordinal and 2 continuous (O1, O2, C1, C2).
O1 <- c(2,2,1,2,2,1,3,2,2,3,3,2,1,3,2,2,2)
O2 <- c(2,2,3,2,2,1,2,2,2,1,1,2,3,2,2,2,2)
C1 <- C(49,25,1000,19,61,700,25,375,35,46,105,437,3300,31,203,34,800)
C2 <- c(25350, 25050, 14925, 25050, 14325, 16300, 26425, 22250, 22250,
        44650, 44650, 21400, 30125, 25350, 25050, 14325, 17525)
data <- data.frame (O1, O2, C1, C2)
data <- within(data, {
O1 <- factor ((O1), ordered =TRUE,
              levels = c("1", "2", "3"))
O2 <- factor ((O2), ordered =TRUE,
              levels = c("1", "2", "3"))
})

In a first step I want to model O1 as response variable and O2, C1 and C2 as predictors (3 different models) and second, use O2 as response and O1, C1 and C2 as predictors (another 3 different models).
m1 <- clm(O1 ~ O2, data = data)
m2 <- clm(O1 ~ C1, data = data)
m3 <- clm(O1 ~ log(C2), data = data)
m4 <- clm(O2 ~ O1, data = data)
m5 <- clm(O2 ~ C1, data = data)
m6 <- clm(O2 ~ log(C2), data = data)

As you can see all models run without problem except for the first one (m1) which gives as warning message:

(1) Hessian is numerically singular: parameters are not uniquely determined
In addition: Absolute convergence criterion was met, but relative criterion was not met

and do not report any standard error or wald z test.
I do not have this problem when simulating data
 data$x1 <- sample(c(1,2,3), 17, replace = TRUE)

What confuses me is that, unlike with m1 (O1 ~ O2), the model which uses O2 as response and O1 as predictor works perfectly fine. In addition I have tried replacing some values in O1 and it happened that when substituting 1 by 2 or 3 I do not get any warning message and I obtain all the coefficients of the model.
I made some research and it seems and this can be due to low representation of certain values in the response, as well as to a small sample size. Is that right or can it be a bug? Can someone help me please?
Comment: There is a typo : C versus c!
Answer: It is because you have too many empty cells (here you have only 2 subjects iwith O2=3)
Try to merge categories and refit the model


Square-integrable functions tend to zero at $\pm \infty$

Question: Is it true that all differentiable square-integrable functions tend to zero at $\pm \infty$? If that is not true could you give a counterexample?
Comment: Only if the limit exists. In which case the proof is trivial.
Comment: If $\lim_{x\to \infty }$ exist, then yes it's true. Otherwise, you can have that $f\in L^p$ (where $p\geq 1$) and $\limsup_{x\to \infty }f(x)=+\infty $. But it's nevertheless true that $\liminf_{x\to \infty }f=0$.
Comment: $$\sum_{n\geq 1}\exp\left[-n^4(x-n)^2\right]\in L^2$$ but for any $n\in\mathbb{N}^+$ we have $f(n)\geq 1$.
Comment: Is this function differentiable?
Answer: Let $f =\sum\limits_{n=1}^{\infty} nI_{(n,n+\frac 1 {n^{4}})}$. Can you see that this is a counterexample?


How are Guild rewards distributed?

Question: I've been trying to find out the distribution criteria (if it's known) of the rewards in Guild Battlegrounds for the Guild members.
Meaning: if the Guild's reward at the end of the Battlegrounds is 30 fragments of (for instance) the Statue of Honor, is every Guild member getting the same amount of fragments? Even though they made 0 points?
I've tried making 0 and 1 points in 2 different Battlegrounds and the fragments reward I received was the same, a smaller portion of the Guild reward (it was about 30 fragments in the first case and I got 9, and 23 fragments in the second case and I still got 9).
So I guess that there is some sort of cap (or ratio) based on the member's contribution. Does anybody know the specific criteria? I've tried looking it up but couldn't find results.
Edit: I might have made a mistake. It has been pointed out to me that I might have misread the number of fragments assigned at the end of the Battlegrounds. Since the number displayed is always one digit, it's possible that the number shown was "9+" and not just "9". If that's true (I'll verify at the end of the next GBG) I have probably got in both cases the total reward (30 and 23 fragments). Sorry for the mistake.
Answer: I confirm that there's no assignment ratio depending on the member's contribution in the GBG. If a reward is given, everyone gets the same.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).

How are Guild rewards distributed?


How to switch on an AC bulb using arduino as well as regular switch?

Question: I'm trying to build a GSM based AC Power ON/OFF switch using Arduino. I've successfully completed the ON/OFF mechanism using SMS with the help of 240v 100amps relay to control the circuit. Apparently I don't want to disturb the regular on/off switch's operation. I want both of them to be operational. When I'm not at home arduino should be the switch control and the regular one should be preferred while at home. I'm actually a noob in this topic, and want your precious help to solve this issue.
Answer: This can be done (to a certain extent) using a SPDT (Single-Pole-Double-Throw) relay and an SPDT switch.
The basic principle is the same as when you have two light switches controlling the same light (such as on a staircase - one switch at the top and one at the bottom).  The two switches alternate between one of two different paths for the current. When both switches are routed to the same path the light is on.

Both the Arduino and the switch can turn the light on and off at will. The only problem, though, is that the Arduino has no clue if the light is on or off. To know if the light is on you will need some kind of feedback mechanism.  That might be a simple LDR that looks to see if it's light or dark, or some kind of current monitoring system (current transformer, hall effect current monitor, etc) which the Arduino can use to see if current is actually flowing through the lamp circuit or not.
Comment: You could hook the (or another) switch up to the Arduino, so you have total control over what effect the switch will have. So that switching it on/off twice , fast, will enable disco mode ;p (perhaps you can find a better use, but yeah.)
Answer: A safer approach is to optically link the Arduino to an IR remote control light switch.  Such an approach is discussed in this thread. The technical specifications appear to be here for the Lutron light switch remote controls.  From this document one could construct an Arduino IR transmitter to send out these code.


Isekai manga where the hero moves to another world and encounters a girl from his world that turns out to be his dad

Question: I remember a manga where the hero moves to another world. He encounters a girl who works in a restaurant whom he suspects is from his world. The hero is surprised by the food there. He approaches her and discovers that she is his father (the father is in the body of the girl).
Answer: Perhaps this is Isekai Shokudou. I see some points identical to this.
It sounds like Ep 12 of Isekai Shokudou (I haven't read the manga).

There are 4 heroes who defeat the Devil King. But 1 of them got isekaied in order to defeat the devil.
1 of them enters the restaurant (which connects two worlds every Saturday).
He meets the owner of the restaurant (son of the female Hero Koyomi who got transported 50+ years ago).
There is 1 girl working there and 1 dragon lady both from the same world (like the hero) who come to do maid job every Saturday.
The manga is about food. Every customer was impressed by it.
Comment: No, not the one I'm looking for.


HTML editing with preview

Question: Editing html is good but I really would like to have a way of fast previewing the changes that I made. Is there e.g. a script to open Chromium or refresh a site for that?
Comment: Look for impatient-mode
Answer: You have some options: http://wikemacs.org/wiki/Markdown#Impatient-mode the best for html looking to be impatient-mode, it allows to see the changes in your browser while you type.
After intsallation (in melpa) it is just a matter of
M-x httpd-start

and
M-x impatient-mode

and then open your browser to http://localhost:8080/imp/
Comment: This seems to mirror what i see in emacs. I expected my browser to display the rendering of the html document that I am editing.
Comment: It is supposed to. Now testing I see a "forbidden" message. Maybe new browser policies prevent it from rendering. I'd like someone to confirm it still works on FF >= 83.
Answer: You have many options depending on tools you use and setup you want. The first one does not need anything to be installed:

M-x browse-url-of-buffer
https://github.com/skeeto/skewer-mode
https://github.com/skeeto/impatient-mode
https://github.com/yukihr/Warp

HTML editing with preview


How to Disable Save and Save As using VBA

Question: I am writing a macro and I need to disable the save function on the workbook that VBA has copied and pasted all the information into. Is this possible?
Answer: You can use the Workbook_BeforeSave event to achieve this, disabling the CommandBars won't stop your users using a shortcut such as CTRL + S.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    MsgBox "You can't save this workbook!"
    Cancel = True

End Sub

Comment: Just to note that the proposal by Francis must be saved in VBA in design mode because this piece of code works so perfect that it doesn`t allow to save itself :-)
Comment: This is the more appropriate answer.
Comment: This is more reliable than using the answer marked as answer.
Comment: How do you save this code, once it in place. Because if you click save it is cancelled
Comment: @TomHanson too late, but as user2249468 mentioned, you can go to Design Mode and save it http://www.addintools.com/documents/excel/where-is-design-mode.html
Comment: Neither this nor the accepted answers do work for my Excel 2010 WinXP 32bit :(
Comment: I don't know why but my Office 2010 ignores Cancel = True and accepts Cancel = 1
Answer: You can use the Application object to access the toolbar buttons directly:
Private Sub Workbook_Open()
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save As...").Enabled = False
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save").Enabled = False
End Sub

Answer: One more side note; I had difficulties with the above codes because my organization uses HUNGARIAN version of Excel.
So in case you use NON ENGLISH EXCEL you must specify the Controls elements in your Excel's local language ... in my case what worked was:
Application.CommandBars("Worksheet Menu Bar").Controls("Fá&jl").Controls("Menté&s má&ské&nt...").Enabled = False
Application.CommandBars("Worksheet Menu Bar").Controls("Fá&jl").Controls("Menté&s").Enabled = False


From Euler angles to Rotation matrix Staubli

Question: I want to know the transformation matrix between End effector and Robot base (FK). Staubli gives me x,y,z and Rx,Ry,Rz. Those three Rotations are Euler angles? How could I transform those Euler angles to Rotation matrix? What convention of Euler does Staubli use? It should be R = Rz(φ)Ry(θ)Rx(ψ)?
Comment: I think those Rx, Ry & Rz angles are basic rotations.  The rotation around the x axis, y axis & z axis respectively. Staubli is just a textile company, correct?  Why would they use anything but common Rotation Matrix math?
Comment: Staubli is also a robot manufacturer
Answer: Consider using elemental rotation matrices as defined on this wikipedia.org page:

... then substituting the angle into the trigonometric functions in the matrix and finally cross multiplying the X, Y & Z matrix with the rotation matrix. For example to rotate a vector [1, 0, 0] 90 degrees about the Z axis perform the following calculations:


Want to transfer a Minecraft profile to another Microsoft account

Question: I bought Minecraft for my son a few months ago, using my Microsoft account to set it up.  He has since established a profile and has built a lot of stuff, which he understandably wants to hang onto.  He now wants me to play with him, which (from my understanding) would require me to buy another Minecraft license and set up my own Minecraft profile.  My question is: how can I transfer his Minecraft profile from my Microsoft account to his newly-established Microsoft account?  Thanks in advance!
Comment: do you mean *purchases* or do you mean *worlds*. to my knowledge you cant for purchases(including the game), but worlds aren't tied to accounts.
Comment: What platform are you playing on? PC, a console (if so which one? Xbox, PS4, Switch), or mobile device?
Comment: @Penguin on win 10 edition yes. but thats not what the question asks
Comment: @Penguin i know
Comment: @Penguin thats because your comment was about a completely different thing than the poster asks about, as stated in the comment
Comment: @Penguin you are saying purchases are available cross platform, that is *not the same as transferring between accounts*
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/119346/discussion-between-topcode-and-penguin).
Answer: As stated in another answer, you cannot transfer profile stats, however there are two accounts used in Minecraft on Windows 10. #1 is the Windows Store MS account you have signed in on your PC to purchase Minecraft. #2 is the Xbox/Windows Live account you used to sign in once Minecraft is launched. In your case, you used the same account for both purposes. On a different PC, you can download Minecraft with your Windows Store MS account, but create another Microsoft account for your kid. I suggest creating a proper child account that you can manage to protect them online. Check this link for instructions: https://support.microsoft.com/en-us/account-billing/what-is-a-microsoft-family-group-b6280c9d-38d7-82ff-0e4f-a6cb7e659344
The application license is tied to the MS account used on the Windows Store. It doesn't appear to be applied to the PC itself, so in my case, me and 2 kids play using the same application license, but different online accounts. I'm not sure if that is intended to work that way or not.
Answer: Ok so im going to take it as you are asking if you can transfer worlds? If so, yes you can download it onto a USB drive or onto another computer directly (Or Mobile), if your asking if you can transfer your skin, its possible but I dont know how you would do so other than to remake the skin in a skin creator. If your asking if you can transfer your profile stats  (Kills, Deaths, Worlds Completed, ECT.), No I dont think you can.
Comment: Thanks for answering and pardon my ignorance on terminology and general knowledge as I am new to this.  Good to know about transferring worlds.  So, he would need to get a new license and set up a new profile, and then we could transfer the world over to his machine?
Comment: @ClayWiddifield Yes. If you are playing on PC or Mobile, you can just buy Minecraft again, and transfer worlds. Theoretically, if you are on mobile (and maybe PC), you just need to sign in with a different Microsoft account, but I can not confirm that.
Comment: @ClayWiddifield No problem man. I like helping out the community! If you have any more questions regarding minecraft, Dont be afraid to ask me.


PCP is decidable over the unary alphabet

Question: Show that the Post Correspondence Problem (PCP) is decidable over the unary alphabet ? = {0}.
Comment: We don't always answer questions like this, which show absolutely no effort, but it seems you were lucky this time.
Answer: I will use the following formalization: A PCP-instance is a set $X = \{(a_1, b_1), ..., (a_n, b_n)\}$ where $a_i, b_i \in \Sigma^\ast$ where $\Sigma = \{0\}$ is our alphabet (note that thus every $a_i, b_i$ is of the form $0^k$). Such an instance is a yes-instance if there exists a finite sequence $I \in \{1, ..., n\}^m$ such that $a_{I_1}...a_{I_m} = b_{I_1}...b_{I_m}$.
Now, obviously, if there exists a pair such that $a_i = b_i$, then we have a yes-instance and if $|a_i| < |b_i|$ (or, by symmetry, $|b_i| < |a_i|$) for all $i$, then the instance must be a no-instance. Otherwise, there exist $i \neq j$ such that $|a_i| < |b_i|$ and $|a_j| > |b_j|$ and note that the problem now boils down to finding $k_i, k_j \in \mathbb{N}$ such that $k_i \Delta_i = k_j \Delta_j$ where $\Delta_i = |b_i| - |a_i|$ and $\Delta_j = |a_j| - |b_j|$. But this equation clearly has a solution for all $(\Delta_i, \Delta_j) \in \mathbb{N}^2$ by simply choosing $k_i = \Delta_j$ and $k_j = \Delta_i$, giving us that
$$ a_i^{\Delta_j} a_j^{\Delta_i} = b_i^{\Delta_j} b_j^{\Delta_i} $$
as $|b_i^{\Delta_j}| - |a_i^{\Delta_j}| = \Delta_j (|b_i| - |a_i|) = \Delta_i \Delta_j$ and $|a_j^{\Delta_i}| - |b_j^{\Delta_i}| = \Delta_i (|a_j| - |b_j|) = \Delta_i \Delta_j$ and thus,
$$
\begin{align}
|a_i^{\Delta_j} a_j^{\Delta_i}| - |b_i^{\Delta_j} b_j^{\Delta_i}|
&= |a_i^{\Delta_j}| + |a_j^{\Delta_i}| - |b_i^{\Delta_j}| - |b_j^{\Delta_i}| \\
&= (|a_j^{\Delta_i}| - |b_j^{\Delta_i}|) - (|b_i^{\Delta_j}| -|a_i^{\Delta_j}|) \\
&= \Delta_i \Delta_j - \Delta_i \Delta_j\\
&= 0
\end{align}
$$.
Hence, it suffices to check whether there exist $i, j$ such that $|a_i| \leq |b_i|$ and $|b_j| \leq |a_j|$ (output yes if this is the case and no otherwise) and it follows that the PCP over unary alphabets is decidable.


XPage Link URL does not work in Notes Client

Question: I added a simple link to a sample xpage to open a web URL (sample: Google).
The code work fine when I open the Webpage in a web browser but acts differently when I open the Xpage in the Lotus Notes Client. It only sends a blank screen and did not open the site. Any fix, suggestion or work around to make the behavior act the same way in both Notes Client and Web Browser?
Answer: I guess you are creating your link in a not right way.
Let's do the following.

Create a test xpage
Open XPage controls via menu: Window -> Show Eclipse Views -> Controls

Now, select a "Link" control and drag it to the Xpage body

Set the "Link" control properties:

Make sure, you have set "Project - Build Automatically"

Save the page and open it in the client and in a browser.
Comment: Rafael, I was able to make it work using the advice from Mark Leunsik's blog: http://linqed.eu/2012/08/13/send-a-serverside-redirect-to-a-new-window/. I skipped the checking of my client setting as it would be hard to predict what other users in my company has, so I was searching for a solution regardless of the notes client setting.  This issue has been fixed.
Comment: Nope. I am well versed using the steps you suggested and it worked fine using firefox / chrome or any other browser. What I am trying to do is open the xpage in Notes Client and the link just wont behave like it did outside of Notes.
Comment: In this case take a look at your Notes client settings. Do you have this problem on different computers with different Notes clients ?
Comment: Already tried using 3 computers and it just opens a blank page.
Comment: What Lotus Notes version do you use ?
Comment: @MarkAnthonyAdriano also, what is set in your Notes preferences related to `Web browser`. My settings: http://i.imgur.com/5q7a3GM.jpg
Comment: @MarkAnthonyAdriano Ok, I am glad you have resolved the issue :)


Editing photos to improve quality

Question: I took this photo below and edited it a little. I didn't know where the lightning would hit so the lens was pretty wide. Since the lightning hit so far away, I scaled it up and blended it with the rest of the image so it looks closer, but I'd still like it to fill the frame more. I'm afraid if I try to scale it up any more, the poor quality will be apparent. Is there anything I can do in photoshop to improve the quality? I also accidentally took it as a jpeg, not raw, is there anything I can do to remove the jpeg artifact? By the way, my end goal is to print this picture.
Answer: First off, I'd be very cautious about some of the things you have already done.  Some of the editing you previously completed could have been done in a way to reduce the overall image quality.  For example did you work within a TIFF file for all of your editing or did you save a few different versions of a JPEG?  In addition the fact that you already scaled up the lightning portion of the image is a bit worrisome to me, as it leaves me wondering if that rescaling also caused loss of detail and introduction of artifacts.
Secondly, no - you cannot add quality to an image you already captured.  If you took a very low resolution image, there is nothing in photoshop that is going to be able to regenerate new pixels that aren't there to begin with.  What I would advise is:

Ensure that your editing workflow is keeping in mind the fact that you want to hold on to every last bit of quality along the way (work with TIFF for example)
Apply sharpening as your final step before exporting to print
Print at a size appropriate for the final image dimensions
Let your print lab scale up the image if you desire blowing it up, since they have software designed specifically to do this well and they do it often
Keep in mind that most images printed on a wall are not created so that someone can inspect the image up close from a few inches away
Comment: I save my work as a psd. When I'm done, I save a copy as a jpeg
Comment: And one small point to add to dpollitt answer. Use whatever is possible 16bit TIFF (or PSD) to have bigger range of values and not lost much quality
Answer: First, crop it so the lightning is off-center to make it more interesting. You might use the Rule of Thirds or some other amount to offset the subject.
Second, the amount of enlargement depends on the intended use. A rough guide is that ~300 dots [pixels]/inch (dpi) (~120 pixels/cm) produces an acceptable image, though some top-grade printers may be capable of 2,400 dpi. So if you're working with a 12,000,000 pixel image, perhaps 3,000 x 4,000 pixels, a print might be 10" x 13" (25 cm x 33 cm) before the dots become noticeable. But you're the judge. Consider that pointillists made a living from "grainy" images.
Comment: Be careful when talking about dpi for a printer: usually the resolution of a printer counts the number of ink droplet (or equivalent in another technology), which is either present or absent (i.e. 1 bit per color). You need a lot of them to render all the scale between white and black. OTOH, when counting the resolution of the image, one counts the number of pixels with something like 24 bits per pixel, i.e. each pixel can already render all possible colors. I'm pretty sure your 300 dpi refers to the later and 2400 dpi refers to the former.

Editing photos to improve quality


Getting feature at point in C#

Question: I want to get the feature at where mouse was clicked in map. So I was wondering how to get features which intersects with that point. Plus I was wondering how can I check what type of object it is (point, poly-line, polygon) ?
Comment: Where are you currently at? The first step is to acquire the shape of the clicked map point. Is your project an Add-in or a COM tool?
Comment: I don't know exactly difference, but I think it's COM tool. Well at this point I only managed get point object which represents clicked space. I thought that I didn't need to get shape as there should be function on some object which would get all objects which intersects with clicked location.
Comment: Were abouts are you having the problem? Please post some code of where you're up to... you should be in the OnMouseDown event, have you done DisplayTransformation yet?
Answer: To select from the map using the current selection environment (you can turn off selectability and visibility of layers then this wont pick them up.
Firstly you need to be creating a tool:
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Geodatabase;

namespace RED
{
    public class REd : ESRI.ArcGIS.Desktop.AddIns.Tool

Then in the OnMouseDown event of the tool:
protected override void OnMouseDown(MouseEventArgs arg)
{
    //if (arg.Button == System.Windows.Forms.MouseButtons.Left) // check for left mouse button if you like
    // convert point from 'screen' to 'map' coordinates
    IPoint MouseMapPoint = (ArcMap.Document.FocusMap as IActiveView).ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
    // clear selection first
    ArcMap.Document.FocusMap.ClearSelection();
    // Select using the shape (point) to
    // select the feature(s) - false to select any intersecting, true to select just the first
    ArcMap.Document.FocusMap.SelectByShape(MouseMapPoint,(ArcMap.Application as IMxApplication).SelectionEnvironment,false);
    // get the (now) selected features
    IEnumFeature EnumFeatures = (IEnumFeature)ArcMap.Document.FocusMap.FeatureSelection;
    IFeature ThisFeature = EnumFeatures.Next();
    do
    {
        // get the geometry
        IGeometry ThisGeom = ThisFeature.ShapeCopy; // IMPORTANT! USE SHAPECOPY not SHAPE
        // do something different for each geometry type
        if (ThisGeom.GeometryType == esriGeometryType.esriGeometryPoint)
        {
            // something for points (note: does not include multipoint)
        }
        else if (ThisGeom.GeometryType == esriGeometryType.esriGeometryPolygon)
        {
            // something for polygons
        }
        else if (ThisGeom.GeometryType == esriGeometryType.esriGeometryPolyline)
        {
            // something for polylines (note: polylines are different to lines)
        }
        else
        {
            // unrecognized geometry type
        }
        ThisFeature = EnumFeatures.Next();
    } while (ThisFeature != null);
}

Which works fine for selecting using a point... this will have problems when trying to select a point or line so to counter that use an increased search buffer (polygon) to make the selection:
// to increase the search

    IGeometry selectionGeometry = (MouseMapPoint as ITopologicalOperator).Buffer(SmallDistance); // make a buffer
    ArcMap.Document.FocusMap.SelectByShape(selectionGeometry, (ArcMap.Application as IMxApplication).SelectionEnvironment, false);

Read about IMap.SelectByShape, IEnumFeature, ITopologicalOperator and Esri Geometry Type Constants
Normally I don't do it that way - the selection environment gets in the way so I use IMap.Layers to iterate through each layer then with an ISpatialFilter make a selection against each layer... that works even if the layer is invisible and/or not selectable.
Comment: Thanks, I wouldn't have thought of the idea to use selections like that
Comment: No worries Vilius. I usually create objects for the focus map and others (*IMap thisMap = ArcMap.Document.FocusMap;*) to make it less wordy (then it's *thisMap.ClearSelection();* instead of *ArcMap.Document.FocusMap.ClearSelection();*); I have left it as the default objects to show the relationship/inheritance.

Getting feature at point in C#


Shift a lat/lon coordinate based on a distance and direction?

Question: I have a coordinate in (lat/lon). I want to find a new coordinate shifted from this point by 'x' meters in the direction given by a compass bearing (degrees). The distance offset I am hoping to calculate will be fairly small, anywhere from 4-10 m, so I will need a fair amount of accuracy.
Comment: What software are you using?
Comment: Your title and question don't quite tally, the title suggests moving a coordinate, the question is about find a new coordinate.  What software or programming language are you using?   If you were using QGIS you might find the Azimuth and Distance Plugin will do want you want ~ a new coordinate from an existing coordinate based on compass bearing, distance, and dip
Comment: The formal name for this the Direct (or Forward) [Geodetic Problem](https://en.wikipedia.org/wiki/Geodesy#Geodetic_problems). Different software packages have different tools to address it, so you need to [Edit] the question to specify the software you are using.
Comment: Does this answer your question? [Calculating Latitude/Longitude X miles from point?](https://gis.stackexchange.com/questions/5821/calculating-latitude-longitude-x-miles-from-point)
Comment: Because the distance is so small, *relative to the distance* you can get by with rather poor accuracy.  For instance, if your calculation is accurate only to four decimal places, the new coordinates will be correct to better than one millimeter (relative to the base coordinates, of course).  The simple method I describe at https://gis.stackexchange.com/a/25883/664 will be more than good enough.
Answer: This is an interesting question.
The simplest approach is a numerical integration -- divide the path up into 10 meter segments, for example, and use a simple approximation for each point.
consider:

the change in latitude is the sine of the heading (90 deg == north) times the distance times the conversion factor from distance to radians (π / 20000 km).
calculate an average value of cosine over he interval.  A simple approximation is the cosine of the average latitude.
the change in longitude is the cosine of the heading (0 deg == east) times (π / 20000 km) divided by the cosine.
check to make sure you didn't cross a pol (cosine of the latitude < 0).  If you did, then it's an error.  There's no such thing as heading north from the north pole.

Do capture the whole distance in one shot is extremely challenging mathematically, however, since consider a route heating 5 degrees north of east from 1 mm north of the south pole to 1 mm south of the north pole.  It will be a spiral of increasing, then decreasing radius.
Comment: Actually geodesic functions capture the whole distance (short of antipodal distance, of course) quite easily. Iterative application of the Vincenty equations is part of every library that implements the Direct/Forward solution.
Comment: That's very interesting -- I looked up the iterative Vincenty equations on Wikipedia and they are fairly complex, and are still just an approximation.

To test my very simple algorithm, I calculated the result of starting at (0, 0) and moving northeast for 10000 km.

coordinates listed as latitude, longitude:
5000 points: 63.6396103067921 83.17349983439119: reference
1000 points: error = 1.4 meters
200 points:  error = 37 meters
10 points: error = 14.7 km

The error is inversely proportional to the square of the number of points.  So it comes down to more iterations vs complexity.
Comment: The type of path that you calculate here is called a [rhumb line](https://en.wikipedia.org/wiki/Rhumb_line) (loxodrome), a path with constant bearing, which is very different from a geodesic. For the very small distances mentioned in the OP, and away from the poles, the difference should be negligible, but increases quickly when the distance gets longer. A 10,000 km loxodrome starting at (0,0) lands you in northern siberia, while a 10,000 km geodesic with the same start point and bearing will land you in China.
Comment: I was assuming "moving in the direction of a compass bearing" implied following a constant bearing (neglecting magnetic compass issues).  You're right -- if you're going to find a geodesic instead (a "great circle route") then that's different, and is more easily solved.


Visual Studio Code Quick Fix not working

Question: I am using Visual Studio Code to code for an app. I am using flutter to build the app. However, recently I have been unable to use the quick fix option to import files or fix simple errors. Previously I have not experienced this issue. I tried doing a clean re-install of VSC (and the plugins as well) but to no avail. Does anyone know how to fix this? Thank you so very much!
Comment: I am sorry I don't know what you mean by hand but if you mean like i tried to solve it not through the command line / shortcuts then yes (ie i uninstalled the extensions one by one then the whole software itself - although it did say preferences wouldn't be removed.)
Answer: I have the same problem when using the mouse to select a quick fix.  Instead of using the mouse use the keyboard:

Place the cursor on the error.
Press Ctrl + .
Use the keyboard to select your fix.
Comment: Thank you very much! It is a good temporary fix - i am more accustomed to using mouse when doing this kinds of quick fixes. So hopefully a fix is around the corner. But thank you for this option too!


ArcMap shutting down when I add rasters to a mosaic in foreground processing

Question: I'm trying to add rasters to a mosaic - I was initially trying to do this by background processing but I was receiveing an error - I've followed the advice of this article (http://support.esri.com/en/knowledgebase/techarticles/detail/38695) (turning off background processing/turning off the option to add geoprocessing results to the display) but I still can't get it to work - now instead of returning an error message ArcMap just shuts down with no warning.
Comment: You're experiencing a 'really bad crash'. Because BG is a separate process, when it crashes you don't lose ArcMap. When you turn BG off, ArcMap runs the tool and crashes. Which version are you running? I show the bug in the KB as fixed in 10.0sp2. If you're using newer than that it could be a new bug, probably data specific.
Comment: Ah, that makes sense. I'm running 10.2.2 so I guess it might be a new bug.
Comment: Besides the workaround suggested in the answers, I can only suggest logging a support ticket and submitting the data (if thats an option for you) so we can try to fix it.
Answer: using Arcmap 10.1
you can use an alternative option:

add your all geo-refed raster in a new arcmap
define the projection properly in the data frame properties
Go to windows menu and click on image analysis.
In image analysis tool select all your rasters and click on mosaic button present in a window below named "processing".
A temporary raster add in table of contents, finally export it in tif or img format because you have 16bit data.


Furnace not working after installing nest thermostat

Question: I installed nest thermostat without turning off power to furnace.  Blower kicks on but not furnace. Is there anything I can do?
Comment: Can you post photos of the wiring at both ends and of the wiring diagram of your furnace please?
Comment: Call a service person and see what you shorted out/did not connect right.  Just because it is low voltage and won't hurt you too bad, does not mean a short will not burn out a control board.
Comment: "Blower kicks on" ... when you do what? And what did the Nest say at first start up and going through the setup? If it didn't even make it that far, then yikes... Put the old Tstat back... does it work?
Answer: Hopefully there are fuses on the control board for the furnace, and hopefully one of them is blown.  If you're comfortable opening the case of your unit (after turning off all the power), look around for some removeable fuses and test them.  If you don't find any that are blown, or can't find them at all, then its probably best to call in a pro.
Best case - $2 fuse, worst case - $$$ on a control board.
Comment: Pretty sure with a blown fuse it will do absolutely nothing.
Answer: A typical furnace attached to an air conditioner can turn on the blower independently of the furnace. This allows for the blower to be on when used with the air conditioner, and it also allows for "fan on all the time". So this may just be wires in the wrong places, but could be something much more serious.
Pictures and other details about the furnace and the thermostat would help. Keep in mind that while there are some fairly standard color codes in use for thermostat wiring, they are not always followed. If a couple of wires were connected previously without following the usual color coding and then you connected them to the Nest based on the usual color coding, things won't work quite right.
Comment: Guessing you're already aware of this, but in case you and other readers are not: Nest setup should walk you through entering what colors your wires are and what terminals they're connected to on the old thermostat, which tells it 1) whether it's compatible with your system and 2) where to put each wire on the new thermostat. Setup guide also tells you to label each wire (and box provides labels) so you're not dependent on wire color.
Comment: @FredricShope I know that. I also know sometimes people look at colors and disconnect from the old without looking at labels on the old thermostat do if it was wired non standard with the old one it won't work so easily with the new.


Eclipse class navigation in package/navigator explorer

Question: Is there a plugin in eclipse where when i switch on a open class on eclipse, it will highlight that class name in package explorer or navigator. So i don't want to manually check the package declaration and explore it in package explore or navigator?
Answer: first you should check which version of your eclipse, if you version is Java EE dev, then it has this function. just click the button which is 2 arrows that in the top of package explore or navigator, then you see when you change the file in editor, then the package explore or navigator explore will focus on the file that you select in editor.
Answer: Not automatic but you can use Alt-Shift-W to open "Show in..." giving you options to show it in either Navigator, Package Explorer, etc.


How can I convert between EU, MJ, and Blutricity?

Question: I have RedPower, BuildCraft and Thermal Expansion, and IndustrialCraft. Unfortunately, these all use different forms of energy. Is there a way to convert between the three forms of energy?
Answer: It's possible, but not directly (unless you're using the Ultimate or YogCraft pack.)
In the Direwolf20 and Mindcrack packs, you can easily convert EU to MJ and BC to MJ using the Electrical Engine and the Blulectric Engine respectively. You can convert MJ to EU by using engines (of any sort) connected to a Magma Crucible, which is fed by either cobblestone or netherrack. This produces lava, which can be pumped into a geothermal generator to produce EU. Unfortunately, there is still no way to convert to Blutricity, although the developer of Redpower says it will come in a future update.
In the Ultimate and YogCraft pack there are Power Converters. This allows much easier conversion. The above trick using the Magma Crucible still works.
Comment: Also, there is a blulectric engine, which can convert blutricity into MJs. As for creating blutricity, I don't know.
Answer: It depends on what pack you're using.

In the Direwolf20 and Mindcrack FTB packs, not really, no. The Electrical Engine is powered by EU and outputs MJ, but the reverse isn't possible. RedPower2's own Blutricity Engine also generates MJ, but nothing converts to Blutricity.
In FTB Ultimate you have the Power Converters mod available. It provides a set of blocks that can be configured to convert between EU, MJ, Volts/Amps/Watts (Universal Electricity), Steam, and Charge (Factorization). There is still no way to convert to Blutricity, however.
Comment: Darn. That kind of sucks
Comment: You can convert from blutricity to MJ by using a blulectric engine, but there is no way to convert anything other power to blutricity
Comment: @Steve That's right! I forgot about those.
Answer: There is a way to convert RF/MI into EU in FTB DIREWOLF20
If you charge power armor in the energetic infuser and discharge it in a MFSU. You can automate it with tesseracts/BC pipes/Itemducts


Stress in a sentence. Is "some" a determiner in "Get some sleep"?

Question: As far as I know determiners are not stressed as long as we don't need special emphasis. Am I right? If we don't need special emphasis we only stress the content words "get" and "sleep". Am I right?
Comment: +1 - *BUT* can you wait at least a couple of days before selecting an answer please old bean!
Answer: Yes. With no special stress, the word "sleep" would carry the most emphasis. "Some" would be entirely unstressed. A more visual representation might be:

GET some SLEEP.
Answer: Indeed, without special emphasis determiners are normally not stressed. The word some is an indefinite determiner here.
In terms of stress, sleep would normally get the primary stress and get the secondary stress. This means that sleep will be stressed slightly more than get.
Answer:
/ˈgɛʔ sm ˈsli:p/

Determiners
Most determiners don't usually take stress in normal, unmarked speech. For example, the articles a and the are very rarely stressed. The same is true of the indefinite determiners some and any. Many words in determinative function do take stress though. One example is numbers. So in the phrase:

Two sugars, please

both two and the first syllable of sugars will usually be stressed.
Get
The verb get is often described as an 'empty' verb. This is because it often has very little meaning of its own. In get passives for example, GET seems to have an auxiliary like role, almost. In other sentences such as:

Ben got an email

GET will also not be stressed. It doesn't give us much specific information here.  In the example above we would expect Ben and the first syllable of email to be stressed, but not the word stressed.
However, in the Original Poster's example, GET is the main verb in an imperative construction. We normally expect the main verb in an imperative to be stressed (although not necessarily, especially with the verb BE). In the phrase:

Get some sleep

we would normally expect the verb get and the lexical noun sleep to take stress. The word some would not be stressed in a normal, unmarked version of the sentence. Because there is a noun following the word some here we would expect to see the weak form /sm/ or perhaps /səm/ here. We would definitely not expect the strong form /sʌm/.
Prominence
In terms of the overall sentence, the word sleep will get the nuclear tone because it is the last content word. It may therefore be perceived as the most prominent syllable in the utterance. However, it is also perfectly possible for the word get to be the loudest or highest pitch syllable here in the onset position. The imperative construction here makes this even more likely. It depends on the context of the utterance.
Pronunciation note:
When followed by a noun the word some will usually be unstressed and weak. When we see the word some without a following noun, as in the sentence:

Do you want some?

... the word some will still be unstressed, but will have a full vowel. In other words the strong form, /sʌm/, is required.


Command to measure TLB misses on LINUX?

Question: Could some one direct me to a command to measure TLB misses on LINUX, please? Is it okay to consider (or approximate) minor page faults as TLB misses?
Answer: You can use perf to access the hardware performance counters:
<code>$ perf stat -e dTLB-load-misses,iTLB-load-misses /path/to/command
</code>
e.g. :
<code>$ perf stat -e dTLB-load-misses,iTLB-load-misses /bin/ls > /dev/null

 Performance counter stats for '/bin/ls':

             5,775 dTLB-load-misses
             1,059 iTLB-load-misses

       0.001897682 seconds time elapsed
</code>
Answer: A minor fault and a TLB miss are not good analogues. A minor fault occurs when a requested page is in memory but is not mapped in the current page table. It would certainly be the case that a minor fault will be associated with a TLB miss (as the TLB entries are shortcuts to page table entries) but TLB misses will be caused by many other things eg hard faults, or a transition in a program's locality.
Answer: Minor page faults occur when the page is already loaded in memory, but the associated page table entry is not yet created. As a side effect, minor page faults always incur TLB misses. On the other hand, a TLB miss occurs when the the translation entry for a page is not residing in the TLB (which is a cache), which may happen when that TLB entry had previously been evicted due to the limited capacity of the TLB.

Command to measure TLB misses on LINUX?


How to apply Newton's method on Implicit methods for ODE systems

Question: I am writing a Fortran program to solve any ODE initial value problems. There is a subroutine called Jacobian matrix and for different problems it is required that we just make changes to the subroutine such that all types of problems can be solved. The first step is to transform any high order ODEs to the first order ODE system. The next step is to use the implicit method, e.g. backward Euler method, to solve it. The question I have is how to use Newton's method on the implicit method? Especially what the Jacobian matrix should be?
enter image description here
enter image description here
How to use Newton's method to solve this ODE system? Anyone can give a detailed example? I would really appreciate it!
Answer: In Backward Euler, the equation to be solved at each step is
$$x_{n+1}=x_n+(t_{n+1}-t_n)f(x_{n+1},t_{n+1}).$$
That is, you want to find roots of the function
$$g_n(x)=x-x_n-(t_{n+1}-t_n)f(x,t_{n+1})$$
where we interpret $x_n,t_{n+1},t_n$ as parameters. So in particular the Jacobian for Newton's method is $I-(t_{n+1}-t_n)D_x f(x,t_{n+1})$, where $D_x$ represents differentiation with respect to the $x$ variables.
Comment: Thank you it really helps! But I am still a bit confused with the Jacobian part. Would you please explain more for the following example? Given the initial value problem: y"+y'-6y=0 with conditions y(0)=1, y'(0)=0.  If I transform it into system, it will be f1=y'=6y-y" y(0)=1; and f2= y"=6y-y' y'(0)=0; So we use backward Euler to solve these two equations. What would the Jacobian matrix be here?
Comment: @Patrick123 You have not recast the system correctly. The system should be $u'=v,v'=-v+6u,u(0)=1,v(0)=0$. ($y''$ can't be on any right side.) Thus $f(u,v)=(v,-v+6u)$, and then you plug into what I said above.


What exactly is flash sync speed, and should it be a factor in a buying decision?

Question: What exactly is flash sync speed and should it be a factor in a buying decision?
Comment: See also http://photo.stackexchange.com/questions/1615/ for some good answers explaining how this works.
Answer: Flash sync speed is the maximum shutter speed possible when using a flash. For most flashes, the flash sync speed, sometimes also referred to X-Sync speed due to the use of Xenon in the flash bulb itself, is around 1/200th to 1/250th of a second. When using flash, your maximum shutter speed is limited to the flash sync speed. In many cases, this is perfectly adequate, as the flash pulse itself is sufficiently short enough (around 1/1000th of a second), and brightly lights up the scene beyond the normal ambient lighting for a fraction of the time the shutter is actually open. Flash sync speed can sometimes be a limiting factor, such as for action photography, as 1/200th or 1/250th of a second may not be enough to stop some kinds of action being photographed when fill flash is not able to overcome ambient lighting.
Some higher-end camera gear is capable of higher flash sync speeds. Some models support up to 1/500th of a second, which is better for photographing action. There are also alternative flash sync modes for better camera gear and flash gear. Normally, flash is synced with the "forward" shutter edge, and fires when the forward shutter curtain edge has opened and is moving. An alternative sync mode that syncs flash with the "back" shutter edge.  When shooting with back curtain flash, you can produce action ghosting, and freeze your subject at the very end of the exposure, which is sometimes a desirable effect for sports photography. Finally, there is "high speed sync." With this alternative sync mode, cameras may sync to flash at any shutter speed, even up to 1/8000th of a second on top-end models.
High speed sync does have some limitations. With normal flash sync, there is a single pulse of the flash. In high speed sync mode, the flash pulses continuously thousands of times a second. This ensures that the scene is illuminated for the duration that the shutter is open and accommodates the behavior of a camera shutter at such speeds. The drawback here is that to provide enough power for continuous flash pulses, the power of each flash is less, by around 1 stop per stop of higher shutter speed. Additionally, since the scene is illuminated continuously for the duration the shutter is open, the flash itself is not as useful for "stopping" action. This is often not that big of an issue, however, as the higher shutter speed itself is capable of freezing action (particularly at 1/4000th or higher.)
If you don't need high-speed flash sync, any flash supporting a standard sync speed will suffice. If you need to sync flash at extremely high shutter speeds, then you will need both a camera body and a flash that supports high speed sync. You won't be quite as limited with high speed sync, but keep in mind that the power of your flash will be a little less than normal. (Generally, this is not a problem at all, and you can usually open your aperture to compensate...but it is a factor to be aware of.)
Comment: I think this could be improved w.r.t. action; it's leaving out that the duration of the flash is at least as good at stopping action as the shutter.  Sync speed only needs to stop action in fill-flash situations.
Comment: Looks good to me!
Comment: Note that when action is so fast that faster than sync speed shutter is needed to freeze it, there will be [rolling shutter](http://photo.stackexchange.com/questions/9523/4390/what-is-a-rolling-shutter-when-do-i-have-to-be-aware-of-it) artifacts visible because capture time of edges of the frame is still sync speed apart.
Comment: Indeed! Accepted
Comment: And another reason why the Nikon D-40 is still wildly popular. I keep wondering why Nikon did away with that .. perhaps just too much of an unappreciated feature for the intended users of that camera.
Comment: @smillie: Thanks for the comment. I've updated the answer to provide info on flash pulse duration and its effect on stopping motion. Let me know if you think its sufficient. While I understand flash theory, I've done minimal work with flash as most of my work is nature/wildlife and has been during bright daylight.
Comment: One benefit of flash sync speed that has nothing to do with flash is the amount of distortion that you will get with very fast moving subjects.  It is the same as the rolling shutter effect of DSLR video slow sensor readouts, but their effective speeds are much much slower.

I am not sure how much the improvement is, if anyone else knows.
Comment: Excellent answer, but I wish you had also explained what actually limits flash sync speed. Is it just the time the flash takes from the cameras signal to actually firing?
Answer: Short Answer:  Probably not a Factor in Buying Decision
definition:
The sync speed is the fastest shutter speed you can use when using the flash.
It depends mostly on the camera body.
typical behaviour:
Most flashes will sync with most cameras at around 1/250.
Unless you have specialist requirements, they will all perform in a very similar way.
Other factors are more likely to help you decide which flash to buy.
(e.g. price, manufacturer, recharge time, length of flash, controls, remote control, swivel, ...)
freeze the action:
This does not typically affect your ability to freeze the action, because (as @che points out) the flash only lasts for 1/1000 of a second (typically), so for images where the subject is being illuminated mostly by the flash, it will be frozen as though you were using a shutter speed of 1/1000.
Confusing?  I find it a bit confusing, to be honest, but it does all work out logically once you get the hang of it!
Answer: X-sync is the lowest shutter speed during which the shutter is entirely open at some time, and thus allows use of flash. (You don't want it to light just top half of frame.)
X-sync differences don't play that much role in stopping action (flash pulse duration is around 1/1000 anyway), but rather in eliminating ambient (or overpowering sun, if you want) with flash in photos when you have both kinds of light.
If you have a flash-lit portrait outside, you usually want to have the surrounding landscape a bit darker than the person. Now, if you use a full power of your flash, and get proper exposure of foreground at f/8 and ISO 100, out might even get background overexposed at 1/200 sec if it's sunny day. Being able to go to 1/500 might make the shot possible, or allow you to raise ISO to 200 and save some flash power to get faster recycle times.
Sometimes you can kind of "cheat" by using high speed sync which fires the flash multiple times to cover all parts of the frame. This doesn't really help in this situation as it eats flash power you need to have foreground exposed properly.
Comment: Thanks for the exemplified answer, che. But should I take the sync speed into account when shopping around ?
Comment: I sometimes mix flash and daylight, and I can still live with camera that has X-sync at 1/200 sec. I'd think twice about buying something even slower. 1/500 X-sync would be nice, but there are things that matter a lot more to me (such as sensor size, price and weight).
Answer: IMO, it can be a factor in a buying decision, but when/if it is, you'll generally know it ahead of time. That is to say, if you've been running into problems (e.g., when using flash under daylight) and wishing you could get a faster flash sync, then it can certainly be worthwhile to get a body that syncs at higher speed. On the other hand, if you haven't run into a problem, then chances are pretty good that you really don't care.
At one time, X-sync speed was a serious consideration. When most cameras only synced at up to 1/60th or 1/90th, there were quite a few situations where it caused of a problem. The obvious problem arose when you had decent (but not really bright) ambient light. If you wanted, say, 1/500th to stop action, but only had ambient light to support (say) 1/125th, you ended up with problems either way -- if you didn't use a flash, you only get 1/125th, and with it blur. If you did use flash, you could only use 1/60th, so you had to stop down quite a bit and use the flash at (close to) maximum power to overpower the ambient light enough to keep it from leading to "ghosts". Shooting at full power, however, lead to longer flash cycle times, so you were more likely to miss shots as the flash recycled.
Unless you collect relatively old cameras, however, you'll probably get an X-sync of at least 1/200th, which is enough to prevent problems under most conditions. Being able to go higher is sometimes handy, but not nearly as critical.
A few additional bits and pieces, though it's probably more in the range of trivia than useful information for most people:

You can get X-sync at up to 1/1600th of a second on a few cameras (some of the PhaseOne medium format bodies). Flash selection gets tricky though, because to work right, you need a flash with a duration of less than 1/1600th of a second, where many are around 1/1000th, and some studio flashes have even longer duration. This can give some pretty strange effects though -- at 1/1600th, with a decent-sized studio flash, the flash can overpower the ambient light to the point that even shooting in broad daylight, you can make it look almost like you were shooting at night, with the sky and most background relatively dark. You do have to be careful, though, to avoid the "deer in the headlights" look. With care, however, you can help isolate the subject, even (for example) with a background that would otherwise be excessively busy and distracting.
As far as I know, the fastest X-sync with a focal plane shutter was at 1/350th (Minolta Maxxum/Dynax/Alpha 9 and 9xi).
Those same cameras did high-speed sync at their maximum shutter speed of 1/12000th.
The Sony Alpha 9 Mark 3, has a global electronic shutter, which allows X-sync at all shutter speeds, up to 1/80,000th of a second. Since most flashes have a longer duration than that (at least at maximum power), at higher shutter speeds, a flash starts to act like a continuous light source where faster shutter speeds reduce the exposure.

Global shutters will probably become more than trivia eventually, but right now I believe it's only available on the Alpha 9.3, is a bit out of most people's price range (currently just under $6,000 US).
Answer: A higher flash sync speed is useful if you wish to shoot with flash at large appeture (because you want low DoF) but are shooting at a subject that has bright backlight.  A typical instance where this might happen would be a wedding shot with the sun behind the subject.  You want flash because you want to bring up the dynamic range, you want large appeture because you want low DoF, and you have bright light so you want a shutter speed faster than 1/250th.
In this case a camera that can do 1/500th sync speed is a life saver and if you were doing wedding photos for a living I guess you would rely on that for brightlight shooting.
Is it a factor in buying desision?  If your going to want to use flash in bright light (for dynamic range) and low appeture for DoF then YES.  Otherwise NO.
Answer: What is flash sync speed?
The flash sync speed is a limitation that's based on the shutter mechanism of the camera. Generally speaking, flash bursts can be much shorter than the shutter speeds of the camera.  And with focal plane shutters, the shutter speed is determined by the gap between the first and second curtains as they travel across the frame.  At the sync speed, that gap is big enough to leave the entire sensor/frame of film uncovered during the exposure. When you go faster than that, the gap is smaller than the frame, and you'll get black bars where the curtains cover the frame (with dSLRs, it'll be at the top and/or bottom of the frame).  A typical maximum sync speed for dSLRS is around 1/200s.
High speed sync
To get around the limitation of X-sync speed, some camera/flash combinations are capable of high-speed sync (called HSS or FP [focal plane] flash)--the camera and flash communicate so that the flash can send out multiple bursts timed to follow the travel of the gap across the sensor, so that the whole sensor sees the same amount of illumination from the flash.  But this will reduce the power output of the flash by roughly two stops.
High-speed sync becomes useful in two basic situations. (See also: Neil van Niekerk's Tangents post on when to use HSS).

When you're working in bright sunlight and want a thin depth of field, the sync speed limitation can put you in a situation where overexposure is inevitable unless you use neutral density filters or HSS.
If you're in a flash situation where you can't kill the ambient and you need to freeze fast action (if you can get the majority of illumination from the flash, however, the flash burst is probably high enough to freeze the action on its own).

So whether or not sync speed affects a purchase decision depends on the following factors:
Do you shoot flash?
If not, it doesn't matter.
Do you plan to use flash with a fast shutter speed?
If you're never going to use flash for fast-action photography where you can't kill the ambient, or you don't want thin depth of field in very bright conditions with fill flash, then you can probably limit your shooting at or below your sync speed.  Studio shooting, for example, typically doesn't use HSS.
Does the camera you're looking at have a particularly slow sync speed?
1/200s as a sync speed is one thing. 1/160 is another (especially with cheap manual radio triggers that add a delay).  And 1/10s is another.  For example, the Panasonic GX-7 has a very respectable sync speed of 1/320s. With the built-in flash. It's 1/250s with an external flash. And in silent mode, it's 1/10s--so flash is completely disabled with an external flash. These are limitations you would probably want to factor in when deciding whether or not to buy this camera body.
Can your camera body do high-speed sync?
Not all camera bodies can.  So, if, for example, you have a Nikon D3x00 or a Dx500 body, then the sync speed takes on more importance, because those bodies don't do HSS/FP, so you'll never get above that x-sync speed with flash.  The GX-7 I mentioned above can do HSS with a four-thirds HSS-capable flash.
Are the flash and triggers you're looking at HSS-capable in your system?
Not all flashes or triggers do HSS, either. If you're using off-camera flash, then the camera, flash, and triggers all need to be capable of communicating the sync signals for HSS or you'll be limited to your x-sync speed.
Answer: In addition to the other answers about flash, there is something else that can be interesting, and it is not related to flash use :
x-sync speed is also the time difference between the top and the bottom of your picture. Even if you use the fastest speed (1/8000 for example), there will be 1/400 of seconds (More or less depending on your sync speed) between the capture of the opposite side of your frame.
This is not much, but on some fast-moving subjects (The one you are going to need the fast speed in the first place), this can lead to some rolling shutter effect.
Using the numbers I cited earlier, this effect will be 20 times more important than the motion blur. A sport car going at 180 km/h will have move 6 mm in the 1/8000th of second, giving no noticeable motion blur, but 12.5 cm in the 1/400th, which will really lead to oval-looking wheel.
Conclusion :
If you do high-speed day-light photography, flash sync speed can be a factor in the buying decision.


Are the feelings always a noun?

Question: Are feelings always a noun? For example, "headache" or "nausea". Why I am asking this question is because I always have a problem with countable and uncountable nouns. First job is identify the nouns. Thus, I am asking is feeling a noun always.
Comment: The *feeling* in *I'm not feeling well* is not a noun.
Comment: A word that can be replaced by he/she/it is a noun singular and a word that can be replaced by they is a noun plural. And you can place the article before a noun  (in most cases. It works not so well with proper nouns).
Comment: headache and nausea are not feelings. They are physical states. feelings would be: anger, happiness, annoyance, irritation, etc.
Comment: @Lambie, for someone who is probably not a native English, the word "feeling" can be quite broad, when thinking for examples from his own language and English. In English, physical feelings might be better described as sensations, but it's normal to say "I feel pain." so you can say that pain is a feeling.
Answer: A noun is generally defined as "a person, place, thing, or idea". So a thing that you are feeling or can feel must be a noun, because it is a "thing". So yes, "headache", "nausea", "happiness", "depression", etc, are all nouns.
The state of feeling a certain way is an adjective. So in "I feel nauseous" or "The happy man left the room", "nauseous" and "happy" are adjectives.
Comment: You should cover verb usages as well: nauseating, saddening, angering, etc.
Comment: Well, okay. Sure, there are verbs for some things that cause a feeling. Like you say, "His actions angered me" or "The bad food sickened me."  Note that "nauseating" is most often used as an adjective, as in "That movie was so bad it was nauseating." I think we usually say that something "made me feel X" or "made me X" rather than "it Xed me". For example, we say, "That made me happy". No one says, "That happied me."
Comment: True and valid point.
Answer: "Feel" is a verb. It's present participle is "feeling", as @Damkerng T. mentioned in the comments.
However, "feeling" is also the noun. It is countable.
Here are some examples of its usage:

I have a feeling tonight's going to be a good night.
It's an uncomfortable feeling, knowing that it could all be over soon.
I hate feelings of pain; headaches, nausea etc.
Answer: I couldn't resist citing this welll-known phrase:

I have a bad feeling about this

(just to make an example of feeling used as a countable noun)
Answer: The question asks about feelings, which may refer to:

Normal body sensations, like warmth and sleepiness
Feelings as symptoms of a disease, like a headache and nausea
Heart feelings or emotions, like joy, peace, fear or anger
Certain mental states, like confidence, uncertainty

A noun is a word that refers to a person, place, thing, event, substance, or quality (Cambridge Dictionary). You can say that a feeling is a quality, so, in general, all feelings as independent words are nouns.
Most body sensations, emotions and mental states are uncountable. You don't say warmths, joys, angers or confidences. Still, some can be countable, for example, "I have a fear of driving." or "I have many fears."
Feelings as symptoms of a disease may be countable or not, which depends more on the  usage of the articles in medical terminology rather than on grammar.
Example of countable symptoms:

I had a headache/frequent headaches, a fever/frequent fevers, a pain/frequent pains.

Examples of uncountable symptoms:

I had nausea and jaundice.

Some symptoms end with -ing, but they are still nouns, like itching or bloating.
And of course, you can express feelings as adjectives: happy feeling, painful arm, etc.

Are the feelings always a noun?


Maintaining legacy code

Question: I have an old codebase that still "works" but is difficult/nearly impossible to maintain. It may be expensive (time and money wise) to update it. Do I just go for it, or should I continue to hate my world (but continue working on something that works and is relatively bug-free)?
Comment: What language is the codebase?
Comment: Without specifics of the site, I think this is not a real question, and I've voted to close as such.
Answer: If you see a future in your site please rewrite it as soon as posible if it's not maintainable. I maintain several +5 year old big sites and in the time I've spend cursing on the stupid problems that came from it I could have rewritten them all. Do yourself a pleasure and rewrite it, it's more fun to build something new as well ;)
Comment: Ah yes, all those wasted hours swearing. It makes you feel so much better at the time, though...
Answer: I'm sure it depends on the specific circumstances, but be sure to factor in the extra time you have to spend maintaining your existing codebase vs. the expense of updating it.  Not knowing more details, I'd say update it rather than struggling with what you've got.
Answer: I agree with @D4V360, there is indeed pleasure in writing something anew. Also, consider the concept of "Technical Debt" that Jeff and Joel have spoken about in their podcasts. Here are some pertinent links on the subject:

Steve McConnell (author of the great book "Code Compete") on Technical Debt
The aforementioned and our very own Jeff Atwood on Technical Debt
Answer: I am in a similar situation. My company has their legacy website that does everything they need. In addition, they have a website being built by an outside company to replace it that does 90% of what they need. They expect that 90% to become 110%.
I have decided on the following course of action:

Maintain the legacy website until the new site is delivered
Get the extra features integrated into the new site as quickly as possible
Maintain the new website as if it were not being replaced
Once everything is up and running, rebuild the site and create a migration plan
Migrate to the new new site and forget that either of those old ones ever existed

As much as I'd like to simply ignore the other two sites, that's not an option. Regardless of how I feel about it, the site that is being delivered will have to serve us for a certain number of months before I can even attempt to replace it. Optimizing, maintaining, and improving upon it will be my priority. That site must perform during its lifetime. So building the new new site will be a during-those-times-that-everything-is-working and on-my-personal-time-when-I-want-to-hack-on-something project. But that's fine, since it manages everybody's expectations. The company that expects this new site to perform to a certain level will have their site performing at that level, and at the same time I'll be actively improving it behind the scenes. And at the same time again, I will be building a replacement that will blow it away.
In my situation, my "new site" (from the outside company) is your legacy codebase, and my "new new site" is your should-I-just-rebuild-it. So I guess my short answer is that while maintaining the legacy codebase to keep the world turning, you can still rebuild.

Maintaining legacy code


issues with incorporating sub model which includes iterating featureclasses as output

Question: Does anyone know why my model builder does not work when I tried to incorporate a sub-model into my main model?
This is my problem:
I created a sub model in which copies featureclasses within a folder to another folder. I used the iterator featureclass to copy all of it and used $name% as my output name for each feature classes. I've set the input workspace and output it as my model parameters.
I then added the sub model into my main model which shows up with model parameters. It is connected to my merge process as the input.
I ran the model as a whole and it gave me error 000229: Cannot open ...\%Name%.shp warning. Failed to execute (Merge ALL feature classes in processing Folder)
This seems like the issue in which ArcGIS can not locate my featureclasses as it seems to interpret %name% as a shapefile name when it is the output from iterators?
Answer: Your sub-model should end with a Collects Value tool (exposed as a parameter). This collects the featureclasses and returns a list to the master model. Your merge tool can take this list as the input.


How can i simplify $b^\frac{\ln a}{\ln b}$?

Question: What rules can i use to simplify $b^\frac{\ln a}{\ln b}$ for $a,b>1$ ?
Answer: An alternative route to the answers already present is as follows:
$$b^{\frac{\log a}{\log b}} = \exp\left(\log b \left(\frac{\log a}{\log b}\right)\right) = \exp( \log a ) = a$$
which may have the advantage of not requiring the knowledge that $\frac{\log a}{\log b} = \log_b a$.
Answer: $b^{\frac{\ln a}{\ln b}}=b^{\log_ba}=a$.
Comment: @Devid, let $\frac{\ln a}{\ln b}=t$, then $\ln a=\ln b^t$, and so $a=b^t$, yielding the result.
Comment: @Devid. This technique involves a very useful result that isn't well enough known, namely that $(\log_pq)(\log_qr)=\log_pr$. To help remember this, there's a kind of cancellation involving the $q$s. A consequence is that log functions to different bases are essentially the same, up to constant multiples.
Comment: How do you get to $b^{log_{b}a}$ ?
Answer: $\dfrac{ln(a)}{ln(b)}$ = $\log_b  a$
$b^{(\log_b  a)} = a$
Hence the answer is $a$
Answer: To get an equation that you can manipulate, let $x$ denote the expression you have.
$$x \; = \; b^{\frac{\ln a}{\ln b}}$$
Take the natural logarithm of both sides. Note that this is a natural thing to try, since doing this will convert the "harder" exponentiation operation on the right side into an "easier" multiplication operation.
$$\ln x \; = \; \ln \left( b^{\frac{\ln a}{\ln b}} \right)$$
Use a logarithm rule to rewrite the right side.
$$\ln x \; = \; \left( \frac{\ln a}{\ln b} \right) \cdot \ln b$$
Cancel common factors on the right side.
$$\ln x \; = \; \ln a$$
Use the fact that the natural logarithm function has the one-to-one property.
$$x = a$$


How to compute Legendre symbol $\Bigl(\frac{234987}{9086}\Bigr)$?

Question: How to compute $(\frac{234987}{9086})$? I know that Legendre symbol is $(\frac{p}{q})$ where $p \in \mathbb{Z}$ and $q$ is odd prime and Jacobi symbol is $(\frac{p}{n})$ where $p \in \mathbb{Z}$ and $n$ is odd integer. But in this case $n=9086$ is even. So is it still possible to use Jacobi symbol formula by making canonical presentation: $9086=2\cdot 5 \cdot 11 \cdot 59$ and then calculating the product of Legendre symbol of those primes? Especially I would like to know if there is need to use Quadratic reciprocity?
I must make a point that although answer would be 1, it doesn't mean that $x^2 \equiv 234987 \pmod {9086}$ is solvable.
Comment: The [Kronecker symbol](http://en.wikipedia.org/wiki/Kronecker_symbol) generalizes the Jacobi and Legendre symbols so that you're able to take any integer "denominator." It also satisfies its own reciprocity law, and you are correct: even if $\left(\frac{a}{n}\right) = 1$, the equation $x^2\equiv a\mod n$ need not be solvable.
Comment: In other words, you already know it is not defined, why are you trying to compute it?
Comment: I guess I have not used Kronecker symbol before. Is it same as using Jacobi symbol?
Comment: @Stahl: Do you mean that it cannot be solvable or "need not be solvable"?
Comment: Need not be: if you take $\left(\frac{a}{p}\right)$ with $a$ odd and $p$ prime, the Kronecker symbol agrees with the Legendre symbol. However, if you take $\left(\frac{a}{b}\right)$ with $a,b$ satisfying the requirements for the Jacobi symbol, you can find $a,b$ such that $\left(\frac{a}{b}\right) = 1$ and $a$ a quadratic nonresidue $\mod b$. But in this case, the Kronecker symbol $\left(\frac{a}{b}\right)$ will agree with the Jacobi symbol.
Answer: It seems that the intention of this problem is to use the Kronecker symbol. It generalizes the Jacobi and Legendre symbols so you can evaluate $\left(\frac{a}{n}\right)$ for all $n\in\Bbb Z$. If $n = u\cdot p_1^{e_1}p_2^{e_2}\cdots p_k^{e_k}$ is the prime factorization of $n$ with $u = \pm 1$ (a unit), then
$$
\left(\frac{a}{n}\right) := \left(\frac{a}{u}\right)\prod_{i = 1}^k\left(\frac{a}{p_i}\right)^{e_i},
$$
where if $p_i$ is odd, then $\left(\frac{a}{p_i}\right)$ is the Legendre symbol, and
\begin{align*}
\left(\frac{a}{1}\right)&:= 1,\\
\left(\frac{a}{-1}\right)&:= \begin{cases}-1, \quad a < 0\\ 1, \quad a\geq 0\end{cases},\\
\left(\frac{a}{2}\right)&:= \begin{cases}0, \quad a\in 2\Bbb Z\\ 1, \quad a\equiv \pm 1\mod 8\\ -1,\quad a\equiv\pm 3\mod 8\end{cases},\\
\left(\frac{a}{0}\right)&:=\begin{cases}1, \quad a = \pm 1\\ 0, \quad a\neq\pm 1\end{cases}.
\end{align*}
It also satisfies the following reciprocity law:
Suppose $n = 2^e n'$, $m = 2^f m'$ where $n', m'\in 2\Bbb Z + 1$ (for $n = 0$, $n' = 1$), and let $n^* = (-1)^{(n' - 1)/2}n$. Then if $n\geq 0$ or $m\geq 0$, we have
$$
\left(\frac{n}{m}\right) = \left(\frac{m^*}{n}\right) = (-1)^{\left(\frac{n'-1}{2}\right)\left(\frac{m'-1}{2}\right)}\left(\frac{m}{n}\right).
$$
So the Kronecker symbol shares many properties (which can be found at the wikipedia page) with the Legendre and Jacobi symbols (under certain restrictions), but one needs to be a bit careful, as certain things are different.


Is there proverb about war and mother?

Question: In Ukrainian, there is proverb "Кому війна, кому мати рідна". I would translate it into English as following: "What is war for one, that is mother for another".
This means that while some people are suffering from war, some other people are making money from it.
Is there English proverb with a meaning like that?
Comment: Saddam Hussein talked about "the mother of all wars", but that's different.  :-)
Answer: This one comes close:

One man's meat is another man's poison.
What is good for or enjoyed by one is not necessarily so for someone else.

(source: Dictionary.com)
Comment: Sounds interesting but rather about different flavors.
Comment: @liehater - It isn't literally about flavors.  It just means that what is good for one person is not necessarily good for another.
Comment: I did not mean literally flavors. I did mean that proverb should not accept war as flavor at all. Probably instead of "flavors" there should be "preferences".
Answer: Unfortunately, this one sounds too homespun:

One man's death is another man's bread.

So let's make one up:
Death is always a good investment.
Comment: Looks very close.
Comment: *One man's death is another man's bread.* that's literally what we say in Dutch: *de één zijn dood is de ander zijn brood*.
Answer: There is a saying "War is good for business".  Googling that will bring up lots of references, including, for Star Trek fans, #34 of the Ferengi Rules of Acquisition: http://www.sjtrek.com/trek/rules/.
The expression is intended somewhat to have "shock value", since people normally think of war as bad.  So the dual nature of war is implied rather than the negative side needing to be explicitly included in the saying.
Writer Allen Ginsberg sarcastically adapted this expression for his famous anti-Vietnam War slogan, reimagined on this 1968 poster by Seymour Chwast:
Comment: Pictures about "War is good for business" are very meaningful.

Is there proverb about war and mother?


SharePoint 2013 view with date filter

Question: I'm using SharePoint 2013 and I want to create a view to find items created between two dates. But I dont know how to pass two dates to View.aspx and apply filter.
Answer: Click on modify view on that specific page, there is filter section where you can set the filter conditions. for example created date > date1 and created date < date2.
Comment: Actually I know this but how to pass two dates to view via URL?
Comment: If you are trying to do this via code, you can try using REST API  that has filter option where you can pass the date values.
Answer: Filter View by Date
You can only use [Today] in the View Filter options
(add or substract the number of days, 5475 = 15 years)
Important: Do NOT use spaces in these Formulas!!!

For more advanced use of [Today] Filtering (Filter by current Month etc.) see: http://blog.pentalogic.net/2009/11/howto-filter-items-current-calendar-month-view-sharepoint/

SharePoint 2013 view with date filter


How long does it take to visit VDNKH in Moscow in summer 2019?

Question: For a family with 3 kids 14-18, how much time should be allocated for a visit to the VDNKH amusement park, and what attractions are must-see?
Answer: Allocate at least an hour. Must-see is walking up the main alley, seeing all the fountains and pavillions. Then you can take some side detours but that's optional.
If you want to visit anything, my recommendation is space museum that's outside of ВДНХ, under the rocket monument.
You can also spend half and hour to see the iconic "Рабочий и Колхозница" monument in the walking distance outside of main ВДНХ entrance.
Then you can leave via monorail if it still operates.
Thus a good complex visit may take around three hours. I'm pretty sure you won't run out of things to see.
Comment: +1 for the [Museum of Cosmonautics](http://www.kosmo-museum.ru/?locale=en), which alone can take a few hours if your kids are interested in space stuff.


how to know which tones to double if you are writing counterpoint in a mode?

Question: I have a Cantus Firmus in D dorian mode that I am trying to write a 4 part counterpoint exercise with. In my textbook it says that since we have 4 notes per triad I need to double a note per triad to get a 4 voice voicing. It also says to double the degree 1, 4 and 5 of the scale I am in (it uses C major as an example which means the notes to double are C, F and G). However I get confused how this applies to modes? Since D dorian is part of the C major scale, do the same notes get doubled (C, F and G)? Or does being in dorian mean I need to use 1,4 and 5 of Dorian mode?
Answer: The 1, 4, and 5 being referred to are within the mode; that is, they are not 1, 4, and 5 of the corresponding major scale.

The general principle is not to double "tendency tones". Since you're dealing with triads, this means, in particular, the leading tone.
For example, in G - C cadence, you wouldn't double the B in the G chord.
This idea gets extended to say that you shouldn't double the third of a triad (the leading tone being the third of the V chord, for example). In C major, if one is dealing primarily with I, IV, and V triads, this means that 1, 4, and 5 (i.e. the roots or fifths of the triads) can always be doubled. However, 3, 6, and 7 are risky in that they could be the third of a I, IV, or V chord, respectively.
Doubling roots and fifths of major and minor triads is safe regardless the mode.
Comment: So in D dorian which are the "tendency tones"?
Comment: @armani That genuinely deserves to be it's own question. But briefly, the idea of "tendency tones" relates primarily to major/minor Tonality, so in that sense other modes don't have tendency tones. Dorian, for example, has no leading tone. However, unless you're writing in strict Dorian, the usual practice is to raise the seventh degree at the cadence, thus creating a leading tone (i.e., a tendency tone), so you wouldn't double that.
Comment: I totally get the concept of not doubling the raised 7th degree but that is only on the last chord. If my textbook tells me not to double tendency tones for all triads, then how will I know which those tones are? Yes I can use your method and just double the root and 5th but surely if my textbook is telling me not to double tendency tones then it must be known which those are.
Answer: I'd like to add that the reason not to double "tendency tones" is that, because of the tendency, these "tend" to resolve to the same tone leading to parallel octaves. In C-major, (as an example), one doesn't double B as the tendency of B to move to C is felt rather strongly, especially as B is the third of the dominant. I know little about modes but the same ideas should apply. Tones in major or minor or modal tend to resolve by half-step if possible to another diatonic tone. I'd guess that (using the "white" notes from the natural hexachord) that moves of B to C, C to B, E to F, and F to E can have trouble with parallels.
The entire point is to keep the voiced independent. (In fact, in my stuff, my biggest problem is parallels between bass and melody. It's even worse when improvising.)


HP PC screen goes black after unplugging power cord

Question: For the past few days, I've been having trouble with my HP laptop's screen. Whenever I unplug the power cord from the PC, my screen goes almost black. You can only see the screen a little bit if you hold a flashlight to it. When I re-plug the power cord, the PC screen is still dark. The screen would go back to normal if I close it and log in again. Even with the PC being plugged in to the power cord, the screen still goes black after a few hours. I've tried going to the control panel and adjusting my battery settings, but that didn't help. How can I fix this problem?
Comment: How old is the battery? Sounds like time for a new one.
Comment: I think it's about 4 years old.
Answer: As LCD's dont produce light by themselves, they need illumination to produce a visible image. A backlight illuminates the screen from the side or back of the panel.
If your screen goes so black that you need an external light source to still see something, it would seem to me your LCD backlight stopped working.
Since it can be reset, it would seem there's some kind of short circuit or overheating problem. Not the backlight itself doesnt give off much heat, it's probably in some circuitry that drives it.


How do I prove that among any $5$ integers, you are able to find $3$ such that their sum is divisible by $3$?

Question: How do I prove that among any $5$ integers, you are able to find $3$ such that their sum is divisible by $3?$
I realize that this is a number theory question and we use modular arithmetic, but I'm unsure of where to begin with this specific situation.
Answer: Consider the residue class modulo $3$ of each of the five numbers. If three of them are equal, then the numbers corresponding to them will work. Otherwise, no three numbers have equal residue classes, but there are only $3$ potential residue classes, and that means that all three actually occur. The numbers corresponding to these classes work.
Answer: All the integers can be represented as $3n+1, 3n+2$ or $3n; n \in \mathbb{Z}$. Among the five integers, if there is at least one integer of each form, then their sum would be divisible by $3$, as $3a+(3b+1)+(3c+2)=3(a+b+c)+3 \equiv 0 \, (\mathrm{mod} \; 3)$
If there isn't, all the numbers are of the remaining two forms. So, there are at least three integers of the same form, which is obvious using the pigeon hole principle. Their sum would be divisible by 3 as $(3a+i)+(3b+i)+(3c+i)=3(a+b+c+i)\equiv 0 \, (\mathrm{mod} \; 3);i =0,1,2$ Thus, completing the proof.
Answer: Hint: pigeonhole principle. $5$ pigeons (integers) and $3$ pigeonholes (numbers of the form $3n, 3n+1, 3n+2$). This works for $5$ or $4$ distinct integers among the $5$. If $3$ or more integers are the same, then it is trivial since you have 3 times the same number, say $k$, so $k+k+k=3k$ is obviously divisible by $3$ no matter what $k$ was.
Answer: Consider the remainders of the numbers when divided by 3. Clearly there are only three possible remainders: 0, 1 or 2.

If all these remainders occur among the given numbers, then adding together three numbers with different remainders will yield a sum that is divisible by 3 (since 0 + 1 + 2 = 3).
Otherwise, at least one of the three remainders does not occur among the five given numbers. By the pigeonhole principle, at least one of the other two remainders must thus occur more than twice (since 5 > 2 × 2). Adding together three numbers with the same remainder will then yield a sum divisible by 3.
Comment: And yes, I'm aware that this is essentially equivalent to several of the answers already given by others. I just wanted to try giving an elementary answer using as simple language as possible, without a profusion of notation or fancy terms like "residue class". That said, I did give the other answers a +1 too.
Comment: +1 from me, presented much better than the other answers.  Although I would have just simply said "WLOG, this is the same problem if you restrict the numbers to $\{0, 1, 2\}$.
Answer: Consider the following seven numbers:
$a_1\\a_2\\a_3\\a_4\\a_5\\a_1+a_2+a_3+a_4\\a_2+a_3+a_4+a_5$
Since there are seven numbers three of them must have same remainder modulo $3$. If all are from the first five then their sum is multiple of $3$ otherwise one of the four-element-sum and one of its summand must be included and their difference is divisible by $3$.