How do I implement RichTextEditor in Flash?

Question: I'm looking at this example: and for the life of me I don't see how to utilize this in Flash.  I don't want to build a Flex app... I want to implement this object in my Flash code.  But I'm not having any luck importing mx.controls or getting an instance of this component. It's not in my component's library, either.  Is there some lib I'm missing? Or am I just attempting the impossible here?
Answer: Flex components/containers must be parented by other Flex components/containers.  Adding one to a regular Flash project won't function properly.
As for Rich Text Editors you have to either build one or look around.  It seems like there's a few non-Flex ones available.  Here's one I found: http://www.flashloaded.com/flashcomponents/flashtexteditor/
Answer: This is the one I would go with it is an open source rich text editor.
http://code.google.com/p/as3texteditor/


Multiplicative order and primitive roots

Question: Let $p$ be an odd prime and r an integer coprime to $p$. I am trying to show that if $r^{p-1}/q$ is not equal to $1$ for all primes $q$ dividing $p$, then $r$ is a primitive root modulo $p$. The hard part is that we only need consider the primes $q$ dividing $p$ for some reason. Thanks for any help you can give.
Answer: If $r$ is not a primitive root, then $r$ has order $m$ where $m$ is a proper divisor of $p-1$. But then  $m$ divides $\frac{p-1}{q}$ for some prime divisor of $q-1$.
If this does not seem obvious, note that $\frac{p-1}{m}$ is divisible by some prime $q$. Thus $\frac{p-1}{m}=kq$ for some $k$. But then $km=\frac{p-1}{q}$, so $m$ divides $\frac{m-1}{q}$.
It follows that $r^{(p-1)/q}\equiv 1\pmod{p}$. But the problem specified that
$r^{(p-1)/q}\not \equiv 1\pmod{p}$.
Comment: Thanks! I guess I could always take q to be the smallest prime dividing p-1.
Comment: Not really. Want (the smallest) prime dividing $\frac{p-1}{m}$ where $m$ is the order of $r$.
Answer: Lagrange's theorem tells us, that the smallest $k$ satisfying $r^k=1$ in $\mathbb Z_p^*$ divides $|\mathbb Z_p^*|=p-1$. So there is some $a$, such that $ka=p-1$ for this $k$.
Assume, $r$ is not primitive, then $a>1$, so you can write $a=qb$, where $q$ is a prime. Now $kqb=p-1$. Then $r^k=1$ implies $r^{kb}=1$ and
$$1=r^{kb}=r^{\frac{p-1}{q}}$$
is a contradiciton to your precondition.


Populate a UITableView with data

Question: First of all, while I have an understanding of some of the basics, I'm am still somewhat of a newbie.
I have a sectioned UITableView that I am currently using NSDictionary(for grouping) and 4 or 5 different NSArrays (for data, some of which gets passed to the next view when a cell is selected) to populate the table.  It works but it's a very long list and after a few minutes of scrolling the UITableView up and down, leaving that view and coming back to it, the app starts to "slow down" and eventually freezes.  I have been doing some research and have found that the way I am doing that is not the best way.  I have read about using another object to populate the table which will only load data as needed and won't keep that data in memory(which is probably causing my app to freeze).
Can anyone help point me in the right direction to build a "data object" to store my data and then use it in my UITableView?  Can I just take my NSDictionaries and NSArrays and somehow put them in thier own class and call that class?  Would I use Core Data?  Any other suggestions?  As a note, this data cannot be added to, updated, or deleted by the user. The only time I will change the data is to add more data(a completely new record) to make the list longer and maybe once in a while, but very rarely, updated or deleted by me.
Any help would be greatly appreciated.
Comment: My guess is that it is not the dictionaries or arrays. Can you post the `cellForRowAtIndexPath:` method from your view controller? It could be that you're not properly reusing the table cells.
Answer: It is true that UITableViewController is most efficient when coupled with CoreData. To do this, you should look into NSFetchedResultsController. If you want an easy way to get into CoreData, use MagicalRecord. It is very easy to use and very efficient.
However, it is worth noting that an NSDictionary with several NSArrays filled with thousands of NSStrings should not cause you memory problems. The fact that you are able to load this into memory in the first place suggests that you can hold the entire data structure in memory. The fact that you slow down and freeze when scrolling means that the memory problem comes from UITableView cell instantiation.
Here are a few things you should check:

Do you know how to use Instruments? If so, check for memory leaks.
Do you receive didReceiveMemoryWarning in your UITableViewController? I'm guessing so. But you want to be sure it's not some thread blocking issue.
Are you using images in your UITableViewCells? If you have thousands of images, you definitely want to use an NSCache to store it. That will automatically clear up memory when needed.
Are you using custom UITableViewCells? Since you are experiencing slowdown from scrolling, check that the custom cell isn't having problems drawing.
Make sure you are dequeueing cells. This is done in template UITableViewController code, but you may have removed it for some reason.

Populate a UITableView with data


$\alpha$ and $\beta$-decay, why don't they neutralize each other?

Question: $\alpha$ radiation consist of positive charged helium nuclei, $\beta$ radiation of negative charged electrons. So why don't the $\alpha$ particles take those electrons to get neutral?
Comment: Yes, I mean $\beta^-$ decay.
Comment: you mean $\beta^-$ decay, there is also $\beta^+$ decay consisting of positrons
Answer: I agree with jwenting but in some sense, I feel that he is not answering the question: why there's no "combined $\alpha$ plus $\beta$ decay in which a nucleus emits e.g. a helium atom?
Well, let me start with the $\beta$-decay. Nuclei randomly - after some typical time, but unpredictably - may emit an electron because a neutron inside the nuclei may decay via
$$ n\to p+e^- +\bar\nu$$
which may be reduced to a more microscopic decay of a down-quark,
$$ d\to u + e^- +\bar\nu.$$
This interaction, mediated by a virtual W-boson, is why a nucleus - with neutrons - may sometimes randomly emit an electron. So the $\beta$-decay is due to the weak nuclear force. On the other hand, the $\alpha$-decay is due to the strong nuclear force: the nucleus literally breaks into pieces, with a very stable combination of 2 protons and 2 neutrons appearing as one of the pieces (helium nucleus).
The two processes above are independent, and each of them can kind of be reduced to a single elementary interaction whose origin is different. This independence and different origin is why the "combined" decay, with an emission of both electron (or two electrons) and a Helium nucleus, is extremely unlikely. Such an emission of a whole atom (which is electrically neutral but it is surely not "nothing"!) could only occur if several of the elementary decay interactions would occur at almost the same time which is extremely unlikely.
Answer: when they meet, it might happen. But calculate the chances of 2 particles meeting that have the right energy levels to actually combine. You'll find those chances are miniscule.
Comment: Do you have a reference for this calculation?
Comment: @martin I think jwenting has right, but he didn't explain the reason enough well. Both radiations are typically in the order of MeV, it is *very* energetic on human scales (order of tenth of eV). Thus, anything radiating alfa or b-, has actually a very little concentration from them. Thus, the post is about a reaction between two, very, very rare substance. Furthermore, also the binding energy between an alpha-particle and an electron is in the order of eVs. There is only a very little chance for two, MeV-energy particle to combine with eV-order binding energy.


why did Elisha lay on the boy two times in order to raise him from the dead in 2 Kings 4:35

Question: In second kings, chapter 4 Elisha went to the son of the Shunammite woman to raise him from the dead after Gehazi's attempt had failed. It says that Elisha got on the bed and stretched out upon him once more in verse 35 and then he sneezed seven times and opened his eyes. Why was a second time needed? Between times he had got up, turned away and walked back-and-forth in the room. Wondering what had been occurring during that time if anything other than prayer. Wondering also if the two times were representative of Christ, raising us physically, and then also spiritually. His identification with us in both ways?
Comment: The staff did not raise the child. The prophet, alone, did not raise the child. Then the prophet walked to and fro _in the house_. Then . . ..  then, the third time, was the child raised from the dead. The House, and the third. Significance. Up-voted +1.
Answer: I try to avoid interpreting it metaphorically.
In 1 Kings 4:34, the account describes Elisha laid on the boy mouth to mouth, eyes to eyes, hands to hands, in order to warm up the boy. It should be noted that Elisha did not fully lie down on the boy. Instead, he supported his own weight to ensure that the boy could breathe freely. This act of care might have left Elisha physically exhausted, prompting the need for rest.


How did the Master return in season 8?

Question: Any classic Whovian will know that the Master is never dead, just renegotiating his contract with life.  I just want to know how the writers justified his return as the Mistress in season 8.  What in-universe reason is there behind the Master's return?
Comment: Do they ever explain how the Master returns?
Comment: Big spoiler in the headline!
Comment: Season 8 was three years ago.  There has to be a statute of limitations on expecting a spoiler warning.  P.S.  Rosebud is a sleigh.
Answer: The doctor answer this question in the final episode of season 10
Explanation

The Master was last seen, in a semi resurected state charging into Gallifrey in "The End of Time".  The Doctor assumes that Gallifreyans cured the master of his problem (semi resurected state) then kicked him out Gallifrey.

Corresponding Transcript

Doctor : The last time I saw you, you were on your way to Gallifrey.
  Master : Well, I didn't stay why would I stay?
  Doctor : So they cured your little condition and kicked you out.
  Master : It was a mutual kicking me out

Moreover

 This Master is killed in the last episode of season 10. It is currently unknown if he regenerated into Missy or if there is another regeneration between them
Comment: Interesting. When I heard that exchange, my immediate thought was that the "condition" was the madenning drumbeat they instilled in him from the vortex. This makes more sense though.
Comment: I don't think there is a clear answer wether the drumbeat is still there. But It might have been cured too.  Missy doesn't seem affected. That being said, the Master did had his signature beat in his musical theme in the last episodes.
Comment: "*Moreover, it is currently unknown...*" - yes, it is known, because they had a whole conversation about it in the last episode of season 10.
Comment: @RemyLebeau Although they had a whole conversation about it, you can't assume anything. Missy clearly didn't remember any of this happening, so she can't have remembered the regeneration either.
Comment: @MrLister she had some memories from his time. And besides, I recall him specifically asking her if she is who he regenerates into next.
Answer: I don't have a particular source, but the general context of the episode and subtext implies that the master turned into missy at the end of that episode. Seeing as how the nethershere:

 Was also a secret cybermen construction project

It is likely that the master left the ship and went off into space at that moment to construct the nethersphere. There is likely no delay considering the direct relation of the two projects the master/missy engaged in.
The other answer seems to clear up how he got trapped around a black hole but I never saw the end of time. I've watched all the episodes but missed that one. As far as I've ever known he:

 was shot dead by his assistant at the end of season 3 (which I assumed prompted his regeneration into Missy).
Comment: The Master didn't regenerate at the end of season 3, he refused and died a "final" death to spite the Doctor. He came back later of course, in The End of Time.
Comment: @JDoe well...  i assumed at the appearance of missy that he regenerated in secret. to be fair... I assumed the tardis regenerated beings as back then that was my impression.

How did the Master return in season 8?


Using a apt repository to install packages but not auto-update them

Question: I had some problems with Linux, probably caused by a bug in the kernel or some drivers.
Old distriutions such as Ubuntu 12.10 work, and that's what I use.
However this release is old and isn't supported anymore, so I download most packages over the Debian repo web interface.
I want to add the Debian Jessie repository to sources.list, but I don't want to neither packages be upgraded automatically, nor over apt-get upgrade.
I want packages only be upgraded if I type: apt-get install --only-upgrade packagename or if it is required because packagename is required as an dependency by apackageiwanttoinstall.
Comment: add a  hold  line  in your apt conf  file  something  like   ' apt-get --hold {pkgs}
Answer: What you need is APT Pinning.  You should set the priority of Jessie packages low enough that they won't be auto-installed, e.g.
Package: *
Pin: release n=jessie
Pin-Priority: 50

See the apt_preferences man page.


Proving that rational numbers are dense

Question: I am trying to show that for any real number a, there exist infinitely many rational numbers m/n with $ |a - m/n| < 1 /n^{2} $. I've tried to attempt the question by assuming there are finite rational numbers and finding a contradiction.
Comment: That's a much stronger statement that the rational numbers are dense.  And look in Niven's number theory book for the proof.
Answer: There might be simpler ways to prove this, but the only way I know how to do this is via the following theorem (which makes use of the pigeonhole principle):
Theorem. Now show that given any positive integer $Q$ we may find positive integers $p, q$ with $1\leq q\leq Q$ and such that $|x-p/q|\leq 1/(qQ)\leq 1/q^2$.
Proof. Let $Q$ be any positive integer. Consider a list of $Q+1$ terms $a_0,\dotsc, a_{Q}$ where $a_k=kx-\lfloor kx\rfloor$ for $k=0, 1,\dotsc, Q$. Note that each $a_k$ is the decimal part of $kx$, so $a_k\in [0,1)$. We divide $[0,1)$ into $Q$ parts:
$$[0,1)=\bigcup_{n=0}^{Q-1}\left[\frac{n}{Q}, \frac{n+1}{Q}\right)=\left[0, \frac{1}{Q}\right)\cup\left[\frac{1}{Q}, \frac{2}{Q}\right)\cup\dotsm\cup\left[\frac{Q-1}{Q}, 1\right).$$
Since there were $Q+1$ terms in our list and we divided $[0,1)$ into $Q$ parts, the pigeonhole principle implies at least one of our subintervals contains two terms, which we label $a_i$ and $a_j$. Without loss of generality, assume $i>j$. Each subinterval has length $1/Q$, so $|a_i-a_j|<1/Q$. Thus,
\begin{align*}
|a_i-a_j| &=\left|(ix-\lfloor ix\rfloor)-(jx-\lfloor jx\rfloor)\right| \\
&=\left|(i-j)x-(\lfloor ix\rfloor-\lfloor jx\rfloor)\right|<1/Q.
\end{align*}
Define $p:=\lfloor ix\rfloor-\lfloor jx\rfloor$ and $q:=i-j$. Then $1\leq q\leq Q$ and
$$|xq-p|<\frac{1}{Q}\implies \left|x-\frac{p}{q}\right|<\frac{1}{Qq}\leq \frac{1}{q^2}.$$
EDIT: After all that work, I kind of lost sight of the question at hand. If there were finitely many rationals $p_i/q_i$ satisfying the inequality, we could find a positive integer $m$ such that
$$\frac{1}{m}<\left|x-\frac{p_i}{q_i}\right|.$$
Now let $m=Q$ in our theorem above, and find the corresponding pair of integers $a,b$. You should be able to show that $a/b$ was not one of our original $p_i/q_i$ from there, a contradiction.
Answer: Try to show that for every real number $a$ and every positive integer $N$ there exist $p,q$ integers with $1 \le q \le N$ such that $|qa - p| \le 1/(N+1)$.
This can be shown just using the pigeonhole principle in a clever way.
The result is called Dirchlet's approximation theorem. In this way you could easily find more detailed information in case it is needed.
Answer: Consider any point $x$ on real line. An open sphere centered at $x$ with radius $r$ is an open interval of radius $2r$. Let the open interval be $(a,b)$. Let the binary representations be
$a=a_1,a_2,\cdots, a_n, \cdots$
$b=b_1,b_2,\cdots, b_n, \cdots$
For every such numbers we can find an intermediate binary representation having finite digits. This corresponds to a rational number. So every real number is a limit for set of rationals showing that set of rationals is dense.
Suppose $m$ is the last integer such that $a_m = b_m$. As $b>a$,  $b_{m+1}=1$, $a_{m+1}=0$.
If for all $n>m$ the $a_n=1$ and $b_n=0$ then a=b so $(a,b)$ will not be an interval.
Therefore we have three possibilities, In each case we can find a binary number lying between them having a finite number of digits  and thus representing a rational number.
1)
$a=a_1,a_2,\cdots, a_m, 0 ,1 \cdots 0, a_{n+k}$
$b=b_1,b_2,\cdots, b_m, 1, 0 \cdots 0, b_{n+k}$
$c=a_1,a_2,\cdots, a_m, 0,1 \cdots 1$
2)
$a=a_1,a_2,\cdots, a_m, 0, 1 \cdots 1, a_{n+k}$
$b=b_1,b_2,\cdots, b_m, 1, 0 \cdots 1, b_{n+k}$
$c=a_1,a_2,\cdots, a_m, 1, 0 \cdots 0$
3)
$a=a_1,a_2,\cdots, a_m,0, 1 \cdots 0, a_{n+k}$
$b=b_1,b_2,\cdots, b_m,1, 0 \cdots 1,b_{n+k}$
$c=a_1,a_2,\cdots, a_m, 0, 1 \cdots 1$
Here we have not explicitly written about the case $a_m,0,1..$ and $b_m,1,1$ or $a_m,0,0..$ and $b_m,1,0$ but that can be dealt with by removing the digits $a_{m+2}$ and subsequent dots in above explanation.

Proving that rational numbers are dense


How do I create a canvas selection tool?

Question: What I'm wanting to do is create a selection tool (like what you see in most paint programs) using PyGtk.  I've seen a previous question that asked something similar, but they already seemed to know what they were doing to make the selection itself.  That user said he was using an eventbox, but I don't know how I would use that to accomplish what I am trying to do.  How would the eventbox work with a selection?
The algorithm for the rectangle isn't a problem at all, I just need to know what tools I should be using to actually select a part of a picture and be able to move it around.  This is my first time using PyGtk, and I'm also fairly new to python itself, so any help would be great.
Answer: If you want to display an image and allow the user to select and move parts of it, you best look for a ready-made image editing widget. GTK doesn't come with one.
To roll your own you can use an image widget for display, but it doesn't care about the mouse, so you can place it inside an event box and connect to button and movement events. You'll have to handle all the drawing of rectangle, walking ants and floating cutout yourself in the pixbuf backing the image.
It might be easier to start from scratch with an empty event box and draw even the image yourself.


Is there any SQLite Manager for MAC OS X which is able to show ER Diagram?

Question: Is there any SQLite Manager for MAC OS X which is able to show ER Diagram (Relationship between tables)?
Answer: You could give SQLEditor a go, check it out here. It supports using JDBC drivers for SQLite according to this page.
Admittedly, it's not free, but it does come with a 30 day trial period to determine if it's suitable for your needs.
As another option it seems that MySQL Workbench may be an option to use, as a plugin has been released supporting SQLite export read more about it here. I know from firsthand experience MySQL Workbench is reasonable to work with and it's available on OSX.
Answer: I use Visual Paradigm, there's a free version you can use :) Also has a Windows version.
Answer: I use SQLiteManager and sometimes, Navicat for SQLite. Marco Bambini is the author of SQLiteManager and is very helpful and responsive. The people at Navicat are brilliant but the product is a bit pricy.
Also, note that for most SQLite3 databases created outside of xCode (and for use in iApps, the DB has to be converted to the proper format. Marco's SQLiteConverter works for that. Navicat does not have such an app.
Hope this helps.
David


What does it mean to "expose" something?

Question: So I am working on creating a Google App Engine Application, and I've come across the term "expose" a number of times, e.g. "your first app can expose objects using an HTTP based API" and "expose this datamodel class through a REST API". What does "expose" mean? Is there a particular action associated it, or is it an abstract part of design?
Answer: It means that you enable objects to be accessed through some means. In your examples, you could let the users create, read, update or delete objects (usually abbreviated to CRUD) using the HTTP protocol through some predefined way to interact with your objects (an API).
That API can adhere to a set of rules - e.g. RESTful APIs use HTTP verbs to perform some actions on objects and they adhere to some principles that say how resources should be identified/represented and how they should be manipulated through those representations.
In the context of a web application, let's say you have blog posts stored in your database. You would like the users of your application to be able to do something with those posts. They don't have to necessarily use your web site, but could perhaps use their own application that would connect to your application (e.g. a blog reader program).
As the owner of your application, you could define an interface through which your application can be accessed. For example, you might want to add an option for some users to read or write blog posts. The interface could look something like this (for an example of a more complex API, see Twitter's API definition):

If a GET /posts/{number} HTTP/1.1 is requested from your web application, you will provide a representation of your post object with an id {number} in a predefined format

Note that you are not providing an actual database object, nor your application object. You are providing a representation of your object

If a POST /posts HTTP/1.1 with a title={text1}&body={text2} is posted to your web application, you will create a new post object titled {text1} that will contain {text2} for its body, and will return an id value of the newly created post

Again, you are allowing the user the manipulate representations of your objects. The user does not have to know how your objects actually look like (that is abstracted away by the interface from the user).
Exposing the object means providing the user with an interface to access and manipulate your objects. If that interface satisfied some additional predefined conditions regarding representations of the object and states of the application that exposes its objects, then that interface is said to be a REST (or RESTful) API.
Answer: "Expose" here means what it means in regular English - give access where access would not otherwise be available.
For instance "your first app can expose objects using an HTTP based API" means that someone on another machine can manipulate your object on your machine by asking for the right web pages.
Answer: Unfortunately, that's not what "expose" means in regular English. A typical definition of "expose" is "to remove what is covering something so that it can be seen."  That has nothing to do with "give access."
This is the whole point: in the API world, "expose" has been turned into a jargon word that means something different from its "regular" English meaning.
Comment: I found reading the dictionary definition of "expose" just now, very good for a laugh - it almost invariably suggests something improper is occurring or that something is subject to an unnatural condition.
Comment: I don't see any incompatibility between the usual English meaning of "expose" and the software jargon.  If something is hidden, nobody else can access it.  If it's exposed, then they can.
Answer: "Jargon": special words or expressions that are used by a particular profession or group and are difficult for others to understand.
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Comment: Please edit this into your other answer instead of posting a new answer.


What are internal forces and how do you calculate them?

Question: There are many questions similar to the below, where you need to find the internal forces. I find such problems very poorly worded and designed. First, what do they mean by internal forces? Is it the force reaction to the sum of the external forces applied to the object, so that it doesn't move? And how do I calculate that? For example, for the thin rod, is it $F+60=20$ or $F+60=20+120$? Or what?
Answer: You must choose a system.
In your case it could be $A$, or $B$, or $C$, or $A$ & $B$, or $B$ & $C$, or $A$ & $B$ & $C$.
A system could also include the wall.
Within a system you can identify forces which form a Newton's third law pair of forces which are equal in magnitude and opposite in direction.
Remember that each of the forces must act on a different object and that the forces must be of the same type eg both contact forces of both gravitational forces, etc.
If the two objects are labelled $1$ and $2$ then you are looking for the force on object $1$ due to object $2$ sometimes written $\vec F_{12}$ and its pair the force on object $2$ due to object $1$, $\vec F_{21}$.
An external force to a system does not have such a pairing associated with it.
So assuming $A$ & $B$ & $C$ is the system and that there are only contact forces.
$A$ can act on $B$ and $B$ can act on $C$ but $A$ cannot act on $C$ and $C$ cannot act on $A$.
What is the $60$ kN force acting on?
Does it have a Newton's third law pairing? Yes - internal force; No - external force.
What is the $20$ kN force acting on?
Does it have a Newton's third law pairing? Yes - internal force; No - external force.
etc
Comment: Can you tell me please the ΣF for each rod? In my understanding, you need to know the time each force started to apply (the sequence) and also the displacement from original positions. If you take the thin rod, Does it experience both 60 and 20 forces? or only the 60, assuming that the 20 is only acted on the medium rod?


Difference between rinkeby.etherscan and etherscan alone

Question: Which is the difference between both?
Both are useful to have the own ethereum tokens or someone is better than other.
Can someone explain??
Answer: Rinkeby is a testnet - a sandbox for safely testing and demonstrating where no real value is exchanged. Although it walks like a duck and quacks like a duck, it is not a real duck and the Ether is worthless.
Without rinkeby. is the real ethereum blockchain where everything is for keeps.
Hope it helps.
Answer: Etherscan is a web application that scans the ethereum blocks. You can see transactions that some address has performed, amount of ether or tokens it holds etc. Moreover, it is possible to see each transaction. Regular Etherscan does that for the. so called, mainnet. But using mainnet when testing your own Dapp is expensive. Therefore you have few test nets that are like the mainnet, but their ethereum is just for testing and is basically worthless. One of those test networks is Rinkeby. Etherescan that scans blocks on Rinkeby network is rinkeby.etherscan. It is pretty much alike the etherscan on the mainnet. There are howerver few differences. On Etherscan on the mainnet you can see all the "internal transactions". That is, when you send some ether to a smart contract's function that is marked with payable, you can see if and where that ether or its part is further forwarded. On the Rinkeby Etherscan it is still not possible. Therefore the later is a slimmer version of the main network's etherscan.


Android fill PDF form

Question: I have .pdf file and multiple forms are there.
I want to open my .pdf file, fill the forms and save it from Android development.
Is there any API for Android Rendering.
I found iText but I just manage to create new pdf and than i can fill form. means which .pdf file i created that will be filled out. I need to fill my form in my own .pdf.
Thanks in Advance...any help will be appreciated...
Answer: DynamicPDF Merger for Java allows you to do just that.  You can take an existing PDF document, fill out the form field values and then output that newly filled PDF.
There was a recent blog post on dynamicpdf.com on setting up DynamicPDF for Java in an Android application and creating a simple PDF from it, http://www.dynamicpdf.com/Blog/post/2012/06/15/Generating-PDFs-Dynamically-on-Android.aspx.
You can easily take that example one step further and use it to accomplish your task of form filling.  The following (untested) code is an example of what it would take to form fill an existing PDF on an Android device using DynamicPDF Merger for Java:
InputStream inputStream = this.getAssets().open("PDFToFill.pdf");
long avail = inputStream.available();
byte[] samplePDF = new byte[(int) avail];
inputStream.read(samplePDF , 0, (int) avail);
inputStream.close();
PdfDocument objPDF = new PdfDocument(samplePDF);

MergeDocument document = new MergeDocument(objPDF);
document.getForm().getFields().getFormField("FormField1").setValue("My Text");
document.draw("[PhysicalPath]/FilledPDF.pdf");

Answer: The native PDF support on current Android platforms (including Android P) doesn't expose any controls for filling forms. 3rd-party PDF SDKs such as PSPDFKit fill this gap and allow programmatic PDF form filling:
List<FormField> formFields = document.getFormProvider().getFormFields();
for (FormField formField : formFields) {
    if (formField.getType() == FormType.TEXT) {
        TextFormElement textFormElement = (TextFormElement) formField.getFormElement();
        textFormElement.setText("Test " + textFormElement.getName());
    } else if (formField.getType() == FormType.CHECKBOX) {
        CheckBoxFormElement checkBoxFormElement = (CheckBoxFormElement)formField.getFormElement();
        checkBoxFormElement.toggleSelection();
    }
}

(If you click on above link there's also a Kotlin PDF form filling example.)
Note that most SDKs on the market focus on PDF AcroForms, and not the XFA specification, which has been deprecated in the PDF 2.0 spec.

Android fill PDF form


Array sorting faster than array_multisort?

Question: I'm trying to sort a large array based on a column of orders. The way the array is built doesn't allow me to do much in the query to sort, but I would like to know if there is a way that's faster than array_multisort() in PHP?
My code is:
foreach ($returnArr as $key => $row) {
    $tmp[$key] = $row['orders'];
}

array_multisort($tmp, SORT_DESC, $returnArr);

I'm also up for suggestions on how I can build a single query and have some of my where conditions only apply to a single column. If this is possible, then I would just be able to do it with MySQL rather than PHP.
Comment: **See the following question:**
http://stackoverflow.com/questions/4710457/fastest-way-of-sorting-multidimensional-arrays-in-php
Answer: Hard to answer without your query, but I doubt if multisort is what you want. It essentially sorts your column names as well, which you could easily do in the query itself. You can also let the database sort the values for you, so your query would look something like:
select
  Col_AAA, Col_BBB, Col_HHH, Col_ZZZ
from
  YourTable
order by
  Col_AAA, Col_BBB, Col_HHH, Col_ZZZ

This will return the values sorted, and the column in the order in which you specify them.
Answer: If array_multisort() is the answer, then the question is wrong. I have yet to see a case where array_multisort was necessary, PHP arrays are such a strong data structure that multisorting is not really necessary.
Why do you fetch all the orders from $returnArr and then sort this array together with $tmp? You should simply sort $tmp in a way that keeps it's array keys as well, and if you want to iterate this $tmp array, the key inside the foreach is the same that also points to $returnArr - you have access to the matching data set in $returnArr without having to sort it. Same keys in $tmp and $returnArr will always belong to the same dataset.
On the other hand, you did not state anything about what you want to do.


Why is there still power to my oven after the breaker trips?

Question: Just moved into a new house that had a new oven when we moved in. After the first use the breaker trips but there's still power to the unit. Is the source of this a faulty breaker?
Comment: So it's a new self contained stove with oven—-not an oven by itself, as the title and question imply?   Most breaker handles don't move to off when tripped, that's normal.   We still don't have details to answer your question tho, you should check the pointers in the help center about how to ask.  People are not going to guess, or spend there time trying to google which whirlpool stove you might have.
Comment: You say the lights and clock stay on when the breaker trips. Do the surface burner units heat?
Comment: Assuming it's an electric oven, Make and model of the oven?  (we need to check if there's anything special in wiring, although not likely).  Also what type of breaker is it?  Most should have "common trip", it sounds like yours does not.  Finally, why do you say it still has power?  Could it be a battery for the clock?
Comment: Electric Whirlpool, glass top not convection. If circuit breaker panel is original and it looks like it is, its approx 40 years old. All lights stay on , just no heat. Breaker doesn't have green or orange bars. I believe it is a common though
Comment: Using the oven seems to be the Catalyst for the breaker popping. Using the cooktop has no effect on the breaker. The all the lights and clock stay on after the breaker is popped when turning on the oven. But the breaker switch barely moves does not trip to half-mast or fully
Comment: Breakers are $9 in case you just want to throw parts at the problem.  Pushmatics are more, FPE or Zinsco are dangerous panels that must be replaced ASAP so they're a lot more lol.
Comment: Did you ever resolve this problem?  If so, do add your own answer showing what happened.
Answer: What size is the breaker? An electric stove will normally be supplied by 240 V through a 40-A double pole common trip breaker. If the range is still getting some power, but the oven is not heating then it could be that one leg is tripped and the other is not.
Do all the surface burners heat at full heat. I am sure that these are supplied at 240 V so if you turned them each on singly to high and they all work, then you are getting 240 V to the range. If you turn them all to high at the same time and the breaker does not trip, then I would say the oven is malfunctioning (shorting). Does the broiler work?
Comment: With the breaker tripping when the oven is used I would suspect a blown element this is common but having power with the breaker tripped is unusual unless there is a 120v cord for the controls I have see an a couple of these so they could be run on a 3 wire 240 for the heat and 120 for controlled, a plug is lots cheaper than a transformer, but rare.
Answer: Ok let's start with some basic electrical. If a circuit is attache to a breaker it is physically and mechanically disconnected form the power. So how does your range have power?
The only scenario where it can be getting power is from a second source. That would mean the range is getting power from a second circuit or more likely somewhere in your electrical system you have lost a leg or neutral and power is in back flowing  into your range.
First visually check to see if there are any other circuits acting peculiar or or showing signs of low voltage. Thing I call ghost electrical, you know "I turn the lights off and the AC comes on and the lights come back on". Second go to your panel and turn every breaker on to see if it kills the range and locate the circuit that is back feeding. If those don't work then your going to have to locate it with an voltmeter if you have one or seek experienced help.
Turn on of all breakers including your main and begin checking voltages first from your meter then turn on your main and check the bus, Then  start a progressive search one breaker at a time.
Remember if you are doing this then you have removed the panel cover and you are  dealing with live circuits. So approach it with extra caution.
Stay safe and good luck
Answer: I had the exact problem with my maytag, it is a bad breaker in the wall, replace it and all will be fine
Comment: Hello, and welcome to Home Improvement. It isn't clear what you mean by "in the wall"; would you edit your answer to clarify? And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to contribute here.


Javascript MSI automation - closing the database

Question: I'm maintaining some build scripts that munge MSI databases from Javascript files (.js). The code is basically:
{
    var oTargetDB = g_oInstaller.openDatabase("mymsi.msi", msiOpenDatabaseModeReadOnly);
    var oView = oTargetDB.openView(...);
    oView.execute();
    oView.close();
}
// Later...
{
    var oTargetDB = g_oInstaller.openDatabase("mymsi.msi", msiOpenDatabaseModeTransact);
}

The second openDatabase fails with the ever-helpful 0x80004005 (E_FAIL), which I assume is because the first one is not closed. However, the Database object has no close method. I tried oTargetDB=null - didn't change anything.
What can I do to close the database, so I can open it again?
Edit:

I see the handle open using handle.exe from sysinternals, so it's definately the problem
Delay didn't help (I tried waiting for a really long time, and it didn't help)
Short-lived script isn't an option due to the existing script structure
Uber-hacking is beyond the scope of this fix
I'll have to uglify my code and go with the (pseudo-singleton) solution. Blergh.
Answer: Setting the handle to null works with VB Script, so I'm not sure why it wouldn't with JS. My best guess would possibly be that you've discovered a bug in the JS implimentation - especially if you're opening it as read-only the first time, there isn't any need to call the Commit method to flush any changes.
The documentation seems to indicate that simply closing the handle is all that is needed to close the database. So I'm guessing even after setting oTargetDB=null Javascript isn't releasing the handle by the time you go to open it again. You could try inserting a delay after releasing the handle to see if this is the case.
Answer: In this case, MS forgot to implement a close method. Really. Lame huh? In general, setting obj=null does not perform clean up such as close operations.
When I ran into specific this problem, it was calling the MSIDatabase objects from C#. The database needs to be closed (see MsiOpenDatabase and MsiCloseHandle). Unfortunately, as you have observed, MS forgot to implement Database.Close in the COM object you see. From C#, I was able to call Marshal.FinalReleaseComObject to unlock the file.
We eventially gave up on the COM object as unreliable and switched to p/invoke.
If jscript is your only option, you can keep the scripts short lived - when they die they release their handles. Or, you create a singleton to represent the object. Potentially, some uberhacker will know how to invoke MsiCloseHandle from jScript, and identify the handle used by that COM object.


Observed Effects of Gravitational Lensing 2

Question: So what is the minimum amount of mass that is required for the gravitational lensing effect to be visible? For instance, we can not observe the suns light during a solar eclipse because the moon does not have enough mass to curve space sufficiently for the suns light to be visible here on earth. So what is the minimum amount of mass required for the effect to be visible. does a single star have enough mass, or does a small solar system have enough mass, or does it take the mass of a entire galaxy or or galaxy cluster to make the effect visible. Is there a known amount or is there an equation that tells us the minimum amount of mass required for the effects of gravitational lensing to be visible?
Comment: It depends on what you mean by visible. It makes a difference if you mean visible to the human eye verses visible to a telescope on earth verses visible to the Hubble telescope. It also depends on the distance the source is away.
Comment: I believe the MACHO surveys of the 90's and forward found objects of mass similar to that of our gas giant planets, but I don't have references or any notion of what the lower limit might be. This is of course for the micro-lensing of star light from nearby dwarf galaxies and globular clusters by objects inside the Milkyway.
Answer: Your question is a bit vague: a massive body deviates a beam of light by a certain angle, and therefore whether the deviated beam will end up on the observer or not depends on the position (distance) of the observer from the massive body. Anyway the equation that you are looking for comes directly from general Relativity and is the following:
$$\delta\phi=\frac{2r_g}{\rho}=\frac{4GM}{c^2\rho}$$
This gives the deviation from the unperturbed trajectory as a function of the mass of the body $M$ and the minimum distance from the body $\rho$. For example for a beam passing close to the sun we have $\delta\phi=1.75''$ (result found on Landau-Lifshitz) which is not so small for modern accuracies. But whether this is observabe (and by who) depends on the position of the observer and the experimental apparatus that he has.
Comment: The mass of a neutron star is of the same order of magnitude of the mass of the sun. Thus the above estimate applies approximately. Although I haven't done the precise calculation, this means that the shadowed area would be reduced by a very tiny amount, with no visible effect.
Comment: I am not enough of a mathematician to figure this out but say our moon were made out of neutron star material and it was not emitting photons, would the moon then have enough mass to curve space enough so that we could see the sun with our eyes on earth during a solar eclipse?


Can I make a living as a novelist?

Question: I enjoy writing, I really do. I don't want to kill my time to make a living. I want to enjoy earning money. I don't want to be rich, I just don't want to be poor. Can I make a living as a novelist? I live alone. Do I need to be a really good writer to make a living from it?
Answer: Is it possible to make a living as a novelist? Yes, a few people do.
Is it sensible to plan on making a living as a novelist, the way you might plan on making a living as a dentist or an accountant? Absolutely not. Very few of those who try ever make even pocket money from writing fiction.
A realistic approach is to plan on making your living doing something else and write novels on the side. If you ever make enough to live on, quit your day job.
You can, of course, make your living writing, perhaps as a journalist, copy writer, or technical writer. These are careers you can plan for and work towards with a reasonable hope of success.
Comment: I think lots of people are trying who have not yet published any books.In fact, I know several. And by published do we mean self published or professionally published? A self-published book every two years may still be nothing more than a vanity project or a hobby.
Comment: I wish there was a way... maybe there is... of finding out how many people who actually TRY to make a living from writing actually do.  I know I don't, but I also know that I haven't really tried to.
Comment: There might, conceivably, be a way to find out how many do, though fundamentally that is private financial information. We know roughly from writers associations and the like that is it not many. But to know the ratio, we would have to know how many are trying, and I don't see how we would be able to get that number, or even agree on what counts as trying. We know from agents and publishers that the ratio of manuscripts they receive to those they publish is very low, and that even most published authors don't make a full living.
Comment: I guess if we set some completely arbitrary rule that said an author was "trying" if they were publishing a book at least once every two years... That gives a lot of leeway for slow writers and busy writers - then we could... Look... Somewhere... And see who it is that is actually trying... And I have no idea what we'd do after that.
Comment: If you count as "trying" everyone who has had a book published by a traditional publishing house, I'm sure the success rate is way higher than if you count everyone who ever said "I think I'd like to write a novel". Counting anyone who has been published as "trying" is a skewed statistic. Like saying that we're going to calculate your chance of becoming president by starting with all those who have ever been nominated for president by one of the major parties. Like wow, the success rate is 50%, it's easy!
Answer: The US Census bureau reports that 126,601 Americans are employed full time as "writers and authors", and they have a median income of $58,150. http://www.census.gov/people/io/
That's way more people and way more money than I would have guessed. They don't define "writers and authors" nor do they break it down into categories. This probably includes many people who have jobs writing, like people who write instructions on how to put together furniture and the like, as opposed to novelists. There's a separate category for reporters, so I guess this doesn't include reporters.
This article from the UK -- http://www.telegraph.co.uk/news/celebritynews/11550871/Just-one-in-ten-authors-can-earn-full-time-living-from-writing-report-finds.html -- finds that 11% of Britons who describe themselves as "authors" actually make enough money writing to live on.
I know I've read several sources that say that hundreds or perhaps a few thousand Americans actually earn enough by freelance writing to make a living. (The exact number depending on how you define "author" and "living" and how you collect the statistics, etc.)
To echo mbakeranalecta, there are many professions where if you are at least reasonably competent, you have a good chance of being able to earn a living. A competent plumber or auto mechanic or accountant or lumberjack can usually find a decent job and make a comfortable living.
But there are other jobs where a few people achieve huge success and become very rich, while the vast majority earn little or often nothing. Jobs like rock singer, movie actor, drug dealer, and novelist. Success in these occupations depends on a lot of factors other than your individual skill -- call it "luck".
I've been writing on and off for over 20 years. I've published maybe 20 or so magazine articles, contributed chapters to four textbooks, and self-published three books of my own. I haven't added it up exactly but I'd guess my lifetime earnings from my writing are several thousand dollars.
Is it possible to get rich writing? Of course. Do many people accomplish this? No.
Writing is a wonderful hobby, but a terrible profession.
Comment: Most importantly it includes TV and Film writers.
Answer: I make a full-time income as a novelist, but I self-publish. I also never started out wanting to make a full-time income, I just did it for fun, and published my first novel length original fiction because my husband nagged me into it.
I had a day job, but gradually I didn't need the money anymore, and having a product seemed better than providing a service. I cut back on my hours and gradually cut them out completely.
It is a little nerve-wracking having this career. Sometimes I feel like it can all go away in the blink of an eye. But that is true of most things, and actually, even if I stopped writing completely, I'd still earn some money without advertising.
Most amazingly, I get paid to daydream. How cool is that? I've heard there are about 10,000 authors in the U.S. who make a full-time living out of it. Those aren't great odds, but then, I'm not sure 1) what constitutes a full-time income 2) how many are doing it full-time and 3) how many people who are writing "full-time" are actually publishing? (Are they just sitting on manuscripts waiting for a publisher?)
Answer: Many people do make a living as novelists, but it's a very small percentage of the people who write. To offer some personal perspective, over the course of nearly 20 years writing, I've produced one traditionally published book (a picture book).  It was well-reviewed, reasonably successful and went through more than one printing.
Over the lifetime of the book I made about $5000 total.  Even doubling that number (due to the fact that I had to split my royalties with an illustrator), I'd have to regularly publish around eight books a year, to similar success, in order to approach the salary of my day job as a programmer.
Most professional writers are either insanely prolific, do writing-for-hire jobs and/or make most of their money on touring and speaking (and possibly direct sales).  As with any artistic job, you could potentially be gifted, hard-working and lucky enough to create a big hit, but most people only get to that level after years in the trenches.  For what it's worth, I get as much writing done now, in the evenings, as I did during the brief period of time when I was trying to do writing full time.
Answer: You can potentially make a living as a novelist, but you have to reassess what that means.
Writing a novel is as much a part of being a novelist as slicing people up is being a surgeon. If someone else publishes your work then book sales are a trifling part of your income unless you are extremely popular.
Firstly you need to promote yourself and the book. You can sell your own books, give talks, do radio, judge competitions, run a digital marketing campaign, or make appearances at festivals.
Next you need to use your writing skills to make money. This means teaching writing, running workshops, editing or developing books with others, or writing articles for a few hundred dollars a pop (if that).
Then you supplement an income with prizes, grants, competitions, and writing residencies.
Being a novelist is like any other serious profession. It's full-time, it involves a lot of tedium, and it takes a few years of training and not getting paid before you make any money. To make writing novels exclusively into a living (not many 'writers' do this) you either need to be talented enough to get grants or hardworking enough to market your own work.
A lot of people overplay the level of luck involved. Are you seriously talented and capable of being original? Are you happy to work 50 hours a week? Can you write half a million words a year? Will you be constantly creating working and promoting it? Are you content to earn less than a manager at Starbucks?
Think of being a novelist like trying to become a professional athlete. Do you think you can get into the Olympics by just playing basketball once a week with your friends?
Answer: Yes, authors can make very good livings. I personally know a number of self-published fiction authors who earn well into six figures a year. Quite a few of them earn seven figures a year. This year will be my first year to earn six figures. I'm a self-published romance author, and I publish 2 full-length novels a year. So, yes, it's possible. Will every author succeed at that? Unfortunately no. It depends on the skill of the author, the quality of the book cover, and how effectively the author promotes/markets his or her own books to the targeted audience. Best of luck to you!!
Answer: Artists starve. They hold food service jobs part time, or the like, and devote themselves. Or they have alternative forms of income or a supportive spouse or savings.
To try to give yourself a reasonable target, taking into account the time it takes to publish and see an income from an accepted manuscript, six years (a number out of my behind) is my suggested time commitment. You won't know unless you try. This gives time for three or four full-length novels.
You can do it! It starts with page 1. Some artists do quite well. But don't get your hopes up.
Answer: Last year I decided I'm going to be an author and make a living out of it. Here are my two cents:
I was a chef for 15 years. Do you have any idea how hard it is to open a restaurant and have it succeed? Well, the odds are not in your favour. But if your food's good, if you understand your clients, if you put in the work – and I mean you have to be ready to clean toilets if you must (a restaurant with poor toilets is dead) –, if you have a good grasp of what to aim for and are willing to adapt, it may take 3 to 4 years to build a steady clientele, but you will get there.
Same with novels.
Write novels people want to read, be ready to do the dirty work, tend to your audience and nurture it. Once you've gained the trust of a certain number of readers you are set.
Don't forget the importance of a good art cover, graphic design and formatting, good developmental editing, good copy editing, and marketing. Do not just throw money at Amazon. Find out where your audience hangs out and go there. Start a blog and newsletter. Build your readership one reader at a time. Make offers to them, sell merchandise, and make your readers feel unique, giving them the chance to own part of your fictional worlds. Once you have a foothold you can also coach aspiring authors or sell courses, plus books on how to write with your unique insight. Build your brand.
Remember, it takes as much time as opening a restaurant and has about the same chances of success. But people open restaurants all the freaking time, carelessly, and no one bats an eye, but the moment you say you want to be an author, they all hiss like scaredy cats. The thing is you need more than one novel to kick you off, so you better start producing quality material, invest a lot of your time and money to make it look professional and figure out your marketing strategy.
A lot of self-published books don't sell, and that's largely because the author did a poor-ass job of making it look professional and took no interest in interacting with their audience. Just go through the lists of newly published books and see how poorly made most of them look. Or walk through the streets and see the same restaurants popping up with the same boring menus and horrible service trying to cheap out their way to riches. Writing is like everything else: you have to commit and you have to do it right.
Do you agree? Or am I just full of dreams?
Comment: Welcome to Writing.SE! There's nothing wrong with answering old questions as long as you're providing something new. At the moment, however, this is a considerable wall of text that's quite hard to read. Would you be able to break this up into paragraphs so it's easier to read? Thanks.
Comment: John Fernand, I edited your question as an example for how you might make it less of "a wall of text", as F1Krazy calls it. You can revert my edit or improve upon it, if you want.
Comment: Thank you, Ben. That's very kind of you.  I thought this was just a random Forum and no one would read it so I didn't put any extra effort. But hey, love to be wrong.

Can I make a living as a novelist?


Cats awake on home planet while asleep on earth

Question: I read somewhere that there is a book or perhaps a short story, written possibly by Philip K. Dick, where at least part of the story includes the premise that when our cats are asleep here on Earth, they are actually awake on their home planet and vice versa. Does anyone know of this story? I would really like to find it.
Comment: Sounds like H.P. Lovecraft's "The Dreamquest of Unknown Kadath" - cats are intelligent and noble in the Dreamlands.
Comment: Another possibility is HPL's "The Cats of Ulthar." Not enough info to distinguish.
Answer: I think this is from The Sandman: Dream Country (the third volume I think) and the story is called: A Dream Of A Thousand Cats.

Dream presents her with a vision of an alternate reality where cats are huge and humans are merely their playthings, tiny servants which groom their bodies and which the cats can kill at their leisure. A man ruined that world by informing the humans that their dreams will shape the world. Enough humans listened to make the vision a reality. Upon waking, the cat undertakes a spiritual quest for justice. She preaches her vision to motley assortments of housecats around the world, hoping that if she can make enough cats believe in and dream of this reality, the world will change to conform to their dreams.


Google Translate Bar moving content down

Question: Is there a way to stop Google Translate Bar from moving my content down? I have a static background image, and a header image that corresponds with the background image, so when the Google Translate Bar is fixed to the top of my screen, it moves my top content down and out of the background image.
Is there a way to make it just statically over my content or fixed in such a way it won't move my content down?
Or Can I detect is Translation is taking place, then move my background accordingly? I tried to use this but it doesn't revert back if I remove the Translation Bar:
document.addEventListener('DOMSubtreeModified', function (e) {
if(e.target.tagName === 'HTML' && window.google) {
        if(e.target.className.match('translated')) {
            document.body.style.backgroundPosition="0px 40px";
        } else {
            document.body.style.backgroundPosition="0px 0px";
        }
    }
}, true);

Comment: your addEventListener('DOMSubtreeModified') code helped me :) ... I have a fixed menu but when google translation appear and disapear it didn't moved my menu. whit this code it's thumbs up.
Answer: It's a bit difficult without a code example, but the easiest solution would be to set position: fixed; and top: 0 on the translate bar, however, this means it will always remain at the top of the page once you scroll down.
If the translate bar is near the top of your document, which it sounds like it is, you can set the position to absolute instead, keeping the top: 0 declaration. This should make it appear at the top of the closest positioned ancestor, i.e. an element with position set to relative, absolute, fixed, or sticky. If this doesn't exist, it'll be positioned according to the root tag, i.e.  in a well-formed document. Here, you could set position: relative on your , for example.
Both fixed and sticky takes the element entirely out of the document flow, so they will do exactly what you're requesting here: appear on top of other content.
Answer: The addEventListener('DOMSubtreeModified') is outdated. What you want is to use DOM MutationObserver Events to apply the change. This DOM API is available on all major browser since 2012 I think.
I use this on to lower the google translator bar, so maybe moving the bar down also solves your problem. If not, just change the callback function and variables for your need.
The google translator creates an iframe element like this:
...

So the MutationObserver code to move that element down is as follow:
//Observer for Google translator bar creation and action to move to bottom
// Select the nodetree that will be observed for mutations
var nodetree = document.getElementsByTagName("body")[0];
// Select the target node atributes (CSS selector)
var targetNode = "iframe.goog-te-banner-frame";
// Options for the observer (which mutations to observe)
var config = { attributes: false, childList: true };
// Callback function to execute when mutations of DOM tree are observed
var lowerGoogleTranslateBar = function(mutations_on_DOMtree) {
    for(var mutation of mutations_on_DOMtree) {
        if (mutation.type == 'childList') {
            console.log(mutation);
            if (document.querySelector(targetNode) != null) {
                //40px is the height of the bar
                document.querySelector(targetNode).style.setProperty("top", "calc(100% - 40px)");
                //after action is done, disconnect the observer from the nodetree
                observerGoogleTranslator.disconnect();
            }
        }
    }
};
// Create an observer instance linked to the callback function
var observerGoogleTranslator = new MutationObserver(lowerGoogleTranslateBar);
// Start observing the target node for configured mutations
observerGoogleTranslator.observe(nodetree, config);

You can learn more about this here: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver


Removing Indexes

Question: Using ArcGIS , I'm trying to automate a process to remove indexes from a dataset using the ArcGIS Modelbuilder. Is it possible to use a dataset (not a feature class) as an input parameter? Or would I have to put each feature class of the dataset as a parameter?
Answer: According to the help page it has to be at the feature class level (not dataset):

The table containing the index or indexes to be deleted. Table can
  refer to an actual table, a feature class attribute table, or an
  attributed relationship class.
Comment: great! Thanks alot , i saw that also. i was just wondering if anyone may have done it at the dataset level.

Removing Indexes


How does the group algebra look as a Lie algebra

Question: It's probably a well known question, so it is just a reference question.
Let $G$ be a finite group and let $C[G]$ be a group algebra. Then we can define a bracket on $C[G]$ by $[f,h]=f*h-h*f$. What does $C[G]$ look like as a Lie algebra? When is it solvable?
Comment: $kG$ is often isomorphic to or closely related to the restricted  enveloping algebra of a Lie algebra (I'm thinking of Quillen's version of Jennings' theorem).  This raises the question of what the (restricted) enveloping algebra $U(L)$ looks like when you regard it as a Lie algebra in this way.  It obviously has $L$ and the trivial 1d Lie algebra as subalgebras, but there's much more...
Comment: @mt: Restricted enveloping algebras are finite dimensional but arise only in prime characteristic.   So your observations lead in another direction.
Answer: Assuming that your ground field $K$ has characteristic prime to the order of $G$. Then the group ring is a seminsimple algebra. Therefore, $C[G]=\bigoplus_{i=1}^{r} Mat_{n_i}(R_i)$ is a direct sum of matrix algebras, where $R_i$ is a finite-dimensional division ring over $K$. All this is very classical and nicely explained in Procesis book on Lie groups.
Thus the Lie algebra is a sum of general linear Lie algebras over division rings.
If $K$ is $\mathbb{C}$, then $R_i=\mathbb{C}$. So the Lie algebra is solvable iff all $n_i$ are $1$ (this happens iff $G$ is abelian).
For $\mathbb{R}$, you also get the quaternions. For fields like $\mathbb{Q}$ or finite characteristic dividning the order of $G$, the story is going to be way more complicated and interesting.
Answer: Maybe you could look at the following paper:
Ivan Marin, Group algebras of finite groups as Lie algebras
http://arxiv.org/abs/0809.0074
Comment: This paper is limited to fields characteristic 0 (even assuming the ground field is a splitting field for the finite group), but also considers compact groups more generally and discusses a fairly broad related agenda.   (The paper appeared in 2010 in *Comm. Algebra*.)
Answer: There is an interesting proof by Brauer of the fact that when $G$ is a finite group and $F$ is an algebraically closed field of prime characteristic $p$, then the number of simple $FG$
modules is the number of conjugacy classes of elements of $G$ of order prime to $p.$ This proof has a definite Lie Algebras flavour to it (and can be found in Curtis and Reiner, Representation Theory of Finite Groups and Associative Algebras,Wiley,1962).
In this proof, Brauer sets $A = FG$, and considers the $F$-subspace $K(A)$, which is the
$F$-span of $\{ab - ba: a,b \in A \}.$ It is relatively easy to see that the codimension of $K(A)$
is the dimension of $Z(A)$, which is clearly the number of conjugacy classes of $G$.
Then he defines $T(A)$ as the set of elements $x \in A : x^{p^{n}} \in K(A)$ for some $n$.
It is not immediately obvious that $T(A)$ is a linear subspace, but it is. It is clear then that
$T(A)$ contains the Jacobson radical $J(A)$, so it is then reasonably easy to calculate the
codimension of $T(A)$ in two ways to get the result: one is by considering $T(A)/J(A)$ inside the
semisimple algebra $A/J(A)$, and other is by thinking on terms of group theoretic information.
A person who has developed this line of thinking further in recent years is Burkhard K\"ulshammer,
who has found invariants by this sort of method which have recently been proved to be useful invariants under derived equivalence.
Answer: A full characterization of group algebras which are solvable or nilpotent as Lie algebras can be found in the paper [I.B.S. Passi - D. Passman - S.K. Sehgal: Lie solvable group rings, Can. J. Math. 25 (1973), 748-757].
Answer: Concerning the situation in characteristic $p$: when $p$ divides the order of $G$, the case not covered by Maschke's theorem, the group algebra $KG$ is no longer semisimple. There is, however, a whole array of papers, started from J.D. Donald and F.J. Flanigan, A deformation theoretic version of Maschke's theorem for modular group algebras: the commutative case, J. Algebra 29 (1974), 98-102, DOI:10.1016/0021-8693(74)90114-8, aiming to prove a conjecture which can be considered as a modular analog of Maschke's theorem: the group algebra KG is deformed to a semisimple algebra. Most of these papers have a group-theoretic flavor, arguing in terms of blocks and other group-representation-theoretic data.  Murray Gerstenhaber and Anthony Giaquinto have claimed in: Compatible deformations, Trends in the Representation Theory of Finite Dimensional Algebras (ed. E.L. Green and B. Huisgen-Zimmerman), Contemp. Math. 229 (1998), 159-168, that there is a counterexample to this conjecture: a 8-element quaternion group over a field of characteristic 2. This was believed to be true for a decade or so, after it has been proved wrong (N. Barnea and Y. Ginosar, A separable deformation of the quaternion group algebra, Proc. Amer. Math. Soc. 136 (2008), 2675-2681, DOI: 10.1090/S0002-9939-08-09480-X, arXiv:0704.1556). As far as I know, the Donald-Flanigan conjecture is still open.


Filament being pushed back out the filament hole

Question: I just got a Monoprice Maker Select v2 off eBay for $200 and I'm very happy with it (so far). I'm learning a lot, but I've run into this problem that I cannot solve:
When I put filament into the extruder (it's a direct drive extruder), it works well for a minute or two and then the extruder pushes it back out the entrance hole where it should be inserted.
I have no idea why it's doing this. The weird thing is when it's being pushed back out it curls up, maybe from being pushed back up and being hot? It is unclear to me why it curls.
What I have tried:

Multiple brands of filament but nothing is working (I'm not sure what type of nozzle is on the Maker Select v2 but I have printed a Benchy once before this with no problems);
Unclogging - I took the cold end off and nothing looks jammed in it;
Pushed a guitar string through the hot end and no jams.

I cannot figure out why it's doing this.
Comment: Please answer @mac 's question and put it in the main body of the question, maybe also post pictures or (a link to) a video.
Comment: Also: when looking at the stepper running in reverse: does it push the filament back out in a long, single swoosh or it appears to do the usual move-stop-move-again movements typical of the extruder stepper, simply in reverse?  What happens then?  Does the print resume spinning the stepper forward or keeps on in reverse, or yet it stops the print completely?
Comment: Please copy-paste the comments in the main body of your question. And format you question so it's readable rather than a solid blob of text. Then remove the comments. :)
Comment: forgot to mention, im using solutech and amz3d pla filament at 200-210 c and it just keeps pushing itself back out the top of the extruder.
Comment: i have the printer plugged into the computer via usb and cura is sending commands for what to do. i figured cura could be messing up so i deleted the profile and restarted cura and am trying again. maybe this will help? would gcode from an sdcard be better?
Comment: so i took the fan off the side of the extruder and held the cold end in place so it wouldnt move and ran a print. i could see what the cold end was doing and it ran the motor in reverse and pushed the filament out. why would it do this?
Comment: May I suggest trying a micro SD card such as the one that came with the printer. I've had problems when connecting a computer directly.
Comment: Does it push the filament out until if cannot (because there is no more loaded filament), or does it return to pushing it back in for a while?  In other words, is it in some sense cyclical (in-out-in-out), or in-until-event-then-out-until-you-stop-it?
Comment: In until event then out and stays out until I restart
Comment: I got an idea: Maybe the heat crawls back so that the extruder can still push it out the entrence (no resistent) but don't get grip to push it in the nozzle direction, because it is to soft and deformed.
Answer: Change the retraction distance, maybe you have a too long distance, that pushes the filament the whole way out.
Comment: retraction is set to 6.5 mm for cura 3.2.1. is this good or bad?
Comment: @user25832 That is the Cura default, that value works well on my Ultimaker 3. But I doubt that this is the issue, throats are generally longer than 6.5 mm


Compact disk utilizes 650 of 700 Mb

Question: A normal compact disk has a size of 700 MB but it only holds data upto 650 MB. What is the other 50 MB utilized for?
Answer: Not all CD's hold the same amount of data.  There were a couple different versions produced that attempted to squeeze a few more megabytes out of the standard. The 650Mb/74min and 700Mb/80min  standards are the most common. Check out the table in the wiki within the capacity section.
http://en.wikipedia.org/wiki/CD-ROM
They actually hold a little more information beyond the stated capacity of each size and this extra data space is used for error correction data.
Answer: 1Kb = 1024 bytes
1Mb = 1024x1024Kb=1048576Bytes = 1Mb
650Mb = 1024x1024x650 = 681574400 bytes
I think the rest is CRC checksums.
Answer: I think this Wikipedia entry explains it quite well: http://en.wikipedia.org/wiki/Compact_Disc

Compact disk utilizes 650 of 700 Mb


How can wind affect my Wi Fi signal?

Question: I live next to a university campus. Sometimes I get a nice strong Wi Fi signal. Sometimes I don't get anything. It all depends on the wind direction.
How is it possible for wind to affect electro magnetic waves?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: Water is a Wi-Fi killer. Plants (trees, etc.) are full of water. The wind moving the plants a certain direction, or bringing in moisture can greatly affect Wi-Fi signals.
One of the worst plants for Wi-Fi is alfalfa, but I assume you do not live next to alfalfa fields.
Comment: It's a good answer. Plausible. However, I'm reasonably certain that moisture is not the inhibiting factor in my case. How so? My signal improves when it rains or is cloudy. I wonder, could this this have something to do with cloud cover bouncing back signals?
Comment: Then your company needs to hire a wireless site survey to determine what is happening.
Answer:
How is it possible for wind to affect electro magnetic waves?

It isn't. At least not directly.

I live next to a university campus. Sometimes I get a nice strong Wi Fi signal. Sometimes I don't get anything. It all depends on the wind direction.

So you have directly correlated WiFi signal with wind direction. Yet you also correctly pointed out that wind should affect EM waves. While there may be a correlation, if it does exist it is likely indirect at best.
Let me start by mentioning you don't provide how you are determining "nice strong Wi Fi signal". Often wireless clients represent a signal using some sort of iconography. Five bars is good and one is bad, right? But just what does that little icon represent? Is it actual signal strength or signal quality or something else? For example, on my cell phone, I know that one bar of "LTE" is better than three bars of "4G". So three bars isn't always better than one bar. But back to the question.
As Ron already mentioned in his post, the frequencies used by WiFi are subject to higher absorption by water. So his suggestion that plants shifting could be part of the answer. Wind also tends to move in certain directions based on weather conditions, which may include humidity.
But you point out that your "signal improves when it rains or is cloudy" so this can't be the case. This statement of course runs contrary to physics, but taking it at face value may be a clue to what is taking place on a larger scale. But back to that in a minute.
If wind direction is truly a factor, then water (plant, humidity, etc) is certainly one thing that could be different. Another thing could be is the geometry at play. Buildings and structures can/will flex or shift with different prevailing winds. These changes may be negligible when both the client and the AP are in the same building, however you mention that you are "next to a university campus" rather than in the same building as the AP.
While these changes are often relatively small, modern 802.11 traffic (802.11n or newer) takes advantage of a phenomenon known as multipath propogation through the use of more than one radio chain and/or spatial stream simultaneously. Without getting into too much detail, ultimately as conditions change, the best "paths" between to RF endpoints will change as well. These subtle changes can result in big differences to signal strength/quality and with multipath the coverage pattern is often far from intuitive.
So, end result is that the path the signal gets from the AP to your client could change based on things like wind direction.
Getting back to your comment that "signal improves when it rains or is cloudy",  and you wonder if this could have anything to do with cloud cover bouncing signal back. Physics tells us that this is impossible (the signal strength of an 802.11 device is not strong enough to be usable at the level of clouds, much less to the cloud cover and back) and further that rain/water will absorb RF signal in the frequencies in question.
So why does your signal improve? My best guess would be that you are measuring signal quality rather than signal strength. While it may seem counter-intuitive, you may actually have better signal quality when conditions are less than ideal.
Under "better" conditions, your wireless client may be seeing more interference on the channel (i.e. other devices) or other sources of RF noise. This may reduce the signal quality. Less ideal conditions (such as raining, changes in the RF path) may be absorbing or masking a portion of that other interference or noise, allowing your signal to be better.
Of course, this is all just speculation on my part. Without knowing a lot more about your particular situation, no one could say for certain why things are working as you report. There may be other factors of which we aren't aware; for instance, university buildings near you may be more heavily occupied (more people/devices) under certain circumstances and less occupied under others.

How can wind affect my Wi Fi signal?


Coinbase / Web3 - how are they connected? Where is my balance on Web3

Question: I am brand new. I created a Coinbase Account and started investing. I heard someone say something about web3. I don't know what this is, but I think i have money in there. As I'm still waiting to be able to transfer my crypto to my hard wallet, I noticed my available transfer amount keeps decreasing. 1st day i tried to send, $4.04 available balance vs. the $47 I want too. The next day $3.46 available funds to transfer, and now it' $2.97 and said: Available balance calculation is your balance equal to your XRP balance minus your unavailable balance and your web3 wallets. Ummm  What? and why when I have 1 day left to send to my wallet would my available funds to send be lowering. Am I losing on an investment I don't know about? What is web3 - the new internet explorer?  Lastly, why do I have to wait so long to send to my wallet in that 5 days...I could have lost my money.
Comment: Hey, you should verify that you really have an account with Coinbase, as outside the organic nature of falling asset prices reducing an account balance that doesn't sound like my experience with them. Scam?

Seems web3 in the context it has been given here just means 'on chain'.
Coinbase is an exchange with an off chain account "wallet", but also has a self custody "wallet" product called Coinbase wallet (for on chain activity). Coinbase additionally offer some "easy web3" experiences through their exchange, so without clarifying details it's impossible to give any definitive answers.
Comment: https://hbr.org/2022/05/what-is-web3
This is an article to learn what is web3
Answer: Web3 is just a term that refers to the newest evolution of the internet, through use of Cryptocurrencies, decentralized networks, token-based economics and blockchain technology. You can read more about it and why it is important here.
Coinbase is a Centralized Exchange that allows users to buy, sell, and trade cryptocurrencies.
The only reason the dollar value of your account would be steadily decreasing is if the assets you are holding are decreasing in value, or if you are slowly withdrawing amounts.
Considering your situation, it seems unlikely that the tokens on your account are being steadily withdrawn in small increments, leaving me to believe that you are holding volatile currencies that may just be simply losing value.
For example you said you are holding XRP, here is a price chat of XRP:

At the time I'm writing this, for the last month, XRP has dropped in value by 25%~.
As to why part of your balance may be labeled unavailable, Coinbase sometimes will put a hold on your balance if they suspect you of suspicious activity or are trying to verify the validity of your transactions with the bank associated with the card you used to fund the account.
If your funds are still unavailable after a couple days with no explanation as to why, I would contact Coinbase customer support and explain your issue to them.


What is meant by Input clamp current/Output Clamp current in micro controller datasheet?

Question: While reading a PIC data sheet, I found the parameters Input clamp current / Output Clamp current. Where do I consider these specifications?
Comment: Can you provide a link to the data sheet and tell us which page this data is on please?
Comment: pic 18f4550 datasheet  page number 369 :http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf
Comment: which page is this data? I searched the pdf and could find no reference to "Maximum Input clamp current"
Answer: It is an ESD circuit triggering limit specification.
Here is a snip from page 369 (labelled as 367):

Since these numbers are so low it's clearly not the current during the ESD event. Why would an ESD event be clamped at currents less than the maximum current rating of a driven output?  Additionally once an ESD event is underway you're not going to be limiting it to just 20 mA!
Take into account that these are absolute maximum specs and the fact that these "clamp currents" are specified under the conditions that \$V_I<0\$ and \$V_O>V_{DD}\$ the logical conclusion is:
"Thou shall not take the pins below ground or above the upper rail IF you are capable of driving more that 20 ma.  If you do so then the ESD circuits are going to trigger"
- i.e it's the trigger conditions under which the on chip ESD circuits are going fire.
Some datasheets specify dv/dt rates as well.
Modern semiconductor pins have the challenge of protecting against ESD at lower voltages.  The only real way of doing this is to have all the pins connected to an internal ESD rail via diodes (often in a half bridge configuration and sometimes a full bridge).  You can't use a zener or clamping diode circuit as you can't control the breakdown voltage accurately enough for the lower voltages - below 3.3V.  The solution is to have active circuitry that monitors the ESD rails and then clamps them together.  This also allows an any-pin to any-pin clamping action.
These pins will be designed for currents that are well in excess of 100's of mA but they also have to be low capacitance to prevent undue loading of the drivers.
There is also an alternative explanation that these are the limits at which if exceeded will trigger latch up in the substrate.  While possible in older processes this is not likely in modern processes.  However, I don't know the process details so for completeness, this should be mentioned.
Answer: Most modern CMOS chips have reverse diodes to ground and power on each pin.  This is to provide a path for static discharge without hurting the the more sensitive components on the IC, hopefully, most of the time, probably, if you're lucky.
There are probably two separate specs for these clamp diode currents.  The absolute maximum section will tell you what the device can tolerate without getting damaged.  This is the current the diodes can shunt around the rest of the chip without harm.  The other spec will be in the operating section.  This current will be much less because current thru these diodes can cause various problems to the operation of the device.  Basically, in a practical sense you don't want these diode to conduct during operation.
Comment: Most of your 2nd paragraph directly contradicts the datasheet.  Your last sentence is fine. The pads cells in modern processes must be demonstrated to handle multiple Amps to  be able to handle MM (Machine model) ESD. Care to edit?
Comment: +1 for the `hopefully, most of the time, probably, if you're lucky`
Comment: @rawbrawb: I'm not clear what you are saying. How does the datasheet disgree with what I said? I just checked, and abs max is 20 mA. I know I've seen a voltage and current diode clamp spec for other PIC, but this one just specifies the valid input voltage ranges limited to Vss and Vdd. That in effect says 0 forward bias on the diodes is allowed during operation. I still don't see how that contradicts what I said.
Comment: as an aside, the DV's aren't mine.  I think I've answered most of that in my own post. but .. the specs aren't different, The data is FROM the abs max section.  We know it can't be a max current because these values are less than the drive currents.  And then logic/experience kicks in as we know that ESD generates huge currents.  I think what caught you out is the use of "clamping" that is obviously wrong.  A 2KV ESD pulse "clamped" at 20 ma isn't doing anything for EOS.
Answer: Many chips have clamp diodes between I/O pins and the power rails.  Such diodes can be a cheap way of providing a significant measure of ESD protection.  Further, many chips connect the negative rail to a P-type substrate and the positive rail to N-type wells within it; each transistor's source and drain will form a PN junction with the substrate or well within which it resides, and PN junctions behave like diodes when the potential of the P side exceeds that of the N side by more than about 0.7 volts.
In some cases, the clamp diodes are constructed in such a way that current which flows through them will not affect any other operations of the chip.  In other cases, current which flows forward through the PN junctions that serve as clamp diodes can cause unwanted currents to flow across other, reverse-biased PN junctions, in much the way that base-emitter currents in a PNP or NPN transistor will cause current to flow across the reverse-biased collector-base junction.
Unless the manufacturer specifies that a device will operate normally in the presence of clamp-diode currents, one should avoid having any non-trivial amount of current flow during any normal operating condition.  On the other hand, if a device manufacturer believes a part will often be used in cases where it will be necessary to clamp relatively small amounts of currents (e.g. 10mA) to the rails, allocating the extra space to place the PN junctions in such fashion as to prevent such currents from causing unwanted current flows elsewhere may be worthwhile even if only 0.1% of the parts are used in places that would otherwise need a protection diodes.


What code gets executed in an ELF binary when Java loadLibrary() is called

Question: I've been working on reverse engineering this android x86 ELF binary. According to my research when loadLibrary() is called the function JNI_onLoad is supposed to be executed however this binary doesn't have it. I guess I'm confused on what loadlibrary() is actually doing. How would I find the first function or entry point to this binary?
Answer: loadLibrary(..) loads the native library into the current process. Besides the call to JNI_onLoad this is just a standard library loading as it is done by dlopen(..). Note that that as a part of this regular library loading process some code sections in the library may be executed automatically. But that is nothing Java/JNI specific. For more details see this question on Stackoverflow.com.
The JNI_onLoad function is AFAIR optional. It's first parameter is a pointer to the JavaVM structure that allows to interact with the Java virtual VM, e.g. request memory that is recognized by the garbage collector. Or search and instantiate Java classes from within native code.
The more important part of loading a native library into a Android/Java process is that it's exported functions are made available to the Java part. Check the Java classes for methods marked as native. Such methods don't have a method body, instead when they are called a matching (based on the class an method name) native method is executed.


Good popular informative video guides to human anatomy?

Question: Can you recommend visually illustrative, but still scientifically justified video guides with exhaustive commentary to organs and/or systems of the human body? I'd like to familiarize myself with human anatomy.
Comment: Your question is not a question. Also does "popular" matter or is only "informative" enough? I would ask "What are good informative videos explaining human anatomy?".
Answer: Free videos with subtitles:
Introduction to Anatomy: basic anatomical terms, planes, positions, directions..a single 20 min video
Kenhub, comprehensive, organized, with basic anatomical terms, medical imaging, also histology, premium account available with quizzes and study questions
Anatomy Zone, also available on YouTube: 190+ videos, maybe not organized best
Khan Academy: anatomy + physiology combined
Innerbody: interactive images with detailed description


Does rejecting a study's credibility based on sample size make sense even if statistical significance is reached?

Question: I've seen people do this commonly, and to me, it makes no sense because one of the main reasons of having a large enough sample size is that you CAN reach statistical significance in the first place.
Comment: A key assumption, difficult to satisfy in practice, is that the sample be randomly sampled. With suitable protocols in place, it is easier to believe that a large sample achieved randomness than that a small one did. (This may not be true, but perception is important.)// Also, for evidence that a drug is safe and effective, a large sample enables inclusion of a diverse group so that problematic unintended effects in subpopulations are more likely to be discovered.
Comment: Your point has merit, but as a (simplistic) example for clinical trials, 100 successes in 100 might give 95% Bayesian credible interval (.964, .9999) , while 995 in 1000 might give interval (.988, .9978). Even though I believe the math, I wouldn't fault someone who feels much more comfortable with the larger trial.
Comment: @BruceET Okay, but perception is hardly reality. That's kind of what I'm railing against in my post, is an incorrect perception.
Comment: @BruceET I'm not faulting them. I'm asking if it makes sense, statistically. And I don't see that you're making an argument for it, other than appealing to how they feel about it.
Comment: I guess it comes down to what you mean by "makes sense statistically."
Answer: This is to some extent answered in this paper. What it describes is a setting, where

We (sort of randomly) pick research hypothesis to investigate, for which the null hypothesis is either exactly true or we have the hypothesized effect size.
Of course, we don't know for sure when we start our study.
In that setting, a "small sample size means smaller power and [...] the PPV [positive preditive value] for a true research finding" when observing $p\leq 0.05$ decreases as power decreases.
I.e. how likely it is that $p\leq 0.05$ (or any other threshold
$\alpha$) indicates a correct rejection of the null hypothesis
depends on the power. The other thing that matters is what proportion
of investigated alternative hypotheses are true (or in practice, how
implausible your research finding is a-priori).
This means surprising findings with $p\leq \alpha$ from small studies are much less likely to be true than expected findings from very large studies.
The
example in the essay is overly simplified, because few point null
hypotheses are exactly true and even the meaningfully large effects
follow some kind of distribution, but the underlying point is true.

Why does this happen? Well, the p-value is random variable that is in turn based on the other random variables in your study. The smaller the sample size, the noisier the p-value is. Consider an extreme case:

Let's assume we have absolutely no data.
A valid null hypothesis test in that setting is to reject the null hypothesis
randomly with probability $\alpha$.
If we know nothing else, then the probability that a study with $p\leq \alpha$ has produced a true research finding is then simply the a-priori probability that the alternative hypothesis was true.

You may think I'm being silly here to do a null hypothesis test without any data, but when I do a study with a power that is really low (=I have hardly any data), then I am essentially doing the same thing (i.e. looking at a random variable that has very little connection with my research question). That's what the paper I linked pointed out.
Comment: Your argument of power doesn't make sense to me. Power is the probability of correctly rejecting the null hypothesis; we agree there. But if you've already rejected the null hypothesis, what role does the 'probability of rejecting' it have when it's already occurred. Power is useful for deciding how many samples you want in your study in advance so that you can be reasonably sure you'll reject the null if the alternative hypothesis is true. What the role of power is not is to dismiss an already statistically significant result retroactively.
Comment: It's kind of like watching someone make a three-pointer in basketball and then retroactively claiming they didn't because the probability of making the shot was low. How does that make sense?
Comment: No, we don't agree on the definition of power: It's the probability of rejecting the null hypothesis **conditional on it being wrong**. Similarly, the p-value is not the probability that the null hypothesis is true, but the probability to reject the null hypothesis, if it is true. To stick to basketball: Do you accept I'm the world's best 3-point shooter? I'll send you 50 videos of successes & you'll have no idea how many videos I took to get 50. Does it matter for this that I don't have a NBA contract & last played recreationally in college? And, I believe what I describe is widely accepted.
Comment: That is what I mean by power. We don't disagree, you've even taken that shortcut in defining it in your own post: "how likely it is that p≤0.05 (or any other threshold α) indicates a correct rejection of the null hypothesis depends on the power." I only have a limited amount of characters to work with. We don't disagree on the definitions of power or p-value. I've alluded to the full definition of power in this quote "Power is useful for deciding how many samples you want in your study in advance so that you can be reasonably sure you'll reject the null if the alternative hypothesis is true."
Comment: No, I did not define it that way.
Comment: At this point, you're just arguing about what you think I said rather than what I obviously mean. I'm telling you, I agree with the definition of power. So please show me the respect that I may be an intelligent person.
Comment: Basic confusions about what power, p-values and type I errors mean are common, and are at the bottom of many misunderstandings of statistics, such as many people thinking that "statistically significant" always means the same. Thinking these things through properly is important for understanding why $p\leq \alpha$ is less compelling from a small study with low power to reject an a-priori implausible alternative hypothesis. The concept of type S error may be useful to think about: The probability of having gotten the sign of your claimed effect wrong, which also increases in low power studies.