Magento Cron reindexing issue

Question: We are facing an strange issue that products in listing pages are not showing in frontend. we are importing products from zoho and we have setup crons as update by schedule. Suddenly products got disappeared in listings page and there is no logs reported but when we reindex manually the products are showing.Does anyone faced this kind of issue , we are using magento 2.2.5 version.when we index catalog search, products are showing.can anyone know where to debug and to solve this issue.
Answer:
pls make sure your cron are running. After that, you can go to table "cron_schedule" check column "job_code" and "status" view time running. So, I think it is not schedule finished on your case. Just waiting it :)
You should change indexer from "update by schedule" to "update on save" because when you import product, it will pass over save. So, it will automatic reindex.
Comment: hii, our crons are running and i have checked in cron_schedule , and we are using mirasvit asynchronous indexer module for indexing, they said to change from update on save to update by schedule.

Magento Cron reindexing issue


Reindexing without SSH

Question: I'm developing a magento store on a server which i don't have access to SSH right now. Can we possibly reindex without SSH?
http://screencast.com/t/v3pb8E8Ho!
Answer: Yes you can using cron. You can also set your indexing mode for index on schedule to avoid delays every time you save a product, for example.

Set up cron
In the Admin, go to System > Tools > Index Management to set the indexing mode
Comment: yes, ik that is one way of doing that i've tried it without any success. What if some indexes are already invalidated will this approach take care of as well?
Comment: Yes. Make sure cron is running as the correct user, NOT the web server user.
Comment: well, i still haven't figured out the right way to do this so finally ended up doing it vai SSH. I know this is possible with approach you are suggesting, so i will accept your answer for other visitors.
Answer: You can Re-Index using Admin Panel. Here Re-Index can be done in two modes.

Update on Save
Update on Schedule

To do so-
Log in to the Magento Admin.
Go to System and under Tools, click Index Management.
Select the checkbox next to each type of indexer to change.
Select the indexing mode from the Actions dropdown.
Click Submit.

Reindexing without SSH


bound of $f$ on the interval $[a,b]$

Question: A stupid question... if $f$ is continuous on $[a,b]$, then is it also bounded? If so, how do we write its upper bound? Is it $f(x)\leq f(b)$ for any $x \in [a,b]$?
Comment: Image of a compact set under a continuous map is compact, but the upper bound is not necessarily $f(b)$
Comment: No it is not! Think about $\sin x$ in the interval $\left[ 0, \pi \right]$.
Comment: It is bounded, but not necessarily by $f(b)$.
Comment: Nope. Take the function $f(x)=b-x,x \in [a,b]$ where I assume $a < b.$
Answer: Yes $f$ will be bounded on $[a,b]$ and moreover $f$ will achieve it's maximum on the interval $[a,b]$. $f$ being bounded on $[a,b]$ means that there exists $M > 0$ such that $|f(x)| \leq M$ for all $x \in [a,b]$. On the other hand, achieving its maximum on $[a,b]$ means that there exists $c \in [a,b]$ such that $f(x) \leq f(c)$ for all $x \in [a,b]$. However, there still may be a point $x \in [a,b]$ such that $|f(x)| > f(c)$. Note also that $c$ might not be $b$!
Let's now prove that $f$ is bounded on $[a,b]$. Otherwise, for every $M > 0$, we could find some point $x_M \in [a,b]$ such that $|f(x_M)| > M$. In particular, there exists a sequence $(x_n)$ in $[a,b]$ such that
$$
|f(x_n)| \geq n, \quad \forall n \geq 1.
$$
Because $[a,b]$ is bounded, $(x_n)$ has a subsequence $(x_{n_k})$ that converges to a point $x \in [a,b]$. Then, by continuity, we must have
$$
f(x) = \lim_{k \to \infty} f(x_{n_k})
$$
whence $(f(x_{n_k}))$ is convergent and bounded. However, $|f(x_{n_k})| \geq n_k$ for all $k \in \mathbb{N}$ ensures that this sequence cannot be bounded. This gives us our contradiction.

bound of $f$ on the interval $[a,b]$


Higher-order probability

Question: How does one assign a probability to statements that are themselves probabilistic? For example, how would one assign a probability to the statement, "There is an 80% chance that it will rain on September 16, 2017"? And how would one assign a probability of THAT statement? etc. Is there a paper where someone talks about this problem?
Comment: If you accept past performance as measuring future probability (not true), you could make statements like: "it has rained on 60% of the days when Bob the weatherman has said there is an 80% chance of rain". This is something you may do if you were comparing different predictions. Note that "probability of rain" is a bad example, because it could mean it will rain over 80% of the forecast area, not that there's a 20% chance there will be no rain at all.
Comment: One interpretation is that the probability in the sentence is statistical probability of rain, whereas probability of the sentence concerns the credibility of its source. Since estimating credibility may include considerations beyond forecasts of rain such second order statements can not be accomodated into first order statements. This is similar to two-dimensional modal semantics, which interprets sentences like "it is possible that stable wormholes are impossible" as expressing two different types of possible, see e.g. [Chalmers](http://consc.net/papers/conceivability.html)
Comment: Probabilities multiply...
Comment: Fuzzy logic involves the notion of meta-fuzzy rules:  Rules about your measures of certainty that may themselves need to be tuned to the situation as you find out your predictions of uncertainties are wrong in a systematic way.
Answer: My analysis would be that such statements represent propositions that are about other propositions.  The example you gave proposes that the proposition [it will rain on September 16, 2017] has an 80% likelihood of being true.  I would claim that such propositions will always be probabilistic in nature because there is nothing to be said about a proposition except its truth value.
If I were to make a 'higher order' proposition about the likelihood of the probabilistic assertion, I claim that the same meaning, with respect to the non-probabilistic proposition, can be achieved by revising the lower order claim.  For instance, if I were to say [There is a 20% chance the exemplary proposition is true], all I have to do is multiply .2 and .8 to get the revised probability that [it will rain on September 16, 2017], by the multiplicative rule of probabilities.  I have no real conclusion about this kind of proposition, but I've described what they are and how I think they work.  Check out Bayes' Rule if you are interested in reading more about revising probabilities.
Answer: There is much more to so called higher-order probabilities than taking the mean of a random variable.
Yes, there are a bunch of papers which talk about this problem.  A good starting point is:
Do We Need Higher-Order Probabilities and, If So, What Do They Mean?
https://arxiv.org/abs/1304.2716
The takeaway by Pearl and others is that yes you can talk about higher-order probabilities (people do it all the time), but that typically they are derived from an existing causal model.
Comment: Who are the others besides Pearl? How does the causal model fit in with this?
Answer: You're talking about the mean (first moment), as opposed to the variance (second moment), etc, and perhaps more directly about quantiles. See https://en.wikipedia.org/wiki/Moment_%28mathematics%29#Significance_of_the_moments   and   https://en.wikipedia.org/wiki/Quantile_function   or just google   "statistics moments quantiles"   for detailed discussions.
Comment: The standard deviation does not cover the odds the mean is wrong, it handles the error that is not accounted for by the mean.  Say you do a t-test.  The p value is the chance your mean is wrong.  What is the chance your p-value is wrong?  It is not the p-value on the F distribution on the standard deviation.  That answers a totally different question.  The original p-value already has the standard deviation baked into it.
Comment: @jobermark thanks for contributing the additional statistics info.

Higher-order probability


Are there any magic items that can increase spell range?

Question: Certain abilities in the game allow you to increase the range of your spells such as extended spell or the Spell Sniper feat. Are there any magic items that can also grant these benefits?
Answer: Not any that do it in a general way
While it is always hard to prove a negative, as of the time of this writing there appears to be no magic item that would allow you to extend ranges of your spells in a general way like a feat like Spell Sniper would.
Wand of Wonder extends (or reduces) the range of some spells it can cast to 120 feet:

If the effect causes you to cast a spell from the wand, the spell's save DC is 15. If the spell normally has a range expressed in feet, its range becomes 120 feet if it isn't already.

Of these the range of faerie fire (normally 60 feet), stinking cloud (normally 90 feet), and enlarge (normally 30 feet) is increased - but you cannot select, the wand determines its effects randomly.
Answer: You'd have to house-rule it into 5e.  There was something similar to Spell Sniper in D&D 3.5, Enlarge Spell metamagic feat. It allows you to "alter a spell with a range of close, medium, or long to increase its range by 100%." (PHB 3.5, pg.94) The metamagic feats could be duplicated by the Metamagic Rods. I don't see any reason you couldn't homebrew a Spell Sniper Rod.
Here is how it worked in 3.5e for reference.
"Metamagic rods hold the essence of a metamagic feat allowing a spell to be altered.  A caster may only use one metamagic rod on any given spell. Normal metamagic rods can be used with spells of 6th level or lower. Lesser rods can be used with spells of 3rd level or lower, while greater rods can be used with spells of 9th level or lower.   Metamagic, Enlarge: The wielder can cast up to three spells per day that are enlarged as though using the Enlarge Spell feat." (DMG 3.5, pg. 236)
Comment: Hello and welcome. If you are suggesting house rules, you should back it up with references to your experience. How did you do it? How did it work? This site format don't work for guessing and opinions, and things that has no source in the rules should have one in the experience. –
Comment: +1 good find, I remember using the metamagic feats :)


How we compute expectation of a singular random variable?

Question: In probability (or measure) courses, we often see the Cantor distribution that is singular with respect to the Lebesgue measure. Its CDF is increasing but whenever its differentiable, the corresponding PDF is zero. But afterwards, we never use singular distributions. Sorry for my naive question but is it possible to work with them? Compute expectations? Variance? etc... Any book references?
Answer: In the case of any probability distribution of a non-negative random variable, including the Cantor distribution, we can compute
$$
F(x)=\mathrm{P}(X\gt x)
$$
Then we can compute the expected value using
$$
\mathrm{E}(X)=\int_0^\infty F(x)\,\mathrm{d}x
$$
and the variance using
$$
\mathrm{Var}(X)=\int_0^\infty2xF(x)\,\mathrm{d}x-\left(\int_0^\infty F(x)\,\mathrm{d}x\right)^2
$$
Comment: @SergioParreiras: It's true for all measures, yes.  The question may become, if you don't have an explicit formula for $F$ (which you typically don't), how do you compute those integrals?
Comment: @SergioParreiras: It is true for more general random variables. I have extended the answer to cover the case of non-negative random variables. The general case is similar but the added complexity is not really that instructive.
Comment: Thanks! Why this would not be true for **all** singular measures and not only the Cantor? If any monotone function can be integrated that would be the case right?
Answer: It is certainly possible to "work with" such distributions, though sometimes you will need to use different methods than for continuous or discrete distributions.  For example, the mean of the Cantor distribution is clearly $\frac{1}{2}$ by symmetry, and you can find more information (variance, mgf, etc) on its Wikipedia page.
Do they arise in practice?  Yes, though certainly not as often as their continuous and discrete cousins.  As a contrived example, consider the following game.  Flip a fair coin.  If it is heads, you win $\frac{2}{3}$ of a dollar; if it is tails you win nothing.  On the next flip, heads wins you $\frac{2}{9}$ of a dollar and tails wins nothing.  In general, on the $n$th flip, heads wins you $\frac{2}{3^n}$ dollars and tails wins nothing.  Repeat indefinitely.  How much money do you have at the end?  Of course, it's a random variable, so call it $X$.  What is the distribution of $X$?  It's the Cantor distribution.
Written in symbols, if $\{\xi_n\}$ are iid Bernoulli, we have $X = \sum_{n=1}^\infty \frac{2}{3^n} \xi_n$, where the series converges with probability 1 by comparison with the geometric series.
This also makes it easy to compute the variance; since the $\xi_n$ are independent with $\newcommand{\Var}{\operatorname{Var}}\Var(\xi_n) = \frac{1}{4}$, we have
$$\Var(X) = \sum_{n=1}^\infty \Var\left(\frac{2}{3^n} \xi_n\right) = \sum_{n=1}^\infty \left(\frac{2}{3^n}\right) \Var(\xi_n) = \sum_{n=1}^\infty \frac{4}{9^n} \cdot \frac{1}{4} = \sum_{n=1}^\infty \frac{1}{9^n}.$$
Summing the geometric series, we get $\Var(X) = \frac{1}{8}$.
Comment: @SergioParreiras: I don't know that there are general techniques.  You may have to use different methods for different distributions.
Comment: Thanks! You wrote "sometimes you will need to use different methods than for continuous or discrete distributions." do you know any book or articles that discuss these methods?
Comment: The construction above seems very interesting. If we define $X_n=\sum_{k=1}^n\frac{2}{3^k}\xi_k$ for any $n$ we have a discrete rv. But the limit (a.e.? prob.? dist.?) converges to a singular measure. If instead of $\frac 2{3^k}$ we had $\frac 1{2^k}$ we get the uniform right? This seems to give a recipe for constructing singular measures. Now I remember seeing something like that in Dudley's book centuries ago, must check.
Comment: I wish I could give two bounties instead of one. I feel robjohn answered the question as it is in the title but your comments were very helpful.


Will melted chocolate stick to cupcake papers?

Question: I plan to use mini cupcake papers in a mini cupcake pan. Then I will add fruit and/ or nuts. Then, pour melted chocolate to fill the paper. My question, once set in the fridge, will the paper stick to the chocolate or will it come off? Should I spray the paper with Pam? Please let me know, help! I don't want to make these treats to discover the paper will not come off. Thanks.
Answer: In my experience molten chocolate has never stuck to cupcake papers.
You can always make a trial with a little amount of chocolate and 1 piece of cupcake paper. It doesn't take too much effort and time.
Comment: I definitely recommend running a trial.  Empirically, I've found that the stickiness of disposable non-stick products varies by brand (i.e., the well-known brands tend to have better non-stick properties).
Comment: I wouldn't use Pam as it will make an oily coating on the chocolate. Worse thing is you'll have to tear off the cupcake liner. No biggie.


How to connect to a Windows server on Ubuntu?

Question: At work I usually run Windows 8 but I'm looking to use Linux since I'm mostly a Linux user. How do I connect to it usually? I just type //MIKE-SERVER then hit ENTER key in address bar of a file browser. How would I do that on Linux? It's a Windows Server.
Answer: To connect to your share using CLI interface, you need to install smbclient (Samba client). Then you can access your windows machine like the following:
smbclient //MIKE-SERVER -U <your_windows_credentials>

and you will be prompted for a password.
Answer: It varies depending on your file browser you're using. Here I'm using Cinnamon's file browser, Nemo, which has a pulldown called "Connect to server". Most of the browsers have something similar.

You can put your server, share, and credentials in this dialog to connect to a remote server's share.


Where do I change my password and email for my account?

Question: I need to change my password and email for this account. I think used openid to create this account. Thanks.
Answer: If you are logged-in, and look at https://drupal.stackexchange.com/users/mylogins/1352, you will see a change password under Stack Exchange. That is the last login method you used on Drupal Answers.


Gravitational Potential Energy irony

Question: While calculating potential energy of an object with respect to Earth which equals work done  to bring it from infinity to that point. The gravitational force and displacement are in same direction, then why the potential energy is negative?
Comment: Potential energy = Work done by EXTERNAL force(other than gravity) to bring it slowly from infinity.
Comment: Okay got it. The external force is just opposing gravitational force
Answer: Potential energy is defined as the energy stored in the object brought from infinity to that point. Since we are not doing any work, work done by the system is positive. U can think of it like this, a real life example for instance, assume that u are walking along a road, now u have done work, but ur energy has decreased or u have become more stable. It is the same thing In gravitation, the body has done work so it's energy has decreased but since we assume the energy at infinity to be 0 and since the energy has decreased, the energy should be negative.( This means that we have to supply energy for the body to do work. U may ask then,how come the body moves towards the bigger object if we have to supply energy, ans: in this case the energy is being supplied to it by the force of gravity) .
Answer: It is because the work done here considered is external work and gravity is pulling towards earth while we are applying approximately same force opposing it to cause opposite displacement that bring out negative value .also the potential energy of configuration at infinity at 0 and its directly proportional to distance and if it's 0 at infinity and will starts to decrease as distance decreases i.e when it moves towards earth ..so it gives negative value

Gravitational Potential Energy irony


Custom Permalinks Structure with particular word

Question: I have some headache trying to customizing my permalinks...
So here is what I need :
1) "mysite.com/news/" has to display all the posts.
2) "mysite.com/news/firstcat/" has to display all the posts of the "firstcat" category.
3) "mysite.com/news/firstcat/myposttitle" has to display the single post "myposttitle", which is in the "firstcat" category.
So here's what I've done :

I have a page called "News", with "news" as slug. In the settings, I've set this page to be the blog page. So When I go to "mysite.com/news/", I have the listing of all my posts.
In the "Permalinks" settings page, I have changed "category prefix" to "news". Now if I go to "mysite.com/news/firstcat/", I have the listing of all the posts that belong to the "firstcat" category.
In the "Permalinks" settings page, I have changed the settings to "custom permalinks" and type "%category/%postname%". Now the permalink of my single post is "mysite.com/firstcat/myposttitle" but I want it to be "mysite.com/news/firstcat/myposttitle"... with "news" ...

How could I do that ?
Thanks !
Answer: You Can Try This In The Custom Structure
/news/%category%/%postname%


Where can a mathematician read Hawking's proof for the existence of a black hole's radiation?

Question: Can a mathematician with no knowledge in physics understand this proof? Is there a paper that presents in suitable way for me?
Comment: Not specifically for mathematicians, but generally worth a read: https://physics.stackexchange.com/q/251385/50583
Answer: I suggest Wald's paper Quantum Fields in Curved Spacetimes (http://arxiv.org/abs/1401.2026) as it presents the algebraic approach which I believe is more friendly for mathematicians. He also gives several references for specific points throughout his review that expands the discussion. There you'll find one rigorous derivation, albeit not being the same given by Hawking.
By the way, without prior knowledge in QM and GR you won't understand the motivations behind what he is doing and might have a hard time to get the physics intuition.
Answer:
Where can a mathematician read Hawking's proof for the existence of a black hole's radiation?

IMHO the first port of call is his papers. Hawking's first paper on Hawking radiation was arguably the four laws of black hole mechanics co-authored with Brandon Carter and Jim Bardeen in 1973. Section 1 talked about gravitational collapse and gave three references to Hawking's papers followed by three references to Carter's. Section 2 talked about an integral formula and Killing vectors and covariant derivatives and antisymmetrization. It talked about hypersurfaces and angular momentum measured asymptotically from infinity. It also talked about complex conjugate null vectors and null tetrads, and it gave a great deal of mathematics including expressions like this:

In section 4 the authors said "we shall pursue the analogy between black holes and thermo-dynamics and shall formulate four laws which correspond to and in some ways transcend the four laws of thermodynamics". They started with the second law wherein "the area A of the event horizon of each black hole does not decrease with time". They claimed that it establishes an analogy with entropy. Their first law which said "any two neighboring stationary axisymmetric solutions are related by δM = κ/8π δA + ΩHδJH + ∫ΩδdJ + ∫μδdN + ∫ΩδdS". And that "it can be seen that κ/8π in analogous to temperature". They also said "it should be emphasized that κ/8π and A are distinct from the temperature and entropy of the black hole" along with "the effective temperature of a black hole is absolute zero". Their zeroth law said "the surface gravity, κ of a stationary black hole is constant over the event horizon". Their third law said "it is impossible by any procedure, no matter how idealized, to reduce κ to zero by a finite sequence of operations".
Hawking's next significant paper was black hole explosions? which appeared in Nature in 1974. Hawking said "any black hole will create and emit particles such as neutrinos or photons at just the rate that one would expect if the black hole was a body with a temperature of (κ/2π)(ħ/2k) ≈ 10−6 (M /M)K where κ is the surface gravity of the black hole". He also said the temperature will increase as the hole loses energy and a smaller black hole would end its life in an explosion "equivalent to about 1 million 1 Mton hydrogen bombs". He talked about a massless Hermitian scalar field in an asymptotically flat spacetime. He referred to the Heisenberg operator ϕ with ai and ai+ interpreted as creation and annihilation operators. He talked about outgoing waves and waves crossing the event horizon and positive and negative frequencies. He said the number of particles created and emitted in a gravitational collapse can therefore be determined, and he talked about a wave propagating backward in spacetime from future null infinity to past null infinity.
Hawking's next paper was his Hawking radiation paper particle creation by black holes dating from 1975. He said "it is shown that quantum mechanical effects cause black holes to create and emit particles as if they were hot bodies". In section 1 he set the scene talking about general relativity and quantum mechanics in curved spacetime, saying "one can interpret this as implying that the time dependent metric or gravitational field has caused the creation of a certain number of particles". He said the uncertainty in the local energy can be thought of as corresponding to the local energy density of particles created by the gravitational field. He said "the gravitational field of a black hole will create particles and emit them to infinity at just the rate that one would expect if the black hole were an ordinary body with a temperature in geometric units of κc/2π, where κ is the 'surface gravity' of the black hole". Then he said that as the mass of the black hole decreased, the area of the event horizon would have to go down, thus "violating the law that, classically, the area cannot decrease". Hawking also said "this violation must, presumably, be caused by a flux of negative energy". He then said "one might picture this negative energy flux in the following way. Just outside the event horizon there will be virtual pairs of particles, one with negative energy and one with positive energy". He said one of the particles has negative energy relative to infinity, and that the other particle of the pair "having a positive energy, can escape to infinity where it constitutes a part of the thermal emission described above". There's more, but IMHO you have to sit down and read it for yourself.

Can a mathematician with no knowledge in physics understand this proof? Is there a paper that presents in suitable way for me?

It's hard to say. I think you can understand what Hawking is saying even if you don't know too much physics. See of the black hole thermodynamics by Xinyong Fu for more information, along with work by Yvan Leblanc.
Comment: Thanks! This is it a lot of info. And quite a lot for a mathematician to catch up.
Comment: @OMGsh : my pleasure.


Looking to add new color options to a current product. (Question from someone new to Magento 2.4) Can anyone provide step-by-step directions?

Question:
Looking to add extra color swatches here. I'm pretty new to Magento 2.4 Any help would be greatly appreciated.
Comment: **Please check blow links** to add new color option for the product. https://www.simicart.com/blog/magento-colors/ https://zemez.io/support/magento/how-to/magento-2-add-color-swatches/ https://bsscommerce.com/blog/2-easy-steps-to-add-color-swatch-in-magento-2/
Answer: Here is a simple way to add an option to every attributes in Magento.
1. Find your attribute
You can find your product attribute here : Store > Attributes > Product
This will lead you to a list of every product attribute.
Search for 'color' in attribute code column

2. Edit your product attribute
You can edit your product attribute by clicking on it
On Your product attribute, look for the list of each value you can have. here on sample data 'Manage Swatch'

Don't forget to click on this tiny icon to add your color.
Add a label to it, then you can save your attribute.
3. Edit your configurable product
Reach your configurable product to edit it.
On configuration tab click 'Edit configuration'

On step 2, select the colors you want to add to the product

On step 4, Magento give you a summary of product taht will be created

Click 'Generate product' and configure the new product by adding image, price, quantity, weight...
You can save your product and check on your storefront
4. Verify
Verify on storefront the new added color

Hope this helped you. If you need a programmaticaly way, let me know


Will gcc on onlinegdb always agree with gcc on CentOS 7?

Question: Is there anything OS-dependent about gcc that would cause a meaningful change between the two versions? Are the two versions even different? Just want to make sure, because I test my code on onlinegdb but paranoidly compile and check it on my school's CentOS server before I submit. I'm wondering if this necessary.
Answer: Agree with @fox, but additionally there are platform dependent behaviour, and undefined behaviour (GCC tried to define these where it can). These may differ by platform OS and hardware. However Gcc will try to keep things consistent (where it can).
An example of differences, will be the size of the long int and size_t data types may be 32 bit or 64 bit. (on other compilers them may also be 8 bit or 16 bit).
Answer: The site you mention is currently using GCC 5, while CentOS seems to use at least GCC 7. But this is why we have standards. Valid C99 code will compile on either platform just fine. It'll run the same (though possibly faster or slower) unless you're doing something like using platform-specific libraries or "incorrectly" serializing structures without caring about endianness (if the host architectures differ)
tl;dr: for things you'd be doing for school, it's unlikely the differences would be meaningful


When to use "am not" and "do not" in a sentence

Question:
"I don't know what I'd do without you"
"I'm not know what I'd do without you"

Are these sentences correct?
What are the rules to use "not" in a sentence?
To what is not pointing in the above sentences?
Answer: When you are negating with not, look at the finite verb in the clause, the one that carries person and tense.

If it is an auxiliary verb (the first verb in a verbal construction) or a form of be, you may simply add not:

He is here. ... The verb is a form of be. >>> He is not here.
  He has arrived. ... The verb has is an auxiliary. >>> He has not arrived.
  He must have arrived. ... The verb must is an auxiliary. >>> He must not have arrived.

Otherwise, you require DO-support:

He came today. ... The verb came is not an auxiliary. >>> He did not come today.
  He arrived today. ... The verb arrived is not an auxiliary. >>> He did not arrive today.
  He has a car. ... Here has is not an auxiliary but a lexical verb meaning 'possesses'. >>> He does not have a car.

Until the twentieth century it was common to negate lexical HAVE without DO-support, but this is disappearing. Even earlier any verb might be negated without DO-support, but that died out by the nineteenth century.
Comment: @FumbleFingers Quite. I'll add that.
Comment: @Ale I see no need to expand this indefinitely; most folks who need answers to questions like this know what auxiliaries are.
Comment: At one time it was also common to negate the main verb without including do-support, but ["I know not what to say"](https://www.google.co.uk/search?q=%22I+know+not+what+to+say%22&btnG=Search+Books&tbm=bks&tbo=1) has a decidedly "Shakespearean" flavour today.
Comment: Other constuctions add: *can, need* and son on.
Comment: @Ale : *Can/could, may/might, shall/should, will/would*, like *must*, *have* and *be* are auxiliaries.
Comment: Of course, I know, I thought you were going to put them all.
Answer: "I don't know " is correct. It is the negative of "I know". Other examples:
I like it. (positive) - I do not like it. (negative)
I watch TV. (positive) - I do not watch TV. (negative)
"I'm not know" is wrong. If you try to say the negative of "I know", that is "I don't know". If you want to use "I am not", it is the negative of "I am". For example"
I am from France.(positive) - I am not from France (negative)
I am tired. (positive) -  I am not tired. (negative)
I am cooking. (positive) - I am not cooking. (negative)
Answer: The constructions you are looking at are different and represent important structures in English.
"I do X" where X is a verb is an example of do-support. Technically, you don't need to use do-support in positive statements, e.g. "I do know". When do-support is used with positive statements then do acts to emphasise the claim. E.g.

A: Do you know your twelve times table?
  B: Yes, I know it.
  A: I bet you're lying to sound clever.
  B: I am not! I do know it!

In the above example the do is used as emphasis by B.
In negative situations, do is used as an auxillary (or helper) verb when denying something, e.g. "I do not know." This is because *"I not know" is not grammatical.
Do-support is only used with the infinitive, i.e. the form of verb that matches its name.
So you say

"I do not know", never *"I do not knowing".
"He does not know", never *"He does not knows".

In these situations not is pointing to the verb being supported by do. I.e. not is negating the verb.
Your other construction: "I am X", where X is a verb. Here am is also a helper verb. Am is a form of the verb be. Using be in this way is using it as a copular verb. That means it is joining something to something else. For example in "I am happy" am is joining the subject I to the adjective (descriptive word) happy. The same is happening in "He is cold", he is the subject and cold is the adjective it is being joined to.
When used with a verb, be joins the subject to the finite forms of the verb (finite meaning the forms that change based on who is the subject and whether you're talking about past, present, future, etc.). For example: "I am writing an answer". This uses be to create the present progressive form of write.
When creating a negative statement about your actions, then you use the same form of the verb, e.g. "I am not writing an answer".
In this example not is pointing to writing.
Back to your examples: *"I am not know" is wrong because know is the infinitive form, and am must work with a finite form. However, because of the type of verb that know is, saying *"I am not knowing" is also wrong. This is complicated to explain and I can't think of other verbs that behave like this right now.
As a rule of thumb, when making statements about what you or others do not know, use do, never use be.
Answer: I get that what you are trying to write is the negation of "I know" in "I know what I'd do without you."
Using the simple present, the negation of a verb that is not be, used in a sentence that is not a question, is done by adding "don't" or "doesn't" (the latter is for the third person singular) between the subject, and the verb. In your case, the sentence becomes:

I don't know what I'd do without you.


Is there a way to tell how close you are to getting a badge?

Question: For example,  you need to dive and catch 500 sea creatures to get the gold badge from Phineas.  I have now been keeping track of how many I have caught,  but I didn't do that from the beginning.  Is there a way to see how far you are or how many you have done to see exactly how many more I need?  For this badge and all other badges.
Answer: No, no there isn't. (It would be a wonderful add to the game though)
Fish Encyclopedia (Maybe)
However, it's been far too long since i've even touched this game. Maybe the Fish Encyclopedia will tell you in total for fish caught.


Which offers more privacy, coinjoin-whirlpool or non-KYC online exchanges?

Question: After buying crypto with fiat on a KYC exchange, instead of just moving the crypto to a wallet, I understand that I should get more anonymity from tracking by putting the coin through coinjoin or whirlpool. But it would actually be more economical for me to buy LTC on the exchange and send it to an online exchange like Changelly where I could exchange the LTC for BTC and then send it on to my wallet. (More economical because my exchange charges much more to withdraw BTC than for LTC.)
But I wonder if the swap may give anonymity to the BTC. If that is so, then I wouldn't have to go through the coinjoin process, which seems complicated to me.
Does anyone know if non "know your customer" exchanges provide as good anonymity to crypto as coinjoins do?
Answer: Ideally you should never use KYC exchanges with or without coinjoin. The record with the exchange and third parties that manage KYC stays forever about your real identity and bitcoin transactions.
Swaps done using services like changelly do not provide anonymity. The service has all the links for your transactions and in some cases it could be tracked with chain analysis.
Quoting from https://changelly.com/aml-kyc :

We obtain and hold required and accurate originator information and required beneficiary information on virtual asset transfers and make it available to appropriate authorities on official request

Coinjoin is a transaction between some users that try to break the history of their UTXOs. Outputs in a coinjoin transaction look similar and its difficult to associate them with any inputs.
Comment: It's worth noting that one should not simply prefer non-kyc exchanges as many of those are still highly centralized and are generally acting outside of the law and would likely run away with any money they held on to if they were busted by feds. One should however prefer exchanges that have decentralized order books with self custodial features such as atomic swaps or 3rd party arbitrated self custodial swaps. Otherwise it may be safer to just buy from a reputable exchange with KYC and utilize coinjoin or other privacy features to mitigate the risk of losing funds.


How to execute reportEquivocation function in babe pallet?

Question: I was trying to execute a function reportEquivocation(equivocationProof, keyOwnerProof)in the babe pallet . I was stuck in filling the parameters for the same.Could anyone guide me about how to fill slot and keyOwnerProof parameter?
Answer: The slot is just the slot number (u64) at which the equivocation you want to report happened.
You can see the rest of the struct for the EquivocationProof here:
#[derive(Clone, Debug, Decode, Encode, PartialEq, TypeInfo, Eq)]
pub struct EquivocationProof {
    /// Returns the authority id of the equivocator.
    pub offender: Id,
    /// The slot at which the equivocation happened.
    pub slot: Slot,
    /// The first header involved in the equivocation.
    pub first_header: Header,
    /// The second header involved in the equivocation.
    pub second_header: Header,
}

The keyOwnerProof is the proof of key ownership. The proof must include the session index and validator count of the session at which the equivocation occurred.
You specify it when you implement babe in your runtime, an example in Rococo runtime. In that scenario the fields you need to fill are these (see primitive here):
#[derive(Encode, Decode, Clone, Eq, PartialEq, Default, RuntimeDebug, scale_info::TypeInfo)]
pub struct MembershipProof {
    /// The session index on which the specific key is a member.
    pub session: SessionIndex,
    /// Trie nodes of a merkle proof of session membership.
    pub trie_nodes: Vec<Vec<u8>>,
    /// The validator count of the session on which the specific key is a member.
    pub validator_count: ValidatorCount,
}


Does any Ship appear in more than one Culture novel?

Question: One recurring motif of the Culture novels of Iain M Banks is the amusing names that the Ships bestow upon themselves. There are too many such for my feeble mind to encompass, but I wonder if they have been catalogued against the novel(s) / novella they appear in and if any Ship appears in more than one book.
Comment: I've always suspected that when it to naming his giant spaceships, Iain Banks was ripping off the way racehorses in Britain get some unusual names. Here are some examples: Don't mention the war, Sorry about that, I'll get along, Guilty conscience, Running naked, Foolish pleasure and Don't worry about me. Maybe he thought of his spaceships as thoroughbreds (or inbreds - who knows?).  Maybe. 'nuff said.
Answer: The Grey Area is mentioned in several novels but only appears in one, 'Excession'.

The General Contact Unit Grey Area didn't hold with avatars; it spoke through a slaved drone. 'Young lady-'
Excession

and

"It is done very, very rarely, and the result tends to be ostracism. There was a ship called the Grey Area, once. It used to do that sort of thing.
Look to Windward

The Experiencing A Significant Gravitas Shortfall is mentioned in two  novels but only makes an appearance in one, 'Look to Windward'

"That is the Equator Class General Systems Vehicle Experiencing A Significant Gravitas Shortfall," the avatar said. Kabe saw its eyes narrow fractionally and a small smile formed about its lips and eyes. "It changed its course schedule to come and see the concert too." The avatar watched the shape grow bigger, and frowned. "It'll have to move from there though; that's where my air-burst meteorites are coming through."
Look to Windward

and

She'd had the luxury of a choice in the matter and had turned down the Experiencing A Significant Gravitas Shortfall and the Pure Big Mad Boat Man just because of their ridiculous names.
Matter

Collectively the group known as the "Interesting Times Gang" are mentioned in two novels but only seen in one, 'Excession'.

In fact I am acting on the specific instructions of an SC committee which calls itself the Interesting Times Gang.'
Excession

and

As for the Interesting Times Gang, they have been silent for nearly half a millennium. Several are believed to be in Retreat and at least one has itself joined the Enfolded.
The Hydrogen Sonata

In terms of other recurring characters, Diziet Sma appears in both 'State of the Art' and 'Use of Weapons'

'Their children's children will die before you even look old, Diziet. Their grandparents are younger than you are now ... In your terms, there is no hope for them. In theirs, every hope.'
State of the Art

and

"Zakalwe," Diziet Sma said, "we diverted twenty-eight million people and a trillion tons of spaceship two months off course to get you to Voerenhutz on time. I'd appreciate it if you'd wait until the job is done before you blow your brains out."
Use of Weapons

as does the drone Skaffen-Amtiskaw

Another thing; you will notice that Sma has the gall to refer to me simply as 'The Drone' in her letter. I have humoured her matronizing whim quite long enough, and now wish to make clear that my name is, in fact, Fohristi-whirl Skaffen-Amtiskaw Handrahen Dran Easpyou.
State of the Art

and

"The Xenophobe's heading this way," Skaffen-Amtiskaw said, suddenly there in front of her, its body shining in the sunlight. "Here." It stretched a field out, offering her the little chain of bright flowers it had made.
Sma bowed toward it; the machine slipped the chain over her head like a necklace. She stood up and they went back into the castle.
Use of Weapons

The mercenary Zakalwe also makes a surprise return at the end of another novel

 He wondered if this counted as a poetic insight. Probably not. Or if it did it had already occurred to countless poets. Still, he'd mention it to her when she arrived. Likely, she'd snort, though it would depend or her mood; instead she might assume that wry, amused expression that told him he was impinging, clumsily if charmingly, upon her territory. Tiny crinkles of skin formed under her eyes when she had that look. It would be worth it for that alone. He heard steps. The maître d' crossed the terrace, arrived at his side, bowed fractionally and clicked his heels."Your table is ready, Mr. Zakalwe."Surface Details
Comment: This put a big smile on my face, thank you!


Terminology: Screen with both filter and sort actions

Question: What would be a proper way of calling a screen that provides both filter and sort actions? Focus is on Android apps.
Answer: We call it Refine in our job search Android app (Naukri.com), So does Outlook and ebay in its iOS app. You can add a suffix like Refine results or Refine [list items].
Another option could be call it Filter (specially if you are using a funnel icon) and add a Sort section on top.
Answer: I will need some more context in order to give a better answer. I guess that you have something like a product-list page, or an array of elements.
Possible names that I would use:

"Refine your data"
"Refind your products" => When it comes to a product-list page
"Options"
"Filters & Sorting" => It might be better to have a list of filters and a list of sorting ways. Keep in mind that users might not truly understand the difference. Also, a lot of times, sorting happens in the main screen and filters in another screen, especially when it come to mobile.
Comment: This is an entertainment app with mainly image content. I was thinking options but we have a snackbar which reminds users that sorting or filtering have been applied. I could not come up with good text for the snackbar. It would be best if it would just say "Filters applied" and then have a Reset-button.
Comment: "Filters applied" would be a good option if filters are applied. So it could be "Filters" and "Filters applied". Also reset-button sounds good. I am wondering if it is possible on your screen to show already which filters are applied, so that the user doesn't need to go to the other screen a lot of times.
Comment: I'm just worried that can it be misleading if the "Filters" screen has sorting options also? Or maybe I'm just overthinking it. :)
Comment: My suggestion is to have Sorting on the main screen. For example look at e-commerce apps. They have a separate Filter page and the Sorting happens in the product-list page. Of course it depends on the Sorting possibilities that you would like to include.
Answer: This screen from Expedia seems to show a good option for combining both filter and sort on one screen (though it is iOS and not Android).
The filters button and search bar only appears after the user pulls the list "down", indicating that they scrolled through the list and were not satisfied with the results.

The Expedia iOS app has some really excellent UX in my opinion.


If I renew my passport do I get 10 years from the expiration date or 10 years from the renewal date?

Question: If I renew my passport do I get 10 years from the expiration date or 10 years from the renewal date?
My passport expires in December 2013 so if I travel now, I would still have more than 6 months before it expires, but if I travel after June 2013 I would have less than 6 months before it expires.
If I renew my passport now and my passport would expire 10 years after the renewal date it would be valid until December 2022. If I waited until April of 2013 I'd get an extra 4 months, and it would be valid until April 2023.
On the other hand, if they gave me 10 years from the expiration date of the current passport, then my renewed passport would be valid until December of 2023, almost a year longer than if they only give me 10 years from the renewal date.
Therefore please advise me if I get 10 years from the expiration date or 10 years from the renewal date.
Comment: What's your nationality?
Comment: I am not sure if there is an answer that fits all countires. My passport has a validity that lasts 5 years on the date of issue.
Comment: Which country is this for?  Also, perhaps you could rephrase so that your answer focuses on conveying useful information, as opposed to complaining.
Comment: Same, NZ is 5 years only now :(
Comment: It's true. Just spoken to passport office. The 'unused' months are lost if you apply early. I did so as to avoid the fiasco of last year. Never again. I have lost four months as mine now starts in March and has taken away months for last one which ended in June. Last passport did add months on to the end if you applied early.
Just another way to s*** on the public
Answer: It depends on what country issued your passport
If you have a British Passport, and renew it early, then Time left on your existing passport will be added to your new one - up to a maximum of 9 months. Thus you can have a British passport with an expiry date 10 years and 9 months into the future.
However, many countries don't extend the validity of a new passport based on time left on the old one, so you won't get any credit for renewing early. Australia is one such country, there are many more.
Generally, if you look up the rules on passport renewal and you see something about transferring time from an older passport then it'll be done. If you don't see anything about it there, then most likely your country doesn't offer it.
Comment: I think the UK is an exception with this; its interesting. Just a few checks around the office and with my own experience as well, you "lose" whatever validity remains if you renew early.
Comment: I have also seen that some countries will only recognize the passport for 10 years after renewal, the 'extra' months you get will be lost at that end.
Comment: As of September 10th 2018, the exception for British passports here is no longer valid - you now get 10 years from renewal date, as with most other countries.
Comment: @Willeke that is true for Schengen, certainly, and presumably therefore for the Schengen-candidate EU countries, but I don't know of any other jurisdictions that apply this rule.
Comment: It only has to be one country to make you need a new passport and countries that do not have the rules now can change to them. Or the ones who have those rules now may stop having that restriction.
Comment: WARNING:  https://www.gov.uk/guidance/passport-rules-for-travel-to-europe  "Any extra months on your passport over 10 years may not count " for having 6 months validity in visiting Europe for example.
Answer: Logically, it will be from the renewal (issue) date. Otherwise the passport will be valid for more than 10 (or 5 years depending on your country, some countries like Jordan issue a 2 years passport sometimes).
Lets say you renew your passport in December 2012, if the expiration date will be 10 years from the previous passport's expiration date (December 2013 in your case) then the new passport will have the issue date of December 2012 and expiration date of December 2023! Your passport which will have a new passport number will be valid for 11 years which is logically wrong.
Anyway, Some countries, Like Sudan and Egypt, before they start issuing the new passports with the bar code, they used to add a renewal stamp which will usually has a new date of expiration which will be n years added to the previous expiration date. These were the good days when passports used to be hand written and this is not valid with the new passports.
UPDATE:
It seems that UK citizens can have passports for more than 10 years (check the comment by Gagravarr). I think this is an exception.
Comment: Nothing wrong with having a passport with a validity of more than 10 years, it's very easy to do if you renew your UK passport early - the UK gives up to 9 months credit on new passports for early renewals
Comment: Also, if you have a 10 year valid passport, and it expires, and you wait 10 years your next passport would already be expired by the time you get it!
Answer: For USA passports, the new passport is valid for 10 years from the issue date. See "How long is a passport valid and when should I renew my passport?" in the passport FAQs.
My boyfriend had to get his passport replaced (for name issues) recently, and even though his previous passport was only a year old, his new passport is still valid for the 10 years.
Answer: In the case of Italy, the passport is not renewed but re-issued. Quoting from the Italian Police website:

Il passaporto è rilasciato ai cittadini italiani e ha durata decennale. Alla scadenza della validità, riportata all'interno del documento, non si rinnova ma si deve richiedere l'emissione di un nuovo passaporto.

With this in mind you can easily guess that you will get a new document with 10-years validity starting from 00:00 on the day of renewal to 23:59 of the day before that of renewal plus 10 years.
Comment: Most countries actually reissue passports rather than renewing them, yet the term "renew" persists.  So it has two possible meanings: it can refer to the extension of an existing document's validity, or it can refer to the issue of a new document to replace an existing one.
Answer: The UK Passport Office have changed their policy sometime in 2014. They say they add unused months, but they add them at the starting date, not expiry date,
So you lose all unused months!
The wording is the same, all unused months will be added, but you lose them all!
I am looking into Trading Standards.
Comment: Can you link a source for this change?
Comment: Reading the phrase "but they add them at the starting date, not expiry date, So you lose all unused months!" actually caused me physical pain.
Comment: My UK passport has 25 NOV 15 as the issue date, and 25 APR 26 as expiration date. It is valid from the time I did the renewal in November 2015 through 10 years after the expiration date of the passport it replaced.


Reference request for the analysis of the concept of "fact"

Question: I am looking for books and papers that analyze the concept of "fact" in a philosophical way. That is, such texts might define what a fact is, talk about whether a fact is one kind of entity in and of itself, talk about how facts differ (if they do) from truths, etc. I read the Stanford Encyclopedia of Philosophy entry on facts, but I am looking for further references.
Comment: How about references at the bottom of that SEP entry, in the "bibliography"?
Comment: I don't know that anyone has a list handy, but you might want to do some work on PhilPapers: https://philpapers.org/browse/facts-and-states-of-affairs/
Comment: The answer may be found in the *mode* of *pop philosophy*
Answer: The SEP entry on facts will be a good direct and indirect resource. There are strong connections between the concept/word "facts" and talk of states-of-affairs, and facts are the classically preeminent truthmakers.
More specific references would be the articles on various philosophers' commitments (temporary or not) to logical atomism, e.g. Russell's or Wittgenstein's.
Talk of facts is often involved in talk of truth as in the correspondence theory of truth. Oftentimes, given their metaphorical {Subject, predicate} character, facts are supposed to be related to properties (where properties are the predicates, and substance-terms are the subjects).
Answer: David Wootton's book The Invention of Science devotes a chapter to the meaning of facts. In particular, he argues against Nietzsche's claim that facts, as such, are merely a matter of interpretation and, therefore, have no real existence.
Against this claim Wootton's contention is that we live and swim in an sea of facts, invisible, yet determining of our world.
https://www.google.com/books/edition/The_Invention_of_Science/7exeBwAAQBAJ?hl=en&gbpv=0
Comment: Can it be that (yes, it can be!!) some dogs are Alsatians and some dogs are Dobermans?


Show the number of comments on the Top Questions page

Question: Would it be possible to have, in the "Top Questions"/"Home" page, the number of comments next to the number of votes, answers and views?
Comment: Why? What benefit would that bring?
Answer: Comments are second class citizens on Stack Exchange, so they're less visible than questions and answers. The main problem is that (without reading them), the number of comments* conveys absolutely nothing. It could be that the question is rather unclear, and the comments are trying to clarify (but you don't know whether that was successful until you read them); it could be that there's a lot of discussion (in which case the comments aren't even used for their intended purpose). Users may leave a (partial) answer in a comment, but again, that's not their purpose, and such comments should be converted into a proper answer.
Space is at a premium, especially often viewed pages like the question lists. So I don't think it is a good idea to add the number of comments to those pages.
*: under the question alone, or the entire Q&A thread? Anyway, it doesn't matter...
Comment: You can 'follow' questions you're interested in to get notified when a new comment is posted.
Comment: I just wanted to see if any new comments appeared without opening the question, so without falsely increasing the number of views.
But I understand your point of view.
Thank you


What's the difference between perseveration and hyperfocus?

Question: Dr. Russell Barkley says hyperfocus goes with autism while perseveration goes with ADHD.
I read that perseveration is the same as hyperfocus or that hyperfocus goes with ADHD.
So what's the difference? Is Dr. Russell Barkley right?
Answer: I myself have never found evidence to suggest a difference between perseveration and hyperfocus when referring to ADHD. However, while 'hyperfocus' can be a psychiatric or non-psychiatric condition, perseveration is typically considered a psychiatric condition in all instances.
The wikipedia page for hyperfocus has an entire section dedicated to the confusion between hyperfocus and perseveration, particularly as it pertains to ADHD.

Hyperfocus may in some cases also be symptomatic of a psychiatric condition. In these cases it is more commonly and accurately referred to as perseveration (or perseverance) - the inability to, or impairment in, switching tasks or activities ("set shifting"), or desisting from mental or physical response repetition (gestures, words, thoughts) despite absence or cessation of a stimulus, and which is not excessive in terms of quantity but are apparently both functionless and involve a narrow range of behaviours, and are not better described as stereotypy (a highly repetitive idiosyncratic behaviour).
It is typical for individuals with ADHD to say they 1), can not focus on boring things and 2), can only focus on stimulating things, and that focus is often extreme. Thus it is both a concentration deficit and over-concentration, or generically: "hyperfocus.
Comment: Lol. I saw that page and section but not the subsection title. Thanks Sydney Maples hahaha
Answer: Actually,if you saw a few of Dr. Barkley's presentations. He referred to people with autism spectrum disorder as hyperfocus because they focused immensely on fine details of their sensations and their environments. While this hyperfocus, lacks the big picture perception. For instance, the child with autism might focus on the car wheel, while not attending to the car itself.
While perseveration was well defined by the "upstairs" author.
EDIT:
Scientists would agree that they have what the ADHD community defines hyperfocus, but some (not all) psychologist/psychiatrist would not appreciate the use of this term based on the definition alone. They would disagree on the word used to define it. They would agree that people with ADHD have perseveration, but not hyperfocus (based on the definition alone). There is science to backup issues related to perseveration. While positive aspects of perseveration is probably lacking in the literature (since that's harder to look for). Hyperfocus would be kept for the autistic symptoms of focusing far too much on one element or detail and not perceiving the remaining of the item for instance.
To make things more complicated, I know there is one psychiatrist who uses the term hyperfocus (although probably not in thescientific literature). His name is Edward Hallowell. He's more of a clinicians and a book writer than a scientist from what I remember.
Comment: Well. I was wrong to say about the definition alone since the term is not often used in academic journals. So there is no actual definition. But Barkley has stated in many conferences that he views hyperfocus to be more related with the attentive patterns of autistics, rather than ADHD. Mostly since the word entails an increase focus on singular items or task. While ADHD is more about perseveration of the task, not hyperfocus of attention. But that's his view, and his comments.
Comment: Thanks MindsEye. What do you mean not scientifically? Some scientists don't think people with ADHD have hyperfocus (or perseveration) or something of the sort?
Comment: Check out my edit in the previous post.
Comment: 'based on the definition alone' --> the definition of what? hyperfocus? what is the definition?
Answer: NOTE:
This response is based on my own personal experiences with these kinds of things and also on the information I've gathered online from people who claim to know about the subject (experts). I do not recall specifics, so as to be able to cite every source. Thus, your mileage may vary.  :-)
I like words, especially in higher reading levels.
However a lot of this quibbling over technical definitions of one condition or another seems to be missing out on what caused the question to arise in the first place.
Perseveration and hyper-focus both can FEEL similar to the casual observer
on account of the effects of either symptom making a person behave similarly.
Splitting hairs about what to call it might come from a concern over clearly and consistently identifying the source of what's causing each issue.
So- If I understand correctly:
PERSEVERATION is a general difficulty regulating one's ability to persevere,
either for eventually starting or in having trouble with stopping.
It is affected or enhanced when the task involves a subject that is particularly stimulating in it's interactions.
It can often feel like a strong motivational inertia regarding task management.
Specific stimulating interests can make it easier to start and also harder to stop.
This can both work for and against timely task completion,
until sufficient supports and accommodations are permitted
in order to put that within the reach of the person.
But it sure makes a 12 hour video game marathon easier to do,
if a person finds that sufficiently stimulating.
Over all, they WANT to try to function, but they can have a tough time making themselves functional on a consistent basis.
HYPER-FOCUS is fixating on a detail or subject specifically.
The subject itself is stimulating, even if the activities  relating to it might not ordinarily be that engaging to other people.
It doesn't matter if the subject relates to the task at hand,
it will definitely, definitely draw the person's attention in a compulsive manner.  That's what they want to talk about, study and/or do.
If the behavior resulting from the fixation produces something useful,
such as an exceedingly niche position of employment, then great!
At least they managed to find work, finally.
In extreme cases, until their subject of interest presents itself,
they (like the honey-badger) just don't care.
Comorbidity between the two conditions is not entirely uncommon,
(overlapping effects from both conditions).
The way professional smart people try to argue that both are completely different and there can be no other way
might be losing sight of this point.
TO ANSWER YOUR QUESTION:
the cause of either condition may be different enough to warrant distinct labels when discussed in a professional medical setting.
So I wouldn't be surprised if Dr. Russel Barkley is technically correct.
When it comes to fixing a problem, it helps to classify it accurately, rather than just generalize for convenience.
There may even be some people who possess a measure of both conditions,
on account of being affected by the separate causes of those conditions at the same time.
Whatever the case,
the day-to-day experience is a pension for extreme focus.
Thus the casual inclination of people who are NOT Dr. Russell Barkley
is to just call it "hyper-focus" and be done with it.  :-)
Hopefully that helps.
Comment: Answers based on personal experience are [frowned upon](https://psychology.meta.stackexchange.com/q/1037/7001) here.


How to draw a plane equivalent to a given btStaticPlaneShape using OpenGL

Question: With all other shapes in bullet, you can easily get the transform from the MotionState which holds the origin, the scale, and the rotation. There seems to be no way to get the same information about a btStaticPlaneShape. How can I get this information, so that I can build a rectangle with 4 vertices that will act as a representation in OpenGL?
Comment: Edited to clarify the question being asked. Please amend further if it's changed the meaning in any way.
Answer: Looks like btStaticPlaneShape is an infinite plane, so you could pick an arbitrary point and just draw a really big plane centered on that that point using the normal stored in btStaticPlaneshape
Comment: Seems sensible to me. I'd add the small refinement that you'd probably want the rectangle centre to be pretty close to the camera that's rendering it. It should be fairly easy to calculate the closest point on the infinite plane to the camera, then project out 4 vertices, one on each cardinal axis, some large distance from that point. However the original asker should be aware that super-large polygons can sometimes have clipping issues, not to mention the issue of UV mapping and texture resolution. Depending on how/if you need to texture, you might be better making a grid of smaller triangles


How to check if a laser's light is circularly polarized?

Question: I have $532\,\mathrm{nm}$-laser passing through a quarter-wave plate polarizer.
How could I check whether the light out from the quarter-wave plate is circularly polarized?
Answer: The quarter wave plate doesn't destroy the polarization - it just changes its character. Circularly polarized light has an electrical vector that rotates without changing its magnitude; if you pass the light through a linear polarizing filter, and rotate the filter, the intensity of the observed light should not change.
Contrast this with the original light from the laser pointer: if you do the same experiment, you will see the intensity after the linear polarizer go from "almost zero", to "almost fully transmitted".
In the intermediate stage of elliptical polarization, you would see the intensity change without ever fully being extinguished. This happens when the initial light is not polarized at exactly 45° to the fast/slow axis of the quarter wave plate.
Answer: If the laser is not to strong, grab a pair of 3D glasses and see if the light passes through both glasses more or less equally, make sure they're the kinda modern ones from like the last 5 years or so. These are circularly polarized.
To quote Wikipedia, yeah I know, it explains below, it also tells you how to make your own:

To present a stereoscopic motion picture, two images are projected superimposed onto the same screen through circular polarizing filters of opposite handedness. The viewer wears eyeglasses which contain a pair of analyzing filters (circular polarizers mounted in reverse) of opposite handedness. Light that is left-circularly polarized is blocked by the right-handed analyzer, while right-circularly polarized light is blocked by the left-handed analyzer. The result is similar to that of stereoscopic viewing using linearly polarized glasses, except the viewer can tilt his or her head and still maintain left/right separation (although stereoscopic image fusion will be lost due to the mismatch between the eye plane and the original camera plane).

*Quick edit:
If it passes equally through both it's of course NOT circular (since one of the two should block the light right/left-handed).
Answer: Finally found the method to check whether light output from circular polarizer is perfectly circularly polarized or not.

Consider that a polarized light is passed through quarter wave plate which is fixed at certain angle and its output is send to linear polarizer.
now measure the power output from linear polarizer by varying its angle,but keep quarter wave plate fixed and plot a graph (linear polarizer angle of rotation vs power) if the plot is perfect sine wave,the light is perfectly polarized(linear polarizer was used only check circular polarization).if not change the quarter wave plate angle to next and repeat the above method ie,varying linear polarizer angle and measuring power.
I did the experiment by keeping quarter wave plate @ 130,132,135 and varied the linear polarizer and measured the power and from the plot,the perfect circular polarisation can be achieved by keeping quarter wave plate at 135 degree.
Comment: That's... some pretty suspect data. If the polarization were truly circular, then that graph would be completely flat as you rotate the linear polarizer; moreover, regardless of the polarization state, the variation here should be completely sinusoidal where your blue curve shows a much funkier variation. There seem to be additional factors in your experiment that you likely need to account for (say, noisy variations in your source's intensity?).
Comment: More importantly, though, "perfectly circular polarization" isn't an achievable goal ─ instead, you need to focus on an *accurate* production and characterization of a given polarization, where much of the work is directed to characterizing and presenting your uncertainty in the polarization state of the light (usually via polarization tomography, presented using its [Stokes parameters](//en.wikipedia.org/wiki/Stokes_parameters)), so that you can say just how close to circular your light is, and deciding what is an acceptable deviation from complete circularity.
Comment: I did the same experiment and for one angle there is essentially no change in intensity and after 45° it is maximal intensity change. BUT the flat line occurs for 31° and not 45°. Is there any obvious reason how the angle can change, that I am missing ? Of course if my incident linear polarization is not correctly set. But besides that ?


What happens if your teleporter gets damaged when your entire remaining crew are currently boarding?

Question: What happens if your entire crew is in the enemy ship and your teleporter gets damaged in your ship, with no way to repair it? You immediately lose?
Answer: When the battle is over, there will be a popup saying that your crew used one of the other ship's shuttles to return to yours. This will get all your crew back to your ship.
This can happen at any point after the battle, such as if the teleporter is destroyed by fire after the battle is over or if the last crew member on your ship suffocates.
Comment: What if you have another crew member in the ship but dies trying to do the repair (fire, suffocation), after the battle?
Comment: @SysDragon Edited into answer.


Physical meaning of geodesic equation $p^\lambda \nabla_\lambda p^\mu=0$

Question: In Sean Carroll's GR book pg. 109, it was said that the geodesic equation for timelike paths can be written in terms of the four momentum $p^\mu=mU^\mu=m\frac{dx^\mu}{d\tau}$:
$$p^\lambda \nabla_\lambda p^\mu=0$$
It was then said that this relation expresses the idea that freely falling particles keep moving in the direction in which their momenta are falling. I don't understand why this equation implies that. Is there some kind of dot product involved here?
Comment: Yes, there is a dot product at $p^{\lambda} \nabla_{\lambda}$. If you'd like you can instead view it as $p^{\lambda} ( \nabla_{\lambda} p^{\mu})$ which is just another way to say $p\cdot (\nabla p^{\mu})$ (technically $(p\cdot \nabla)p^{\mu}$).
Answer: If the $\nabla$ were $\partial$, the equation would simplify by the chain rule to $m\frac{d}{dt}p^\mu=0$, so the momentum is "conserved" in the sense of being unchanged by a change in $\tau$. This notion of free motion is just the intuition of Newton's first law, in relativistic language. But since a geodesic can be described with any choice of affine parameter, not just the proper time $\tau$, we generalize the $\partial$ to $\nabla$.
Answer: Along time-like or null geodesic we can associate "rate of change" wrt some affine parameter $\tau$ as $$\frac{d}{d\tau}=P^a\nabla_a$$ where $P^a$ is tangent vector along geodesic. Then the geodesic equation can be stated as $\frac{dP^a}{d\tau}=0$. The intuition is that, if we work in a flat space-time and in non-relativistic limit (assume $P^a=mU^a$ with $U^a\approx (1,\vec{v})$), we see that $$\frac{d}{d\tau}=\partial_t+\vec{v}.\vec{\nabla}$$ which is our usual time derivative (negelecting an overall factor of $m$). Thus geodesic equation in this limit will boil down to simple free particle equation:$$\frac{d\vec{v}}{d\tau}=0$$.
Answer: A geodesic, when parametrized by the arc lenght, can be expressed as the parallel transport of the tangent vector being zero. $U^\mu=\frac{dx^\mu}{d\tau}$ is exactly the tangent vector with such parametrization.
$$U^\lambda \nabla_\lambda U^\mu=0$$
Multiplying by $m$ the $U$'s we get the expression for the momentum.
For a visualisation, we could change from the spacetime to the surface of a spherical planet perfectly smooth without friction. The momentum of a free moving particle along the surface would follow a great circle, the geodesic in this case.


Controlling RGB LED (common anode) with Arduino

Question: I have an RGB LED (datasheet here) that I want to control using an Arduino R3 (datasheet here). How can I do this? The LED has a common anode, not a common cathode. However, the arduino's I/O pins can only be +5 volts. This is a problem, because I need to somehow hook up the LED's cathodes to the arduino's I/O pins.
Answer: This is only a problem if you think in terms of SOURCING a current from an output. Outputs also SINK current.

When the output is set LOW current will flow INTO the pin to ground (SINKING).
Answer: The Arduino IO pins can "output" high or low (+5v or 0v) which means you can drive a LED either direction. Generic schematic (couldn't find RGB LED in the editor):

simulate this circuit – Schematic created using CircuitLab


Local variable importance vs Global Variable Importance

Question: Is there any technique to find local variable important? For example in credit card concept, is there any way to specify why a person is not eligible for a credit card? or which features cause this person to not be eligible to get a credit card? I have never heard about local variable importance so any resource would be appreciated.
Comment: Local variable importance is a feature of random forests.
Answer: You can try LIME (Locally Interpretable Model Agnostic Explainations)
They give you the explanation for local variables.
I would suggest you look at two libraries in Python.
Eli5 and LIME for local explanations.
Comment: Welcome to CV! The aim of CV is to have standalone solutions to questions, unreliant on external links. A good answer will provide background and at least a brief explanation of concepts. Links to more in depth resources are welcome but should be provided a good context and the answer should still be informative in the event of link rot.


DbContextScope ReadOnly and Create Context in same service

Question: Is there a pattern which allows for a Service class to handle both read and write operations? Im trying to retrofit our current service layer to use DbContextScope github/mehdime/DbContextScope (no repo layer) and we do read/write operations in the same class.
If I use a single IDbContextScopeFactory object, it will throw an exception Cannot nest a read/write DbContextScope within a read-only DbContextScope
I dont want to have to create two service classes, just to handle read or write operations, is there away around this? If its solely a scoping issue, perhaps i can somehow design the layer in a way that will have separate scopes for each operation type?
Any guidance would be very helpfull!
Answer: I found why the exception was being thrown. I was trying to create a dbContext instance in the same line where i was referencing the factory call.
using (var db = _dbContextScopeFactory.Create().DBContexts.Get<*NAME*>())
{}
I think this was causing the the dbContext be disposed incorrectly. Once i refactored the code to retrieve the dbContext outside of the using line, the errors stopped.
using (var fact = _dbContextScopeFactory.Create())
{
    var db = fact.DbContexts.Get<*NAME*>();
}


how to determine changes belonging to same changelist in perforce while diffing?

Question: Is there a way to determine if two differences between two versions of a file belong to same or different changelist ?
If not, then would it be a good practice to mention the changelist numbers in the comments when the changes are made ?
Comment: As it stands, this question makes no sense.
Answer: I'm not quite sure what you're asking, but the visual client has a Time-Lapse View for a file that will tell you which revision introduced a particular change, and you can scrub that back through revisions as well to find out earlier changes if needed.


Is it possible to have your flair displayed on all Stack Exchange websites?

Question: I want to have my Stack Exchange flair on all stack exchange websites. Is that possible? Can it be implemented?
Comment: Find your [flair here](https://stackexchange.com/users/15514439/haversine) and add it to your profile. Is that what you're looking for?
Answer: Possible, yes.
Considered off-topic as personal and not appropriate - also yes.
As the help center states:

Do not use signature, taglines, or greetings.
Every post you make is already "signed" with your standard user card,
  which links directly back to your user page. If you use an additional
  signature or tagline, it will be removed to reduce noise in the
  questions and answers.

However, on your profile, if you include (by copying and pasting):

You get this:

You will find the code here.
Paste it into your profile on a site say meta here. You'll get the option to copy it onto all site's profiles.
As the help center sais:

Your user page belongs to you — fill it with information about your
  interests, links to stuff you've worked on, or whatever else you like!
Comment: Yes, my question was how I can make that flair appear as my profile when I post a question or answer. Is this possible?
Comment: Where do I post it on my profile? On the About me section?
Comment: so if i post my flair code there, it will show up on my profile?
Comment: What? I just edited it twice within 1 day and it saved...
Comment: Do you have any examples of people who have added flairs to their profiles so I can see how it looks like?
Comment: I see, did you use the html code on your profile?
Comment: @Haversine Yes, just paste it in there.


Does a ground wire to a receptacle box improve safety if appliance only has 2 prongs?

Question: If an outlet will only ever have 2 prong devices plugged in is there any safety purpose to have a ground wire added.
Comment: Are these two-pronged devices marked with a "square within a square" symbol? Is the outlet box metal or plastic?
Answer: Since the outlet has a ground pin, it must be protected
You certainly did have the option to fit a 2-prong outlet (NEMA 1-15), which are still sold by competent hardware stores and electrical supply houses for this very reason.  By the very fact that you are asking this question, I gather you did not.
For instance, I have outlawed 2-prong outlets in our facility because we have gorillas who like to break off ground pins whenever they find a 2-prong socket.
No.  If you have fit a 3-prong socket, you only have two options.  You must either actually wire the ground so you have a continuous ground of sufficient size all the way back to the main panel (it can merge onto other ground paths, as long as it is wide enough)... Or pursue option #2.
Assure that the outlet is downstream of a GFCI device
... and label it "GFCI Protected / No Equipment Ground".
The GFCI protective device must protect hot and neutral coming here, and can be anywhere between here and the main panel.
The "GFCI Protected" half of the label is not required if the GFCI device is part of the socket itself, with obvious "Test" and "Reset" button.
You are not allowed to use the "No Equipment Ground" alone to guard an ungrounded 3-prong socket.  You must use GFCI, or use option 1.
To revisit "actually wiring the ground"
If your house is wired with metal conduit, in most jurisdictions the intact conduit is a legitimate ground path.  Your work may be done!
Some people believe that to retrofit a ground wire, they must replace the entire Romex cable.  Those people really need a copy of NEC 2014.  That document threw open the gauntlet for simpy retrofitting just the ground wire.  Of course if the Romex cable is roached, this may be a good time to replace it for that reason.
Answer: The outlet should be to code and have the ground or earth connection.
While you may only ever plug two-prong devices into it, someone else may plug a different device, now or when you no longer have the property, and they could suffer as a result.
Do it to code so all are safe.
Answer: Should you upgrade, yes. Would I lose sleep over that? No. And there are inexpensive ways to fix that. Whenever a wall is open, bring stuff up to code.


K-nearest neighbors for a moving query point

Question: I have been given coordinates of n fixed points and m query points. I have to find the k-nearest neighbors of each of the m query points from the n fixed points. Finding distances separately for each query point is very costly. Is there an efficient way of doing this?
Comment: the dimensionalality of the data matters a lot.
Answer: There are fast indexing structures for such problems, like KD Tree or Ball Tree. In particular - scikit-learn (sklearn) implements them in their knn routines ( http://scikit-learn.org/stable/modules/neighbors.html )
Answer: A real answer to your question depends on numerous factors. For example, if you are not using the Euclidean distance - then you can't use KDTrees. There is also scaling issues (how many points enrolled? Dimension Size? "Clustered" ness) How long you can wait for training, if values need to be added to the set, and so on.
A number of less commonly available, bust still useful, algorithms for such are available in JSAT. This includes VP Trees, RBC, and LSH. (bias warning, I'm the author of JSAT)
Answer: If you are working out the square root of the sum of the squares to get the distances, try dropping the square root which is computationally intensive. Just find the ones with the nearest squared distances - they are the same points.
Comment: Why is this marked down please? It is a perfectly legitimate answer to the question.
Comment: I agree -- would the downvoter please elaborate his objection to this answer


Heat loss by radiation reference

Question: In our lab practice, we measured the rate of heat loss of a copper plate in atmospheric pressure and the rate of heat loss of the same plate in high vacuum ($\sim 10^5 torr$). So all I could find for heat loss in the internet is Newton's law of cooling, which is pretty much elementary (pressure doesn't appear as a variable). I was wondering if someone could give me a reference of where I can read something more profound about rate of heat loss for a metal plate involving radiation of course.
Comment: http://hyperphysics.phy-astr.gsu.edu/hbase/thermo/cootime.html
Answer: there are lots of good books in thermal radiation, read Modest for example
Author : M  Modest    Release Date: 15 Mar 2013Imprint:Academic PressPrint Book ISBN :9780123869449 eBook ISBN :9780123869906 Pages: 904Dimensions: 276 X 216

Heat loss by radiation reference


Could someone explain the last train scene with Snafu and Sledge in "The Pacific"?

Question: In episode 10 of The Pacific (2010), Snafu and Sledge head home on a train after the war. By the time they reach Louisiana (Snafu's home), Sledge is sleeping. Instead of waking up Sledge to say goodbye, Snafu takes a long look at Sledge and he leaves the train without ever turning back. However, while exiting he seems hesitant about the decision he has made. Could someone explain the symbolism/meaning of this unceremonious departure? I've seen this motif before such as in the movie Life of Pi.
Answer: I think you're seeing two different things in play here.
Firstly, why doesn't Snafu wake Sledge?
Well, and this is just my interpretation, there's two reasons.
Firstly, he sees Sledge asleep and untroubled...at peace, if you will, even if it's only for a few minutes or hours and doesn't want to disturb someone who has been through the hell that they have shared.
Secondly, they're brother's in arms...nothing more really needs to be said, they know what they mean to each other and it doesn't need to be put into words.

As to the second part, the hesitation, after leaving Sledge it brings a realisation to Snafu of everything he's about to lose. The brotherhood, the shared experiences...and a new beginning...his life is about to change immeasurably...that gives you pause...in this case, a literal as well as  figurative one.
Anyway, my interpretation...for what it's worth.
Comment: This interpretation is almost certainly correct.  There is an additional emotional payoff in the recounting of the history of the characters after the events of the show. Namely, that Snafu finally reunites with his brothers in arms, decades and decades later, after reading Sledge's book **With the Old Breed: At Peleliu and Okinawa**.
Answer: I agree with all of the above but must add. Nothing is more precious to a combat veteran than "peaceful sleep". SNAFU knew this and did not wish to disturb it.
Comment: You should put this under comments of the referred question. First, this is not a answer on itself, second you don't know the order of questions or what's above this answer.


Understanding the Handshake Problem

Question: I need help with this problem. The problem goes like this: In some countries it is customary to shake hands with everybody in the meeting. If there are two people there is 1 handshake, if there are three people there are three handshakes and so on. I know that the formula is $ \dfrac{n(n-1)}{2} $ but how do I get to this solution using a thinking process, specifically how would you solve this? Thanks.
Comment: http://en.wikipedia.org/wiki/Pigeonhole_principle#Hand-shaking
Comment: @Nick Off topic. That link is about 'at an N-guests party there are always at least two guests who have shaken hands with the same number of guests', which is quite different problem from 'how many handshakes are done if N people shake hands with each other'.
Answer: There are $n$ people who can shake hands with $n - 1$ other people. Since two people shake hands at once, we really count twice as many handshakes as we should since one handshake is counted twice. So, we divide by $2$ to remove redundancy. By the product rule, this gives us $$\frac{n(n-1)}{2} \text{handshakes}.$$
Comment: @Nick I'm not sure what this comment means. If you say "half the room shakes hands with the other half", you fail to count any of the handshakes that could occur within either of the two halves.
Comment: Or you can say we're only considering half the population because they'll shake hands with the other half.
Comment: @Nick Perhaps there's another perspective, but I don't know of a simpler one. The technique of overcounting is ubiquitous in combinatorics, so it's best to become familiar with it.
Comment: @Austin: hehe, didn't consider that. But how would you define the formula without saying that we're "halving the number of handshakes so that they're not double counted"? I mean there's got to be another perspective, right?
Answer: If there exists $n$ people, then each person can shake hands with $n-1$ others. Each handshake gets counted twice. So ....
Answer: What you can do is induction : You want to know that, if there are $n$ people at meeting, there will be
$$
\frac{1}{2}n(n-1)
$$
handshakes.
You have already established this for $n=2$, so suppose it is true when $n=k-1$, and you want to establish it for $n=k$. Now you know that, with $k-1$ people in the room, there are
$$
\frac{1}{2}(k-1)(k-2)
$$
handshakes. If 1 person enters the room, he/she shakes hands with each person in the room, adding $(k-1)$ handshakes to the total. This gives
$$
\frac{1}{2}(k-1)(k-2) +(k-1) = (k-1)\frac{(k-2) + 2}{2} = \frac{1}{2}k(k-1)
$$
handshakes.
Thus, by induction, you have established it for all $n\in \mathbb{N}$.
Comment: I'm not sure this really answers the OP's question, which seems more about "how would I find this formula from scratch?". This answers "how would I prove it is correct once it's given to me?"
Answer: Another take on the getting the same formula:
Rank the $n$ people in some defined way: age, salary, whatever.
Top person gets handshakes from $n-1$ people younger/poorer paid than him/her.
Next in the ordering gets $n-2$ handshakes from those "beneath" him/her, and so on.  Last person gets $0$ handshakes from underlings.
What is the sum of all the integers from $0$ to $n-1?$
Really just another way to avoid double counting...
Answer: Hint: Start with one person out of the $n$ persons, he handshakes $(n-1)$ persons. Follow with any other and remember that you already shook hands with the first person.
Comment: To deform this question a bit. What if we had $n$ people in a room, each person is only allowed to shake the hands of $k$ other people. What is the total number of handshakes? $\large\frac{n\cdot k}{2}$
Comment: Not quite. For $n=5$ and $k=3$ for instance, you only get 7 handshakes. The last guy only shook hands with two people. Unless the formula you pointed truncates.
Answer: Here's a more mechanical way to look at it. We can use the binomial coefficient to express the same result. The notation $\binom{n}{k}$, pronounced "$n$ choose $k$," is the number of ways that a set of $k$ objects can be chosen from $n$ objects in total. It can be shown that the formula for calculating it explicitly is
$$\binom{n}{k} = \frac{1}{k!} \cdot \underbrace{n(n-1)\cdots (n-(k-1))}_{k \text{ factors}}.$$
In this situation, we're trying to find the number of ways that two people can be chosen from the group of $n$ people. There are $\binom{n}{2}$ ways to do this, or, using the above formula, $\frac{1}{2}n(n-1)$ handshakes.
Answer: There's generalization for undirected graphs
http://en.wikipedia.org/wiki/Handshaking_lemma
Here are few ways you can think about this or ways that can give you more insight.

If there are $n$ people. The first person makes $n - 1$ handshakes, the second $n - 2$ ... the last one $0$
so we have to calculate the sum $n + (n-1) + (n-2) + ... +0$ and well you know this sum.
Matrix representation by Adjacency matrix. In undirected graph the matrix has diagonal symmetry.
Proof at wiki article above.
Mathematical induction thinking. Like for example you construct the graph add one vertex (with only edges connecting vertices that are already) there at the time and see that invariant stated in handshaking lemma stays true.
Writing down some graphs and marking the two ends of each edge (like for example dashes or 1 symbols) can give you more intuition.
You can try to imagine graphs in 3D to give you more insight.
You can play in mind with some graphs and try to count edges.
Add new Guard vertex in the "middle" of the graph and then change every edge in a way that instead of edge (V1)(V2) I have two edges (V1)(Guard) (Guard)(V1) and also I mark these two edges like this

(V1)-V1-----V2-(G)-V1-----V2-(V2)

That way graph becomes planar (the edges doesn't cross) . And you kind of see the same graph structure + it is more clear that each original edge has two ends.

And of course the ways other people mentioned and well there are for sure many more.

Understanding the Handshake Problem


What are the products of the haloform reaction of acetylacetone?

Question: I searched a lot to find the products of the haloform reaction of acetylacetone (pentane-2,4-dione),  but I didn't find any results.
What are the products of the haloform reaction of acetylacetone?
Comment: Not sure about this but it looks like malonic acid should be formed.
Answer: Because acetylacetone is a 1,3-dione, the carbonyls are very enolizable.  This makes the hydrogens attached to carbon 3 on acetylacetone very acidic.  When introducing the conditions for a haloform reaction, base is added.  The base will take carbon 3's hydrogens, in the presence of some halogen, they will be replaced, this happens twice.  Now, with the product 3,3-dihalopentane-2,4-dione, the reaction will end.
If you insist on a haloform reaction occurring, a much stronger base will be needed and the reaction vessel would probably need to be heated.  It will proceed as usual and create first 2,2-dihalo-3-oxobutanoic acid (2,2-dihaloacetoacetic acid). The reaction will probably stop at this point. Upon heating though, this compound may decarboxylate to give 1,1-dihaloacetone and carbon dioxide. If you wanted to continue with this, you could do another haloform reaction to first generate perhaloacetone, and if you wanted to, this may be able to become trihaloethanoic acid and haloform.
But realistically, the reaction would end at the 2,2-disubstituted dihalo acetoacetic acid (2,2-dihalo-3-oxobutanoic acid)
Comment: This is kinda hard to follow without chemical structure diagrams, it would be nice to see what's happening visual.
Answer: In 1933 Hurd and Thomas1 investigated the action of bleaching powder (calcium hypochorite) on ethyl acetoacetate (1). They isolated dichloroacetic acid (2) in 60% yield without the production of chloroform. Their conclusion was that chorination did not occur on the methyl group (no chloroform) and that dichloro acetoacetic ester 2 was the intermediate. Reasonably, hydroxide attacks at the ketone, as is typical with disubstituted β-ketoesters.2 Acetic acid was not isolated but is implied by the mechanistic considerations.
In a similar fashion acetylacetone (4) would be expected to afford dichloride 5. Cleavage by base (red arrows addition to the carbonyl; blue arrows for cleavage) yields the anion of dichloroacetone (6), which is in equilibrium with its protonated form 11. Further chlorination of anion 6 yields trichloroacetone 10. A final haloform reaction provides chloroform 7 and calcium acetate 9.

1) Hurd, C. D. and Thomas, C. L., J. Am. Chem. Soc., 1933, 55, 1646.
2) The hydroxide cleavage of ethyl 1-methyl-2-oxo-cyclopentanecarboxylate affords α-methyladipic acid.