Proof: If n is a perfect square, $\,n+2\,$ is NOT a perfect square

Question: "Prove that if n is a perfect square, $\,n+2\,$ is NOT a perfect square." I'm having trouble picking a method to prove this. Would contraposition be a good option (or even work for that matter)? If not, how about contradiction?
Comment: The first question is not "What method shall I use?" but "What's happening here?". So fool around with numbers. Anyway, contraposition is probably hard on the back.
Comment: I was an Assistant Professor there. And we were in Swain. Some fond memories.
Comment: @AndréNicolas I disagree re. contraposition.  To get from a square to the next smallest square, you have to subtract an odd number ...
Comment: @Neal: Ultimately we will use, at least implicitly, some logical apparatus. A little experimentation will show that the next square is always too much bigger, or some parity condition is violated. Once it is clear that this seems to be the case, one can worry about proving it. But the insight about what might be going wrong comes first.  Does the Math Department have a new building? It has been forever since I was at IU.
Comment: @AndréNicolas I'm sorry, I should have been clearer.  I wholeheartedly agree that insight should come first.  I just meant that some insights would suggest logical contraposition.  Anyway, the Math Dept. is still in Rawles, the grad students are still infesting Swain East, but the Atwater house got a makeover last year.  Who did you work with at IU?
Answer: Hint: Every perfect square is either $0$ or $1$ modulo $4$.
Comment: Haha thats not a hint, thats an answer!
Comment: No, I think it is a hint, in particular taking into account the probable basic level the OP has in these matters...and a rather nice, fine hint.
Comment: how to prove this one?
Comment: @LouisRhys: Consider $(2k)^2$ and $(2k + 1)^2$.
Answer: Suppose $n=m^2$ and $n+2=k^2$. Clearly $k>m$, so $k\ge m+1$. But then
$$n+2\ge (m+1)^2=m^2+2m+1\ge m^2+3=n+3$$
a contradiction.
Comment: That proof only works for $n>0$ (but for $n=0$ it's easily checked directly).
Comment: @celtschk Yes, of course. This generalizes to large differences than $2$ as well, if you check finitely many cases.
Answer: $$n=a^2\,\,,\,\,n+2=b^2\Longrightarrow 2=(n+2)-n=b^2-a^2=(b-a)(b+a)$$
Now check that this is impossible (and $\,b>0\,$ )
Comment: Do you mean set (b-a)=2 and set (b+a)=2?
Comment: Well, yes: we have that $\,b-a\,,\,b+a>0\,$ and $\,b-a0$)? Seems to me that's not important.
Comment: Just to avoid the option $\,(-2)(-1)\,$ , and everything is positive, that's all.
Answer: Hint $\rm\ f(n) = n^2\:$ is increasing on $\Bbb N$ so the difference between two different values is at least the difference between two consecutive values, which is $\rm\:(n\!+\!1)^2 - n^2\:\! =\, 2n\!+\!1 > 2\:$ for $\rm\:n > 0.$
Remark $\ $ This has a natural presentation by  telescopy, e.g.
$$\rm f(4)\!-\!f(1)\ =\ f(4)\!-\!f(3)\ +\ f(3)\!-\!f(2)\ +\  f(2)\!-\!f(1) $$
and since each RHS difference is $> 2,\,$ so too is the LHS.
Comment: This is certainly the best answer. Good one.
Answer: You don't even need algebra to do this – think squared paper. The only thing to specify about a square is its side length, so if you want to show a bigger square is a perfect square, the only thing you can do is increase the side length. But if you increase the side length by 1, you need to add at least 1 square to each side, and 1 on the corner, so you need to add at least three squares.
This is aside from the case where $n = 0$. But $2$ isn't a perfect square, so that's fine.
Answer: I don't know that you should pick a proof strategy before you have played with the hypotheses a little bit.  In my experience, thinking about the hypotheses tends to suggest natural proof strategies.
In this case, I would think like this: perfect squares are the partial sums of the series of positive odd numbers, so you can't get to the next perfect square by adding $2$.  This suggests contradiction.
Alternatively -- and this would suggest proof by contraposition -- if you have arranged $n$ tiles in a square, and you remove two, can you rearrange those into a smaller square?
Answer: More generally, for every positive integer $m$,
there are only a finite number of positive integers $n$
such that $n^2+m$ is a perfect square.
Proof: Suppose $n^2+m = (n+k)^2$.
Then $m = 2nk + k^2 > 2nk \ge 2n$,
so $n < m/2$.
If $m = 2$, then $n < 1$, so there are no solutions.
To find all solutions for a particular large $m$,
congruences can greatly reduce the number of cases that have to be tested.
This readily generalizes to any function that increases at least linearly:
If $f(n+1)\ge f(n)+cn$ for some positive $c$,
then, for any positive $m$,
there are only a finite number of $n$
such that $f(n)+m = f(k)$ for some $k > n$.
Proof: $f(n+k) \ge f(n)+cnk$ (you can do better, but this is enough),
so if $f(n+k)-f(n)=m$,
$m \ge cnk \ge cn$
or $n \le m/c$.
Generalizing further
(my goal is a theorem so general it has no particular application),
the result holds
if $f(n+1)-f(n) \ge g(n)$
where $g$ is strictly increasing
and unbounded
(an example of a slowly growing $g$ is $\log$).
Proof: $f(n+k)-f(n) \ge g(n)+g(n+1)+ ... +g(n+k-1) > kg(n)$
so, if $f(n+k)-f(n) = m$,
$m > kg(n)$.
The assumptions about $g$
imply that. for any particular $m$,
 there are only a finite number of $n$
satisfying this.
Answer: If $n$ is odd and perfect square, then it is of the form $n=8k+1$. But $n+2=8k+1+2$ is also an odd number, so it must be of the form $8k'+1$ which is not.
If $n$ is even, It is of the form $n=4k^2$ while $n+2=4k^2+2$ is even but not of the form $4k'^2$. Therefore $n+2$ is not a perfect square.
In each case such $n$ does not exist.
Answer: Any integer $\ n$, upon division by $\ 4$ leaves one of the remainders $\ 0,1,2$ and $\ 3$.
Therefore $\ n$ will be one of the forms $\ 4k, 4k+1, 4k+2$ and $\ 4k+3$, $\ k\in\mathbb{Z}$
Since $\ n$ is a perfect square, $\ n$ cannot be in the form $\ 4k+2$ and $\ 4k+3$
$ \bbox[tan,5px, border:2px solid red] {{\text{To prove it, we assume}  \sqrt{n}=p. \\
\text{Then  p may be even or odd.} \\
\text{Let} \; p=2q\;\text{(for even) or}\;  p=2q+1\;(\text{for odd})\\
\text{Now} \;p^2=(2q)^2=4q^2=4k,\; k=q^2\in\mathbb{Z} \\
\text{or}\,  p^2= (2q+1)^2=(4q^2+4q+1)=4(q^2+q)+1=4k+1,\; k\in\mathbb{Z}\\
\text{So any perfect square p is of the form 4k or 4k+1}, k\in\mathbb{Z}}}$
Thus $\ n$ will be one of the forms $\ 4k $ or $\ 4k+1$
If $\ n=4k$, then $\ n+2=4k+2$ which is not a perfect square $\ \mathbf{(just\; mentioned \;above)}$
If $\ n=4k+1$ then $\ n+2=4k+3$ which is not a perfect square $\ \mathbf{(same \;reason)  }$
Therefore in whatever form a perfect square $\ n$ may be, $\ n+2$ is not perfect square.


SEP-24 deposit failed The transaction source account is not equal to the server's account

Question: I'm working through the steps of setting up the Stellar Anchor platform. Docker is all set up and working okay. I'm at the stage where I test the Stellar Demo wallet by Initiating a SEP-24 deposit. I get the following error message --> SEP-24 deposit failed The transaction source account is not equal to the server's account.
Answer: This error was caused by a rookie mistake, I had entered my JWT key as the value for "SIGNING_KEY" in my stellar.toml file instead of entering the public key of my distribution account.


The top of my lens is "loose" — will this affect performance?

Question: I recently bought a used 70-200 f/4L (non IS) for a super low price (about $200). It looks perfect, and the optical performance is out of the box good. BUT the top of it (the actual top of the lens), where the red ring sits, and where you put your lens lid, is "loose", I can easily move it. Can this affect the performance?
Answer: I had this on my old 2.8 USM version and in my case you could actually see movement along the entire barrel when twisting.
I took it into Canon as I needed the IS replaced on a seperate lens and they told me something had gone inside of it (I think it was some form of bearing, but this was about six  years ago). They asked if I wanted it repaired for £200 (I was a penniless student they'd put it back and tightened everything so the movement had gone so I opted against it.)

Optically there was no difference.
I was aware of the issue
The movement came back after a whilst due to general use.
I had the lens for five years, lived with the issue, it didn't fall apart.

However I'm probably not a good example. I could very well be the exception that proves the rule. I wouldn't now take the chance I would get it checked out and if needsbe repaired. The last thing you want is it falling apart and you're then out of a lens. Considering you spent $200 even after any repair there is a high chance you'll be quids in and still have a deal. It could very well be why the lens cost only $200 in the first place.
One thing I certainly would not do is glue it. Maybe tape it where the tape can be removed. The risk being something else goes wrong and you are then not in a position to get that repaired because it's glued. You could also potentially damage any resale value.
Answer: I've got this on one of my Pentax lenses. Its no big deal, I wouldn't glue it in though. For now I just line up the piece and push it in - once every so often it comes loose again so I push it back in. No loss of quality at all.
For me I'm keeping my eye out for a replacement lens entirely but price point of yours on the used market is quite a bit more so you might want to look for one on ebay marked as "Parts Only" though it probably doesn't pop up too often.
The main issue is if you want to use filters and such which is the only reason I'm considering a replacement.


Are orbiting planets an  example of perpetual motion?

Question: I understand that perpetual motion is impossible, but I became confused when a friend of mine told me that the orbits of the planets is an example of perpetual motion. Will earth's orbit ever end, and whats wrong with his statement. I'm asking for a simple answer to 'disprove' my friends 'theory'.
Comment: By "perpetual motion machine", we mean a gadget that is able to perpetually move despite its motion being used to do some work, and/or despite the friction that converts a part of its kinetic energy to heat. Equivalently, "perpetual motion machine" (of the first kind) is a gadget that violates the conservation of energy. Planets don't - they move (almost) indefinitely but they don't do work and they're not being decelerated by any (significant) friction. So they don't violate the energy conservation law and despite their indefinite motion, we don't classify them as "perpetual motion machines".
Comment: What about an orbiting moon? it generates heat and tidal movement.
Comment: Lubos is right: The rule is that there's no such thing as a perpetual motion *machine*. The last word is critical, as it conveys the point about getting work out of the system.
Comment: @LubošMotl, but the planets are accelerated all the time, aren't they?
Answer: Actually, what is impossible is a perpetuum mobile which is a machine or system that breaks the first or second law of thermodynamics. Planetary motions break none of those laws, therefore there is no contradiction with their "perpetual motion".
The question of the end of Earth's orbit is a different one though. Certainly, the Earth's orbit will end, most likely because the Sun will engulf the Earth as it grows to a red giant. If it doesn't end sooner.
Answer: Strictly speaking, planetary orbits are not perpetual motion.  As the planet (and their star) rotate around their common center of gravity, they emit gravitational waves.  Those gravitational waves drains the planet/star orbital system on energy so the planet eventually get's closer and closer to its star.
Now this orbital decay due to gravitational wave emission is ridicoulusly small so it has only been measured for extreme systems like binary neutron stars (which are heavy and may orbit each other within minutes, seconds or just a fraction of a second).  Our planet Earth is subject to gravitational wave emission as well, but the orbital decay is so small that it in practice won't affect earth within the Suns lifetime, instead of Earth spiralling into and being devoured by our Sun, it will rather be our Sun (turning into a red giant) which extends beyond the current orbit of Earth and thus devours it.
So even by cosmological timescales, planetary motion around a star will go on for a long time, e.g for the lifetime of a sun-like star and beyond.
Answer: Perpetual motion is a system that produces work (energy) while maintaining its state (which implies it can forever produce energy without changing state).
Orbiting planets are not a perpetual motion system.  NOTHING we know of or can explain is a perpetual motion system.
Orbiting planets APPEAR to be a perpetual motion system, because the length of time needed for an OBSERVABLE (measurable) state change to occur is enormous (many, many, many, many lifetimes).
Comment: If there is infinite matter in the universe then motion could effectively appear perpetual.


How to reuse a figure from a patent? Is it free to reuse?

Question: I recently came across a journal article that included and referenced a figure (photograph) from a US patent. I found the patent, and I would like to use the same figure, and I'm wondering who the copyright holder is. Might it be free to use since the patent itself is public, or do I need to ask around until I find the copyright holder?
Comment: The answer is maybe: http://www.uspto.gov/news/media/ccpubguide.jsp
Answer: It depends on how the figure is being used.  If it is for non-commercial purposes -- e.g., in a scientific journal to support a study -- then it will likely fall under the 'fair use' provision.  If it is for commercial purposes, such as a book that you are seeking to publish, then it is likely considered commercial purposes, and you will need to work out the permissions.
http://patentdocs.typepad.com/files/memo-on-use-of-npl.pdf
Comment: That memo is inapplicable to this question, since it's about **non**-patent literature. Patents fall under [different rules](http://www.uspto.gov/terms-use-uspto-websites.html) -- they're assumed to be public domain unless the holder claims otherwise.
Comment: Sorry Brian, I forgot about your answer until recently. This is what we ended up doing in the end. The paper has been published, and so far, no accusations of copyright infringement :)
Answer: I have always felt that directly re-using (i.e., copying) anyone's figures in any work, including student papers, is dubious practice even if cited. If students re-draft figures and cite them properly, this seems just about acceptable for undergraduate work. For almost any other purpose, however, I think substantial modification of the figure is necessary.
Comment: How can a screenshot of an existing tool that constitutes the previous state of the art, that the new work is based upon, or needs to be contrasted with, be "substantially modified" - especially in fields where reviewers do complain if they just see a mock-up rather than a screenshot of an actual software? I'm not saying directly copying someone's figures is definitely the way to go, but in fields where figures are not so much used for showing information about the results, but rather they *are* the results, re-drafting figures is not always practical.
Comment: @O.R.Mapper is right. In my case we would have had to buy some expensive material that we would not otherwise need, just to photograph it up close and compare with a computer generated model.
Comment: Screenshots are good practice to document one's work, of course. Copying someone else's screenshots are not.


Office 365 "sites" vs. "teams" managed path when creating a site collection

Question: In Office 365 when you create a new site collection, the Web Site Address gives you the option to choose to create your site collection under "sites" or "teams".  What is the difference and why would you choose one over the other?
Answer: There is no real difference, it is a matter of taste and consistency,
I for example would create my projects and team sites under /teams, and other types of site collections under /sites
This blog seems to describe Managed Paths in an Office 365 context quite well: http://schakrabortytcs.blogspot.se/2011/10/office-365-sharepoint-online-managed.html?m=1
Comment: No, the public site had its own AAM: public-TENANTNAME.sharepoint.com
Comment: +1 it seems odd to have those two options and just have it down as a matter of taste. Is it possible that teams would originally have been for intranet type sites and 'sites' for public websites which is being discontinued if I understand it correctly?
Answer: Robert is absolutely right. To summarize though there are 2 main types of managed paths, which practically control whether you go Wide vs. Deep in your URL structure (when creating site collections) for on prem installations (this is not applicable for SharePoint Online):

Explicit inclusion managed path defines an exact path to which a single
site collection can be directly attached.
A wildcard inclusion managed path defines a path that will not allow creation of a site collection directly at this point, bur rather create multiple site collections assigned beneath it (sites and teams are examples of Wildcard)

You must also be aware that it is recomanded to keep to < 20 per Web Application, so you need to balance carefully how new Managed Paths are created.


The shipment couldn't be saved. {"exception":"[object]

Question: The shipment couldn't be saved. {"exception":"[object] (Magento\Framework\Exception\CouldNotSaveException(code: 0): The shipment couldn't be saved. at /vendor/magento/module-sales/Model/Order/ShipmentRepository.php:150, Magento\Framework\Exception\LocalizedException(code: 0): Not all of your products are available in the requested quantity. at /vendor/magento/module-inventory-source-deduction-api/Model/SourceDeductionService.php:86)"} []
Answer: Just checked the product Qty you have in source item table
<code>mysql-> select * from inventory_source_item where sku = %your sku%;
</code>
Just check the product Qty you have in legacy Catalog Inventory Stock Item table
<code>  mysql-> select * from cataloginventory_stock_item where product_id = %your product id%
</code>
If the Qty item is zero in the inventory_source_item update the Quantity item . Then issue will be solved.
Comment: i am getting this error in log after every second in exception log
Comment: if youare working any cronjob for this ?
Comment: not sure but i have 2 enviorment 1 is stage not getting there but getting on live


Are the words in the Lord's Prayer "Hallowed BE Thy Name" or "Hallowed BY Thy Name"?

Question: I was recently caught off guard when encountering a version of the Lord's Prayer that has it as hallowed-by; the page goes so far as to cite Matthew 6:9-10, even as exactly none of the English versions on BibleHub translate it like that. A user on this site used this apparently novel version of the verse, as do plenty of webpages who's general purpose for doing so is to center deification/perfection Theologies. Is this simply a shoddy mistake on their part or is there something else going on here?
Comment: Young's Literal Translation has _hallowed be thy name_. Green's Literal Translation has _let be sanctified your name_. [Biblehub](https://biblehub.com/interlinear/matthew/6-9.htm) translates αγιασθητω as 'hallowed be'. αγιασθητω is the aorist imperative passive (third person singular) and 'hallowed be' is the correct translation.
Comment: It's probably just a typo.
Comment: This question would be better asked on [Bible Hermeneutics.SE](https://hermeneutics.stackexchange.com/).
Comment: The Bible wasn't written in English, originally.
Comment: In the King James Version of the Bible the text reads: 'After this manner therefore pray ye: Our Father. who art in heaven, Hallowed be thy name.' Matthew 6:9
Answer: It's surely just a typo. The word in the original languages here is hagiastheto which is both passive and a third person imperative.  A third person imperative in English is something like this.
Who will clean the room?
Let Danny clean it!
Let here sounds a lot like giving permission in modern English.  We don't use 3rd person imperatives.  We use 2nd person (you) all the time:  Clean it!  We sometimes use 1st person plural (we) imperatives:  Let's clean it!  This is the same grammatical idea, but for a third pe)son (he/she/it) party.
A passive verb is one where the subject is the one receiving the action instead of doing the action.  So a third person passive imperative might be like this:
Let the room be cleaned!
i here s hagiazo which means "to make holy".  So what happens when we make that a 3rd person passive imperative?
Let it be made holy!
And the "it" here is onoma sou ... "your name" ... so Let your name be made holy ... but we have a special work for something that has beendin English made holy: hallowed.  strong text  So, we end up with
Hallowed be your name.


in the sentence below should i use of/ for ? Please explain places where one can use of and where one can use for

Question: The international monetary fund maintened its forecast 'of/ for' weak global growth???
According to me it should be 'of' as the news of weak global growth makes up the forecast and hence is a part of the forecast.
Answer: "...its forecast of weak global growth" is correct.
It has the same function in the sentence as (as you say) "news of weak growth", "predictions of weak growth", "consequences of weak growth", etc.
It's the same construction as the words you used: news of weak global growth.


What is the difference between NLM vs Open image denoise?

Question: What is the difference between NLM vs Open image denoise? also what is the "denoising data" in view layer properties?
Comment: Hello :). NLM (*non-local means*) is an old Blender denoiser. *Open Image Denoiser* is a new advanced denoiser. *Denoising Data* simply allow the *Open Image Denoiser* to be used in the compositor.
Answer: Here is a nice explanation video by IBN-Blender 3d Artwork
here.
From what I understood:
Open Image Denoise and NLM are two sorts of denoising modes. OID is faster and doesn't need a high sampling rate, it is ideal for animation. NLM is slower and needs a higher sampling rate, it is ideal for single image.
You can use OID either through the Render panel or through the Compositor. The second solution gives better results.
For the first solution, enable OID through Properties panel > Render > Sampling > Denoising > Render.
For the second solution, make sure you've deactivated any denoising in the Render panel, then go into Properties panel > View Layers > Passes > Data, and activate Denoising Data, it will create all the necessary output sockets in the Compositor Render Layers node.
Now open the Compositor, create a Filter > Denoise node, plug the Nosiy Image, Albedo and Normal output sockets of the Render Layers node into the Denoise, plug Denoise into the Output and Viewer nodes.
Comment: so can I use OID if I have AMD CPU and GPU?
Comment: I guess so, have you encountered any problem?
Comment: Futher reading: [Type of Denoiser built into Blender](https://blender.stackexchange.com/questions/178257/type-of-denoiser-built-into-blender/178330#178330)
Comment: no, just wondering if I will get the same speed as if I used intel CPU


Finding function from the tangent line

Question: I have equation for tangent line: $y=x+1$ and the tangent line is through point $(x_0,y_0)$ whose coordinate is $(0,1)$ therefore from this formula $m=1=e^x0=e^0$ (the slope of the tangent line) and thus the derivative of the function we are searching for is: $e^x$ to have the function we are searching for,we need to compute $\int e^x~dx= e^x+C$ and we have graph function is through point $(0,1)$ so the constant is just zero therefore the function we are  searching for is $e^x$
But is this correct way? How do I know it is the slope of function e^x or some other function?
Thank you so much!
Answer: I'll just give a few things, which you should prove:
Every function staisfying the following two equations would give you a correct solution:
$$f(0) = 1 \\ f'(0)=1$$
For example calculate the tangent line at the point $(0,1)$ of the function $f(x) = (x+\frac{1}{2})^2 + \frac{3}{4}$.
Comment: So in some way: $$tangent-line-from-function\Rightarrow function-from-tangent-line$$ but not the opposite
Comment: Yes that is correct. In fact from the example I think you can get to see the fact that there are infinetly many functions passing trough that point and having that tangent line.
Comment: PS: And I would phrase that like this: Given a function you can always get the tangent line everywhere, but given a tangent line you can find inifintely many functions, which are tangent to it a spesific point

Finding function from the tangent line


Is there a user constructed version of the pain field?

Question: I have noticed that I lose shield and health when I walk next to a hive base built by the enemy what is the component that causes this effect ?
Answer: Yes, there is the Skywall Shield Emitter. It looks like this:

The color depends on the faction which built it. This is a Vanu one, so it's purple.
When an enemy soldier comes into contact with them, they will set them on fire and do damage over time. That DOT will persist for a while even after they leave the area. If they leave immediately they might survive with HP in the red zone.
They form a mushroom-shaped cupola 15m over the generator. The intended purpose is to prevent light assaults from flying in and to counter galaxy drops, so the enemy is forced to attack on a ground route. However, some players will try to place them in ditches (like here) so even ground-based attackers have no other choice than walking through them.
Comment: Is that abuse of the mechanic known to the developers? Is it even considered an abuse or is it seen as "smart/tactical placement" ?
Comment: @Eternal_Light In this particular case I believe that the builder also exploited a bug, because it seemed like the structures were somehow placed below ground. But whether or not this is fair-play is a different question.


Can only victor way be used for route in cross country?

Question: In IFR low-en route chart, there are many ways related to victor ways. Do I have to select the route for cross county? Or, Can I choose the ways between victor ways?
Comment: Are you asking about a specific country? In some parts of the world (e.g. Asia) routes are very strictly controlled; in others (e.g. United States) there's a lot more flexibility.
Answer: You just use (starting waypoint)  DCT  (ending waypoint) in your flight plan (DCT = Direct) and submit that.  It's up to ATC to approve that routing and you'll find out when you are issued your clearance.
Especially at lower altitudes it's likely you'll be cleared as filed, but there's always a chance they'll shift your route a bit to improve traffic flow for whatever reason, adding waypoints or moving you to an adjacent V airway, doing their best to minimize any increase in your distance.
Answer: You can request any way you want. The actual IFR clearance given may be something else altogether, depending on other traffic, and possibly even GPS direct from your current location to a waypoint near to the intended point of landing if conditions are favorable.
Comment: Your routing will also be impacted by where you are starting from. I depart from a non-towered airport, typcially with a void-time clearance (have to be airborne and contact ATC within a time-limit). The clearance is usually to fly some heading where the Class B overlying the airport can confirm it's me they see on radar, then a heading change or two before being released to a first waypoint farther along on my planned route.  If I can depart VFR instead and get away from the Class B before asking for IFR, there is a lot less fooling around to start the trip.


Creating neural net for xor function

Question: It is a well known fact that a 1-layer network cannot predict the xor function, since it is not linearly separable. I attempted to create a 2-layer network, using the logistic sigmoid function and backprop, to predict xor. My network has 2 neurons (and one bias) on the input layer, 2 neurons and 1 bias in the hidden layer, and 1 output neuron.
To my surprise, this will not converge. if I add a new layer, so I have a 3-layer network with input (2+1), hidden1 (2+1), hidden2 (2+1), and output, it works. Also, if I keep a 2-layer network, but I increase the hidden layer size to 4 neurons + 1 bias, it also converges. Is there a reason why a 2-layer network with 3 or less hidden neurons won't be able to model the xor function?
Comment: You can predict XOR using that structure. In fact you don't even need biases (see [here](http://stats.stackexchange.com/questions/12197/can-a-2-2-1-feedforward-neural-network-with-sigmoid-activation-functions-represe)).
Comment: Do I need to initialise my weights in any special way to get convergence? I a trying a simple neural net with weights between (-1,1) initialised randomly, but I cannot get it to converge (even using biases)
Comment: Actually, using the logistic sigmoid it does converge sometimes, but not all the times, it depends on the initial choice of random weights.
Comment: Your range seems quite large, try (-0.1, 0.1). Otherwise you risk that input signal to a neuron might be large from the start in which case learning for that neuron is slow. You might also want to decrease learning rate and increase number of iterations.
Comment: On the contrary, larger values make it converge faster. I have tried smaller learning rate and many iterations. I think Neil Slater's answer below sums up the issues, though I am still not sure why.
Answer: A network with one hidden layer containing two neurons should be enough to separate the XOR problem. The first neuron acts as an OR gate and the second one as a NOT AND gate. Add both the neurons and if they pass the threshold it's positive. You can just use linear decision neurons for this with adjusting the biases for the thresholds. The inputs of the NOT AND gate should be negative for the 0/1 inputs. This picture should make it more clear, the values on the connections are the weights, the values in the neurons are the negatives of the biases. E.g. for input1=0 / input2=1, hidden neuron 1 would be sign function(0*1 + 1*1 - 0.5) == 1, meaning it passes the OR gate. The decision functions act as 0/1 decisions (or just the sign function works in this case too).

Picture thanks to "Abhranil blog"
Comment: Thank you, then it is not possible to do this using a logistic sigmoid, since it restricts the value to (0,1)
Comment: No it should still be possible to learn this with a logistic sigmoid, it should just learn the thresholds/weights differently
Comment: The bias in the NAND gate should be a $+1.5$.
Answer: Yes, there is a reason. It has to do with how you initialize your weights.
There are 16 local minimums that have the highest probability of converging between 0.5 - 1.

Here is a paper that analyses the xor problem: Learning XOR: exploring the space of a
classic problem, Bland 1998.
Comment: @Emil So, if the weights are very small, you are saying that it will never converge? I also fixed the link for you.
Comment: @user Correct .
Answer: If you are using basic gradient descent (with no other optimisation, such as momentum), and a minimal network 2 inputs, 2 hidden neurons, 1 output neuron, then it is definitely possible to train it to learn XOR, but it can be quite tricky and unreliable.

You may need to adjust learning rate. Most usual mistake is to set it too high, so the network will oscillate or diverge instead of learn.
It can take a surprisingly large number of epochs to train the minimal network using batched or online gradient descent. Maybe several thousand epochs will be required.
With such a low number of weights (only 6), sometimes random initialisation can create a combination that gets stuck easily. So you may need to try, check results and then re-start. I suggest you use a seeded random number generator for initialisation, and adjust the seed value if error values get stuck and do not improve.
Comment: Yes, that is what I am observing, with some seed values it does converge, others, it won't. Also, if I use hyperbolic tangent instead of sigmoid it works rather well all the times, with sigmoid it does depend on the seed, as you observed. What is the reason for it to be so tricky?
Comment: I'm not entirely sure what the mathematical reason is, this is just from my experience writing test suite around learning xor. In my case, adding momentum helped, but I think pretty much any adjustment away from the simplest network and/or optimiser helps.

Creating neural net for xor function


Does the nucleus radiate energy?

Question: Does the nucleus also revolve around the centre of mass of atom? If yes then will it radiate any energy?why or why not
Answer: Why the down-votes?  The nucleus does revolve around the center of mass.  Do electrons radiate?  In classical physics both should, but neither do.
The resolution to the paradox comes in two steps. 1) use center-of-mass (COM) coordinates and relative coordinates 2) use quantum mechanics.  The system as a whole is neutral so the motion of the COM does not radiate (roughly speaking).
That leaves the relative motion of the electrons and nucleus.  The relative coordinates takes into account the positions of both the electrons and the nucleus.  The electronic transitions that occur in an atom are transitions of the system as a whole, not the electrons alone.   So the motion of the nucleus is accounted for in the quantum mechanical picture.
Note that the motion of the nucleus is also taken into account in the classical picture if the same change of coordinates is used.  The problem with that is that the classical picture predicts radiation that is not observed in real life.  If the classical picture were correct, the nucleus would indeed radiate.
Comment: Also see shell model for the nucleus.
Answer: Some words about the revolving. The now outdated idea about a rotation of electrons around the nucleus comes from the experimental setup: Atoms were bombed with electrons and as a result the atom seems to have a tiny nucleus and a lot of empty space around with orbiting electrons. The orbiting was dismissed but the name gets a transformation into orbits and means the probability of finding an electron in a specific region around the atom's nucleus.
The nucleus interacts with electromagnetic radiation. For example you can break or accelerate or hold in one place a nucleus with beams of light. And any interaction with EM radiation is not only an absorption of photons but also a radiation of photons. For this radiation it is not necessary to have the nucleus under rotation.

Does the nucleus radiate energy?


What are quantum computers actually doing today?

Question: I am curious about what are quantum computers actually doing today. I seem to only be able to find information online about what they could be used for in the future (i.e. breaking encryption, quantum annealing, simulations, etc.). However, it seems that these use cases are all theoretical and far off in the future. What are quantum computers actually being used for today? Is there any advantage to using a quantum computer over a classical computer with current quantum technology?
Comment: Hi there, your post currently contains two questions, would you mind narrowing it down to just one?
Answer: You are correct that the use cases are theoretical and possibly far in the future; today's quantum computers don't beat classical ones for useful tasks yet, and, for all intents and purposes, aren't being used for anything other than quantum computing research. They are both too noisy and too small to execute flagship algorithms like Shor's for factoring, and although there is research into NISQ (noisy intermediate-scale quantum) algorithms that make use of current or upcoming devices, whether they'll turn out to be useful still remains to be seen.
Answer: For the first question:

What are quantum computers actually being used for today?

They have been used in proof-of-principle experiments of various kind. I can mention for instance for applications in chemistry with NISQ VQE and QAOAs.
They are being used for simulating experiments that address the quantum-to-classical transition, for instance trying to prove quantum Darwinism.
Time crystals are an example of present application of quantum computers where we have new physics being probed in these devices.
At the level of hardware the mere workforce for constructing and understanding fault-tolerant quantum computation has lead to large number of hardware developments, so we can think as quantum computation also probing a variety of different physics from superconducting to linear-optics.
They have also been used in studying how quantum memories affect metrology.

Now the second question regarding advantages for state-of-the-art quantum computers.

Is there any advantage to using a quantum computer over a classical
computer with current quantum technology?

There is computational advantage in simulating permanents and other figures of merit of such. This is an advantage that is grounded by complex theoretic results that are rigorous. If this can be made useful is still to be shown. So far, such a problem has no utility and serves only to show existence of high gaps in the computational power between classical and quantum systems.
There are discoveries or proof-of-principle experiments that have been done and would have been much more challenging without having access to the noisy computers we have so far. Think that quantum computing is a different paradigm, that is not only about computation, but also about a new experimental paradigm for testing physics (opinion based last paragraph).
We are very far from applications that use algorithms such as Shor's algorithms or, in general, provably useful life changing applications. But I would also not claim that quantum computers haven't done anything useful either. Advantages in metrology and interesting physics had been successfully tested in these devices and may have important impact.
We are not capable of implementing most useful algorithms because they demand faul-tolerant quantum computers to work in its full glory.
Answer: Right now Google and IBM are using them to find solutions to logistical problems and knapsack-type problems. VQE or variational quantum eigensolvers are showing promise in making them more efficient than their classical counterparts. The VQEs normally have a classical part that is updated by the quantum part. It is considered a hybrid algorithm and blends quantum computing with classical computing. QAOAs and other hybrid near-term algorithms are showing promise while we work on getting cleaner noise-less qubits and more qubits in a quantum computer. Pennylane is also used for machine learning in chemical simulations. There is plenty of work being done with these computers. There will be so much more to do in the future too.
https://quantumai.google/cirq/experiments/qaoa
https://qiskit.org/documentation/stubs/qiskit.algorithms.QAOA.html?highlight=qaoa
VQEs in Chemistry:
https://github.com/QuantumCodeMatrix/possible_qai_algos/blob/main/Simulating%20Molecules%20using%20VQE.ipynb
Other use cases:
https://github.com/QuantumCodeMatrix/near_term_hybrid_use_cases
This is an organization I built for some quantum code sharing. Contributions are appreciated.
Comment: Could you give a citation for each of those companies? I'm skeptical for a couple reasons, but for example: Microsoft's approach to quantum computing hasn't yielded working qubits yet, so it's unlikely they're using them to do any computations.


Car loan with a student loan

Question: I am trying to buy a new car. However, I have a $3,500 subsidized student loan. I've had it for about a year and haven't made any payments on it. Will this affect me getting a car loan? Will it be wise to put some money down on the student loan before I apply for the car loan? Let's say $500.
Answer: Repayment of student loans is usually deferred until graduation.
Unless you are late or non-performing on a loan, it will make no difference to an auto loan.
To get a (normal) auto loan you will need to demonstrate a source of income or have the loan co-signed by someone who does have income.
As a general rule of thumb, banks care a lot more about your income than your "credit score".
Answer: $3,500 isn't usually enough to make a difference when calculating credit for a car loan. The other factors that you didn't mention are the important factors. How much money do you make? What is your credit score? Do you have balances on credit cards? The only way you can know is to look at your credit score and/or apply. I would generally recommend you buy a 3-4 year old car rather than a new car. With the lower purchase price you can pay it off quickly.
Comment: I have a credit score over 800, I have no debts, and I make significantly more than $1100/month. I still usually buy used cars with around 30k miles on them. A car that is a few years old is still very nice, but I can get up to a 50% discount by letting someone else break it in for me. The decision is yours, but my advice is to go with a lightly used car.
Comment: What kind of commissions do you typically receive?  At 1100 per month that puts you at poverty level and as such a new inexpensive bicycle is about the only thing that should be considered.
Answer: I like Nathan's answer some, but am horribly curious as to why you have not made payments on a $3500 student loan?  If you are wealthy enough to afford a new car, this should be paid off next week.  IMHO.
Above all else your financial goals should dictate if you buy a new car.  What are they for you?  If the goal is to build wealthy quickly then Nathan's advice may be to unfrugal for you.
If your goal is to impress people with the car you drive and accumulate very little real wealth then purchasing or leasing a car should be a top priority.
So to answer your question correctly one must understand your goals.
For 2016, the average car payment is $479 per month.  If you invested that in a decent growth stock mutual fund in 40 years you'll have around 2.6 million.  However, you do need something to drive now.  If you can cut your car expense to $200 per month, and save the other $279 you will still end up with about 1.5 million in that same 40 years.
Personally I attempt to shoot for $200 ownership cost per car per month.  Its a bit difficult as I drive a lot.  Also I would not purchase a new car until my net worth exceeded 2 million.  At that point my investments could mitigate the steep depreciation costs of owning a new car.

Car loan with a student loan


Proof of odd days table

Question: What is the proof for odd days table used for solving calendar related questions?
The table is given below, from the website Talent Sprint.
Comment: I don't see how this is a puzzle, simply a lesson in specific terminology.
Comment: @feelinferrety where should I have had posted it. sorry
Comment: I might expect to see it on English.SE. Others may disagree, but this feels more like an ask for usage clarification to me with only a tangential relationship to puzzling.
Comment: @feelinferrety sorry for this time. i will take care next time onwards. ty
Answer: The page you've taken the image from says this:

In a given time period, the number of days that are more than the weekly cycle are called odd days.

meaning that by "odd days" they mean "days left over when you remove as many whole weeks as possible".
They're working with the so-called proleptic Gregorian calendar which is what you get when you extend the calendar system we're using now into the past. (In reality, that system wasn't introduced until the 16th century.)
When you do that, you find that the very first day of year 1 is a Monday. So if you count the number of days from then until a particular date (inclusive), and then remove whole weeks (thus getting "odd days"), then you will get 1 for a Monday, 2 for a Tuesday, and so on. The table just shows that correspondence.
So there isn't really anything much to prove, beyond the fact that in the proleptic Gregorian calendar January 1, AD 1 was a Monday -- which is basically just a matter of counting :-).
(One thing worth knowing that they don't say explicitly, though they use it once, is that in the Gregorian calendar everything repeats perfectly every 400 years; in particular, the number of days in 400 years is a multiple of 7. So instead of starting from year 1, you can start from 1601 or 2001 and get the same answer.)
Comment: They are simply using [modular arithmetic](https://en.wikipedia.org/wiki/Modular_arithmetic), but without using fancy math terms.
Comment: Yes, that's correct.

Proof of odd days table


Software to translate code description to PCB design?

Question: Is there an application available that allows you to define each component and it's connections in a circuit (kind of like Entity Relationship Diagrams in database design), and have the application generate the most logical use of space on a PCB for you?
Comment: For very simple designs, you might want to look at the autoplace functionality of CAD suites like Proteus. The current release of Proteus does a surprisingly good job with 10-20 components, at least in comparison to the other such products I've seen. The grouping and other settings need some experimentation, though. For anything complex, you've already seen the "Nope, can't be done" answers, which I agree with.
Answer: No, not really.  What you are asking for is called auto-placement, which largely doesn't exist, and works poorly when it does.  This is one of those problems where the human brain is still better than software.  Determining layout is a complex issue with a very large solution space, and as such hasn't yet yielded to anything more than toy software implementations.
However, most of the rest of going from a schematic to a PC board can be automated or at least largely assisted by commonly available software.  Even for layout where the human makes the decisions, the software can make sure some basic rules are met.
Once you have a layout, which defines where what parts go on the board, then the next step is routing.  That refers to figuring out where all those copper tracks go that form the connections between the parts.  For this step, auto-router software is available and can be useful.  Even that isn't to the point where you can fire and forget, but such software can take care of a lot of the details for you.
Usually routing is a iterative process between you manually adjusting a few things, then letting the software do the grunt job of routing the things that are less critical.  Sometimes the software can't find a solution, or you don't like what it did.  You then move a few things around, manually route some traces, set some constraints, and let the software try again.
Anything that calls itself a E-CAD (Electrical Computer Aided Design) package will have schematic capture and routing capability.  Some will additionally have auto-routing capabilitiy or at least the option to add it.  Examples of such E-CAD software are Eagle, Altium, and quite a few others.
Answer: As mentioned in the previous answers, this is basically the function of Electronic Design Automation (EDA) or Computer Aided Design (CAD) tools.
The process of entering the connections between the components is known as schematic capture. Nowadays its normally done graphically rather than textually (as in traditional SPICE). The schematic may be annotated with additional indicators to show, for example, which wires must cary high currents, which wires should be layed out with controlled impedanc, or which ones must be length-matched to each other.
The EDA tool then converts the graphical schematic to a netlist file, which might be a plain text file or might be some kind of binary.
The netlist is imported into a layout design tool. In order to improve autorouting, the user has to carefully program constraints that indicate the design rules the tool should follow in placing the components and routing the wires between them. Managing these constraints to get the best results is the main skill needed to use the autoplacer and autorouter effectively, and it can be very time consuming.
In my experience, like others indicated, I get better results by doing manual placing and routing, possibly with some tool assistance. For example, I do most of the routing manually but use the tool to route multiple lines in parallel after I lay out just one of the lines. Or use the tool to add zig-zags to a line to make it length-matched to another line.
Answer: The O.P. basically describes an EDA software package.  Such software does exist: Cadsoft EAGLE, OrCAD, KiCAD, Altium, to name a few.
The part tasked with automatically creating a layout from schematic is called PCB autorouter.  But be aware that the layouts generated by autorouters are rarely most logical.  A lot of professional PCB designers don't use autorouters.
Comment: @OlinLathrop  Nevertheless, I think, my answer had broadened and improved the O.P.'s outlook on his issue.
Comment: No, a auto-router does *routing*.  The OP is asking about *placement*.  Auto-routers don't generate layouts.  You are confusing terms and not answering the question actually asked.
Answer: The database you describe sounds a lot like the SPICE model that sits underneath almost all electronics simulation / CAD software in some way or another. The old command-line SPICE stuff is, I'm fairly sure, available free & open-source.
Translating from that model to a PCB layout (in theory) should be a matter of finding a PCB-CAD package & importing the database in the correct format, then telling it to auto-route the PCB. In practice you probably need a fair bit of background work to tie the simulation to specific components, footprints, etc.
However, Auto-route is about the worst way to lay out a PCB and is likely to result in a non-space-efficient and inelegant layout using more tracks, layers, vias, or links than you need.
Autoroute will work for very basic stuff, but then you may as well lay those out by hand for all the time it saves you. For anything more complex it will throw its hands up and leave the rest to you, having made a rats nest of the first half for you to untangle.
Comment: Just taking a wild guess at his motivation... anyway, auto route and auto place are two sides of the same coin, they both invoke the travelling salesman problem from different ends... once you've solved that, you're laughing.
Comment: The OP is asking about *placement*, which has little to do with Spice.  It is also a separate problem from routing or auto-routing, so that again is largely irrelevant.


XMLHttpRequest with responseType Blob lightning

Question: For background I have been trying to make a XMLHttpRequest to a webservice to get a blob and then eventually read the same. The call seems to be going through, the chrome network logs shows the call was success and the service did respond with binary data.
But somehow when I am trying to read file using FileReader its giving me error:

TypeError: Failed to execute 'readAsDataURL' on 'FileReader':
  parameter 1 is not of type 'Blob'.

This essentially means its not giving me the required response type, probably converting the blob into some kind of object.
({
    testXHR: function(component, event, helper) {
        var xhr = new XMLHttpRequest();
        xhr.open('GET', 'https://httpbin.org/get');

        xhr.responseType = 'blob'
        xhr.onload = function() {
            var fr = new FileReader();
            fr.onload = function(e) {
                window.open(e.target.result, '_blank');
                return e.target.result;
            }
            fr.readAsDataURL(xhr.response);
        }
        xhr.send();
    }

})

Here are some observations

Made the same call using a VF page and seems like its working as expected
When trying from lightning component the chrome network tab does report the call was successfully and the service did respond with blob.
CSP is already set for the webservice
Cannot route the call via the apex controller , because of the size of response, which can be more than 6mb.

Not sure how to proceed on this. When putting some console.log statements in to log the response in lightning looks something like this:

where as in visualforce page it seems to be returning a proper blob object

I am not sure how to convert the lightning response to a proper blob object show that it can be read by FileReader. Any suggestions will be really helpful.
Answer: I'm guessing that Lightning page hijacked the XMLHttpRequest to optimize communications (but I don't know that for a fact)
If you're able to change the service's response you could change it to respond with a string representation of the blob (return base64 instead of blob). For example, a VisualForce Remoting method would return a type String and end with something like this:
@RemoteAction
public static String getBlobAsBase64() {
  Blob myBlob = getMyBlob();
  return EncodingUtil.base64Encode(myBlob);
}

On the other hand, if you're service is simply returning binary data you could try using jQuery BinaryTransport plugin for jQuery (I am currently using this plugin and it works on my VisualForce pages, haven't test on lightning though).  This method would look something like this:
var jqXHR = $.ajax({url: '/something.pdf', dataType: 'binary'});
jqXHR.done(function( data, textStatus, jqXHR ) {
  var reader  = new FileReader();
  reader.onload = function(e){
    window.open(e.target.result, '_blank');
    return e.target.result;
  };
});

Comment: Well proxying through apex wouldn't be possible because the response sizes can go more than 6mb. I need to give the Jquery plugin a shot, but I fear it might be also using xhr in the backend, which might be hit by the same issue.


Elite: Dangerous Horizons - What does the Data Link Scanner (on SRV) do to turrets?

Question: I used the Data Link Scanner on a hostile settlement turret, and the interface implied it was doing something, but there was no effect I could observe. Obviously deactivating turrets with the DLS instead of shooting them would be overpowered, and yet it's possible to target and scan them. There's no mention of using it on turrets anywhere online - or am I a bit slow, and it's just possible to scan anything you can target (with no effect)?
Answer: The Data Link Scanner can be used to hack/interact/scan different types of turrets. You can also receive data from the scans, much like scanning enemy ships.
The comments of the linked wiki article goes into some detail with troubleshooting if you're having trouble getting it to work. Some of the controls for the SRV arent bound by default, and you may need to bind the data scanner to a key press, fire group, both, or neither (depending on your control scheme).
Comment: that's what I was hoping, however upon reflexion it'd be much too easy, like a few seconds of scanning vs like a minute of shooting would be a total no-brainer. A more balanced effect would be lowering their shields (but they don't have shields) or maybe stopping them temporarily to make it safer to destroy them, but it didn't do either of those either, sadly.
Comment: Yes, it works fine on the data point things, giving data I can sell, as well as on the mining extractors, revealing their contents — it just didn't seem to have any observable effect on the turrets
Comment: @Toadfish oh sorry, i understand now. I've personally never had a "Hack" opportunity either, just scanning, but i took that to mean some turrets may be able to be turned friendly or something via the DLS.


speedup postgres pg_restore

Question: Hi I have to update monthly my database using this big dump (100gb)
I don't have the control over how it's done I only receive a .zip with a lot of .gz
i want to speed up the restoring since I only really need 1 table.
I have a nvme for my disk, but it's only getting written at like 200 mb/s but it's capable of a lot more.
I think this is because it's CPU bound the decompression of the .gz and I can't find a way to paralyze the decompression.
the postgres version is 10.20
how can i check where is the table stored, in what file i mean.
Comment: Start with the docs, paying special attention to `-l` and `-L`.  https://www.postgresql.org/docs/10/app-pgrestore.html
Comment: i already use that i want to see where the .gz is stored so that i can extract with multiple threads.
Answer: It is in a file whose base name is given by the first number in the relevant line from pg_restore -l
So for example:

4292; 0 17010 TABLE DATA public pgbench_branches jjanes

the data for pgbench_branches is in dumpdir/4292.dat.gz
But note that gz decompression does not parallelize well.  The dictionary is built up as it goes, so you need to have decompressed the previous tokens to know how to decompress the current one.
Comment: i think that i can use Pigz for the decompression
Comment: Right, but it only has one decompression thread as I understand it.  It uses other threads to do IO, so the main thread isn't sidetracked doing that.  That is not nothing, but it also is not much.  It is on the compression where pigz really earns its keep.
Comment: oh ok thanks for the info

speedup postgres pg_restore


How do I write a script that exits a cell that is being edited

Question: If I enter a value in cell A1 without exiting the cell . Before I exit editing A1 I run a script that at some point selects another cell B1 , while A1 is still being edited. When I then click C1, the value moves along to the cell B1 before C1 is selected . That is what I want to prevent. The value should remain in A1 when the script selects B1 and I select C1.
How do I call for the initial state of cell A1 being edited to stop before I select another cell.
Answer: You should avoid to call a script when a cell is being edited because Google Apps Script is not able to detect that a cell is being edited.
Resources

https://develoepers.google.com/apps-script/guides/sheets


Seated shoulder press vs standing press

Question: What are the reasons for choosing a seated shoulder press instead of a standing press (barbell or dumbbell)?
Comment: I choose standing, for reasons well outlined in Starting Strength: standing is more athletic, requiring full-body balance and strength.
Comment: Only reason I can find is that bodybuilders can put more weight over their heads with seated: http://tnation.t-nation.com/free_online_forum/sports_body_training_performance_bodybuilding/standing_shoulder_press
Comment: Cool. I agree! It's just I see a lot of people doing seated versions when they do them with dumbbells and was wondering if there's a reason to do them seated instead of standing.
Answer: The standing shoulder press is far more beneficial than a sitting one. This is not to say that the sitting one is useless for people with limited mobility or who are trying to isolate just one muscle group.
While standing, your body is able to activate the stabilizer muscles in your back as your arms extend upward.
The use of the back support while doing a seated shoulder press can lead to faulty recruitment patterns in the muscle groups.
If you do plan to use the seated shoulder press I'd advise that you do so without the back support. Remember to use those abs it will save you spine!
Also, the use of the legs in a standing shoulder press is not cheating. It utilizes the entire body and helps develop explosiveness.
Comment: If your goals are aesthetic and you want to isolate the front shoulder for greater volume, then that is a valid reason to do a seated press instead of standing.
Comment: So, there's no reason to do a seated press? This is what I thought! But, how could so many people be wrong? Anyway, thank you. However, I do think using legs in a press can be cheating if you're doing a press. It's not cheating if you're doing a push press.
Comment: @Affe , this is a good point! Seems like the closest to answering my question.
Answer: Standing press requires more of the stabilizing musculature than with the seated one. It should however be mentioned that a lot of people lack the required mobility in the shoulder joint to perform the standing press without going into lumbar hyperlordosis. While doing so you effectively exclude the musculature on the front of the abdomen and let the back musculature work on overtime stabilizing your body in a poor position. Tightness in the pectoral minor and lack of thoracic extension is often involved in this.
Therefore when performing the standing press you should always make sure that your core is tight and that your rib cage does not tilt in order to make up for crappy shoulder positioning.
An exercise I like to recommend to loosen up the shoulder is called "shoulder dislocations", which you can read about here:
http://stronglifts.com/shoulders-dislocations/
Comment: @Kate
No, you might not have any problems with the exercise, therefore it is probably better for you to do the standing version as it requires more muscle activity to perform (due to stabilization). For others having problems, the seated variation may be a better choice. Especially if one has extension based back problems. I hope this clarifies my answer.
Comment: Thank you for this, but it doesn't really answer my question. I don't have problems with the standing press. I am curious though... Why would lack of shoulder mobility contribute to hyperlordosis? Wouldn't hyperlordosis be caused by not activating the abs? Or weak abs? Or just poor layback technique?
Comment: @Kate For me, sometimes it's that achieving proper overhead shoulder position is right at the end of my range of motion, so I'll accidentally use some layback, causing excessive and potentially injurious lordotic arch. Usually happens on rep four or five of a max set.
Comment: Cool. It does, thanks! I take from this that the seated version is a good option to try for people having issues with the standing version.
Answer: It would be better to do the seated bench press instead of the standing press if:

you have problems with the standing press (based on Wingeer's answer), or
you want to target the front shoulder without using any other muscles for aesthetic reasons (based on comments by Dave and Affe), or
you want strong shoulders (based on Mike's answer)

Seated shoulder press vs standing press


Upgrading to Ubuntu 16.04 Stuck

Question: Trying to upgrade to 16.04.
Currently on the "Installing the upgrades" section.
The Distribution Upgrade window has been "Configuring procps (amd64)" for about 3 hours now.
I'm thinking it might be stuck?
Any way to determine if that is the case?
And if it is, the best way to interrupt the upgrade and restart?
Comment: I think it's normal, for me it took about 4 hours.
Comment: It took 4 hours for the entire upgrade or 4 hours for configuring procps?
Comment: Found a log file: /var/log/dist-upgrade/main.log and at the end: 2016-08-08 08:46:18,966 WARNING no activity on terminal for 300 seconds (Configuring procps (amd64))
2016-08-08 10:34:35,894 WARNING no activity on terminal for 300 seconds (Configuring procps (amd64))
2016-08-08 11:02:00,000 WARNING no activity on terminal for 300 seconds (Configuring procps (amd64))    Sure looks stuck to me!  Any way to kill gracefully?
Comment: Configuring is the slowest process in the upgrade, so it's normal to take you about 3 to 4 hours.
Comment: In a similar post when someone was upgrading to 11.10 it wound up taking 7 hours.  I'm going to let this run overnight and I'll check back in tomorrow.  If it does manage to finish I'll try to determine how long it took and post it for those interested.   If it doesn't, I'm still interested in advice on the best way to kill it, attempt clean up if possible, and restart it.
Answer: Okay, so the install was stuck - still not exactly sure why.  I wound up killing it.  To recover, I did the following (found in another post):
1) sudo dpkg --configure -a
2) sudo apt-get update
3) sudo apt-get upgrade
There were packages that were held back, but when I tried to install them with:
4) sudo apt-get install package-name another-package-name
they all failed to install.  I'm not sure yet whether those will be an issue or not in the long run...
Then I did:
5) sudo apt-get autoremove
to clean things up.
Then crossed my fingers (an important step) and rebooted.
And lo and behold it came up.
Things seem to look like they did before so that's a relief.
Thanks Frogatto for replying to me.

Upgrading to Ubuntu 16.04 Stuck


Can't find in my viewport but it shows in the outliner

Question: Can anyone help, I was sculpting a human full figure. So decided bring in my eyes, I went into object mode to add a sphere and hide the figure I was sculpting pushing the H button so I could work on the eye well. Finished  with the eye, now to put in the right place on the figure I sculpted but I can't unhide it even with the alt H but the object shows in the outliner .Did everything to make it unhide but it keeps hiding from me. Please anyone at my aid as soon as possible?
Comment: Seems like the other objets are in a different layer.
Comment: I can't find the object.. it's hidden in the viewport but visible in the outliner
Answer: Trying pressing the Tilde key (~) to show all layers and then pressing Alt + H to unhide all objects. It looks like there are objects in other layers which could be where the missing object is.
Comment: It's the lamp and camera I moved to the layer. And I have checked the layer but it won't unhide


Must I remove asbestos from my heating vents?

Question: I've got an old house with some asbestos tape on the heating vents, and some old floor tiles which are asbestos suspects as well; duct cleaning firms won't do cleaning on the vents with the tape present. Do I really need to call in the space suit guys to get rid of it? If I just cover it with new foil tape, will that encapsulate it safely?  Should I just rip it off myself?
Answer: It's not really that serious in most cases. In tile or siding, it isn't a hazard unless it is broken down, generating dust that you are breathing. Even then, a lot of tile is like 1% asbestos. If you can get it up without breaking it too much, you're basically fine.
Pipe insulation that is soft is more of a problem. You can probably do it yourself if it's a small amount. It may very well be illegal though. Get a respirator like this http://www.amazon.com/MSA-Safety-Works-817664-Respirator/dp/B0009XW3ZS, take a heavy plastic bag, tape it around the insulation so it's mostly sealed, and then spray it down with water so it's saturated and won't generate dust. Then remove it, dousing with water as needed. Seal it up in the bag and dispose of it lawfully.
I was an asbestos abatement hygienist for 3 summers, and I took airborne fiber readings of thousands of hours of removal being done. Although negative air containment systems were in place on those jobs, I had probably 10 concerning readings out of thousands.
Asbestos is like smoking cigarettes in my opinion. One day isn't going to hurt you. Every day for 5 years will hurt you.
Comment: I understand that perspective to some degree, as long as it's based on fact. If you want to be 100% safe, I hope you aren't walking around a city breathing car exhaust as well.

The fact is, I worked with asbestos contractors for 3 summers and what they do to do the job "safely" is basically what I described. Removing a small amount of intact tape is an extremely low risk thing that many would feel fine taking. Otherwise, encapsulation with duct tape is a perfectly adequate solution as well.
Comment: It may not be serious and could probably be removed easily by anybody, but in most places it is illegal to remove it without a license and proper equipment.  Even if you remove it you may find it hard to dispose of properly since you are not licensed (I assume), so you may have to bury it in the garden to hide the evidence.
Comment: `Asbestos is like smoking cigarettes` - I would never, ever, ever smoke a single cigarette around my children, or **any** children for that matter. So your analogy is correct, which makes your answer completely invalid and dangerous.
Comment: I know someone who did their own asbestos removal from his heating pipes.  He did exactly as Peter said - paper suit, mask, wet down.  Based on his research he could not find a SINGLE instance where minor asbestos "exposure" led to any harmful effects.  The asbestos issues are from people working in an industrial capacity around asbestos for long periods of time.  I don't think it is a real big deal.  The only issue is the waste...
Comment: There are many laws with the removal and disposal of asbestos and even limits to how much can be done by one-self, even in your own home. Regarding the risk -- asbestos fibers cannot be broken down by the lungs, ever. It is not like smoking, in that with smoking, the lungs at least have a chance to try and repair themselves. While a controversial statement, it is said that even a single fiber can lead to cancer. To me, it is less like smoking and more like Russian-roulette. Maybe you'll be fine, but why advocate for someone taking the risk just because you did work in a _professional_ setting?
Comment: The tile or siding seem OK, but I would not be happy doing the soft pipe insulation my self, unless I can wrap each pipe and then remove the pipes without distubring the insulation.
Answer: Get a professional. Asbestos dust is a real killer, and frankly it's not worth the risk of residual dust - especially if you have young childeren.
In Australia the Queensland government even have a "Dob in a neighbour" program if you think that someone is doing DIY asbestos handeling. That's how serious it is.
Comment: Ok, after getting downvoted for my answer, I decided to read more from the Queensland source.

**Part of their guide includes instructions on how to DIY on small, low risk asbestos sources, just like the original question stated!**
Comment: Update: Queensland is back to following international best practice; small-scale DIY asbestos removal is [OK again](https://www.asbestos.qld.gov.au/sites/default/files/asbestos-home-renovators-trades-guide.pdf?v=1551837789). Yes, every dust fiber is a theoretical risk, and so is every time you cross the road. Practical benefits just outweigh theoretical risks. _That_ is why smoking is not like asbestos removal.
Comment: How do you know it is a killer?  Please point me to some research that shows a home removal of asbestos is a risk.
Comment: Do NOT touch Asbestos, I am a Queensland based Home Automation Installer and Systems Integrator. If you think it is asbestos stop work and call an asbestos remover. The fines in Queensland for touching Aspestos are over $125,000


Gravitational waves and quantum computing

Question: Some month ago, I was attending a lecture from a person who worked for LIGO, and eho is now a professor at MIT, about gravitational waves. At the end of the conference, though, time for questions ran out, but I sometime I have this curiosity: do gravitational waves have potential for computing? If so, how much potential do they have, compared to quantum computers ( althiugh I know quantum computers are still a "work in progress")?  Are they studied somewhere, in order to achieve this goal?
Comment: Gravitational waves are far too weak to be used in computing of any sort.
Comment: I would like to say gravitational wave is a classical concept from GR. So let alone that it's very difficult to control it, it will not be a way to achieve quantum computation.
Answer: There are people studying whether it is possible to build "quantum gravity quantum computers", that is, quantum computers harnessing things like quantum fluctuations in the causal structure of spacetime, to solve tasks more efficiently than what is possible with "regular" quantum computers. A quick google search will lead you to some of these studies.
If you instead mean whether it is possible to use gravitational waves to do "standard" quantum computing, I'd say the answer is no.
To do something like this you would first of all need to quantize the gravitational waves, that is, have a consistent theory of quantum gravity.
Also, consider how harder it is to experimentally "see" the quantized nature of light (i.e. single photons) with respect to just detecting an electromagnetic wave.
It took huge effort to detect "classical" gravitational waves.
To detect their quantum nature (like gravitons, if that is even a thing in the real world) would be incredibly harder.
To summarize: it can be interesting, and is currently done, to study whether quantum gravity can allow (in theory) to perform things unachievable for regular quantum computers.
But to harness gravitational waves for quantum computing is even further away from the realm of actually doable things.
Comment: No, I didn't mean using them for quantum computing, I just expressed myself badly, sorry for that. My question was : are there any studies now, or possibilities at all, about a computer working with gravitational waves ( didn t mean the quantum nature of that, of course it would be very difficult to achieve that)? If so, would ot wa
Comment: Sorry, I espressed myself badly then. My question was about there are studies about a computer working with just gravitational waves, given the fact that they don t have the problem of keeping the noise low, or having the problem of decoherence, like quantum computers do(of course it would be almost impossible to exploit the quantum nature of gravitational waves, but I didn t mean that). I mentioned quantum computers, because they're the new technology that has been used, and I just wanted to name  it for a comparison between it and an eventual computer based on gravitational waves.


How old is drawing a distinction between appearance and reality?

Question: I've been reading A very short introduction to literary theory. Just before talking a bit about Rousseau, the author argues that "western philosophy traditionally distinguishes between appearance and reality". I google for that and found Bradley's book: Appearance and reality from 1893. As the author said "traditionally", I thought it was much older than that. Is this the origin of this idea or is it actually older than 1893?
Comment: But that is ignoring at least Plato, who theorized separating the 'real forms' of things from their 'participation' in our reality.  The metaphor of the Cave is surely about appearance vs reality on some level.  At the root of Stoicism, you also have Diogenes the Cynic driven by 'defacing currency' to get behind the mere appearance of value.
Comment: Heraclitus did write about the potentially deceptive features of perception as well (around 500 B.C.).
Comment: In the East, it is several thousand yearss old. In the West, it goes back to the Greek philosophers...
Comment: @SwamiVishwananda - ... and thus also in the West.
Comment: In the modern West the distinction became prominent due to Descartes, see [Cartesian theater](https://en.wikipedia.org/wiki/Cartesian_theater), and was particularly dramatized by Kant with his ["thing in itself"](https://en.wikipedia.org/wiki/Noumenon#Kant.27s_usage)
Answer: The distinction between appearance and reality is extremely ancient, much before written history. Any myth, any form of religion and world-view, is inherently bound with a distinction between appearance and reality.
Philosophy itself is often said to have been born out of ancient myth. The distinction between appearance and reality has been a constitutive part of philosophy, and right from the start. The earliest known philosopher in the West, Thales of Miletus (c. 600 BC) is reported to have theorized that "Water constituted (ὑπεστήσατο, 'stood under') the principle of all things". By that he is believed to have meant, that although there appear to be many unrelated things, and many unrelated events, in reality there is one principle, one ground, one explanation behind it all, and that one principle is identical with what we think of as water.
Answer: Long comment
An additional source from Plato (429?–347 B.C.E.), from Theaetetus, 157e, discussing Theaetetus' proposed definition (in 151e) that "knowledge is nothing else than perception [ἄλλο τί ἐστιν ἐπιστήμη ἢ αἴσθησις]" :

Socrates : Let us, then, not neglect a point in which it is defective. The defect is found in connection with dreams and diseases, including insanity, and everything else that is said to cause illusions of sight and hearing and the other senses. For of course you know that in all these the doctrine we were just presenting seems admittedly to be refuted, because in them we certainly have false perceptions, and it is by no means true that everything is to each man which appears [τὰ φαινόμενα] to him; on the contrary, nothing is which appears.

It is woth noting that the examples of "false perception" used regard disease, madness and dreams... a lot of centuries before Descartes.
Answer: Plato's Simile of the Cave (c. 380 BC) is the earliest I know of. The inhabitants of the cave think the shadows cast by the fire are the real phenomena, but it isn't until they leave the cave and see things in sunlight that they discover the truth.
Comment: You just made Plato 200 years older than he actually is.
Comment: Hi. Can you fix that date?
Comment: Date corrected.


How to view DB2 Table structure

Question: How to view the table structure in DB2 database
Answer: I got the answer from the sysibm.syscolumns
Select distinct(name), ColType, Length from Sysibm.syscolumns where tbname = 'employee';

Comment: It may differ by version as it seems. We are running V7R1 and table is `SYSIBM.COLUMNS`. Also columns are different, so i uses `DSPFFD FILE(SYSIBM/COLUMNS)` to find correct columns
Comment: Added 'order by COLNO' because the output order is not the same as the actual column order.

**Select distinct(name), COLNO, ColType, Length from Sysibm.syscolumns where tbname = 'EMPLOYEE' order by COLNO**
Comment: This worked for me on V7R1 and it selects for a specific library:
select COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGth, NUMERIC_PRECISION
from SYSIBM/COLUMNS where TBNAME = 'TABLE' and TABLE_SCHEMA='LIBRARY';
Comment: table name is case sensitive for me.
Comment: NULLS can be added to know mandatory columns
Answer: Generally it's easiest to use DESCRIBE.
DESCRIBE TABLE MYSCHEMA.TABLE

or
DESCRIBE INDEXES FOR MYSCHEMA.TABLE SHOW DETAIL

etc.
See the documentation:
DESCRIBE command
Comment: I tried executing DESCRIBE TABLE statement but there is error:

11:42:25  [DESCRIBE - 0 row(s), 0.000 secs]  [Error Code: -104, SQL State: 42601]  An unexpected token "TABLE" was found following "DESCRIBE ".  Expected tokens may include:  "JOIN ".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.13.127
... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec  [0 successful, 0 warnings, 1 errors]

I am running this on DBVisualizer. Please advise
Comment: IBM DB2 is not responding to this query ! It says-

Error : DB21033E  The command is not valid for this DB2 database server.
Comment: What platform are you using?  Based on your comments, I suspect it may be zOS.
Comment: Thanks for your answer. But i couldn't get the result
Comment: @ssc describe here  is db2 command not sql statement. if you are trying through ibm_studio you will hit this error
Answer: In DB2, enter on db2 command prompt.
  db2  =>  describe  table MyTableName

Answer: Also the following command works:
describe SELECT * FROM table_name;

Where the select statement can be replaced with any other select statement, which is quite useful for complex inserts with select for example.
Answer:
How to view the table structure in db2 database

Open db2 command window, connect to db2 with following command.
> db2 connect to DATABASE_NAME USER USERNAME USING PASSWORD

Once you connected successfully, issue the following command to view the table structure.
> db2 "describe select * from SCHEMA_NAME.TABLE_NAME"

The above command will display db2 table structure in tabular format.
Note: Tested on DB2 Client 9.7.11
Answer: FOR TABLE DESCRIPTION IN IBM DB2 10.7 VERSION I TRIED THIS AND IT WORKED FINE
SELECT NAME,COLTYPE,NULLS,LONGLENGTH FROM SYSIBM.SYSCOLUMNS where TBcreator =SCHEMANAME and TBNAME =TABLENAME;

Answer: 1.use db2 describe table
  db2 describe table tabschema.tabname

2.use db2 describe output
  db2 "describe select * from tabschema.tabname"

3.use db2look utility
  db2look -d dbname -e -t tabname

4.find rows in db2 syscat
  db2 "Select * from syscat.columns wher tabname='' and tabschema =''"

Answer: php example for iSeries (as400) db2, yes this worked!
$i5 = db2_connect($database, $user, $password, array("i5_lib"=>"qsys2"));

$querydesc = "select * from qsys2.syscolumns where table_schema = '".$library."' and table_name = '".$table_name."' ";

$result = db2_exec($i5, $querydesc);

also if you just want to list all tables with their descriptions
$query = "select TABLE_NAME, TABLE_TEXT from systables where table_schema = '$library' ";

$result = db2_exec($i5, $query);

Answer: You can Get the table meta data using this query
SELECT * FROM SYSIBM.COLUMNS WHERE TABLE_NAME = 'ASTPCLTEXT';

Answer: to get all tables: (You may want to restrict schema to your schema)
select * from syscat.tables

to get all columns: (where tabname = your_tabname)
select * from syscat.columns

Comment: I couldn't get the result for the above given.
Answer: Control Center already got the feature of that. It's just below the table list.
Comment: I wanted to get this in a console rather than in control center
Answer: Use the below to check the table description for a single table
DESCRIBE TABLE Schema Name.Table Name

join the below tables to check the table description for a multiple tables, join with the table id
syscat.tables and syscat.columns
You can also check the details of indexes on the table using the below command
describe indexes for table . show detail
Answer: if you're using Aqua Data studio, simply write select * from table_name and instead of pressing execute,, press ctrl +D .
You shall be able to see the description for the table
Answer: The easiest way as many have mentioned already is to do a DESCRIBE TABLE
However you can also get some the same + additional information from
db2> SELECT * SYSCAT.TABLES

db2> SELECT * FROM SYSCAT.COLUMNS

I usually use SYSCAT.COLUMNS to find the related tables in the database where I already know the column name :)
Another good way if you want to get the DDL of a particular table or the whole database is to use the db2look
# db2look -d *dbname* -t *tablename* > tablestructure.out

This will generate the ".out" file for you which will contain the particular table's DDL script.
# db2look -d *dbname* -e > dbstructure.out

This will generate the entire database's DDL as a single script file, this is usually used to replicate the database, "-e" is to indicate that one wants to export DDL suitable recreate exact same setup in a new database.
Hope this can help someone looking for such answers :)
Answer: I am running DB2/LINUXX8664 10.5.3 and describe select * from schema_name.table_name works for me.
However, describe table schema_name.table_name fails with this error:
SQL0100W  No row was found for FETCH, UPDATE or DELETE; or the result of a
query is an empty table.  SQLSTATE=02000
Answer: drop view lawmod9t.vdesc

create view lawmod9t.vDesc as select
       upper(t.table_cat) as Catalog,
       upper(t.table_schem) as Schema,
       upper(t.table_name) as table,
       t.table_text as tableDesc,
       c.system_column_name as colname_short,
       c.column_name as colname_long,
       c.column_text as coldesc,
       c.Type_Name as type,
       c.column_Size as size
from sysibm.SQLColumns c
inner join sysibm.sqltables t
on c.table_schem = t.table_schem
and c.table_name = t.table_name

select * from vdesc where table = 'YPPPOPL'

Answer: I am using Aquadata Studio 12.0.23, which is several versions short of the newest. So your experience may be better than mine. I found that the best way to get an overview was to use the ERD generator. It took a couple of hours, since normalization was not a concept used in the design of this database almost 30 years ago.
I was able to get definitions for all of the objects in a few hours, with a file for each.
Answer: The OP doesn't mention if this is DB2/400 being discussed, but I found that the only way I could get the table structure including the column name descriptions was to use DSPFFD.
DSPFFD FILE(TBNAME) OUTPUT(*OUTFILE) OUTFILE(SOMELIB/TBDESC)
This puts the description of TBNAME in a table called TBDESC in the SOMELIB library.  You can then query that with:
select * from SOMELIB/TBDESC
Comment: The **only** way? Wow! Someone needs to dig into the SQL some more ;-) Try some of the suggestions in prior answers; admittedly some are not going to function on the DB2 for IBM i. Mostly because the authors failed to preface with "For DB2 LUW", unlike this answer did, by so nicely starting with essentially "For DB2 for IBM i". But typically the responses that will have directed to use of the SQL catalogs for obtaining the descriptive information [e.g. from `COLUMNS` or `SYSCOLUMNS`; typically VIEWs with metadata for DB2 *objects*], those should be similar across all DB2 variants.
Comment: The other ways work with the exception of the column name description.  This was the only method I found that gave me that.  I'm not saying there aren't others because I stopped looking when I found what I needed.
Comment: Depends on what is meant by "column name description", I suppose. But the VIEW SYSCOLUMNS in QSYS2 has defined, a COLUMN_TEXT FOR LABELTEXT column, that is derived from the data DBITXT of the System Database Cross Reference file QADBIFLD in QSYS that should be the *same* as the data obtained from the WHFTXT column of the system-supplied record format QWHDRFFD of the model-file QADSPFFD in QSYS; i.e. the dynamically maintained information for that "column name description" can be obtained directly from the catalog rather than having to use the Display File Field Descriptions (DSPFFD)
Answer: The Db2 catalogs hold lots of information about table structure. You can query them to find (most) things out about the structure of a table.
For example, you can generate (approximate) DDL for Db2 LUW tables from the catalog with SQL such as contained in this view from the IBM samples
https://github.com/IBM/db2-samples/blob/master/db_library/views/db_table_quick_ddl.sql
Answer: One way to get list of columns and their detail using SQL editor is:
SELECT * FROM  QSYS2.SYSCOLUMNS WHERE SYS_TNAME ='YOURTABLE';
Describe works for MariaDB, but not for IBM or at least I do not know.
Answer: describe output select * from TABLE(WLM_GET_WORKLOAD_OCCURRENCE_ACTIVITIES('',-2))

Answer: Follow this simple steps:

Select the Browsers window.
Extract (expand) it.
Select and extract (expand) the table list.
Select the required table and extract (expand) it.
On double click the code option, it opens the table structure.

How to view DB2 Table structure


How do I find out why my answer was down-voted

Question: Today an answer I posted (Magento 22.214.171.124 Compatibility) was down-voted. I don't know why and I can't see how to find out. Is it possible to know why?
Comment: I'm going to do the moral thing and explain why I downvoted *this question*. It boils down to "how can I know what someone else was thinking while clicking a button on the internet". This is a question that cannot be answered, you will have to live with it. The only advice I can give is to not take it personally.
Comment: So I can ask them why they down voted it. I'm curious because I can't see why they did it. If I have provided a poor answer I want to know how to improve.
Comment: why do you want to know who downvoted your answer?
Comment: Actually eh moral thing to do when one downvotes a post is to leave a comment below the post explaining the downvote, but people cannot be forced to do so.
Comment: Maybe it should be made mandatory to leave a comment if downvoting.
Comment: I think there was a discussion about this on meta.stackexchange.com, but not sure. The result was that it will not be mandatory.
Comment: @fabian Now we're getting into semantics and the vagueries of the English language ;-) All I wanted to know was how to find out who, and hence why, something was down voted. Clearly not possible unless someone has morals. I don't take it personally. I have to say though that stackexchange is not geared for friendliness towards the uninitiated, those who don't know the nuances of the rules, and those for whom English is not their first language.
Comment: Downvote here, upvote there :P
Comment: @jscar, Even on this question also you got downvote. Oh god !
Comment: @TejabhagavanKollepara :o) I love stackexchange! It's definitely not for people with self-worth problems.
Answer: Not possible only the down voter can tell you reason why he did that.


Is there a way to know when someone tries to guess your gmail password?

Question: Is there a way to check if someone is trying to login to my Gmail account without knowing the password (so they keep trying to guess the password and failing repeatedly or trying to guess the answers of account recovery) as opposed to trying to login and getting the password right? (I know Gmail warns you when that happens).
Comment: I don't think so, or everyone would receive dozens and dozens of messages all the time.
Comment: I don't think there's a way to do that by yourself, obviously if you had access to the gmail server, then it would be trivial to check. Maybe it's possible to contact gmail staff for this, but I doubt they are giving that info unless required by a court order or similar.
Answer: Unfortunately, no it is not possible view these logs unless you have a google business account.
If you do have a google business account it can be viewed via the admin panel.
More Info here: https://webapps.stackexchange.com/a/3287/137301


Does it matter if I connect between my devices on LAN using their LAN IP addresses or the IP address visible to the internet?

Question: At my home I have my desktop computer behind a router. There's a port forwarded by the router to the computer's ssh port. When I am using my laptop in the same LAN, I can either connect to my desktop computer on 192.168.1.something or just connect to the router's address on the internet. Does it matter which way I do it in terms of routing, speed and ping?
Comment: so long as it works, no it doesn't
Comment: Most home routers these days make ["hairpin turns"](https://en.wikipedia.org/wiki/Hairpinning), which is what you are doing.  So as @Jasen mentions if it works it doesn't matter.
Answer: If you're using the public IPv4 address (visible to the Internet), then the network traffic gets sent to the device with that address.  That would be your router.  This means your router needs to receive the traffic.  Then, your router is noticing that there is a forwarded port, so it converts the network traffic's IP address and then sends the converted network traffic to the laptop.  This is a heavier burden than required, overworking the router.
If you have a switch between your devices and the router, the switch may be getting used multiple times as well.  Even if that's not the case and the router's multiple LAN ports are being used like a switch, using the internal addresses will allow the router to basically act like a switch when handling the traffic, which likely requires a lower burden on the router, meaning that the router can process the traffic more quickly.
Another benefit: If you use internal addresses, and then if your router dies, you can replace the router with a switch and your internal communication is much more likely to work with minimal (quite possibly no) change.
Answer: So long as it works it doesn't matter. However you will probably get better performance by using the LAN address and thus, not involving the router.
Answer: connect directly to 192.168.1.something will faster. your packages data does not need to passthrough router forwarder. communication will be established in OSI layer 2.


How can I use Solana with Flutter

Question: How can I use Solana with Flutter. İf you know please explain me. Because ı have a project and ı should use this
Answer: To use Solana with Flutter, you can use the solana_sdk library, which provides a Dart interface to the Solana blockchain.
Here's an example of how you can use the solana_sdk library to send a transaction to the Solana blockchain from a Flutter app:
import 'package:solana_sdk/solana_sdk.dart';
// Replace with your own private key and Solana account
final privateKey = PrivateKey.fromHex(
'1111111111111111111111111111111111111111111111111111111111111111',
);
final account = Account(
pubkey: privateKey.publicKey,
lamports: 50,
);
// Create a client for the desired Solana cluster
final client = Client(
clusterUrl: 'https://api.solana.com',
);
// Build a transfer transaction
final transferTransaction = TransferTransaction(
address: Address(
'1111111111111111111111111111111111111111',
),
amount: 10,
);
// Sign the transaction
final signature = transferTransaction.sign(privateKey);
// Submit the transaction to the network
final result = await client.submitTransaction(
transaction: transferTransaction,
signature: signature,
);
// Check the result of the transaction submission
if (result.isSuccess) {
print('Transaction was successful!');
} else {
print('Transaction failed: ${result.error}');
}
This example shows how to create a transfer transaction, sign it with a private key, and submit it to the Solana network. You can modify the example to perform other actions on the Solana blockchain, such as deploying and calling smart contracts.
I hope this helps! :)
Answer: The Espresso Cash team built and maintains a Flutter Solana SDK that includes:

Mobile Wallet Adapter for signing txs/messages.
Flutter solana and jsonrpc_client libraries for constructing transactions and submitting to RPCs.
solana_seed_vault for Seed Vault SDK

A good starting point is their example app and the Solana Dart/Flutter dev discord mentioned here.
Comment: This is the best answer here. I'm using these packages (excluding seed vault) and they're enabling our development fully! Antonie make sure your affiliation with Espresso Cash is disclosed, as per stackexchange TOS
Answer: Hey maybe you can use this:
https://pub.dev/packages/solana_web3
I have been using this library and so far it seems to me that it is complete to do things with the current version of solana to date.
Answer: To use Solana with Flutter, you will first need to install the web3flutter package and import it into your Flutter project. Then, you can use the Web3 Flutter API to create a connection to the Solana blockchain, sign transactions, and interact with smart contracts.
Here is an example of how you might use Solana with Flutter to sign and send a transaction:
import 'package:web3flutter/web3flutter.dart';
void main() async {
// Connect to the Solana blockchain
var web3 = Web3('https://testnet.solana.com');
// Generate a new private key and account address
var privateKey = await web3.eth.accounts.create();
var fromAddress = privateKey.address;
// Construct the transaction data
var toAddress = '0x...'; // address of the recipient
var value = BigInt.from(1); // amount to send
// Sign the transaction
var signedTransaction = await web3.eth.accounts.signTransaction(
privateKey: privateKey,
to: toAddress,
value: value,
);
// Send the signed transaction
await web3.eth.sendSignedTransaction(signedTransaction);
}
This is just a simple example, and there are many other ways that you can use Solana with Flutter, depending on your specific needs. For more information and examples, you can refer to the web3flutter documentation and the Solana Web3 API documentation.

How can I use Solana with Flutter