High Level description of Turing Machines

Question: How can create a Turing machine that checks whether or not an input string is a well-defined regular expression? For example, it recognizes a language that consists of string over {0,1} and the symbols used to write down REs (U,*,+, ...)
Comment: Your title does not match your question. Please clarify.
Answer: Using a fixed alphabet $\Sigma$, one can define regular expressions over $\Sigma$ inductively:

$\varnothing$ and each $a \in \Sigma$ are regular expressions.
if $r$ and $e$ are regular expressions then so are $(r + e)$, $(r \cdot e)$, and $r^\ast$.

From there it is easy to define a context-free grammar for all regular expressions over $\Sigma$ with the following productions:

$S \to \varnothing \mid a$ for all $a \in \Sigma$
$S \to (S + S) \mid (S \cdot S) \mid S^\ast$

Hence, a Turing machine that accepts exactly these expressions only need to simulate a pushdown automaton that accepts the language of the grammar, which is essentially just checking whether there is a closing ) for each ( and there are never more ) than ( in each prefix, which is a standard exercise in each course or textbook on formal languages.


How to deal with an attacker who isn't fazed by anything you do?

Question: I recently got jumped in a parking lot by 3 guys, but when I tried to use every move I know (which is a lot; I.E. sidekick, elbow strike, knee strike, straight punch) and it did NOTHING!!! My Krav Maga instructor says I hit hard enough, but my strikes, grapples, and throws did NOTHING!!! How do I deal with this?
Comment: Let me get this straight, you were attacked by multiple opponents, and you were able to execute at least four effective striking techniques? Did any of these connected to the face, or the solar plexus?
Comment: Was it that you weren't able to solidly land the blows, or that you hit, and could feel the impact, but nothing happened? Did they physically move back from the force, or was it like hitting a brick wall (or a mound of sod, giving a bit but not budging)?
Comment: @ MacacoBranco Like hitting a brick wall, I hit. My technique I think was good.
Comment: The idea of a landed side kick not doing any damage is inconcievable. At least it should  bruise your opponents' ribs. And, by the way, you should see blood coming out of them even if they are high on drugs, considering the strikes you executed. If that didn't happen, then find another instructor.
Comment: IMO this is impossible to answer without specifics. It could be for any number of reasons. Generally speaking if a single person is "jumped by three guys" the single person is going to lose.
Answer: The three most likely reasons this happened:
Your assailants were too strong
A common myth of martial arts is that they are an equalizer. If you are fighting someone who is much larger or stronger, you can have the best technique in the world and still fail. There was a video I saw a while back with a sub-100 pound master against a guy who was over 300 pounds and muscular. The master could punch as hard as he tried, even tried using his entire body in a drop kick, and could not budge the other guy. There are techniques you can use to try to equalize the situation, from weapons to targeting vulnerable spots on the opponent, but in general, if people are bigger and stronger, you may not be able to beat that with technique.
As a side note, someone hyped on drugs or adrenalin may not feel pain, which is its own problem. A lot of techniques rely on pain versus actual physical incapacitation, but even broken bones don't necessarily stop an opponent if they're not feeling the pain.
Your technique may be bad
I don't know your instructor, or how familiar they are with combat, but they may be giving you too optimistic a report on the combat efficacy of your moves, whether because they want to impress upon you how effective their training is (thereby encouraging you to keep taking classes) or simply because they don't know what it takes to actually fight (unfortunately, an endemic issue in a lot of martial arts where they only test the techniques in controlled situations). Unfortunately, it really can be hard to gauge this in a safe way, but if you and a buddy (preferably one who doesn't train the same style) pad up and fight, do you find you can land the blows sufficiently? While the pads will reduce the force of the blows to reduce injury, the other person should still feel it. You can pick a threshold for what's a "if you weren't padded, this would probably take you out", but a general rule is that if you hit the padded person, and they're not pushed back a bit, they don't hurt a bit from the hit, you're not hitting them hard enough to actually hurt them in a fight. One of the other things this can teach you is how much your style depends on the other person not getting a chance to hit back, the "one-step" mentality where you unload one simulated technique after another with the assumption that, when you punch the guy, he's not going to immediately punch back, that when you grab his wrist, his other hand won't be pulling a knife, etc.
You may not have been operating at full efficiency
I don't know how often you train in a simulated combat situation, but adrenalin is a heck of a drug, and if you don't train to actually hit (padded) people, you're going to pull your punches subconsciously.

So, what can you do?
Well, first off, you're not going to win every fight. If you have an opportunity to avoid a fight by surrendering your wallet, consider if the $50 you have in there is worth the risk of brain trauma from getting curbstomped, or the medical cost of getting stitches are winning against an opponent with a knife (because they will cut you). Work on your ability to run, both in a straight line and getting over obstacles quickly. If you do train self-defense drills, make at least some of them involve making a decisive strike and then immediately turning heel and hoofing it. Building up your reflexes to get away from an attacker, rather than having a mindset that you will stay and beat them, will serve you well.
Comment: Maybe the other guy was high, high on drugs. Didn't feel a thing then ...
Answer:
There are two ways to stop someone: pain compliance and damage.

1a. Techniques that cause pain in a dojo often fail against resisting opponents once they get a little adrenaline or if they're just used to fighting and know how to shrug off a little pain.
1b. You didn't do enough to damage to stop your opponent.  It's that simple.  You don't shrug off a broken leg, for example.

There's no such thing as a one-hit stop.  It's irrational to expect one strike or even a dozen strikes to stop someone in a real fight.  People shrug off multiple stab wounds and multiple gun shots...and those are far more damaging than elbows.  The best you can hope for is to make an opening to run away.

It's been my experience that Krav instructors don't really train people to fight well.  They teach people to be aggressive, which is good, but I've not met many krav practitioners that hit as hard as boxer or land throws like a Judoka.

The solution to this is to engage in full contact sparring regularly at varying levels of power.  Especially against people who practice a different art from you and who won't stop or back off when they eat a punch.

Strength and size beat good technique in unarmed fights more than martial artists like to admit.  There are very good reasons why weight classes exist in combat sports.

Consider carrying a legal weapon and developing situational awareness.  There's no reason you should have been jumped by 3 guys if you were paying attention to your surroundings.

Don't go stupid places with stupid people at stupid times.
Answer: Do you ever watch MMA or boxing? If you do, you may notice that many fights take more than ten minutes, involve dozens or even more than a hundred landed strikes, and the fighters are often not noticeably impaired until well into the fight. Of course, these athletes are exceptionally well-conditioned to take punishment and keep going; on the other hand, their opponents are equally well-trained to hit hard. The bottom line is, don't assume that a small number of landed strikes is going to affect your opponent. They might - a single well-placed, well-executed strike can cause a KO - but there's no guarantee.
So what do you do? Assuming there's only one assailant, and you cannot avoid the confrontation: work on techniques that put you in a position where it's harder for them to hurt you, and you can keep hitting them - e.g., put them in a Thai clinch and keep kneeing them; or take them down, get mount, and start dropping elbows. Sooner or later, there will be an effect. Or work on techniques that definitely end the fight, like chokes.
If there are multiple assailants, either use your strikes and kicks to create some space and run (by far the most promising approach - and as Macaco Branco points out, escaping and running should be an explicit part of your training).
Or train hard to become a knockout artist, i.e., reliably deliver very hard strikes to the most susceptible points (chin, temple, liver). ("Training hard" probably includes competition in full-contact striking styles.) However, with multiple attackers, the most likely outcome is that you will lose if try to slug it out.
Answer: There are something like 31 rules for MMA fighters. 27 or so of them are rules to keep them from seriously injuring other fighters. Think about that in relation to street fighting. You are actually being trained to not seriously injure your opponent. That makes sense in training and sport. It does not make sense on the street and you will fight how you trained.
Even then, most decent folk have an inborn instinct not to actually hurt people. It is great for civilizing society, not for self defense. Martial artists may have very good general skills, but they may not have the right mindset and they may not have practiced versions of their techniques that can kill or maim.
Check out these references for in-depth discussions of this:
"When Violence is the Answer" by Tim Larkin
"Facing Violence" by Rory Miller
"Violence of Mind" by Varg Freeborn
These books are eye-opening.
Comment: Is the content of those books similar to the rest of your answer, that you need to throw out rules and practice to hurt people?
Comment: The idea is that someone who practices for dealing with violence needs to BE ABLE to throw out the rules and hurt people, not that you do that to training partners or competitors. If you are in a life or death violence situation, your attacker has no rules and you shouldn't either. But all those books praise regular, safe, martial arts practice. They just recommend there are other things you need to develop, both mentally and physically if you expect your art to work on the street. There are ways to do that safely, but they are not taught in most MA schools.


How to generate/create link automatically on every word of post in wordpress

Question: I am working on a poetry site and I am new to wordpress. I want to publish poems of various authors on my site. What i want is that when i publish a post, a link/onclick event on every word of post may be generated automatically in background. When a user click on any word of post, he may be directed to a new page containing poems with that similar word. Any help or direction will be appreciated a lot.
Answer: I don't know the scale of your project, my solution will help you to get around it quickly, but it's inefficient when it comes to larger scaled projects.
The easy way
You can add a filter to the_content filter and finally link every word inside of the content to the search page of that specified word.
The Hard Way
This is way much better than the first solution when it comes to scale and efficiency.
By assuming that your content is in English and are divided using some character, the general process would be:

Adding a filter to the wp_insert_post_data.
Striping all link tags to prevent linking a word multiple times.
Using the explode function to get an array of words inside the poem.
Add links to the words by using a simple foreach.

To generate your link you can follow one of these approches:

Creating a custom post type and use a plugin like posts2posts to connect your posts and finally generating the link using the_permalink function.

Creating a custom table for keeping track of words and the connected posts.
For the second approach, you have to add a query var by adding a filter to query_vars filter, create a custom shortcode to display your data and finally to generate the links you have to use add_query_var function and a hard-coded value of the page you're putting your shortcode.
Comment: Thanks a lot man, I will definitely give it a try. Actually I am working on a poetry site in urdu language.


Prestigio Multipad USB debuging

Question: I am having troubles with Prestigio Multipad PMP3370B. I enabled USB debuging in Settings, but when I plug in my device to a computer and start adb devices, it does not recognize it. Does anybody have any similar issues? I am using Windows 7. Where can I find Windows driver for that device?
Answer: You can find USB drivers for the Prestigio Multipad PMP3370B (aka Prestigio MultiPad 7.0 ULTRA) in the manufacturer website
Just click the download link for the .zip file corresponding to your model, as seen in the screenshot.

At the time of this answer, the file name is PMP3370B_20121217_V1.0.8.zip, this file is ~224 MB size and it does contain USB drivers for Windows 2000/XP/Vista/7 (32-bit) and Windows Vista/7 (64-bit), besides firmware update image file, upgrade manuals (in English/Russian, 32/64-bit) and other tools. I can tell it because I downloaded it myself and looked inside.
Answer: I don't know where you can find drivers for your specific device; but for most devices (of different manufacturers), Koush's universal adb driver does a good job on Windows 7 and 8 as well. You can download them from the linked site, and find instructions there as well.

Prestigio Multipad USB debuging


Is it worth upgrading to Apache commons VFS 2.0?

Question: Ive had trouble getting a definitive summary (aka release notes) of what has been fixed, changed and so on with 2.0. Has anybody tried it and what experience have they had. I have noticed many bugs with providers such as the inability to move directories (Ram). There also seems to be lots of open issues that would affect the core system rather than edge cases
Answer: I have been running 2.0-RC1 for a while and just updated to 2.0.
There are a lot of thread local leaks which will affect you if running on a thread pooled environment. They have renamed the package to org.apache.commons.vfs2
The reason we upgraded is that they have fixed virtual file systems (they were barely usable in 1.0)


What is purpose of end hinge on garage door?

Question: What is purpose of end hinges that is mounted on 4 section garage doors? This one is from a Pella garage door and mounts on side above where the rollers are mounted. The door uses 6 of these. -3 on each side of the door.
Comment: Isn't it apparent that it does what *any* hinge does?
Answer: They connect the sections together so the entire door moves when opening or closing it.
3 on each side means each except the bottom one is connected to the one below.
Answer: Clearly, Pella likes to do things the hard way.  Normally that whole assembly is one standard part: the hinge and the roller holder all in one piece.
What Pella's setup does, however, is allow the hinge pivot point to be inside the door.  That is why you see a chamfer/relief on the top edge of the door section, to keep the door segments from pinching.
The standard part has the hinge point about 3/8" this side "above" the door's interior surface.

The other hole is for the roller, note that each row of hinges puts the roller farther away from the door, since the roller track is at a slight slant.
Comment: I assume you couldn't  use what you was talking about on this door . Unless I misplaced it,  I am missing the three left edge hinges. I can get hinge like you show locally but would have to order one like I showed.
Comment: Probably not, the holes don't look look like they line up.


What is/are the molecular differences between HDL and LDL cholesterol?

Question: Why exactly is HDL-cholesterol good for us and LDL-cholesterol bad for us. It has been well-established that LDL-cholesterol is associated with atherosclerosis and that HDL-cholesterol helps remove excess LDL-cholesterol from the circulation. From a biochemical view, however, what is the difference between the molecules that causes this difference?
Comment: I would like to just leave this as a comment, but don't have enough reputation to do that. If you want an extremely thorough treatment of cholesterol and lipoproteins with tons of references, you should check out Peter Attia's fantastic set of 9 blog posts on the subject starting here.
Answer: First of all, we should specify that there is no such thing as "HDL-cholesterols" and "LDL-cholesterols". On the same note there is no such thing as "good cholesterol" and "bad cholesterol": cholesterol is just one molecule, with this chemical structure

What blood tests generally report is HDL-C and LDL-C, that is the amount of cholesterol in HDL or LDL respectively (again, cholesterol is always the same molecule, whether in an HDL or in an LDL).
HDL (high density lipoprotein) and LDL (low density lipoprotein) are lipoproteins, aggregates of proteins and lipids that can carry, amongst other things cholesterol.
There are 5 major types of lipoproteins, called chylomicrons, VLDL, IDL, LDL, and HDL and are distinguished by their size, density and the proteins they are composed of.
The main function of lipoproteins is that of carrying lipids (=fats) around the organism in the blood. The problem is that lipids are not soluble in water (try to pour some oil in a glass of water) and blood is mainly composed of water. Lipoproteins, on the other hand, have a hydrophilic (="water-loving") exterior and a lipophilic (="fat-loving") interior, like this:

In the picture, the "balls" represent proteins, called apoproteins, and the C represent cholesterol and T tryglicerids, which are both lipids.
As you can see, all the fats are inside the lipoprotein, but the exterior, being soluble in water can be easily dissolved in the blood.
The biochemistry of lipoproteins is quite involved and I will not go into details here (but please leave a comment if you want further explanations) but, to simplify things:

HDL bring lipids from the periphery back to the liver
LDL bring lipids from the liver to the periphery

It is very important, at this point, to note that lipids are a physiologically important part of our organisms. All the cells in our body contain lipids: the membrane of each cell in the body is made up of lipids (called phospholipids) and also contain cholesterol. In fact, cholesterol is extremely important for the correct functioning of the body as, for instance, it is used as the base to make many hormones (the so-called steroid hormones, such as estrogen, progesterone, cortisol, testosterone etc).
However, too high levels of lipids, particularly cholesterol, are not beneficial, as high cholesterol levels have been in fact linked to many cardiovascular diseases, which we hear a lot about these days.
So, because HDL tend to remove the lipids from the circulation and bring them back to the liver they can be considered as some sort of "cleaners", that remove excess cholesterol from circulation.
Comment: +1 for noting that there isn't a molecular difference.
Comment: Just to add that associations of high cholesterol with CVD are still not clearly established and probably never will be, as there is also good evidence against. This doesn't diminish that high fat diets (= probably more calories than you need) will lead to overweight with all associated risks.
Comment: Better answer than I could have ever hoped for!
Comment: @rwst: surely, I have simplified a lot the problem, I do not know the literature about CVD well enough to put appropriate refs., but if you do, please feel free to add another answer, I wasn't trying to be exaustive!!
Comment: I feel unsure about liver cells taking back LDL and/or IDL as well. In that sense LDL/IDL should be differentiated from "HDL tend"(ing) "to remove the lipids from the circulation and bring them back to the liver." If you ever get back to your answer  - I'd be interested in removal of LDL as/in the form of IDL or even VLDL by the liver.
Answer: Your question is about the molecular differences between LDL and HDL.
The  way you formulate, asking about differences on the molecular level,  draws the attention to the surprising fact that the molecular structure is not that different as the big differences in physiological function may make you assume. Your question is valid, as textbooks list different contents of cholesterol, triglycerides and proteins, but do not elaborate on differences in structure of - for instance - "molecular markers of LDL". Similar to different classes of antibodies (IgM, IgG, IgA...) there seems to be a very similar structure to all transporter lipoproteins.
Conversely, to illustrate, the word "chylomicrons" may mislead to thinking of those as "micelles" or being very distinct from those  lipoproteins termed  HDL, LDL,IDL and VLDL. However, they also belong to the class of lipoproteins the function of which is transport of lipids, and they are more similar in molecular structure as labeling suggests.
Interestingly, a similar question on Stackexchange Chemics has been refered to your question. That might illustrate the above: any relevant differences do not relate either to the load of the lipoproteins or to their differences in coating or core proteins (that exist), but any difference is in biology that,ironically, very much corresponds to "labeling": which lipoprotein in contrast to the other derives from which organ, which one addresses and unloads at which kind of target cells.
To sum up: differences are neither differences in load nor coat but are differences in send and receive signalling which are differences, as it turns out, of apolipoproteins.
Thus, the ligand on LDL to
"LDL-receptor"
is key difference "literally",
which is remarkably reflected by the fact that the LDL-ligand on LDL-molecules is the biggest protein known, called
Apo B-100.
Anwswering your question: it is expression of Apo B-100 protein, that distinguishes LDL from HDL on the molecular level in respect of pathogenicity.
Conversely, the apoA-I protein may be considered distinguishing feature of HDL (see, for instance,  quote down below, Verghese et al.)
What's more, and may come to a surprise, is the fact that there is no one and the same HDL or LDL molecule, both terms denote classes of proteins; it seems that no single "LDL-cholsterol" is like any other "LDL-cholesterol". See, for instance, Kontush et al.,2014 Structure of HDL: Particle Subclasses and Molecular Components.
Relevant feature of those proteins are their receptor ligand proteins.
LDL-receptor downregulation is the key cause of  atherosclerosis (No known other detrimental effects of cholesterol).
From Nobelprize.org
"Brown and Goldstein have discovered that the underlying mechanism to the severe hereditary familial hypercholesterolemia is a complete, or partial, lack of functional LDL-receptors. In normal individuals the uptake of dietary cholesterol inhibits the cells own synthesis of cholesterol. As a consequence the number of LDL-receptors on the cell surface is reduced. This leads to increased levels of cholesterol in the blood which subsequently may accumulate in the wall of arteries causing atherosclerosis and eventually a heart attack or a stroke."
Note that hereditary disorder is not the only cause for LDL-R downregulation: "LDL receptors are downregulated by increased cellular cholesterol to prevent sterol engorgement, which is a characteristic of cells in atherosclerotic lesions." From: Biochemistry of Lipids, Lipoproteins and Membranes (Sixth Edition), 2016
The way you put your question draws attention to the fact that there is no corresponding downregulation of HDL-receptor.
Search on Wikipedia for "HDL-receptor" results in: "The page "HDL-receptor" does not exist." Presumably, no trivial knowledge that Nobel prize laureates Goldstein and Brown discovered  a whole family of so called "scavenger receptors".
What would happen if the HDL-receptors was downregulated (to  compare  with LDL downregulation)?
The "molecular difference" seems surprisingly unclear then: both HDL and LDL do carry cholesterol (It is  the very same molecule in both HDL and LDL). If too much LDL leads to depositon of cholesterol, same deposition might be made  by ("too much") HDL - your question is valid in that respect.  Downregulation of receptor distinguishes LDL from HDL.
There is one answer to a related question on Stackexchange that seems to exactly fit, in regard of the distinguishing role of Apo B100, quote: "Because LDL contains only the ApoB protein, it is less easily recognized. Thus, more LDL lingers in the blood.", with further reference about the pathological effects. If any  (distinguishing) molecular mechanism other than Apo-protein-signalling presumably protecting transported lipids from oxidation or degradation existed, it would had been mentioned.  Apo-B100 makes the difference.
The essential molecular feature of LDLs is the  LDL-receptor-ligand Apo B-100 which binds to LDL-receptors (on cells of adipose tissue) in contrast to HDL-receptor-ligand to HDL-receptor (on liver cells, surprisingly, however, not only on liver cells) - the latter known as "scavenger receptor class B type I"
which is  barely mentioned in  Wikipedia  (not having done intensive searching, admittingly:  there should  not be found in literature any discussion or even mentioning on  downregulation causing common disease, cp.Rigotti et al., 1997, A targeted mutation in the murine gene encoding the high density lipoprotein (HDL) receptor scavenger receptor class B type I reveals its key role in HDL metabolism: "(...) hepatic overexpression dramatically lowers plasma HDL." - wheras  only the  knock out experiment this paper is about is  cause for downregulation. Presumably, there is no downregulation of HDL receptor that would correspond to LDL-receptor downregulation.
On Apo B-100 as distinctive molecular marker see, for instance, Encyclopedia Britannica:
"LDL contains a single apoprotein and is the principal carrier of cholesterol to the peripheral tissue as both the free sterol and esters. The discharge of the lipid contents of this complex requires the recognition of the LDL B-100 apoprotein by a receptor located on the surface of recipient cells. When the protein is bound to the receptor, the receptor-LDL complex is engulfed by the cell in a process known as endocytosis. The endocytosed LDL discharges its contents within the cell, and B-100 is degraded to free amino acids that are used to synthesize new proteins or are metabolized as an energy source. The elucidation of the process of cellular uptake of LDL by Michael Brown and Joseph Goldstein earned them the Nobel Prize for Physiology or Medicine in 1985."
There is one more aspect to your question in the context of this answer.
The term "scavenger" (for HDL, not LDL) hints to the fact   that another difference between HDL and LDL lies in   LDL being degraded in lysosomes after uptake (by adipose tissue cells), whereas HDL is being recycled after  "touch down" on  HDL-receptor, i.e. not even uptaken by liver cells.  Please let me add this tentative thought: Thus, as there seems to be no "feedback" loop for LDL; the liver producing LDL (which start as so called VLDL, by the way) might not downregulate LDL-synthesis if target tissue downregulates LDL-receptors.
You may  skip the following further tentative thoughts of mine:
According to Voet et al, Biochemistry, the receiving of LDL via LDL-receptor by adipocytes leads to those "shedding" cholesterol (which seems to be picked up by "scavenging" HDL). See, for instance,   Verghese et al., 2007
"In the presence of HDL, composed of human apoA-I and phosphatidylcholine, adipocytes release cholesterol in a lipoprotein-dose and time dependent fashion."
This might be considered recycling of cholesterol (brought from liver to storing tissue by LDL and back again to liver on HDL, as delivery of fatty acids to storing tissue allows those to release cholesterol). In an evolutionary tentative concept, cholesterol as a molecule in itself  might once have been the very transport vehicle to transport lipids and fats from and to cells (see above: HDL is not even endocytosed, in very contrast to LDL-receptor-uptake, when it returns to liver cells, still cholesterol enters the liver cells. HDL leaves the receiving "scavenging receptor" as it is; it is some taxi; my analogy is to cholesterol). This idea leads to considering the sheer quantity of loaded  cholesterol as presumably distinctive: any quantity surmounting a level defined as upper limit for "taxi function" might be unloaded (or oxidized in scavenging funtion). This seems coherent with the existence of "remnants": there are LDL or VLDL-remnants and chylomicron remnants which the liver receives cholesterol  by. On a molecular level, there might be a difference in relative or absolute quantity of cholesterol, between LDL and HDL, reflecting that HDL as such "is" a remnant in the sense that it recyles cholesterol in "remnant quantity/thus quality". (There do exist LDL and chylomicron remnants, however, there is no such term or thing as  HDL remnant, to verify). By the way, counterintuitively, cholesterol is arguably considered "amphophilic", cp. source cited in comment to question and quote Encyclopedia Britannica above that mentions "sterols and esthers" as vehicles of cholesterol transport. Moreover, uptake of free fatty acids by adipose or muscle cells (that is the form derived from VLDL after lipase took on) seems not very well established in its mechanism. Cholesterol, then,  is known to be the distinguishing feature of animal cell walls in contrast to plant and procaryote cell walls. Cholesterol in cell walls might - by "softening" - enable heterotrophic cells to absorb free fatty acid (derived form autotrophic (plant cells, unsaturated fats)) without use of any - yet unknown - membrane transport canal or receptor mechanism. Please let me add one more argument that seems surprising: target cells of adipose tissue are made to "shed" cholesterol by LDL-receptor signalling. "On the other side" these target cells of LDL "take on in"  - and keep - cholesterol and lipids (from degration of LDL). There might be some feedback loop of receiving lipids and shedding free cholesterol that is - in evolution - still independent of APO-B100-LDL-receptor signalling, and downregulating the LDL-receptor  solely might interconnect both levels or regulating free "chole-sterols" in blood, or, if cholesterol is a former instrument of uptake as proposed, in interstitial fluid.   Thank you for having allowed this tentative thinking.
To sum up:
Lipoproteins resemble each other  in molecular structure and transported forms of fat/cholesterol more than the acronymes HDL/LDL may suggest.
The relevant difference lies in   their ligands, which address different target cells: ligand to "LDL-receptor" (which HDL does not seem to have or has to a much lesser extent)  is decisive in pathogenicity as there is "LDL receptor downregulation"; there is no physiological (in vivo) HDL downregulation.
Distinguishing molecular feature thus appears to be Apo-B100 molecule, which is the largest protein of the body.
Comment: Self-comment on   "... as delivery of fatty acids to storing tissue allows those to release cholesterol" - This leads to some other question: What is the role of  insuline on LDL-expression by adipocytes (and hepatocytes), as fatty acid delivery by VHDL should be enhanced by insuline (more LDL-Rs), and, because VHDL is precursor of LDL, any cholsterol  uptake via LDL is necessarily combined to fatty acid uptake via VHDL transport. In (diabetic) starvation less LDL-R, more release of cholesterol to HDL - and, question, more release of fatty acids by LDL-R-storage tissue.


What is the practical application of variance?

Question: I'm teaching myself probability theory, and I'm not sure I understand any use for variance, as opposed to standard deviation. In the practice situations I'm looking at, the variance is larger than the range, so it doesn't seem intuitively useful.
Comment: The SD is more intuitive because it is on the same scale as the data. However, when working with the normal distribution, the variance is the parameter not the SD. Thus, variances can be more useful when working with distributions mathematically. Eg, variances *add*, but SDs don't.
Comment: Take a look at an [ANOVA table](http://www.itl.nist.gov/div898/handbook/prc/section4/prc433.htm).
Answer: In practice, you calculate the SD through calculating the variance (as abutcher indicated). I believe the variance is used more often (apart from interpretation, as you indicated yourself) because it has a lot of statistically interesting properties: it has unbiased estimators in a lot of cases, leads to known distributions for hypothesis testing etc.
As to the variance being bigger: if the variance were 1/4, the SD would be 1/2. As soon as your variance/SD are smaller than 1, this order reverses.
Comment: Would you think that one should use arbitrarily use units that prevent variance being less than one?  I would even go so far as to suggest that the units used should be such that the measure having its variance assessed should not have decimal places.  Take for example, measurements of the same length in metres and its various multiples and subdivisions.
Answer: In portfolio theory, variance is additive. In other words, just as the return of a portfolio is the weighted average of the returns of its members, so to is the portfolio variance the weighted average of the securities' variances. However, this property does not hold true for standard deviation.
Comment: Variance is additive [outside](http://onlinestatbook.com/chapter4/variance_sum_law2.html) of portfolio theory, too.
Comment: although it's been a while, but your answer helped me understand a totally different question that I had about portfolio theory :)
Answer: Variance is the most basic of the two measures... stddev = sqrt(variance).  While exaggerated, it's good enough for a comparison and grows very large when there is mixed-up-ness in the distribution.
<code>variance(22, 25, 29, 30, 37) = 32.3
variance(22, 25, 29, 30, 900) = 152611.0
</code>
Standard deviation is used way more often because the result has the same units as the data, making standard deviation more appropriate for any sort of visual analysis.
Answer: I think you have to really qualify your question when you refer to the practical use of the variance. For instance, in business there's no practical use for the variance. The standard deviation has more of a practical use by giving a mathematical representation of variation that can be understood and applied. For instance, the standard deviation can be used to quantify risk as indicated in the calculation of the Beta for a stock. The variance has no practical application comparable with the standard deviation. If we move to higher level statistical analysis then the variance has many practical applications, but only when dealing with higher level analysis, which is not the focus of the vast majority. So it truly depends on the area in which one may be a practitioner. For business practitioners, the only use for the variance is to find the standard devotion.
Comment: "No practical use" is a bit overly-strong. $\beta$, for example, is calculated using variance and covariance and variance shows up in many, many other calculations as well. People often prefer to report standard deviation instead because the units match the mean (and it's often closer in magnitude to it too), but I'd argue that reporting the raw means and variances/standard is hardly the only thing one can do with business-related data!


When written in decimal notation, every square number has at most 1000 digits that are not 0 or 1. True or false?

Question:
When written in decimal notation, every square number has at most $1000$ digits that
  are not $0$ or $1$. True or false?

This question is from an admissions quiz, so no calculators should be used.
Comment: [silly]$2^2 = 3.9999999...$ have clearly more than 1000 nines, so it's false[/silly]
Answer: This is how I did it, but I'm sure there are better ways.
Let $x = 10^n - 1$ with $n\in\mathbb{Z}$, then $x^2 = 10^{2n} - 2\times10^n + 1 = 999\cdots9998000\cdots001 $
Let $n>1001$  so we have more than $1000$ nines, then we've found a square number with more than $1000$ digits that are not $0$ or $1$, so it's false.
Comment: This is the only part of your answer that I wholeheartedly disagree with: "... but I'm sure there are better ways."
Comment: Brilliant. As long as you're familiar with arithmetic tricks like $99999^2=9999800001$, it doesn't take long to arrive at this counterargument.
Answer: This is so grossly false that I don't think it is worth constructing a very detailed counterexample. The ratio of successive squares $\frac{(n+1)^2}{n^2}$ decreases and tends to$~1$, so for any $\epsilon>0$ there is an (easily found) $~N\in\Bbb N$ such that $1<\frac{(n+1)^2}{n^2}<1+\epsilon$ for all $n\geq N$. Now take a number $m$ given by any sequence of digits that violates your condition ($1001$ digits $7$ will do) and find $N$ corresponding to $\epsilon=\frac1{10m}$. Now take $k\in\Bbb N$ sufficiently large so that $10^km>N^2$ and put $n=\lfloor\sqrt{10^km}\rfloor$ (one has $n\geq N$). Then one has $10^km<(n+1)^2<10^k(m+\frac1{10})$ so the number $(n+1)^2$ starts with the digits of $m$.
The same argument shows that any finite sequence of digits occurs (infinitely often) as the initial digit sequence of a square. It can also be adapted easily to many other kinds of numbers with a similar density.
Answer: $$(10^n+n)^2=10^{2n}+2n \cdot 10^n+n^2$$
So each even number can appear as pattern in a square number. If one chooses $n=5m$ then $2n=10m$ and so each $m \in \mathbb{N}$ appears as digit pattern in the above sequence.
Comment: I like this a lot!!!
Answer: Here's the first thing I dug out of a cobweb covered corner in the old brain. Similar in spirit to that of Oliver's
$$
\begin{aligned}
35^2&=1225\\
335^2&=112225\\
3335^2&=11122225\\
\cdots&=\cdots
\end{aligned}
$$
Here $x_n=333\ldots5=(10^n+5)/3$. Therefore
$$
x_n^2=\frac{10^{2n}+10^{n+1}+25}9.
$$
The first $(n-1)$ digits of that are equal to those of $10^{2n}/9$, i.e. all ones. Similarly the next $n$ digits are all twos.

For $111\ldots11^2$ one can say something precise also. This problem shows that if the number of ones in the string of digits is $n=9q+r, 0\le r<9,$ then the some of the digits of the square is $81q+r^2$. As the number of digits in the square is about $2n\approx 18q$ the average digit has to be about $81/18=9/2$, and thus the number of non-$0/1$s grows without a bound.
Answer: I like your answer better, but here's another one anyway.
Fix $n$. Let $x=\sum_{k=0}^n10^{kn}$. Then $x^2=\sum_{j=0}^{2n}\left(n-\left|n-j\right|+1\right)\,10^{nj}$. For example, with $n=3$ we have $$1001001001^2=1002003004003002001$$
$x^2$ contains the disjoint substrings $1$ through $n$ twice, and $n+1$ in the center. (The individual strings move farther apart separated by more and more $0$s too fast for two strings to interact additively.) So with large enough $n$, you can get any number of digits that are not $0$ or $1$. (Or additionally are not equal to $9$; although I like your answer, it does not extend if $9$ is added to the list of special digits.) A quick calculation suggests $n=271$ works for the situation described in the question. (Counting the duplication of each string, we've seen 2 through 9 in the ones place $54$ times for $432$ non-0, non-1 digits. We've seen 2 through 6 in the tens place $60$ times each, for $300$ more. 8 and 9 in the tens place $40$ times each, for $80$ more. 7 has been in the tens place $44$ times. And 2 has been in the hundreds place $144$ times. Now $432+300+80+44+144=1000$ non-0, non-1 digits, and this doesn't even count the 272 that's in the center.

I think you can get the same effect without letting the numbers grow so incredibly large with $x=\sum_{k=0}^n10^{k\lceil\log_{10}(n+2)\rceil}$. For example, with $n=3$ this gives
$$1111^2=1234321$$
and with $n=9$ this gives
$$1010101010101010101^2=1020304050607080910090807060504030201$$
The logarithm is determining how many zeros are minimally needed as buffers to prevent additive interaction. Again using $271$, then this method yields an $x$ with $813$ digits, compared to your $x$ that has 1000 digits.
I'm curious what the smallest $x$ is such that $x^2$ has over 1000 non-0, non-1 digits. My $x$ is an upper bound that's a little larger than $10^{813}$, and $10^{500}$ is a lower bound.


using usb microphone as audio input and 3.5 mm jack as audio output

Question: I am almost done with my Smart mirror project but I have issue with the audio input and output.
I'am using ras pi 3 onboard 3.5mm jack for audio output and usb microphone as audio in.
both are working individually absolutely fine but when I record something using usb microphone I am unable to get the output on the 3.5 mm microphones.
so I would really appreciate some help as soon as possible.I have a demonstration of the project within few days.
Answer: Question

Using Rpi's 3.5mm audio output jack for output and USB microphone for input.
When using USB microphone, unable to get output from 3.5 mm jack.
Help as soon as possible [before coming] demonstration.

Answer
Well, a quick and dirty fix to your problem before the demonstration is the following:

Forget the Rpi's poor quality audio amplifier circuit through the 3.5mm jack.
Use an USB sound card for BOTH audio in (microphone), and audio out (loud sepeaker).

If you are in a hurry to google which USB sound card to use, you might like to read my suggestion in the following post.
Which USB sound card to choose - tlfong01's answer to an old question


J-K Flip Flop Output

Question: For a J-K Flip Flop, once we have J&K=1, now when the CLK Goes high, so Output goes high on the falling edge, but when does the OUTPUT Goes back to LOW?
Comment: Are you asking about JK flip-flop or JK edge-triggered-flip-flop? There is difference between these terms. Maybe this post will be helpful to you: http://electronics.stackexchange.com/questions/74986/edge-triggering-seems-to-me-leaving-every-circuit-in-an-inconsistent-state/74991#74991
Answer: On the next falling edge, assuming both inputs are still high. The synchronous inputs (J and K) are synchronized with the clock.
Answer: When Both Inputs of JK FlipFlop are High, It goes in Toggle Mode i.e. Q = Q'.
So, Assuming it's Falling Edge Triggered flipflop, On Next Falling Edge, Output will be LOW again. And On next Falling edge, it will be HIGH again and so on...
Wikipedia article has this table and timing diagram.

J-K Flip Flop Output


corrupt file in style library

Question: I have a site collection that is having issues with its style library library.  I had 2 css sheets stored in there that mysteriously disappeared.  No matter what I do, I can't list the files - powershell and the om both are unable to find it.  However, when you try to upload a document with that name it errors out and tells you it can't rename to that because that file name already exists.  Is there any way to remove this entry?  Or is the best route to just recreate the site collection?
Answer: What happens when you view the document library using the Open with Explorer functionality? Do you see the files there?
You need to make sure you file's type attribute is set to GhostableInLibrary
Ref: http://msdn.microsoft.com/en-us/library/ms441170.aspx
This article provides a good walk-through for deploying branding solutions even if you do not use Sandbox solutions.
Comment: No, you get the same result - it won't show the two css files that we are having issues with.  If I try to browse directly to the css files, I get a server 500 error.
Comment: Ok, so will redeploying the solution with the GhostableInLibrary attribute possibly solve my issue?  Or will I still have problems since something is wrong now?

corrupt file in style library


Getting a source clip from iMovie

Question: Last year I imported a video into iMove, edited it, cut pieces, etc and I have the result as a mov, but I want to also keep the original video file. I can still see it inside iMovie, but how do I get ahold of that file as a single simple file system file?
Answer: The iMovie Library file is actually a folder…
Right click it & 'Show Package Contents'
Then the original file is inside [movie name] > Original Media
You can drag a copy out to any other location. Keep the original in place, or iMovie will lose it.

Getting a source clip from iMovie


invulnerability no longer working

Question: im trying to make a mob that is invulnerable to all, yesterday on the same mc version I had the same command and it summoned a sheep that could only die to someone in creative mode with a diamond sword, this was good. but now it no longer works. here is the command:
/summon Pig ~ ~ ~ {CustomName:apples_ArE_Us,NoAI:1,Invulnerability:1}
Answer: The nbt tag is Invulnerable not Invulnerability
/summon Pig ~ ~ ~ {CustomName:apples_ArE_Us,NoAI:1,Invulnerable:1}

invulnerability no longer working


How to count the number of shapefiles that touch each polygon?

Question: I am trying to assign a number value field to different habitat shapefile polygons that is the number of other habitat type shapefiles that overlap or share a boundary. For example, I have 5 different habitat type shapefiles.  I want each habitat polygon within each habitat shapefile to have a value indicating the number of different habitats that it touches.  So if a particular wetland polygon touches a forest polygon and a beach polygon, that wetland polygon would receive a score of 2.  Thanks!
Answer: Pat, you should be able to do this with a series of iterations through each polygon.  You can get a list of ID's, then using select statements get the touching polygons - then using a search cursor, figure out what the touching polygon attributes are.  Something like this.  This is only a example and template of the workflow and will produce a python dictionary of all the habitats that intersect the source polygon.
<code>in_fc = "NAME_OF_DATASET_HERE"

habitats = {}
row, cur = None, None
cur = arcpy.SearchCursor(in_fc)
idlist = []
for row in cur:
    idlist.append(row.OBJECTID)

arcpy.MakeFeatureLayer_management(in_fc,"lyr1")
arcpy.MakeFeatureLayer_management(in_fc,"lyr2")

for id in idlist:
    arcpy.SelectLayerByAttribute_management("lyr1", "NEW_SELECTION", "OBJECTID = " + str(id))
    arcpy.SelectLayerByLocation_management("lyr2", "INTERSECT", "lyr1", "", "NEW_SELECTION")
    habitats[id] = []
    cur,row = None, None
    cur = arcpy.SearchCursor("lyr2")
    for row in cur:
        habitats[id].append(row.HABITATTYPE)
</code>
Answer: For a rather labour intensive option, you could make a field for each other habitat in each shapefile, then use a select by location against each habitat type, and calculate the selected features value as 1 in each corresponding habitat field, and then add a column that adds together the values of each other habitat type. so in your forest table, you'd have a field for wetland; water; grassland etc., each with a value of either 0 or 1 depending on if that habitat touches, and a total column that counts the number of 1's for each polygon using the field calculator (i.e. = [wetland] + [water] +....).
Comment: Thanks TDavis.  This is how I was going to approach it however you're right it would be quite labour intensive.  I was hoping there was a tool that would do this in one go by adding a field to each feature table with the number of other features it touches.  May have to do it the long way, if there is no other way.  Unfortunately I'm not familiar enough with scripting to write something in Python.
Comment: you could use a union, if you set your tables up properly, and would join the attributes of all overlapping features, which you could use to pull out habitat occurences in each polygon in the combined shapefiles. this approach wouldn't capture adjacent features without some pre-emptive buffering though. not sure this approach would save that much time over the manual selection approach


Specifying RPM dependency as "one of the following"

Question: I am developing an RPM spec file for an in-house package. The package depends on libuuid, which is available as the libuuid package on Fedora, but there is no libuuid package for CentOS 5 in the standard RPM repositories. We can satisfy the dependency on CentOS with the e2fsprogs-devel development RPM (e2fsprogs-devel installs libuuid and the associated headers). I would like to specify that our RPM depends on libuuid, such that the libuuid package is installed on Fedora during installation of our RPM, but e2fsprogs-devel is installed during installation on CentOS. Is there a way to specify a dependency as "one of libuuid or e2fsprogs-devel, in that order" in an RPM spec file?
Answer: You may directly specify files as a requirement but this is ugly. Also don't use %dist for distinguishing.
You should just rely on the build process. If one specific file is located in different packages depending on the distro then you should just (re-) build the package on every distro you wish to support (AutoReq/AutoReqProv must not be disabled).
Answer: No. Use the Dist Tag to distinguish between Fedora and one of its derivatives.


How can I create Starcraft 2 maps with snow?

Question: I saw some replays on snow maps. How can I create a custom map with this snow/mountain setting?
Answer: Normally you would have to import a custom tileset, created by the community, but apparently there already is a snow tile set in the game. (just hidden) This link explains how you use that tile set and add snowy weather.
Comment: The link is broken now. Is there a working link? Better yet, could the actual procedure be added to this answer (or as a new answer), to prevent this problem from happening again in the future? :-)


Windows Server Domain Controller without real domain

Question: I'm setting up a local logon server, simply to handle user logons and enforce some group policies.
Ideally we could do with not pointing a genuine domain to the server.  Is there any way of setting up a domain controller without a domain (using a fake local domain).
Or even better, can Active Directory be used without a domain controller?
Answer: No the domain controller is a fundamental part of Active Directory. It handles the login requests and is the source of group policy data so you won't get very far without it.
It's not advised anymore but I doubt you will really see any serious issues in your environment by using the old some-appropriate-name.local method.
Comment: Regarding the naming: be advised that [`.local` is not recommended anymore](https://serverfault.com/questions/17255/top-level-domain-domain-suffix-for-private-network).
Comment: I'll try the some-appropriate-name.local approach.. That's exactly what I was looking for. Thanks!
Answer: If I understand correctly, you have a single server that you wish to use in isolation but still apply some policy to it.
You have a two approaches...

Use it stand alone, you can have Local User accounts and configure Local Policy on the server, there is no requirement for Active Directory per se to simply apply policy on a system.
Configure the system itself as a stand alone domain controller, this might give you some options should you want to expand the deployment for any reason or use applications that depend on Active Directory.  Microsoft advice is not to use '.local', but instead to use a real domain name - however this doesn't need to be a top level domain like 'customer.com', it can be a sub-domain - like 'test.customer.com'.  See Active Directory: Best Practices for Internal Domain and Network Names


How do I overwrite all but the first line of a file?

Question: I have a CSV file that I often update with the output of a command, but whose header I want to retain. How do I keep Bash's > file.csv syntax from overwriting that line?
Answer: A couple of options using in-place editing rather than redirection:
ed -s file.csv <<'EOF'
1r !some_command
1,.wq
EOF

or similarly
some_command | sed -i.bak -e '1r /dev/stdin' -e 1q file.csv

although AFAIK the latter uses a temporary file "under the hood".
Answer: execute command >csvfile
sed -i '1i mention the header here' csvfile

Answer: There's no easy way to get a shell to overwrite a file starting at an offset. And you shouldn't edit files in place anyway, because that leaves a truncated file if the editing is interrupted a crash or power failure.
Create a new file. Start by copying the first line, then write the rest of the content. When you're done, move the new file into place.
read -r first_line <file.csv
{
  printf '%s\n' "$first_line
  … # write the rest of the content to standard output
} >file.csv.new
mv -f file.csv.new file.csv

Comment: @cas This has the downside of leaving a half-written file if something goes wrong, so you should only use this approach in cases where the permissions or hard links do matter and you have a way to tell other processes not to use the file while it's being rewritten. Move-into-place should be the default approach because it's the only safe approach, that's why it's the approach I always use if there's no sign that it wouldn't work.
Comment: @cas No. Hard links are rare, and if there's a problem, you'll find it very quickly and obviously in testing. Race conditions do happen, but you'll only find them a lot later, in production, with no idea of what could possibly have gone wrong. Text edtiors are used by humans who can take special action if saving fails, and even so they arrange to keep an intact copy of the file and many have a recovery mechanism if they get interrupted. With a script that's used as part of an automated pipeline, there are no such safeties, so an unsafe approach is a ticking bomb.
Comment: If you want the edited file to keep the old inode and permissions then redirect the new file over the old (e.g. `cat file.csv.new > file.csv ; rm -f file.csv.new`), otherwise it will have the new file's inode (breaking hard links, if any exist) and the default owner/perms/acls from when `file.csv.new` was created (which may be different to what `file.csv` had).  This often doesn't matter, but sometimes does....and is why using a scriptable editor like `ed` or `ex` or `vim` is sometimes better than the so-called "in-place edit" of `sed` or `perl` etc.
Comment: the atomic nature of a `mv` has some benefits, but the risk with a redirection is the same as with any other file overwrite (including "save" from within your text editor or other app).   i.e. not very likely.    Also, fixing ownership changes (and some ACLs) can only be done by root.....and fixing broken hard links is impossible unless you took note of the inode before mv-ing the new file over it, and then used `find / -inum nnnnnn` or something to find them all and re-link them (which the current user may not have RW or X permission in the relevant directory/ies to create the links)
Comment: IMO overwriting is preferable to mv-ing unless you know for sure that a) the inode doesn't matter, no hard links; and b) the owner, group, perms, acls etc won't change.   the inode number doesn't usually matter.   owner, perms, etc almost always do.
Comment: as mentioned, mv is also unsafe (for different reasons).  choose your preferred kind of unsafety.
Answer: For the case of wanting to maintain an unchanging header, you can write the header to another file with head -1 file.csv > header.csv and use the following syntax:
{ head -1 header.csv && some_command; } > file.csv

As described in the comments, Bash first truncates file.csv before running the commands inside { }, meaning you can't just run head -1 file.csv inside { }.
This { } syntax can also be used to combine output from two commands as explained here.
Comment: Since the redirection is the first thing that the shell acts upon (to be able to decide where to send the output from your compound command), the file would be truncated before `head` has a chance to run.
Comment: @JeffSchaller I can't get that command to work even for small files.
Comment: It seems to work for smaller files; I'm wondering if there's a buffer limit or sequence of events that allows it to work in some situations.
Comment: Ugh, you're right. In my case this exact command does cause this problem. I'll edit my answer with a solution.
Answer: sed -i '2,$d'  file.csv && some_command >> file.csv

sed -i '2,$d'  file.csv will delete all but the first line of the file.
-i tells sed to work in-place
2,$ addresses from line 2 to the end of the file
d does the deletion.
You can try out if the command does what you want by leaving out the -i
After that && some_command >> file.csv will append to the file only if sed successfully cleared it.
Answer: Similar to other examples here, this should work in-place without a temp file
FILENAME="file.csv"
HEADER=$(head -n 1 $FILENAME)
{
  echo $HEADER
  echo "your changes here.."  # or, some_command
} < $FILENAME > $FILENAME  # WARNING: SC2094

Disclaimer: Shellcheck raises SC2094 on the this code, so use it on your own risk
Comment: what the use of `< $FILENAME` ? you are generating content.


How was this illustrated? How could I learn to do the same?

Question: This is a recent shirt on instagram, who I love so much. How did they design this beautiful icon of a carrot skinner? I would love to learn how to make such a beautiful image of a simple object.
Comment: This question is ***wayyy*** too broad for a Q&A format. With that being said, think deeply and long about *why* you like it. That will inform a lot
Comment: It's a photo of a potato peeler. [This one](https://www.bing.com/shop/productpage?q=Kuhn+Rikon+Original+Swiss+Peeler++&filters=scenario%3a%2217%22+gType%3a%2212%22+gId%3a%22101582723079%22+gIdHash%3a%220%22+gGlobalOfferIds%3a%22101582723079%22+AucContextGuid%3a%220%22+GroupEntityId%3a%22101582723079%22+NonSponsoredOffer%3a%22True%22&productpage=true&FORM=SHPPDP&browse=true), but in red rather than blue.
Comment: @BillyKerr Link's blocked for the US. Might be a Bing thing.. seems to work in [if direct](https://kuhnrikon.com/us/swiss-peeler-red-2770-u.html)
Comment: @Scott Yeah same one. I put the [image on imgur](https://imgur.com/a/6mpL5dg) - it's even closer, from the exact same angle.
Comment: how did you find that so easily? @BillyKerr
Comment: I searched for "potato peeler" in Bing.
Answer: The peeling tool can well be a photo, one which has been shot with a good camera and well adjusted lights and the background is removed to make possible to place it  as a new layer on another photo (the cloth). Shooting such product images and preparing them for online and printed ads is a common job for many of us. But you have never claimed anything else. I believe you actually asked how to draw it.
Drawing a realistic image even of a single 3D item is not easy. The basic problem is that one must at first have between his ears the ability to see which lines and color splashes are needed to present the item. A great part of it happens already in the birth. I mean no practicing could for.ex make me a person who should start to paint photorealistic images. I have seen how a talented youngster draws in a way which make my creations to look sketches - no matter how well I possibly know how geometric projections happen, which are the parts of a human body, what kind of lights and shadows exists and how to present materials, light and geometry. The talent is the ability to see them intuitively in the fly without slowing down the drawing process or drifting totally out of the road by breaking all to atoms by conscious reasoning.
Persuading a paintbrush, pencil or a computer program to obey one's will is another task which needs much practicing. But it can happen in parallel when one studies the needed knowledge behind proper drawings and trains his ability to see the essential things "what details to put on the paper".
The answer to your question is: Learn to draw -  go to a school or work through tutorials and books and get private lessons. It can take years if you are a beginner and haven't got a superior amount of talent. No talent means no useful results.
In parallel with learning to draw learn to use computer programs. But start with a pencil and paper. Add colors gradually. It's no use to try to make it in Photoshop, Illustrator or other drawing program if you cannot make it happen on paper. The programs do not draw it, it's you who can put the program draw the right colors and forms. Proper tuition speeds up the learning process, but prepare to draw thousands of images by starting from simple and climbing up gradually in complexity and the richness of the details before it starts to look good.
There are some shortcuts which surely help to make good looking finished drawings faster and without so much training and talent:

learn only how to make manually more or less simplified copies of photos
make a 3D model and let the 3D program render the image in 2D (easy only for quite simple items like the peeling tool)
process a photo to look like it's a drawing
Ask an artificial intelligence system (Midjourney, Stable Diffusion etc...) make it for you. It probably brings to you the same or a modified version of the easy to find web image. It's surely copyrighted, so it cannot be distributed. But at least Adobe sells AI image generation as a service which makes distributable images.

You probably find an ad which says: Everyone can be an artist. Learn to draw only in 10 weeks with our revolutionary course. No need to sit years in a school. Only work through one exercise per a week and after ten weeks you draw like a master. You create as well landscapes, portraits, cars, flowers - anything you can imagine. Amaze your friends and be able to get a well paid job in a professional advertising agency. Order today, only $250 the whole 10 week package. And that's not all. You'll get also a high quality set of professional drawing tools, alone worth $100,- when purchased separately.
I'm afraid it's no use to shell out that $250,-
Answer: There's already given a rather pointless sermon how difficult it will be to make this. The writer is right when he claims that building professional grade drawing skills needs some effort. But, as he says, there exists shorter ways than becoming at first an artist who can draw anything. It's not a big deal to practice some time with Illustrator, Inkscape etc... and then draw on an existing photo one's own version of the peeler. The drawing can be simple, because there's no point to make it have any fine details or glosses. They all would be invisible when the image is printed on a normal rough fabric.
As easily one could learn to generate a 3D model of the peeler. No complex surface forms, materials nor rendering finesses are needed, so even a basic 3D CAD program is good enough for the job. Having something finer (Rhinoceros, Blender etc...), of course,  gives a possibility  to create a photorealistic model, but placing it on a rough fabric makes the whole extra effort useless.
I cannot bring a printed shirt as an evidence, but I can make the simplest possible 3D model of it and render it without any realistic material models. Then I can put it on a clean image of the same shirt in the same way as we generally make mock-ups in Photoshop to present non-existent products. Here's the rendered 3D model:

It looks like it's made of matte rubber including the blade. But when it's inserted on a photo of a shirt the roughness of the fabric shifts the attention away from the rubberness and the image is not at all worse than the example in the question:


How to get removed default app back?

Question: I've removed my Gallery default app with NoBloat. NoBloat is a great app and I've used it to remove all of the bloatware that came with my Note 3. Yesterday I was playing with my phone, then I thought "well, I use QuickPic, so let me remove the Gallery app too". Well, not a great idea (especially not backing it up before doing it). Now, I can't access my pics from the corner of the Camera app. Is there anyway that I can get it back without resetting my phone (it just won't happen)? I've tried looking for the app at the Samsung Apps store but they don't keep it over there
Answer: No, you won't be able to get it back without a backup unless you know someone with the same phone who can back it up & provide you with a copy.
You also won't be able to update your system OTA in the future either, as updates check to make sure that all the apps that should be there are present.  If they're not, they won't install.
Freezing apps rather than deleting is generally a much better idea.
Comment: Exactly. So your only ways out are either (as Logos already wrote) find someone with the exact same device and OS version to provide you with a copy, reflash the ROM completely, or (if you have the exact same ROM available which your device currently runs) extracting the required stuff from that ROM.

How to get removed default app back?


Rotating about 2 axes independently

Question: I am looking for a solution to the following problem:
I have a ball travelling to the upper right corner of the screen. That is, its velocity to the right and up are identical.
To simulate its rotation, it has an angular velocity along the X and the Y axis - those are also both equal.
This works fine so far. My problem is now to correctly rotate the ball on display: I am using OpenGL and a simple sphere for the ball.
Now my naive approach was to use
glRotate(rx, 1, 0, 0); // rotate about x axis
glRotate(ry, 0, 1, 0); // rotate about y axis

But this does not work as I intended: The second rotation depends on the first one. On second thought, this works as I was used to it. But now I am looking for a solution to rotate my ball correctly by applying both rotations independently.
I also tried using quaternions but did not succeed. I am even not sure if I get something completely wrong an my approach of "rotate some degrees about x, then some about y" makes sense at all.
Any "enlightment" is greatly appreciated.
Thank you!
Comment: How did you try using quaternions that didn't work?  If your implementation is correct, then quaternions should always be correct
Comment: http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula Axis-angle formula for rotation around an arbitrary axis.
Answer: How about glRotate(rr, 1,1,0); in that case you rotate around the arbitrary vector (1,1,0).

Rotating about 2 axes independently


Position of an index when raising and lowering indices

Question: I'm reading Carroll's book on GR, page 25, and have a question about raising and lowering indices in 1.72:

For the first equation, why do we have (sorry I don't know how to leave spaces for the lower indices)
$$
T^{\alpha\beta\mu}_{\quad\delta} = \eta^{\mu\gamma}T^{\alpha\beta}_{{\quad}\gamma\delta}
$$
rather than
$$
T^{\mu\alpha\beta}_{\quad\delta} = \eta^{\mu\gamma}T^{\alpha\beta}_{\quad\gamma\delta} \, ?
$$
The book said that raising and lowering indices does not change the position of an index relative to other indices. I'm not quite sure what is the relative position of that free index $\mu$.
Comment: You can leave spaces for lower indices by using {}. For example, use the code T^a{}_b to get $T^a{}_b$.
Comment: Because it could destroy the (anti-)symmetry properties. For example, the Riemann curvature tensor is antisymmetric in its first two and last two indices, so it's important to keep the relative position.
Comment: @Níckolas Alves Thanks!!
Answer: In general (ie, without proving some kind of symmetry property), you cannot permute indices on a single tensor
\begin{equation}
T_{\mu\nu\rho\sigma} \neq T_{\nu\mu\rho\sigma} \neq T_{\rho\nu\mu\sigma} \neq \cdots
\end{equation}
However, you are perfectly free to commute products of tensors, so long as the indices on each tensor remains the same
\begin{equation}
\eta_{\mu\nu} T_{\alpha\beta\gamma\delta} = T_{\alpha\beta\gamma\delta} \eta_{\mu\nu}
\end{equation}
In fact this is one of the advantages of index notation, the "non-commutivity" of tensor multiplication is encoded in the index structure, rather than the ordering of the tensor symbols.
Of course you can derive the above facts abstractly from the definition of a tensor. However, I find it easier to justify directly in terms of components. If we think of $T_{\mu\nu\rho\sigma}$ as an array of $4^4=256$ numbers, there is no reason for $T_{1000}$ to be related to $T_{0100}$. In general these will simply be different numbers. That rules out the more general assertion $T_{\mu\nu\rho\sigma}=T_{\nu\mu\rho\sigma}$. However, $\eta_{11} T_{0123}=T_{0123}\eta_{11}$ simply because $\eta_{11}$ and $T_{0123}$ are ordinary numbers, and multiplication commutes for ordinary numbers. That argument will work for any $\mu, \nu, \alpha, \beta, \gamma, \delta$, so $\eta_{\mu\nu} T_{\alpha\beta\gamma\delta} = T_{\alpha\beta\gamma\delta}\eta_{\mu\nu}$. With a bit of thought you can also use a similar argument to show that contracting any pair (or pairs) on indices in this expression also allows you to commute $\eta$ and $T$ (so long as the contracted indices are the same in both expressions and the free indices appear in the same places on $\eta$ and $T$).


Notifying drupal user on publishing

Question: I'd like to be able to notify a fellow publisher within the drupal permissions group that a new piece of content relevant to their page has been published. NOT an end-user alert, but just an internal alert on Drupal.
Answer: Sounds like a perfect use case for the Menu Badges module, which can be used to add notifications to any menu item and/or menu tab of your choice. Here are some details about it (from its project page):

Provides a method for adding iOS-style badges to menu items. (see screenshot)

Because of how it integrates with the Views module, you basically reduce the solution specific to your question here to something like this:

Create an appropriate view about "new pieces of content relevant to their page has been published" (as in your question).
And create a menu item or menu tab for it.
Grant access to that view for those users who fit "a fellow publisher within the Drupal permissions group" (as in your question).
Perform the required Menu Badges configuration to tell it which menu item/tab you used for it in your view.

Refer to the video Defining Menu Badges with Views in Drupal (from the module maintainer) for more details. It shows a scenario that might be close to what you'd want to implement also.
PS: I'm assuming this question is about D7 ...

Notifying drupal user on publishing


How to correct citations in Google Scholar?

Question: Some of the publications have cited my work. But Google scholar is unable to identify those citations and link with my account. I think it is because my name in the references of article has been written differently. Is there a way I can change that?
Comment: It might be helpful to have more detail about what exactly you mean by "my name in the references of article has been written differently" - is there a mismatch between your surname as written in the official details of your paper as published versus how they spell in the citation? What's the difference - is it a typo, is it an accented character or alphabet issue, is it a name-change or dual name issue, or something else?
Answer: Your problem is known to Google and they offer the following fix via https://scholar.google.com/intl/en/scholar/citations.html#citations:

...
  To fix this, you'll need to identify the specific citing articles with
  indexing problems and work with the publisher of these articles to
  make the necessary changes (see our inclusion guidelines for details). ...

In short, Google claims it's always reflecting the state of the internet right now. Misspellings may be part of that, but Google doesn't want to play the corrector.
Comment: please accept this answer
Answer: You think

Google scholar is unable to identify [some citations to my work] because my name in the references of article has been written differently

But, I doubt Google works this way, because numerous mistakes appear in references throughout the literature. Perhaps this issue will resolve itself over time as Google has more time to crawl.
Answer: When your publications are cited, the full reference is the name of the journal/publication, date, volume and maybe even page number, on top of your own name. There is also the DOI.
So if they have misspelled your name when they cite your work, it should not matter, if they actually cited your work. Google Scholar or Pubmed or Web of Knowledge etc should be able to discern that.
What might be the case, I suspect, is that your own name is not the same between your google scholar page and the name you used in your publications.
That might be the case if you have multiple middle names (and/or initials). Or if you have changed names, due to marriage or some other reason. If you have non-standard latin letters in your name, how they are "latinified" into English might be an issue as well.
Hard to say without a concrete example
Answer: It is possible that citations to your work are not recognized by Google Scholar because of errors in (or incompleteness of) the reference string. Such 'stray' citations can be corrected, see Anne-Wil Harzing's guide to correcting stray citations in Google Scholar.
Note that the same problem occurs in all citation databases to some extent. Most of them have some mechanism for reporting and correcting (besides Google Scholar, at least Web of Science and Scopus do).
Comment: The link you're providing doesn't explain how to correct stray citation _on Google Scholar_. It shows how a stray citation can be correct using the Publish or Perish software.


How to review a game in Steam library?

Question: I'm using Steam on Windows. How can I review a game? I remember previously I would right click the game in my library and choose 'write a review' but that option seems to be no longer there.
Comment: Note that reviewing is not available for all games; there must be a minimum play time limit required before you are allowed to review.
Answer: If you scroll down on the game page in your library, there is a button that lets you post a review:

Alternatively, if you have played a game for some time but have yet to write a review, there is a feedback panel that leads to a review prompt page:

Which leads to:
Answer: You can write a review for a game you own from the game's store page. You can reach the store page through the link under the install/play button on the game's entry in your library.
Answer: There is a minimum play time of 5 minutes before, on the store page, there appeared a big box asking for your review just below the "This game is already in your library" message and "Play Now" button:

Search for the game here to get to this page: https://store.steampowered.com/search/
Took me a while to figure this out, as I've been playing with custom options (from the command line outside of Steam) such that it runs with my wonky driver situation. Somehow Steam doesn't register that I've played the game at all. Copying files to another computer doesn't work so there is some DRM active that checks that you're logged in with your account, but it still blocks you from reviewing. (I wonder if it has an effect on the 2-hour refund thing, but anyway that would be scummy to try out.)
If you are in the same situation and Steam literally cannot run the game to accumulate time, what worked for me is writing a few lines of Bash that finds the process ID as soon as Steam tries to launch it (via Proton) and does kill -STOP $pid immediately. Now go drink some water, and after 5 minutes you can kill -CONT $pid to let it crash and now you have enough time on the clock to write a review.
The screenshot is censored because I don't want this to seem like an advertisement, but the major graphic components are left in because I don't have placeholders and so that the page is recognisable at a glance.

How to review a game in Steam library?


How does an electron "move" in an $s$-orbital?

Question: I have read multiple answers on StackExchange about this question, but I wasn't able to find a concrete answer. Like other questions, the reason I ask about the $s$-orbital is because it has a zero orbital angular momentum. But, the implication of having a zero angular momentum is unclear? Some answers discuss probability distributions, but the question is how can there be multiple places for an electron, if it can't move. I read another answer that says that the electron passes through the nucleus or curve around it as a wave. I would appreciate it if anyone could provide a resolution to this question.
Comment: It doesn't *move* around in that orbital, it *exists* in that orbital. When you probe it repeatedly, it can be found in different places without "moving" between them but by still remaining in the exact same spatial distribution.
Comment: "Move" means time evolution of the state, which is given by $| \psi(t) \rangle = e^{-iHt} | \psi(0) \rangle = e^{-iE_s t} | \psi(0) \rangle  $.
Comment: Electrons can exist at more than one place at the same time.
Comment: +1 to the answer by anna v.   The word "particle" means something entirely different inside a physics classroom than outside.  (Same is true for "work" and "heat" and "strangeness", etc).  You'll have to put aside your everyday mental images.
Answer: For me the physical implication of zero angular momentum is that the electron's probability distribution is spherically symmetric. At the deepest level, the angular momentum property in quantum mechanics describes how something transforms under rotations (see Noether's theorem). Although this is quite an abstract property, in the case of electron orbitals it relates to something extremely concrete and amenable to visualisation: namely, the shape of the angular probability distribution.
Any interpretation based on classical concepts is doomed to fail at some point. In this case the confusion arises from imagining that the electron is in a certain "place", or that it "moves".  The only truly useful description of the electron that has been found is the quantum wave function, and its corresponding probability distribution.
Comment: @user29568 The deepest understanding available of this point is via Noether's theorem, linked in my post, which nevertheless requires some mathematics. If you want a physical analogy, note that even classically an object with non-zero angular momentum has an axis of rotation, which defines a preferred direction in space. Saying that an object has no angular momentum is equivalent to saying that no such axis exists, therefore all directions are equivalent and we have spherical symmetry. In general, zero angular momentum is equivalent to the property of perfect rotational invariance.
Comment: @user29568, if anything, mathematics improves certainty, as it is hard to make testable predictions about mere intuitions.  Once you can manipulate, measure and make predictions about those measurements, you can perform science.  The challenge is that as we delve ever deeper, the things we are modeling are no longer the things we evolved to intuitively comprehend.  We viscerally know what it's like to throw a rock and predict where it will fall, but understanding probability distributions takes a bit more work.
Comment: How does zero angular momentum mean spherically symmetric? I suspect that the answer can be proven mathematically, but is their a physical explanation for it.
Comment: The special s-orbital state is simply one of the infinitely many solutions that exist for the Schroedinger equation of an atom. The reason it can have precisely zero angular momentum is related to the quantum discreteness of other quantities like energy for bound states. The best way of understanding this is by analogy with standing waves in classical physics, which can only possess certain quantised values of frequency and wavelength. Ultimately this is related to the properties of wave-like equations when the boundary conditions require the solution to be confined to a finite region.
Comment: I think I got what your saying, so since the electron has no angular momentum then it has no favored direction, which means that it can basically go in all directions which is defined by a spherical area. But, what makes the electrons defined in the s-orbital so special that they have no angular momentum. Is it their by default?
Comment: @user29568 Any time you say or think something  like "an electron can go in all directions" you are confusing yourself. An atomic electron does not "go" anywhere, instead it exists in an orbital: this is a state of nature in which an electron has only a small probability of being in any one place. As anna's answer has tried to emphasise, the electrons do not have trajectories, and trying to understand the probability distribution in terms of these will not work, and just confuse you. The fuzziness is an intrinsic property of the electron, it has nothing to do with some underlying motion.
Comment: So, ultimately, everything on the atomic level is defined by mathematical equations with no original and physical conceptualization and certainty thereon. No wonder this got Einstein, all disappointed. Thanks for your answer, though
Answer: Electrons are elementary particles. Elementary particles are quantum mechanical entities, and their interactions are described very well by he solutions of quantum mechanical differential equations. Orbitals are the mathematical description of these solutions.
Elementary particles are not particles in the sense of a billiard ball, with a specific (x,y,z) trajectory. They do not move in solutions of classical mechanics problems. That is why they are called orbitals and not orbits. They have a locus in space described by a probability function which is equal to the square of the wave function of the solution.

They have measured hydrogen orbitals with an ingenious microscope , so the electrons are not in orbit, but in a distribution in space
Atomic distances, as in the image, are of the order of 10^-10meters, the proton in the picture is localized at diameters of  10^-15 meters . As this involves volumes, the S state probability distribution does go through the  locus of where the proton is , with a very small probability of interaction. At that point one should solve the problem with second quantization, no longer the simple Schroedinger one . There exist studies of this.
The case of the positronium, which has similar solutions to the hydrogen ones, and lives for a while and then annihilates is an experimental proof of the S state passing through the center of the potential.
Also electron capture from the S state is observed in proton rich  nuclei.
Comment: It is quantum mechanics. If there is a time dependence in the probability distribution, a time dependence will appear. Otherwise it will just be the draw of the specific measurement ( as the ones in the picture above). Similar to a standing wave on a string, it is in the whole string.
Comment: It depends on the experiment. Electrons in an accelerator have a velocity. Electrons in a cathode ray tube have a velocity. This is because they are not bound and are only probabilistically limited by the Heisenberg uncertainty principle. Bound electrons are completely probabilistically limited by  the boundary conditions of the solution of the shrodinger equation. The wavefunction is not in an eigenstate of the velocity operator . It is in an eigenstate of energy. estimating velocity by using the 1/2mv**2  but it does not mean much : an average number to compare with the unphysical Bohr model
Comment: I know that an electron has no specific trajectory, but aren't the orbitals, a function that allow us to calculate the probability of finding an electron in a certain region of space. My question is how does the electron have multiple possible places to be, if it can't move. Or is it just that since its impossible to predict exactly where an electron would be, then we can't predict how it evolves with time.
Comment: I don't think I follow. As a particle, does the electron have a velocity?
Comment: If yes, doesn't that mean it is in motion. So, are the electrons described in the s-orbital in motion or are they still?


What is the device called when you use the same word but with two different meanings in a phrase for effect

Question: What is the name of the device used when an author uses the same word to different effects in a sentence. Here, the word 'good' is used as both a noun and adjective
e.g. 'and good goods swimming in the water' - Samuel Pepys
Answer: This is a kind of antanaclasis.
As defined by the OED, antanaclasis is

A figure of speech involving repetition of a word in a different sense.

A famous example is "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo."
However, antanaclasis is not limited to using the same word multiple times as different parts of speech.  So while "good goods" involves "good" used as both a noun and adjective, it qualifies as antanaclasis, but phrases also qualify when they use different senses of a word in the same part of speech.
For example, from Shakespeare's Henry V:

"To England will I steal, and there I'll steal"

This phrase uses two different senses of the word "steal," but in both cases they are verbs.
Comment: +1 for steal.... steal and good goods, but what do the 8 buffaloes mean?
Comment: @ab2 the link is to the Wikipedia page, which gives a thorough description, better than I could do in an answer or comment.


Sharepoint Internal names of Person or group column gets changed on taking list template

Question: I have created a person or group column in list. When I take list template and use it in other site the internal name of the person or group column gets changed. I have used the internal names of this column in my code. Now due to this mismatch of internal names the code is failing.
Comment: Do you have any site columns or list columns with same internal name in your site?
Comment: No, I don't think so because I don't have site column with the same name that I have created. I have created this Person or group column in List. Yea but i have Group name same as Column name@GaneshSanap
Answer: By default, the name we specify while creating the column is used as display name as well as internal name.
However we can change the display name as many times as we want, but can never change the internal name once column is created.
You have to delete old column and create new column if you want to change column internal name.


How can a man kill his sexual desires or desires towards women?

Question: How can a man kill his sexual desires or desires towards women ?
Comment: it cannot be dont by one practice it is by intense effort and love of krishna one can comeout. 1. Ekadashi Fasting 2. Chaturmasya vrata(avoid one item permonth as stated in varaha purana) 3. be in the presence of holy man and serving them. 4. listening to past life time of Sri Krishna 5. Mediatating 6. constant japa morning, midday and evening. 6. Living near ganges taking bath 3 times remember foot of sri hari. Overall Avoid taking excessive food. (No onion and garlic is a must). Avoid outside food.
Comment: how do child stop playing with toys when they grow up?
Comment: I will respectfully disagree with everyone here (what's new hahaha) to say I'm not entirely sure this is necessary. I think can actually do more damage than good to many people. I think there are numerous multiple & misunderstandings and interpolations w/ respect to some larger issues in the religious texts, sex being one of them. Lotsa messed-up views and notions on this imo.
Comment: Also not to be misandrist but the texts are written from viewpoint of men. What abt girls who are tempted by guys ? Or gender fluid people, gay ppl, or trans folks or same sex attractions etc ? There are people of all types trying to read religious texts and trying to understand how to deal with all kinds of this stuff. But in general I think so much misunderstandings around these topics.
Answer: One should divert all his senses towards Lord.

Do not get drowned in delusion by going wild with passions and lust
by seeing a woman's navel and chest. These are nothing but a
modification of flesh. Do not fail to remember this again and again
in your mind.(Bhajagovindam 3)
The childhood is lost by attachment to playfulness. Youth is lost by
attachment to woman. Old age passes away by thinking over many past
things. But there is hardly anyone who wants to be lost in
parabrahmam. Who is your wife ? Who is your son ? Strange is this
samsara. Of whom are you ? From where have you come ? Brother, ponder
over these truths here. From Satsangh comes non-attachment, from
non-attachment comes freedom from delusion, which leads to
self-settledness. From self-settledness comes Jeevan Mukti. What good
is lust when youth has fled ? What use is a lake which has no water ?
Where are the relatives when wealth is gone ? Where is samsara when
the Truth is known ? Do not boast of wealth, friends, and youth. Each
one of these are destroyed within a minute. Free yourself from the
illusion of the world of Maya and attain the timeless Truth.
(Bhajagovindam 7-11)
A yogī should similarly meditate on the most benevolent smile of
Lord Śrī Hari, a smile which, for all those who bow to Him, dries
away the ocean of tears caused by intense grief. The yogī should
also meditate on the Lord's arched eyebrows, which are manifested by
His internal potency in order to charm the sex-god for the good of
the sages. (SB 3.28.32)

Commentary says The charming brows of the Supreme Personality of
Godhead protect the sages and devotees from being charmed by material
lust and sex attraction. Yāmunācārya, a great ācārya, said that ever
since he had seen the charming pastimes of the Lord, the charms of sex life had become abominable for him, and the mere thought of sex
enjoyment would cause him to spit and turn his face. Thus if anyone
wants to be aloof from sex attraction, he must see the charming
smile and fascinating eyebrows of the Supreme Personality of
Godhead.

These inauspicious disturbances can be gradually removed by constant
remembrance of Me, by congregational hearing and chanting of My
holy names, or by following in the footsteps of the great masters
of yoga. (SB 11.28.40)

Commentary says According to Śrīla Śrīdhara Svāmī, by meditation on
the Supreme Lord one can overcome lust and other mental
disturbances, and by following in the footsteps of great
transcendentalists one can overcome hypocrisy, false pride and other
types of mental imbalance.
Answer: Surrender to God (Krishna). Read atleast one shloka a day and try to follow the teachings and apply in life.
For your question from Chapter 6 verse : 14

Thus, with a serene, fearless, and unwavering mind, and staunch in the
vow of celibacy, the vigilant yogi should meditate on Me, having Me
alone as the supreme goal.

https://www.holy-bhagavad-gita.org/chapter/6/verse/14


When to call schedule()?

Question: I'm writing a driver for device that has no DMA.
Driver start device operation and then waits for operation to complete by pulling busy flag from device periodically.
The operation takes 4.5 or 9 microseconds to complete. Under no circumstances device completes operation earlier. No errors will arise from reading state of device later than designated amount of time (9 microseconds).
Busywait
All kernel articles found in Internet tell to busywait for intervals this small. They argue that any sleep operation will waste more resources than busywait. Personally, I don't like wasting cycles on trivial wait.
Schedule/sleep
I've found out that on target hardware with a process using whole CPU schedule() call causing other threads (on empty processor there are no other threads)  can be invoked up to 4 times before device operation completes. When I add more dummy processes to load the CPU, I see that schedule call in my driver gives fairer CPU allocation for concurrently running processes.
Should I call schedule() or even usleep_range() while waiting for my device, or should I rely on kernel preemption to deal with busywaits?
Answer: According to Documentation/timers/timers-howto.txt, usleep_range is what you want for recent kernels.
[Update:  Whoops!  I should have read more carefully.  For < 10us, it says to use udelay.  So I guess it depends on how long you are willing to sleep for.]
Comment: OK I should have read it more carefully :-).  I will update my answer.

When to call schedule()?


What is the authenticity of the athar about Umar not doing Raf' al-Yadayn in prayer?

Question:
حدثنا يحيى بن آدم، عن حسن بن عياش، عن عبد الملك بن أبجر، عن الزبير بن عدي، عن إبراهيم، عن الأسود، قال: صليت مع عمر فلم يرفع يديه في شيء من صلاته إلا حين افتتح الصلاة
Yahya bin Adam told us, on the authority of Hassan bin Ayyash, on the authority of Abdul Malik bin Abjar, on the authority of Zubair bin Adi, on the authority of Ibrahim, on the authority of Al-Aswad, he said:
I prayed with Omar, and he did not raise his hands in any of his prayer except when he opened the prayer.
2469 مصنف ابن ابی شیبہ الرقم
Comment: Salam and welcome to IslamSE the Q&A site about Islam.  Strictly speaking this is not a hadith as it is rather describing what 'Umar did. And there are lots of narration supporting this too and this is the known choice of both Maliki and Hanafi madhhab. Even if imam Malik reported ahadith saying otherwise.
Answer: It is an authentic narration.
Imām Abū Jaáfar al-Ţaĥāwī comments on this:
"This is Úmar, may Allāh be pleased with him, he would not raise his hands except in the first takbīr in this ĥadīth, and it is a şaĥīĥ ĥadīth."
[Sharĥ Ma'áānī al-Āthār, 1/227]

Mullā Álī al-Qārī writes regarding it:
"Ţaĥāwī and then Bayhaqī narrated from the ĥadīth of Ĥasan ibn Áyyāsh, with a şaĥīĥ sanad from Aswad."
[Mirqāt, 2/486]

Ibn al-Turkmānī writes:
"This sanad, too, is şaĥīĥ according to the conditions of Muslim."
[Jawhar al-Naqī, 1/136]
Answer: This narration appears in a chapter of Musannaf (abu Bakr) ibn abi Shaybah in which he quoted those people of knowledge (sahabah and tabi'yn etc.) who used not to raise their hands after the takbirat al-Ihraam (the takbir to start the prayer).
The chapter quotes:

The prophet () according a report on the authority of al-Bara' ibn 'Azib and 'Abdullah ibn Mas'ud

Among the sahbah:

'Ali ibn abi Talib
Abduallah ibn Mas'ud
'Umar
His son 'Abdullah ibn 'Umar
as a statement of ibn 'Abbas

Among the Tabi'yn:

A-Sha'aby.
Ibraheem an-Nakha'iy
Khaythama
Qays
ibn abi Layla
Al-Aswad ibn Yazid an-Nakha'iy
'Alqamah
abu Ishaaq

As for the report which is an Athar on 'umar ibn al-Khattab () it says:

2454 - حدثنا يحيى بن آدم، عن حسن بن عياش، عن عبد الملك بن أبجر، عن الزبير بن عدي، عن إبراهيم، عن الأسود، قال: «صليت مع عمر، فلم يرفع يديه في شيء من صلاته إلا حين افتتح الصلاة» (Source)
I prayed with Omar, and he did not raise his hands in any of his prayer except when he opened the prayer.

Let's check the narrator chain:

Yahya ibn Adam يحيى بن آدم: Is declared as trustworthy by scholars, such as Yahya ibn Ma'yn, abu Dawod, abu Hatim and an-Nasa-i however he did report some manakeer (one of them even with a trustworthy chain of narrator as a-Dahhabi mentioned in his siyar a'alaam an-Nubala' سير أعلام النبلاء) His hadith can be found in both Sahihs and elsewhere.
Hasan ibn 'Ayyash حسن بن عياش is the brother of abu Bakr ibn 'Ayyash the qari' of 'Assim, and both were declared as trustworthy by ibn Ma'yn. His haidth appears in Sahih Muslim and other sources.
'Abd al-Malik ibn Abjar عبد الملك بن أبجر is regarded as a good narrator by ibn Ma'yn, ibn Hibban quoted him among the trustworthy (in his book at-Thiqaat الثقات) and imam Muslim reported two ahadith of his narration according al-Khateeb al-Baghdadi in his Tareekh Baghdad, a simple search on sunnah.com gave me at least 6 ahadith in Sahih Muslim.
Az-Zubayr ibn 'Ady الزبير بن عدي was declared trustworthy by Ahamd ibn Hanbal and al-'Ijly. He was a direct student of Ibraheem an-Nakha'iy and his hadith appears in both Sahih's. He directly narrated from Anas ibn Malik too.
Ibraheem (an-Nakha'iy) إبراهيم النخعي Yayha ibn Ma'yn said he would accept his maraseel. He met a lot of sahabah, but didn't record any ahadith from them without intermediate. And he learnt qira'a and reported from his maternal uncle al-Aswad.
Al-Aswad (ibn Yazeed an-Nakha'iy) الأسود بن يزيد النخعي a tabi'y who was born during the prophet's lifetime and who was a student of ibn Mas'ud's qira'a and he is regarded as a source of knowledge in al-Kufa and as trustworthy by scholars such as Ahmad ibn Hanbal, Yahya ibn Ma'yn, ibn Sa'ad and his hadith appears in the six sahih books.

So as you see the narrator chain of this Athar is of a high standard.

What is the authenticity of the athar about Umar not doing Raf’ al-Yadayn in prayer?


bitcoin payment processing, using bitcoin uri

Question: I am interested in processing bitcoin payments in my application.
I read about bitcoin uri, but its unclear to me how to match the payment transaction to a specific 'user id' in my application?
Is it possible to include the 'user id' on the tx? is it recommended?
Answer: You should manage this in your app by generating a new bitcoin address for each payment from each customer, so that if BTC is received on a specific address, you know what it is for. This keeps specific transaction data private internally in your application rather than public on the blockchain too.