Where to put css media queries in a CSS file?

Question: Where to put CSS media queries?
Each after the related element class style or pack them at the bottom of the CSS files?
which one is standard? or which one do you prefer?
Comment: Clearly late to the party, but here's my two cents. Group lots of similar properties like absolutes Elements
1200 media query992 media query768 media queryetc I wrote a document w/ 4500 lines. Very clean. Each block in alphabetical order. Whoever opens the doc will most likely see your system.
Answer: I found this source helpful in answering this question. CSS Declaration Order. When reading this link it talks about the order in which CSS code is placed.
"Related property declarations should be grouped together in the following order:
<code>Positioning
Box model
Typographic
Visual"
</code>
As for your question, it talks about media query placement having to say this about it, "Place media queries as close to their relevant rule sets whenever possible. Don't bundle them all in a separate stylesheet or at the end of the document. Doing so only makes it easier for folks to miss them in the future. Here's a typical setup."
All this information can from this man's website linked above:  Mark Otto
@mdo Director of Design at GitHub. Creator of Bootstrap. Previously at Twitter.
This helped in giving me some sort of place to start as far as CSS code organization.
Answer: It mostly depends on your project because at the end of the day it is all about maintenance and adding more stuff to it easily.
So, if you are working on a project which only has a few media queries I would suggest leaving them all in one stylesheet but putting comments on top of it to make it explicit and also easier for you to find it later.
However, if you know you are going to have a lot of properties meticulously defined in your media queries and also have various devices defined then I would suggest separating them out just for readability/maintenance reasons.
Answer:
Put all media queries in a block at the very end so they will override
  the relevant style further up the sheet.

When you started designing, you generally started doing it for one device of known specifications. So you design it according to you current device and then apply it for other screen sizes.
Hence the order goes like this: Make complete design --> Add the media query at the bottom.


What is the difference between BERT architecture and vanilla Transformer architecture

Question: I'm doing some research for the summarization task and found out BERT is derived from the Transformer model. In every blog about BERT that I have read, they focus on explaining what is a bidirectional encoder, So, I think this is what made BERT different from the vanilla Transformer model. But as far as I know, the Transformer reads the entire sequence of words at once, therefore it is considered bidirectional too. Can someone point out what I'm missing?
Answer: The name provides a clue. BERT (Bidirectional Encoder Representations from Transformers): So basically BERT = Transformer Minus the Decoder
BERT ends with the final representation of the words after the encoder is done processing it.
In Transformer, the above is used in the decoder. That piece of architecture is not there in BERT
Comment: Thank you for pointing that out
Answer: BERT (Bidirectional Encoder Representations from Transformers) is a deep learning model that was developed by Google in 2018. It is based on the Transformer architecture, which was introduced in the same year in the paper "Attention Is All You Need".
The main difference between BERT and the vanilla Transformer architecture is that BERT is a bidirectional model, while the Transformer is a unidirectional model. This means that BERT processes the input text in both forward and backward directions, allowing it to capture contextual information from both the left and right sides of a word. By contrast, the Transformer processes the input text in only one direction, from left to right or right to left.
Another key difference between BERT and the Transformer is that BERT is trained using a specific type of self-supervised learning called "masked language modeling". This involves masking a portion of the input text and then training the model to predict the masked tokens based on the context provided by the unmasked tokens. This allows BERT to learn general-purpose representations of language that can be fine-tuned for a wide range of tasks.
In summary, BERT is a bidirectional version of the Transformer architecture that is trained using masked language modeling, and is designed to learn general-purpose representations of language.


Practice Assignment for Clone tool in Photoshop

Question: I have been looking around on Google for practice photos for the clone tool, but haven't found any good so far. The thing is that I am taking a paid course for Photoshop, and I have missed a couple of classes and now my instructor is angry at me for not being fluent with the clone tool. I'm new, so any kind of help is hugely appreciated!
Answer: Try Mac Desktops. The link goes to the "Landscapes — Nature" category. Find something with lots of trees. Clone more of them.
If those don't inspire you, browse through the category links at the bottom of the page. There are thousands of images at the site; something will work.
Answer: Ask your instructor to explain it again or to recreate a practice session for you ,you are paying him for something he cant get away till u don't understand or practice the things properly,ask him 10 times 20 times just don't afraid of anything go ahead....
For your practice i rounded up some tutorials, you can work on there images too :

We-r-here
How to Use the Photoshop Clone Stamp Tool
Clone Stamp Tool
The Ultimate Guide To Cloning In Photoshop
Photoshop Clone Stamp

Hope this will help....
Comment: I don't think she's asking for help with using the tool; she's asking for images to practice on. She got the lesson. She needs source material for homework. That's how I read it.
Comment: ummm cud be my mistake but my answer cover any kind of help parameter only :D and in given links there are good photos to practice with.......


Cocoa powder stays stuck at the bottom of the cup

Question: I am trying to make a warm drink using cocoa without much additions.
Basically I boil water and the slowly add it to a cup with cocoa powder while I stir. I also add some cold milk.
When I stir with a spoon, I see that it becomes sticky and liquid and looks like butter melted.
The problem is that when I fill the cup with boiling water and some cold mild and start drinking it, in the end most of the cocoa powder have stayed stuck at the bottom of the cup.
How can I make it so that it is completely dissolved but only using water and a bit of milk?
Please note, that I don't have a microwave
Comment: Are you using 100% cocoa powder, or a pre-packaged hot cocoa mix (which contains sweetener, and other additives like powdered milk and emulsifiers which allow the "just add water" instructions)?
Comment: @AMtwo: Yes 100$ cocoa powder
Answer: Cocoa powder does not dissolve in liquid, it prefers fatty liquids like milk.
You need to create a liquid think enough so that the cocoa particles stay suspended in it.
Answer: Mix your cocoa powder with your cold milk before adding the hot liquid, while stiring.
That way most of the cocoa powder should get into the drink.
But water, cocoa powder and a little milk will not make a normal chocolate drink, for that you need sugar, or a replacement, and a lot more fat, like milk instead of water.
Your recipe would work with chocolate drink powder "just add water".
Comment: Does it matter if the milk is skimmed/low fat?
Comment: We used to use coffee creamer (so very fatty 'milk') as the starter, with sugar added. Chocolate to eat is rather fatty, so making a fat free or almost far free drink does not seem to fit.


Extjs3 Charts with a dynamic store

Question: I'm using this ExtJS 3.4 charts exemple: http://extjs.cachefly.net/ext-3.4.0/examples/chart/charts.html (the third one)
I wanna use a store that return values from php instead of a static store like in this exemple.
I hope that my question is clear and thanks for helping me
Answer: You are way to unprecise. What PHP-Framework do you want to use? From where are you loading the data?
Depending on your Framework you will need to use different solutions. For plain PHP there are examples provided by Sencha. For CakePHP you want to take a look into http://banchaproject.org, for Symfony there is http://www.symfony-project.org/plugins/dsExtDirectPlugin, ....
Also use ExtJS 4!

Extjs3 Charts with a dynamic store


Why no SPAM on SE?

Question: I guess this is more of a general StackExchange question... For many years, MathGroup has been an excellent resource to ask the kind of questions that now can be asked on this site. However, MathGroup has been a moderated group, leading to a ~1 day delay between questions and answers. The reason given for that has always been (and I believe it!) that this procedure is in place in order to avoid spam. So my question is: Why is there no spam on SE?
Answer: The main reason is that the community itself takes responsibility to identify spam and flag it for a moderator to clean up.
This answer from the meta site on StackOverflow explains more.
This other question was closed as a duplicate but has some useful additional information.
In the unlikely event that you do see some spam, you can click the "flag" link under every post.
If you aren't sure, you can always ask about it here on the meta site.
Comment: Thank you! In particular the links you provided were quite informative!!!
Answer: SE sites do get spam; there is however a system in place where if a post is marked as spam by five users, the post is automatically removed.
Answer: Flagging and closing, if found to be helpful by the moderators, contributes to your flag weight. The current value of this quantity is listed in your profile (not sure about new users and beta). The more flag weight you have the more flags of yours draw the attention of the moderators.
A number of badges you may get is connected to this flagging activity, so there are quite a lot of people actively looking for posts to flag (check the Review link in the top of your screen to find suggestions for reviewing). Most spam posts are deleted within minutes this way.
Comment: [Flag weight](http://meta.stackexchange.com/q/119715/151611) went away, it is now just accumulated helpful flags.
Comment: One wonders how many viable (non-spam, that is) posts are lost to overactive flagging. Getting rid of flag weight is probably a good step toward removing this incentive.
Comment: @DanielLichtblau A typical detection theory, false alarm vs. misses, issue. If you don't want genuine posts to be flagged too soon than you need to be soft on spam and vice versa.
Comment: @Sjoerd C. de Vries Understood. My only point was that adding a points incentive to flagging might be counterproductive. Getting rid of spam is good motivation in and of itself, whereas giving people a reason to be overly zealous about it might cause trouble.
Comment: @daniel Well, there used to be a check built-in into the system. If you flagged wrongly it would cost you considerable flag weight. You really had to take care. Especially in the last 50 or so of the 750 points (in the old system) each accepted flag gave you something like .1 point but every rejected flag would cost you 10 points, So 100 times as much. That really hurts. I don't know if they are doing something similar in the new system where they are only counting the number of helpful flags.
Comment: @SjoerdC.deVries: my understanding is that flag weight, or something very much like it, is still used internally to prioritize and weight the flags; flag weight just "went away" in the sense that it's no longer used as the user-visible measure of how good you are at flagging things.
Comment: @DanielLichtblau: Flag weight and the badges that went with it only incentivized flagging that moderators or perhaps sufficiently many other users agreed was correct and disincentivized flagging that the moderators or community disagreed with.
Comment: @Sjoerd C. de Vries Okay, I guess that sort of disincentive for malicious flagging was probably more than adequate to meet my concern. Your remark "so there are quite a lot of people actively looking for posts to flag" had me a bit concerned. As long as there is a check on the exuberance of erstwhile flaggers, I guess not much harm is done.

Why no SPAM on SE?


Showing an operator is essentially self-adjoint

Question:
I have a question about checking if an operator is essentially self-adjoint. Given the operator $$H=-\frac{1}{2}\partial^2_{r}-\frac{1}{r}\partial_r$$
with domain $C^{\infty}_0((0,\infty))$ (i.e. smooth functions with compact support on $(0,\infty)$) on the Hilbert space $L^2([0,\infty))$ with the scalar product $$<\psi,\phi>=\int_{0}^{\infty}\overline{\psi(r)}\phi(r)r^2dr,$$
I wish to find if the operator is essentially self-adjoint. It is straight forward to check if the operatory is symmetric; I just applied integration by parts a couple of times then used the fact that we have compact support to make the boundary terms disappear.
When it comes to checking the operator to see if it is essentially self-adjoint, I'm unsure exactly what to check. My first thought was to see if $ker(H^*\pm i)=\{0\}$, but I got some weird solutions and wasn't sure about the domain of $H^*$. Any help pointing me in the right direction would be appreciated!
Answer: Consider the formal differential operator (i.e., has no specific domain):
$$
    L= -\frac{1}{2r^{2}}\partial_{r}r^{2}\partial_{r}
     = -\frac{1}{2}\partial_{r}^{2}-\frac{1}{r}\partial_{r}.
$$
The solutions of $L\psi=0$ are easily derived:
$$
                 \psi = C\frac{1}{r}+D.
$$
Neither of these solutions is square-integrable at $\infty$ with respect to the weighted inner product you have defined. There are no possible conditions at $\infty$. However, both solutions are square integrable at $0$, which means that there are two endpoint conditions at $r=0$, and, therefore, one endpoint condition must be imposed in order to obtain a selfadjoint operator. But setting both to $0$ will not lead to a selfadjoint operator, and the domain you have chosen is one where both have been set to $0$. So, no, your operator is not essentially selfadjoint.
You obtain an essentially selfadjoint operator $H_{1}$ by adding to the domain of $H$ any $C^{\infty}$ function which vanishes identically for large $r$ and which is identically $1$ near $0$. This is the correct operator to do Physics. The alternative is to add some $C^{\infty}$ function which vanishes identically for large $r$ and which equals a linear combination of $1/r$ and $1$ near $0$ to the domain instead, which is not desirable if $1/r$ has a non-zero multiplier.
Added: I have a little more time now to explain further. Let $L_{0}$ be $L$ acting on the domain $C_{0}^{\infty}(0,\infty)$. That is $\mathcal{D}(L_{0})=C_{0}^{\infty}(0,\infty)$ consists of infinitely differentiable functions which vanish outside a compact subset of $(0,\infty)$. Then $L_{0}$ is densely-defined and symmetric, which means it is also closable to an operator $L_{min}$ on some domain $\mathcal{D}(L_{min})$. I have labeled this 'min' because one normally refers to $L_{min}$ as the minimal operator. What I'll show you is that $L_{min}^{\star} \ne L_{min}$ which means that $L_{0}$ cannot be essentially selfadjoint. The operator $L_{min}$ is a closed linear operator, and it remains symmetric on its domain.
The standard tool for dealing with operators of this type on the weighted space $L^{2}_{r^{2}}[0,\infty)$ with inner product $(f,g)_{r^{2}}=\int_{0}^{\infty}r^{2}f(r)\overline{g(r)}\,dr$ is the Lagrange identity
$$
 r^{2}\{ (Lf)\overline{g}-f(L\overline{g})\}
    = \frac{d}{dr}\{ r^{2}(f\overline{g}'-f'\overline{g})\}
$$
Let $L_{max}$ be $L$ defined on the domain $\mathcal{D}(L_{max})$ of twice absolutely continuous functions $f \in L^{2}_{r^{2}}[0,\infty)$ with $Lf \in L^{2}_{r^{2}}[0,\infty)$. Then
$$
   \left.(L_{max}f,g)_{r^{2}}-(f,L_{max}g)_{r^{2}} = r^{2}(f\overline{g}'-f'\overline{g})\right.|_{0}^{\infty}.
$$
The evaluation limits on the right are guaranteed to exist for all $f,g \in\mathcal{D}(L_{max})$ because the integrals on the left are absolutely convergent. Using this identity, one can show that
$$
    (L_{min}f,g)=(f,L_{max}g),\;\;\; f\in\mathcal{D}(L_{min}),g\in\mathcal{D}(L_{max}).
$$
This is done in two steps: First show the above for $f\in\mathcal{D}(L_{0})$, and then use the fact that the graph of $L_{0}$ is dense in the graph of $L_{min}$. In the language of graph inclusion, the above yields
$$
                            L_{min} \preceq L_{max} \preceq L_{min}^{\star}
$$
That is to say that every $f \in \mathcal{D}(L_{max})$ is also in $\mathcal{D}(L_{min}^{\star})$ and $L_{min}^{\star}f=L_{max}f$. Actually, one can show that $L_{min}^{\star}=L_{max}$, but that fact is not so easy to prove, and it is not needed here.
In order to show that $L_{min}^{\star} \ne L_{min}$, it is enough to show that $L_{min}^{\star}$ is not symmetric on its domain. And this I'll do by showing that $L_{max}$ is not symmetric on its domain. To do this, let $k$ be a $C^{\infty}$ function on $[0,\infty)$ which is identically $1$ near $0$ and identically $0$ for large $r$. Then $l(r)=\frac{k(r)}{r}$ is in $\mathcal{D}(L_{max})$: it is easy to check that $l \in L^{2}_{r^{2}}$, and $Ll =0$ for all $r$ near $0$, and for all large $r$. So $Ll \in L^{2}_{r^{2}}$, which means $l \in \mathcal{D}(L_{max})$. Similarly, $k\in \mathcal{D}(L_{max})$. However,
$$
         (Lk,l)_{r^{2}}-(k,Ll)_{r^{2}}=r^{2}(kl'-k'l)|_{0}^{\infty}=-r^{2}(kl'-k'l)|_{0}=-r^{2}l'|_{r=0}=1.
$$
Therefore $(L_{max}k,l)\ne (k,L_{max}l)$.
Comment: Thank you for your response! Is it just enough to say that none of the solutions are square-integrable at $\infty$? It seems like it would be, because no matter what extension you try you're not going to get a square-integrable function, so there's no self adjoint extension possible. Is that right?
Comment: Because none of the solutions of $L\psi=0$ are square-integrable at $\infty$ with respect to the weighted inner-product, then the equation is forced to be the limit point case at $\infty$, which means there are no endpoint conditions which can be specified at $\infty$. However, because both independent solutions of $L\psi=0$ are square-integrable at $0$ in the weighted norm, then there are two continuous endpoint boundary functionals at $0$, and that means one endpoint condition must be imposed on the unrestricted domain or, equivalently, a function must be added to your domain to get s.a..
Comment: @TinaBelcher : The condition needed at $r=0$ is somewhat artificial as it arises because you start with a domain of functions which vanish near $0$. So the adjoint domain includes all twice absolutely continuous $f \in L^{2}_{r^{2}}$ for which $Lf \in L^{2}_{r^{2}}$. That means the adjoint domain includes functions which are $1/r$ identically near $0$, as well as functions which are identically constant near $r=0$. If you had started with function that could be constant near $0$, then the adjoint domain would not have included things which are $1/r$ near $0$; that would be essentially s.a..
Comment: @TinaBelcher : After giving you the intuition, I supplied all of the details to show you how this machinery works. Look for the "Added" section in the answer. I show you directly that the closure of your operator cannot be selfadjoint because the adjoint of your operator is not symmetric.
Comment: Wow, thank you very much! It's all very clear and I understand it. That's fantastic.
Comment: @TinaBelcher : You're welcome.


Smart cards and firewalls are what type of access control?

Question: Specifically for the CISSP, trying to figure out what type of access control these would be considered.
Answer: Short answer: Both smart cards and firewalls would be considered technical access controls.
There are three types of access control as defined by ISC2, technical, administrative, and physical. Physical includes badge readers, physical locks, etc. Administrative would be policies or procedures about access. Technical includes hardware or software systems which provide access control.
Answer: The above is correct, but my understanding is that they could also could be considered a physical control.  "If you can hit your head on it, or drop it on your foot, it's a physical control".  If you have an actual rack mounted firewall, for example, that device is a physical control.  The software inside would be a technical control.


How to determine minimal wall thickness for a rectangular pressure vessel?

Question: I know this is a basic question but google only gives formulas for more "rounded" shapes. How to calculate the minimal thickness for a flat wall knowing tensile strength of the material and the maximum pressure difference between two sides?
Comment: What is your intended max pressure?
Comment: This is good example of a situation where if you have to ask the question you shouldn't be doing it. Pressure vessels can be very dangerous if you are storing gasses. You should not use high strength materials as they tend toward brittle fracture vs. ductile fracture.
Comment: Why can't we consider a problem based on it's technical problem solving merits instead of calling out the chicken little safety cops? You don't learn anything by hid
ing behind mom's safety apron and assuming all problems must be risk free.
Answer: The reason that you can't find anything on Google is that it is a bad idea to make a rectangular pressure vessel. You get stress concentrations at the corners which makes the vessel much weaker. This is bad because when pressure vessels fail, they release a huge amount of energy very suddenly. It only takes a little googling to find examples of fatalities due to pressure vessel failures. Pressure vessel design should not be attempted by inexperienced people. Hire a professional or just buy one off the shelf.
Comment: If I could up vote this more than once I would.
Answer: There are two ways to deal with this question and both have to do with the deflection of plates (sides and top and bottom of the container) under the pressure load. The first alternative is to demand small deflection,1/2t, the second is allowing for large deflections say up to 20t to save on the material.
In your case, the supports are the corners of the container and the can be approximated as a simple support.
These have discussion and formulas among other references in Roark's Formulas
for Stress and Strain
WARREN C. YOUNG
RICHARD G. BUDYNAS
Seventh Edition
McGraw-Hill pp 451 through 473. 11.10 Bending of Uniform-Thickness Plates with
Straight Boundaries.
I quote the intro into the rectangular plates, but you got to search through the text to find your case.

In Ref. 35 experimentally determined deflections are given and
  compared with those predicted by theory. In Ref. 74 a numerical
  solution for uniformly loaded rectangular plates with simply
  supported edges is discussed, and the results for a square plate are
  compared with previous approximate solutions. Graphs are presented
  to show how stresses and deflections vary across a square plate.
  Chia in Ref. 91 includes a chapter on moderately large deflections of
  isotropic rectangular plates. Not only are the derivations presented
  but the results of most cases are presented in the form of graphs
  usable for engineering calculations. Cases of initially deflected plates
  are included, and the comprehensive list of references is useful.
  Aalami and Williams in Ref. 92 present 42 tables of large-deflection
  reduction coefficients over a range of length ratios a=b and for a
  variety—three bending and four membrane—of symmetric and
  nonsymmetric boundary conditions. Loadings include overall uniform
  and linearly varying pressures as well as pressures over limited areas
  centered on the plates.
Comment: While this is a reasonable approach for the deflection in the center of the plate, it does not address the stress at the corners, which is going to be the hardest location to analyze and the most likely point of failure.
Comment: @DanielK, stress on the corners depends on the material and manufacturing method. If the container is plastic the corners do not have any residual stress from rolling or welding and the stresses are less than membrane and plane moment at the center of each face. unless the containers are banged around. the same book has guidelines for handling those and faces with holes, etc. and also FEM software can analyze the stresses. I have used 3' by 3' cubic containers of water, sand, or other construction materials. Some with protective wire mesh cage some without. they are convenient for Jobsite.
Comment: Well that's fine for a box of sand but the OP asked about a *pressure vessel *. A box of sand won't hurt anyone if it fails but a pressure vessel might take out an eye or even kill someone if it fails. You have to hold those things to a very high standard.


disable enable unobtrusive validation mvc

Question: I have a wizard which contains a very large form.  The wizard has an area where the user chooses one of two options which shows and hides a div with other input elements.  The problem is that the hidden elements are being validated and i need to turn validation off on those certain elements.
I've tried:
$('.data-panel').find('input[type="text"], textarea, select').attr('disabled', 'disabled');
as state in this thread, but it will still validate those input elements.
MVC3 unobtrusive validation: how to remove/re-attach validation from a group of elements?
I thought about injecting/remove a partial view, but those elements won't validate when they need to be validated.
I'm opening for any work arounds.
Thanks!
Answer: To disable:
<code>$('.data-panel').find('input[type="text"], textarea, select').prop('disabled', true);
</code>
To enable:
<code>$('.data-panel').find('input[type="text"], textarea, select').prop('disabled', false);
</code>


Is it okay to put house wrap over the top of pre-existing foam insulation?

Question: We are removing vinyl siding from our house and replacing it with a cement-type product. Is it necessary to remove the vinyl siding's foam insulation  before applying the house wrap?
Comment: Are you sure you don't have housewrap under the foam for the siding?
Answer: Cement lap siding is extremely durable compared to vinyl. Good move!
By "foam", I assume you mean polystyrene foam board. I would not remove the foam, since it increases the insulation in your house, and reduces both heating and cooling bills. But a "water resistive barrier" (house wrap) is required under cement boards. So if your house doesn't already have one under the foam board, you must install one.
Cement board is OK to install directly over foam board up to 1" thick. If yours is thicker, you need to install furring strips over the foam board, or remove/replace it.
More installation requirements for one brand of cement board (don't know if you're using this brand, but other brands surely have installation requirements available either online or in print) are available here:
http://www.jameshardie.com/d2w/installation/hardieplank-hz5-ca-en.pdf


On Pixel 5 phones, how to re-order home screen pages?

Question: On Pixel 5 phones, how to re-order home screen pages? For example, my home screen have 5 pages, and I want to swap the 4th page and 3rd page. How to do it? My Pixel 5 phone is using the default system softwares if that matters.
Answer: not sure if Pixel phones are different functionally from Samsungs, but holding your finger on a blank place on your screen should make the entire page movable, allowing you to insert it wherever you want between other pages of apps


systemd service causes sudo crash

Question: I installed opensnitch as a service, so it automatically runs on system startup.
I then changed my mind and deleted the .service file, but have forgotten to disable the service before deletion. Now On every system startup my sudo crashes cause it still tries to run the service with this line sudo -HE opensnitchd
How can I deactivate it, the .service file is gone.
Answer: Her is my solution
sudo systemctl reset-failed

systemd service causes sudo crash


What font is used on the cover of Boosey & Hawkes pocket scores?

Question: I have consulted WhatTheFont!, Identifont, and FindMyFont, with pretty abysmal results. I would like to identify the font in the image below:

This is the cover of a pocket-sized orchestral study score, printed probably sometime between 1967 (the date of the copyright) and 1984 (date of purchase of this particular score). Boosey & Hawkes is a London publisher of study scores and other music.
Comment: That A-V kerning is beyond horrible.
Answer: The english entry for Gill Sans on Wikipedia reveals some more information on the mysterious Q. It seems that both variants were used in different sizes of the historic metal-type version, at least for this specific Title variant.

An American metal-type specimen sheet of "Gill Title". Note the original "5", "7", "0", and "Q" in some sizes, which were dropped in many later metal type issues and digital versions, and a non-descending "J".
Answer: On just a little bit of further research (a Google Image search on "sans serif Q with curly"), I can say with an amateur's confidence that this appears to be Gill Sans, though I've no idea what that modified Q tail means. Any enlightenment (or correction, if I'm wrong) appreciated.
Comment: That "Q" does not appear neither in variants, listed here https://www.myfonts.com/fonts/mti/gill-sans/
Comment: @Mattia it does in the "shadowed" version https://www.myfonts.com/fonts/adobe/gill-sans/light-shadowed/glyphs.html
Answer: It's Gill Sans with an alternative 'Q'. The current Gill Sans Nova digitisation does include it.
That style of 'Q' was very normal in the nineteenth century, like on Century Schoolbook, and the metal type version of Gill Sans included it (and many other alternate characters) which were available by special order. Here it is in the introductory specimen along with an alternate R and J as well, but that sample still does show the normal Q we're used to as well. It might have been done to give printers a 'Q' that doesn't drop below the baseline at all if they wanted to give lines of capitals a more linear effect, like with the alternative 'J'.


Royal Frost Birch Leaves

Question: I planted a new clump about two weeks ago.  The leaves were green and the new growth is coming out crimson and staying that color, but the existing green leaves are still staying green.  I can see the veins turning a little purple, but not much else.  Will these existing leaves ever turn crimson with the additional sun exposure?
Answer: They might, they might not. All the newly arriving leaves should be burgundy, but remember that this colour fades down in late summer and turns to orange/red or yellow at leaf fall. When it leafs up again next year, hopefully all the foliage will be burgundy.

Royal Frost Birch Leaves


IOS Facebook apprequests, without using the Facebook dialog

Question: I am user to user apprequests using:
<code>[facebook dialog:@"apprequests" andParams:params andDelegate:self];
</code>
This is working, however I would like to work around the Facebook dialog to display a custom view, and send a NSURLRequest with the access token, uids and other parameters embedded in the request.
I have been trying to debug the sdk to what is sent with the request, but as it is send via the UIWebView, I cannot debug it.
I also tried to use a web proxy debugger "Charles" to see the http call request, but it is encrypted, and if I work around that by requesting from @"http://m.facebook.com/dialog/" instead of https, I get the following JSON response.

{"error":{"message":"You must use https:// when passing an access
  token","type":"OAuthException","code":1}}

Is there a way to directly send app request without using the dialog?
Answer:
Is there a way to directly send app request without using the dialog?

Only app-to-user-requests, and these work only if the target user is already connected to your app.
Comment: Yes, I am trying to make app-to-user-requests. But have not found a suitable method or example in the SDK or elsewhere.


Can melacha be done to hear the Hakhel on Shabbat

Question: According to Halacha, types  of melacha which were necessary for the temple were permitted to be performed on Shabbat for the purpose of the Korban sacrifice and the temple operations. My question is, when the Mitvzah of Hakhel is in effect, can melachot be performed to hear the Hakhel reading from the king?
Answer: If Haqhel day was to fall on Shabbat it was pushed off to the next day since the extra things involved do not override Shabbat (Rambam Chagiga 3:7).


What physics background is necessary for pursuing a PhD in Mathematical Physics?

Question: If I wanted to do research related to the topology and geometry of space or their applications in quantum mechanics or general relativity, would it be possible to do that from a Mathematician's POV without the upper level undergad physics typically required?
Answer: Check the website of the program you're interested in. Here's an example.

Basic preparation should include courses in advanced calculus, linear algebra, modern algebra, complex variables, classical mechanics, electromagnetism, quantum mechanics, modern physics, thermodynamics, and statistical mechanics. Knowledge of the following fields is desirable: real analysis, differential equations, probability, topology, differential geometry, and functional analysis.

This makes it sound like you should be OK, but my judgement is not useful; you need to convince the admissions committee.
Answer: For

topology and geometry of space or their applications in quantum mechanics or general relativity

one needs to have a good understanding of tensor algebra, typically used in General Relativity (GR) courses. So if you want to study different topologies of space-time and its implications on GR, then you need to be able to perform matrix and tensor algebra elegantly :)
Research on this can be done from two perspectives - (a) mathematically, identifying the space-time behaviour e.g. conformal field theory, and (b) with a somewhat more physical approach, but that can be in so many different ways that it is peculiar to each project. There is always a non-zero overlap between these two approaches in this research area.
Also, since each programme is unique, they usually will mention the specific courses/skills required to have been taken before they accept the candidates into the project. If that is not mentioned, asking it in the PhD interview is recommended.
Hope this helps.
Comment: I'm not trying to be pedantic, but genuinely curious: when you say that there is a "non-zero overlap", is it merely a pleonasm (because overlap itself should indicate that it's non-zero) or is there some obscure field of mathematics/physics that has this weird cases that trained your mind to be specifically say when there is a non-zero overlap, in order to differentiate from those weird cases?
Comment: That's a nice comment @cinico, I think what I want to highlight here is the significant overlap between mathematics and physics, often hard to differentiate which is which and depends on perspective, compared to some other fields of physics where there is substantial use of mathematics but can't be classified as pure mathematics research.


Return multiple values in Django Class-based View

Question: I am working on a project for a Django course I am taking but currently struggling a bit with views.
In the project I created a View using ListView to display a list of products in my template. By using query_set I am able to get all the objects and return them to display all the products and their attributes in the template by using a for loop.
In the same query_set, I tried returning another variable that contains the total items in stock to display this data in the template as well, however, as soon as I add this variable to the return the template no longer receives the returned values.
This is the code I tried to return both values:
class ShopListing(ListView):
    template_name = "webshop/shop_listing.html"
    context_object_name = 'shop_listing'

    def get_queryset(self):
        #Get all products
        products = Product.objects.all()
        total_stock = products.aggregate(sum=Sum('stock'))['sum']
        return products, total_stock

In my template I added the value 'total_stock' as shown below but I get nothing, and even the values from 'products' stop working:

{{total_stock}} items are currently available

If I remove 'total_stock' from the return everything goes back to normal.
If I print "total_stock" I can see the right value in the logs, but this cannot be used in my template so I wonder what is the right way to do this.
Will appreciate any guidance.
Answer: I suspect this is because of the machinery behind get_queryset(). By returning an additional value, you're actually returning a tuple to the view class methods that internally call get_queryset(). You can take a look at the Django source code for ListView and its related classes to see how they work with models and template context variables behind the scenes.
Given your description, however, I think you want to extend the get_context_data() method instead:
class ShopListing(ListView):
    template_name = "webshop/shop_listing.html"
    context_object_name = 'shop_listing'
    queryset = Product.objects.all()

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context['total_stock'] = Product.objects.aggregate(sum=Sum('stock'))['sum']
        return context

'total_stock' should be available as a template variable, along with the intended QuerySet.


Pressure Exerted by Piston on Gas

Question: I'm currently doing a lab where we are measuring the work done by weights on a gas, where the weights are added on top of a piston. Now, what I don't understand is that work is equal to net force times distance. Therefore, if I were to draw a free body diagram of the piston, it has its own weight, the force due to the weights, and the force due to the atmospheric pressure all going down. The force going up is gas pressure, which is equal to all of those other three forces combined. Now, if I were to add some more weights, the net force at that point would solely be the added weights going down, so work should then equal added weights times the distance the piston moved down. But what my lab answer booklet says is work is equal to the weight of the piston and weights and force due to atmospheric pressure. But why? That's not the net force acting on the piston. I'm so confused as to how work is equal to the entire force acting down without subtracting the force acting up from the gas. Please help.
Answer: Your lab booklet is calculating the work done on the gas, whereas you are trying to calculate the work done on the piston. The pressure of the gas is not part of the calculation of the work done on the gas because the gas cannot do work on itself.

Pressure Exerted by Piston on Gas


Puerto Rico's political parties and statehood

Question: What would happen to Puerto Rico's political parties if it became the 51st state?  Is there any historical precedent for what happens?
Comment: Political parties are private organizations. So, officially/legally, nothing will happen (in practice, they may naturally change/get created/disappear as the issues facing the population will change. E.g. every member of one party may quit and join newly formed PR state Libertarian party that will form and win all elections on "free tokes for everyone" platform).
Comment: We can't really predict what happens in the future. As for past precedents, it won't exactly be relevant since it's been quite a while since Alaska and Hawaii were admitted into the Union in 1959 and each territory's politics differ.
Answer: They would almost certainly fold into the national parties. It would be very difficult to remain independent once national politics come into play.
Puerto Rico would gain a House seat and two Senators. Candidates would take major party funding to campaign (thus assuring they caucus with that party). Those politicians would likely then draw their political party counterparts to the national parties (which already closely mirror mainland US parties), where political funding and organization would be far more than local politics would raise. On the local level some PR parties would remain, but it would be harder for them not to nationalize against opponents who have already done so.
Comment: Iowa and Puerto Rico have a similar population at 3 million and Iowa has 4 representatives.  I would assume Puerto Rico would likely get 4 too.


Hadoop: error connecting to server, ipc.hbaserpc: 60020

Question: "ipc.hbaserpc problem connecting to server 60020"
I have used Hadoop framework where I have one master device and several slave devices. My framework was working fine but this morning, I suddenly found that I am getting this error" and hadoop is not working.
I checked the ip of master, it hasn't changed.
**netstat -nlpt | grep 60020**
tcp6       0      0 172.17.13.29:60020      :::*                    LISTEN      2766/java

vi /etc/hosts

127.0.0.1       localhost
172.17.13.29    master
172.17.13.18    slave
127.0.1.1       bt.foo.org      bt

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

vi /root/hbase/conf/regionservers

master
slave

~
~
~
~

Please guide me in the right direction as to where the problem might lie.
Here is the Complete Error Message as I see it:
root@master:~/hbase/bin# ./hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.94.6, r1456690, Thu Mar 14 16:32:05 PDT 2013

hbase(main):001:0> get 'profile', 'pranshu'
COLUMN                CELL
13/04/22 10:05:04 INFO ipc.HBaseRPC: Problem connecting to server: master/172.17.13.29:60020
13/04/22 10:06:06 INFO ipc.HBaseRPC: Problem connecting to server: master/172.17.13.29:60020

Answer: Comment out the line "127.0.1.1       bt.foo.org      bt" from the /etc/hosts file on all the machines and give it a retry.And it's always better to provide the complete error log.
Comment: Commented it out and retried, not working though. Anything else you suggest?
Comment: That would be possible for me only after having a look at your logs.


Is it alright to combine Profile and Settings?

Question: What do you guys think? Is it alright to combine Profile and Settings in web application? This is quite common approach in mobile apps. Reason to combine these two is to keep the header simple. Not to overwhelm user with too many items.
Comment: How will you be communicating this in the menu?
Comment: I was thinking something similar as Facebook and Twitter does: display the user's image that opens a dropdown with Profile, Settings and Logout.
Answer: Use a generic "secondary actions" element, perhaps utilizing a 'user' icon or profile image, to reveal a categorized list of options
As you've mentioned in your comment below the question, large and presumably well-tested platforms like Facebook and Twitter use this approach.
On that point, my personal experience of the Facebook "gear" or "cog" icon, is that revealed dropdown seems overloaded and requires too much searching for what I need.
So just be mindful of that risk. Put careful thought into the order and categorization of your menu, and don't overload it.
Comment: Thank you for your comment. I will keep those things in mind. Luckily our dropdown won't contain much items. Btw, I noticed that Facebook now has an arrow down for the dropdown to settings etc... I think the arrow down icon is too ambiguous. As a user I would expect to see the gear-icon or my face to access these things.
Comment: @imakesoft as strange as it is, facebook is not the most user friendly website when it comes to things beyond posting and liking.
Answer: a) reasoning
These are two distinct categories and merging them can only cause inconvenience/ confusion. If this is the only way to win extra space, then go for it, but keep in mind that this is a compromise, not a solution, not even a workaround.
b) testing
Produce two prototypes - one with the merged icon and one with two icons and ask respondents to perform tasks such as changing the passwords, changing the display languages, etc. Watch in which case they tend to feel more comfortable.


Where do the gases such as hydrogen and helium end up after leaving the earths atmosphere?

Question: I've heard that gases like hydrogen and helium leak out of the earth's gravity a little by little.
but where are they going? where do they end up after leaving earth's pull?
would the sun pull them towards itself? or they just wander in space until they find another space object with some mass?
Comment: Related: https://physics.stackexchange.com/q/78586/123208
Answer: It takes a long time for hydrogen and helium to work their way to the outer reaches of Earth's atmosphere, millions of years. The outer layers of the atmosphere are the thermosphere and the exosphere. These layers are very tenuous, but the gas in them is still considered to be gravitationally bound to the Earth. The thermosphere begins about 80 km above sea level, the base of the exosphere ranges from about 500 to 1,000 km above sea level depending on solar activity. (The altitude of the ISS is 408 km).
When gases leave the exosphere they get swept up by the solar wind, a stream of charged particles released from the upper atmosphere of the Sun which blows through the solar system. This wind is very thin - in Earth terms it's a hard vacuum, but it is moving quickly.
The solar wind is observed to exist in two fundamental states, termed the slow solar wind and the fast solar wind. Near Earth, the slow solar wind has a speed of 300 - 500 km/s, and a temperature around 100,000 K, the fast solar wind has a typical speed of 750 km/s and a temperature around 800,000 K.
So our lost hydrogen and helium (and other gases) eventually get blown by the solar wind to the outer limits of the solar system, unless they happen to bump into a planet, moon, or asteroid in the mean time.
For more details on the exact mechanisms by which various gases escape Earth's atmosphere, please see Wikipedia's article on atmospheric escape.
Comment: Might be worth pointing out that the velocities you mention (hundreds of km/s) are way beyond the solar escape velocity of about 42 km/s. So those particles are headed for interstellar space...
Comment: @gerrit - There is a termination shock and heliopause (i.e., two electromagnetic boundaries) that greatly alter the dynamics of charged particles.  The solar wind reaches a roughly constant speed usually before even getting to Mercury.  Newly ionized particles, called pick-up ions, are accelerated up to the solar wind speed extremely fast (e.g., something like ~95 km $s^{-2}$ for protons near Earth).
Comment: thanks for the explanation! That cleared up how the gases are escaping in the first place. although I do wonder now where is this solar wind going? are the velocities which you've mentioned enough to send the gases out of our suns gravitation?
Comment: and what is the hard vacuum that you speaketh of? isn't vacuum empty? or is it made up of particles that we don't know yet?
Comment: cool! just out of curiosity do they escape the solar gravitation due to the radiation from a super nova?
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/107888/discussion-between-pm-2ring-and-kevin-godfrey).
Comment: @Oscar I did, in the chatroom. See https://chat.stackexchange.com/transcript/message/54347054#54347054
Comment: I wonder if Voyager data could help to answer the "outside the solar system" part.  And wouldn't acceleration from the solar magnetic field perhaps trap them (after being ionised)?


HP Proliant ML350 G6 SMH reporting error with Smart Array

Question: Our HP Proliant ML350 G6 recently turned off by itself for the first time, with the "Health LED" indicating degraded state.
As soon as I pressed the power button, the LED went back to green, so after OS restart, I opened the System Management Homepage. It was showing error state for the Smart Array P410i, but with all the information missing:

Since I recently installed a newer fw version on the Smart Array, including the new ACU version, I presumed that SMH perhaps doesn't get the correct information from the array, so I started ACU and it indeed doesn't show any problems:

I installed the newest version of the SMH, but the same error is being shown. ACU seems to believe that everything is ok, and the server is operating without problems otherwise, I don't see any degradation in performance either.
Is there a way to get more information about what might be wrong?
Answer: This was just a software issue. Maybe SNMP. It doesn't look like you have a problem now.


Align vertices in straight line in the uv image editor

Question: I am in the UV Image editor.  I am trying to align each row of vertices in the x axis.  When all the rows are aligned, I would like to align each row on the Y axis. Is there a combination of key strokes I can use in the image editor to accomplish this?
Answer: You can select all vertices in a row by using alt+ RMB on an edge;

You can align selected vertices on the x axis with the following keystrokes (one after the other, not all at once);
s, x, 0, enter

Same for the Y axis, select with alt+ RMB

s, y, 0, enter

(those are zeros, not the letter o)
Continuing this process, you can align the desired vertices on x...;

Then y...;


pb12.6 - complex window hierarchy- bad runtime error, mistake or bug?

Question: Hi,

we're developing our product on pb 12.6 Build 4035 - Classic. Now we have following problem:

We have a complex window hierarchy, where each level has a special kind of functionality and becoming more and more complex. On the highest level is a visual userobject. This got the instance var to the window. If the user does any task in the userobject we send over the instance var the actions to the window. Delevoping -> Saving -> Running is all okay. BUT after the deploy the function to the window ends up in a bad runtime reference. This error occurs in running out of powerbuilder (only after deploy) and running the exe (standalone). After a new save of our userobject, it's working again.

Our window hierachie:
from lowest to highest level
 - wo_window ( simple window, basic functions, like a msgbox )
 - wo_uni (window has right system and more functions)
 - wo_sheet (window can communicate with database)
 - wo_tab (window has a tabpage )
 - wo_tab_obj ( object window, special functions, objects are items or address, highest level of hierarchy )
 - w_adr ( object window for adress )

on wo_tab_obj is our userobject.   => wo_tab_obj::open{ uo_blaettern_obj.event ue_set_ref( /*wo_tab_obj awo_tab_obj */ this ) }

->in the userobject the reference is stored in iwo_tab_obj

user starts action on the userobject and the code calls: iwo_tab_obj.get_obj().get_parameterart()

the function call get_obj() throws the exception bad runtime reference. get_obj() is declared at wo_tab_obj. So now we tried something and called function of lower hierarchy level. this is working (also after compiling, and running the exe).

the exception also appers at events, calling a event which is declared at wo_uni works.

So we think there's a bug inside the compiling process, or are we doing something wrong?
We won't recreate our window hierarchy, because it's perfect for our tasks, we need all of this levels.
Answer: I doubt it's a bug in the compile process.  The more likely scenario is a pointer problems in the compiled P-code...  Is there any chance you have a circular object reference somewhere in the hierarchy?
For example, somewhere in wo_tab_obj, you might have a reference to some userobject or NVO class, which itself has a declaration that references back to  wo_tab_obj.


When to use primary or secondary buttons?

Question: Trying to understand when to use a secondary button color on home page? I know to use it on save or cancel etc. But when on home sections?
Comment: Do you have an example of the secondary buttons usage? I see them all using the same hierarchy exception made of "Submit Listing"
Comment: ...and "FIND PROPERTIES", it's a [web template](https://preview.themeforest.net/item/casaroyal-real-estate-wordpress-theme/full_screen_preview/22662762?_ga=2.70661401.82725536.1685580530-77920944.1605563524)
Answer: So on home page, your CTAs will use Primary buttons and your secondary buttons will be used for just that, secondary actions.
The best way to think of this is, what do I want users to when they arrive on my webpage, or see a component. Whatever answers that question needs a CTA with the primary button. Any other "nice to haves" can use the secondary button.
Tech sites, especially developer oriented products/services, have very simple to understand usage of primary and secondary buttons.
Take the Github home page when you haven't logged in.

The primary action is "Sign up" whilst the secondary action is "get a free trial".
Answer: My rule of thumb is that the primary button is used for the most important (ie primary) action only, and any other action is secondary at best.
In your example, the 'FIND PROPERTIES' button in the panel labelled 'Let us Bring You Home' is the primary action, as it has the eye drawn to its position by the background within the image behind. It's also the action most likely to be needed (as indicated by its position), as users are going to want to search more often that they are to submit a property of their own.
In the example you've given, though, there are other sections of the page, many of which have their own primary button, which is acceptable, as long as the sections are meaningfully distinct.


Does the Magic SysRq Key Always Work?

Question: My computer is running Ubuntu from a Live CD and is frozen to the point where I can't even turn num lock on and off. Does the Magic SysRq key work even now? And is it something that's enables by default or does it need to be enabled by the user?
Answer: The kernel itself has certain key combinations that should be able to get you out of a frozen pickle like: ALT GR + PRT SC + K to force a log out, or ALT GR + PRT SC + O to force a safe shutdown...
Comment: Does it work even if the computer doesn't seem to be recognizing keyboard input?
Comment: Sometimes, depends on the actual error that causes hang...
Answer: The SysRq key codes are enabled by default and can be disabled.

Does the Magic SysRq Key Always Work?


Creating bulk field aliases for several layers within same ArcSDE feature class using ArcPy?

Question: I have an ArcMap with ~200 layers from the same sde feature class.  After I finished adding all the layers it was brought to my attention that we need to add field alaises for the attribute table.  Does any one have a python script that will loop through all the layers in a map and add the aliases?
Answer: You need to use ArcObjects to modify aliases as they aren't exposed to the python API.
Changing feature class and field aliases in bulk using ArcPy? has a 3 methods for changing the field aliases at the feature class level. One using arcobjects via dot net, one using arcobjects using python via an unsupported backdoor, and the third through geoprocessing, but this last duplicates data.
A person should be able to build something to modify map layer (.mxd) or layer file (.lyr) field aliases using those examples; it will take some software development smarts.
Comment: ok, then I will have to have one of our developers help me.  Thanks


What is recurrent training?

Question: Is it taken by both pilots and flight attendants? How frequently? What is the main purpose of it? Is it mandatory?
Answer: Recurrent training is required annually by the FAA for both pilots and cabin crews, by 14 CFR 121.427.  I am only familiar with the content of recurrent training for flight attendants so this answer is limited to them only.  In a previous answer I wrote:

Annually we would be required to attend jet recurrent training where we reviewed NTSB accident reports with an emphasis on cabin crew responses to emergencies, review of first aid and CPR techniques, re-testing of our knowledge of the location and how to use all the safety equipment on board, including life preservers, life rafts, and emergency slide procedures. We were also briefed on any changes to FAA mandated procedures and tested on everything.

The purpose of the training is to refresh our knowledge of required safety procedures that might have gotten rusty and to stay up to date on possible changes to FAA required procedures.  Emergency procedures are almost never needed and yet it's vital to be able to recall them when needed.  One day a year was devoted to recurrent training and you had to pass all the tests to stay current.  For this reason, we took it very seriously.
Answer: Recurrent training must be conducted regularly, under most rules (EASA, FAA etc) 2 simulator sessions twice a year. It is mandatory, basically to prove to authorities that the pilots are still up to handling emergencies according to the airline handbooks.
Because airliners are so safe nowadays, nothing happens. My apologies for oversimplifying this, but pilots fly from A to B and back to A again year after year, and nothing happens. So then they find themselves in a Level D flight simulator, and everything happens: engine fail, dual hydraulic fail, smoke in the cockpit, alarms going off, "woop woop Pull Up!"
It is a very useful requirement for keeping everybody sharp and on top of things. The exercise is not an automatic pass - upon a fail a pilot can get a re-assessment. Fail this again and continued employment can get hairy.

What is recurrent training?


Teaching visually impaired mathematics students

Question: How can typical undergraduate mathematics teaching resources be made accessible to visually impaired students?
Comment: Related: http://matheducators.stackexchange.com/questions/8416/is-webassign-ada-compliant . A big culprit in preventing accessibility seems to be non-accessible software such as mymathlab and webassign; there are free and open-source alternatives that don't have the accessibility problems. Another big barrier is books that aren't properly digitized. Tactile graphics may be necessary. A lot of this stuff seems to be expensive and labor-intensive to provide, so it seems that an underlying issue is that the school needs to spend enough money and hire enough people.
Comment: This is not a question I am directly interested in now, but my hope is that it will become a useful resource. It is inspired by http://matheducators.stackexchange.com/questions/8396/what-accessibility-is-available-to-the-blind-and-visually-impaired-students-and and, to a lesser degree, http://matheducators.stackexchange.com/questions/8416/is-webassign-ada-compliant .
Comment: This might be useful: https://arxiv.org/abs/1710.08977
Answer: One person who has published on this subject is Emma Cliffe. A couple of the points she makes are:

There are difficulties here that are specific to mathematics. It is likely that no one person's job description will cover all the aspects that need to be considered, so any plans should preferably be made together by the student, disability officers and members of the mathematics department.
Not many computer file formats of mathematics can be meaningfully converted to accessible resources. As things currently stand, those that are are:
a) well-formatted word-processed documents with equations entered in the correct format;
b) well-formatted Latex using a limited range of packages;
c) html with MathJax.
Comment: Could you give a reference to any relevant publication by Cliffe? If I was listing accessible formats, MathML would be at the top of the list. MathJax is a kludgy workaround for browsers that don't properly support MathML.
Comment: This answer is meant as a stub - hence the CW.


With sendfile(), is it possible to tell when in_fd is at EOF?

Question: Reading through the man page of the Linux system call sendfile, I am wondering whether it is possible for the calling program to know when in_fd is at EOF. Presumably, this could be signaled by a return value of 0, but this leads to the question of what a return value of 0 actually means. If sendfile is like write, then a return value of 0 would just mean that 0 bytes were copied. But, if sendfile is like read, then a return value of 0 would mean EOF. Must one know in advance how many bytes that are to be copied from in_fd to out_fd in order to use sendfile? What does it mean when sendfile returns 0?
Answer: I don't think there is any direct way to know that but it shouldn't really matter.  Normally you would find the input file size via stat/fstat and use that to count out your transfer.  The socket end isn't going to matter to you.
The only situation this should be problematic is if you want to transfer a file that is growing or shrinking.  Given that the input file has to be mmap-ed, and the bad things that can happen (without some clever code) with mmap  in those situations you should probably just not employ sendfile for those cases.
Answer: you can use offset parameter for read count.
According to Man page
If offset is not NULL, then it points to a variable holding the file offset from which  sendfile() will start  reading  data  from in_fd.  When sendfile() returns, this variable will be set to the offset of the byte following the last byte that was read.  If offset is not NULL, then  sendfile()  does not modify the current file offset of in_fd; otherwise the current file offset is adjusted to reflect the number of bytes read from in_fd.
count is the number of bytes to copy between the file descriptors.
RETURN VALUE
       If the transfer was successful, the number of bytes written to out_fd is returned.  On  error,  -1 is returned, and errno is set appropriately.
and yes that means return value 0 means no data copied to write socket.
Answer: You can assume EOF has been reached when then number of bytes sent is 0:
sent = sendfile(out_fd, in_fd, &offset, nbytes);
if (sent == 0) {
    // EOF
    ...
}

This assumption works also in case of non-blocking sockets.
Comment: It's not documented. I just verified directly myself.
Answer: in my case, encounter the file be truncate by rsync, app use sendfile to transmit file in the same time. I find the app eat cpu 100% in the condition, I fix my code refer the follow article , the question disappear.
http://www.linuxjournal.com/article/6345
the point is use F_SETLEASE get the file leases for your app.


Why didn't this get marked as duplicate?

Question: I recently asked this question on photo.se about IR focus markings.
But, later I found this question, it was also about the same problem..
Why didn't my one get marked as a duplicate?
Answer: Finding duplicates relies on users of the site remembering older questions, or doing searches, or sometimes noticing the "Related" questions that appear in the sidebar.  Usually someone will pick up on it, it will get reviewed and voted on, and then possibly closed as a duplicate.  In the meantime your question will usually attract answers, especially when it's not obvious a duplicate may exist.
Answer: Mike obviously has the general answer here, but in your case I'd almost be tempted to mark the older question as a duplicate of yours: in many ways, yours is a better question as it includes the image of the lens front and centre; that's much clearer for anyone else finding the question on the site than the slightly vague description on the earlier question.
Comment: Whoa! I didn't think that **my** question could do such a thing.....


Is there a suggested order of reading Conan books?

Question: Is there a recommended order of reading for Conan books? The order should include both Robert E. Howard's and other authors' material.
Don't really care about comics and other non-book sources.
Comment: @Oldcat - that's an awful idea! Page 1 usually contains useless publisher info!
Comment: start from page 1.....
Comment: Perhaps this question would garner better answers it is explicitly stated that you are not asking a for the chronology of the books? Many people have given good answers stating why you should not worry about reading in chronological order, but presumably their are still books in the series which would make bad starting points, and some others that are particularly good Conan novels.
Answer: I've read a handful of Conan books in random order without feeling like I'm missing anything, but I don't think that's really intended, particularly for the early books written by Robert E. Howard himself.
Several different authors have tried to put together a chronology, but according to Wikipedia:

A completely consistent timeline that would accommodate every existing Conan story is impossible for several reasons. These include:
  (a) errors that crept into the earliest chronologies
  (b) subsequent disregard by the early chronologists of chronological evidence in later-discovered Conan material contrary to the existing schemes
  (c) similar disregard for this contrary evidence in the writing of much post-Howard Conan material, and
  (d) disregard of both the existing chronologies and chronological information established in previous stories by Howard and others in the writing of other post-Howard Conan material.

The page I linked to has several of the major chronologies, so you could either pick one of those (I'm considering following the Robert Jordan version, since I'm a big fan of his), or you could look to see where they're similar and make your own.
Answer: The Barbarian Keep by William Galen Gray
looks like the most comprehensive timeline of Conan by Howard and others, but there is little in the canon that compels one to read in any given order.
Answer: I have the conan stories by Howard in the Gollancz Fantasy masterworks series. Its two books and claims the have all the conan stories by Howard in in-universe chronological order. That does not seem to be the order in which they were written.
A nice series of stories.
The Conan Chronicles - Volume 1: The people of the Black Circle
The Conan Chrnicles - Volume 2: The Hour of the Dragon
Answer: The 12 book series published by Ace that attributes the authors as Howard, L. Sprague de Camp and Lin Carter is an excellent start. The series includes stories by Howard that were published and unpublished, and the other two authors finished partially written manuscripts and outlines and ideas left by Howard. Howard had a grand chronology in place from early on, including maps, but he did not publish the stories in chronological order. The 12 books, in order, are:
1 Conan (with a fabulous Frazetta cover)
2 Conan of Cimmeria
3 Conan the Freebooter
4 Conan the Wanderer
5 Conan the Adventurer
6 Conan the Buccaneer
7 Conan the Warrior
8 Conan the Usurper
9 Conan the Conquerer
10 Conan the Avenger
11 Conan of Aquilonia
12 Conan of the Isles
As for other works I have not noticed that the authors totally respect the original Howard vision. Perhaps some do. I would not consider works outside of these 12 books to be canonical.
Answer: Truly the stories are not meant to be read in order.  The stories were not published in a any particular order because REH meant for the reader to believe that the teller of the story, Conan, told the stories as he remembered them randomly.
Source:
"As for Conan's eventual fate - frankly I can't predict it. In writing these yarns I've always felt less as creating them than as if I were simply chronicling his adventures as he told them to me. That's why they skip about so much, without following a regular order. The average adventurer, telling tales of a wild life at random, seldom follows any ordered plan, but narrates episodes widely separated by space and years, as they occur to him." Robert E. Howard, Letter to P.S. Miller, March 10, 1936.


How do I switch from GNOME to Unity after an upgrade?

Question: When I updated to 11.04 I changed the desktop to Gnome, now with the new 12.04 I'd like to switch back to Unity.  How do I do this?
Thanks!
Answer: I think it depends on how you switched it... Have you tried clicking the Ubuntu icon by the login name at the login screen, then switch it to "Ubuntu"? If you could explain how you "changed the desktop to Gnome" in the first place, maybe we could see about reversing that change.
Comment: Just did, and re-started and Unity came up again...your help is much appreciated...thanks!
Comment: Good. Now, just for the record, cause that might be of help to other users which may have the same problem... Can you share **how** did you do that?
Answer: Well... I guess this is a problem a lot of people is experiencing.
In my own case, I had customized compiz settings previous to the upgrade. And after upgrading from 11.10 to 12.04 compiz started to fail... hence no Unity, no launcher, no menu, no window frames... etc.
I assumed it was because of some personal compiz settings (although not sure which exact settings cause this), since I could login to the Guest account without problems, and there everything worked as expected.
So, I thought the only way to solve this was to reset compiz settings to defaults.
Comment: Hmm, will explore this also, seems to be another way to accomplish what I wanted.  Thank you!
Answer: I believe this has already been asked.
How can I switch between gnome-shell and unity without logging off?
Open a terminal and type:
unity --replace
Comment: This works great...but gnome returns on restart...and I was wanting Unity to be default desktop. (sorry for not phrasing question more clearly...did upgrade to 12.04 after work...excited but tired)
Comment: And I liked the option of using either desktop.
Answer: just logout and select ubuntu on clicking setting icon and then login and you will have your unity environment set. Thats it.
Comment: Perfect solution...easy, quick, and it did what I was after.


Energy from Uranium fission

Question: How do I find the energy released by uranium fission into Nb and Pr ? Every time I see the equation for some nuclear fission it always just states the energy released but what if we didn't know it as a broader question the elements used before are just an example of a fission equation I saw.
Comment: Well, you could compare the binding energies of the parent and daughter nuclei.
Comment: so sum the Nb and Pr for example and find the difference ?
Comment: Nb and Pr cannot be the fission products as the sum of their atomic numbers is 100, not 92. Protons aren't destroyed in fission reactions. In any case, for such a calculation you need to fully specify the fission isotopes (as well as the starting U isotope).
Comment: Nb and Pr may result from different uranium fissions chains
Comment: @igael - the poster obviously believes otherwise.
Comment: @WhatRoughBeast : perhaps there is a distribution on different fissions chains or a typo error on "Pr"
Answer: The sum of the actual atomic masses of the reaction products minus the sum of the actual atomic masses of the reacting species gives you the amount of mass converted to energy during the fission. That latter amount can be found by applying $E=mc^2$ to that mass deficit.
As I wrote in my comment, protons cannot be destroyed in nuclear fission, so the atomic number of the fissile nucleus must match the sum of the atomic number of the fission isotopes.
An example of a real calculation can be found here.
Answer: As written upper , Nb and Pr cannot be a pair of fission products .
With a correct fission  reaction , I can give a complete approximate  calculation by hand . At the end , I obtain the energy of each fission product .

Energy from Uranium fission


Does get_terms() use any sort of caching on its query?

Question: In the docblock for get_terms(), it says the following on caching:
* The {@see 'get_terms'} filter will be called when the cache has the term and will
* pass the found term along with the array of $taxonomies and array of $args.

What does it mean by will be called the cache has the term ?  Does this mean that when I do an apply_filter on get_terms, it will only be called if the term is in cache?  And I'm not entirely sure what cache it is referring to here.  I'm not too familiar with Wordpress caching yet, so please forgive me if this should be obvious to me.
Answer: User gmazzap has a good explanation of Object Cache you may want to read over.
If we take a look at get_terms() we can see it creates a new WP_Term_Query() and that classes get_terms() is where the potential caching happens. Line 666 specifically. Just a little further down we can see if it test if a cache exists.
So the caching will only last a page load to ensure that duplicate queries don't bog down the database with multiple calls. The filters will attempt to use a cache and if it can't find it ( unlikely ) it will create one for future use down the page load line.


Need help identifying some shrubs in the mountains of Israel

Question: I see some bushes around my house and am wondering whether they are useful (if so, I will propagate them from cuttings.) Can anyone identify these?
Comment: Could you ask one question per plant, please? And ideally include also a close-up as well? Any additional information (e.g. scent) would be helpful and of course the location (saves users from digging through your profile).
Comment: Ooh, that's a landscape I haven't seen in a few years. Thanks for the photos :)
Answer: Looks like in the mountains of Crete!

The first one could be sage, to be more precise salvia triloba. Need a close-up to verify.
The second one is surely thyme.
The last one, I don´t know.

If you tell a little bit more about smell and make some close-ups as suggested, we may be able to help some more.


temporary user profile on windows

Question: everytime I log into the computer I am getting Message you are logged in With a temporary user profile. How can I fix this problem? I set up pc With New Windows 7 still i am getting the Message. I am not logged in as my user, but as TEMP-user each time. Any solution that work?
Answer: A bad profile mean your own profile is corrupted or the default's profile on the workstation is corrupted if you haven't logged into that workstation yet.
Backup your data and delete your local profile and let the system recreate your folder is the best solution.
Check there to see if a profile is already there: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProfileList, after Use My Computer or Windows Explorer to remove the appropriate Windows\Profiles\User name folders.

temporary user profile on windows


How to Create Custom Dashboard for my Laundry Website?

Question: Just to give you background, I have a local business and a WordPress website for it. The website helps my customers schedule a pick and drop for their laundry. What I want to accomplish is that:

Customer should be able to login/register to my website.
Check their history.
Schedule a pick/drop for laundry
Give feedback or suggestions.

But since I am new to WordPress, not sure where to begin. Can somebody push me in right direction.
How can I enable login/register for customers and show them a separate customer dashboard where they can check their history, Schedule for laundry or Give feedback or suggestions?
I understand this is a big project, just need enough stuff to study.
Answer: You can use wordpewss appointment plugin to slove the issue
It will let yu schedule booking in your site
Wp appointment+ will also let you social login


The meaning and origin of "hedge your bets"

Question: What exactly does it mean? And what is the origin of the phrase "hedge your bets"?
Answer: To "hedge your bets" means to reduce or mitigate your risk. According to Etymology Online, this usage of hedge has been around since the 1600s.
From this page, the origin of the phrase comes from an actual hedge or plantings that act as a fence to enclose a piece of land.  A hedge delimits an area, so the idea of a limited risk arose from that concept.  An older expression, "to hedge in a debt," supports this origin.
Answer: 'Hedge your bets' - meaning and origin.

What's the origin of the phrase 'Hedge your bets'?
Hedge has been used as a verb in English since at least the 16th century, with the meaning of 'equivocate; avoid commitment'. An example of this comes in Shakespeare's Merry Wives of Windsor, 1600:

I, I, I myself sometimes, leaving the fear of God on the left hand and hiding mine honour in my necessity, am fain to shuffle, to hedge and to lurch.

It began to be used in relation to financial transactions, in which a loan was secured by including it in a larger loan, in the early 17th century. Initially, the phrase associated with this form of hedging was 'hedging one's debts', for example, John Donne's Letters to Sir Henry Goodyere, circa 1620:

"You think that you have Hedged in that Debt by a greater, by your Letter in Verse."

'Hedging one's bets' was coined later in that century. It referred to the laying off of a bet by taking out smaller bets with other lenders. The purpose of this was to avoid being unable to pay out on the original larger bet. The phrase was first used by George Villiers, the 2nd Duke of Buckingham, in his satirical play The Rehearsal, 1672:

"Now, Criticks, do your worst, that here are met; For, like a Rook, I have hedg'd in my Bet."

The verb 'to hedge' derives from the noun hedge, that is, a fence made from a row of bushes or trees. These hedges were normally made from the spiny Hawthorn, which makes an impenetrable hedge when laid. To hedge a piece of land was to limit it in terms of size and that this gave rise to the 'secure, limited risk' meaning. Hedge funds, much in the news nowadays, take their name from their method of limiting, that is, hedging, their risk.
Curiously, the original examples of another financial device currently newsworthy that is, stocks, were literally made from material that was taken from hedges. In the 17th century, the tally that recorded a payment to the English Exchequer was a rough stick of about an inch in diameter, split along its length. One half, the stock, was given as a receipt to the person making the payment; the other half, the counterfoil, was kept by the Exchequer. Ownership of payments that were made jointly by a group were shared among the members of so-called joint stock companies, hence stocks and shares.

Inky Fool: How John Donne Invented the Hedge Fund

Quoting from Mark's interesting article "From that sense of making your debts safe, came the idea of hedging in your bets..." I recall being told by a "betting man" that the original 'hedges' were planted at racecourses as a border between the Grandstand & the public area.
Bookies in the Grandstand were dressed like the rest of the 'toffs' and took bets very discreetly (no 'Odds Board' or Gladstone Bag for them!)
Because 'toffs' usually placed large bets, the Grandstand Bookies went to the hedge to 'lay off' some of their commitments with the bookies in the public area on the other side of the hedge.
Answer: The figure of speech "to hedge one's bets", whether it be in relation to a market investment or a wagering game "bet investment", derives—albeit sometimes loosely speaking—as an allusion to "fencing in" so as to prevent loss by escape (a form of guarding or protection), as if with hedgerows or similar planting arrangements. The chief characteristic of a "hedged" bet/investment is that it requires a (generally profit reducing) counter-endeavor—a likely-to-be countervailing bet, investment, operation—so that the net gain expectation, if any, is knowingly lowered in order to avoid or minimize net loss. To say that one's bets are hedged (in the sense of a generally low-growing planted barrier) as opposed, for instance, to saying that they are walled in, is to say that a hedged investment remains, to some degree, exposed to adverse influences, even loss, from within or without the partial, protective "hedge" screen.
Answer: Longman Dictionary of English Idioms (1979) offers this straightforward and intuitively reasonable explanation of "hedge one's bets":

hedge one's bets coll[oquial] to try to make oneself safe against possible loss, esp. by putting money in other businesses: it is very important to hedge your bets in any business, but putting on plays in theatres is especially risky {Referring to putting a HEDGE or protective wall around one's bets}

Christine Ammer, The American Heritage Dictionary of Idioms, second edition (2013) explains the phrase similarly:

hedge one's bets Lessen one's chances of loss by counterbalancing it with other bets, investments, or the like. For example, I'm hedging my bets by putting some of my money in bonds in case there's another drop in the stock market. This term transfers hedge, in the sense of "a barrier," to a means of protection against loss. {Second half of 1600s}

As noted in the discussion of "hedge your bets" at the Phrase Finder (quoted in full in Elaine Nai's answer), one of the earliest recorded instances of a phrase bringing hedging and bets together, is the prologue of George Villiers (the Duke of Buckingham), The Rehearsal (1672):

We might well call this short Mock-play of ours / A Posie made of Weeds instead of Flowers; / Yet such have been presented to your noses, / And there are such, I fear, who thought 'em Roses. / ... / Now, Critiques, do your worst, that here are met; / For, like a Rook I have hedg'd in my Bet. / If you approve; I shall assume the state / Of those high-flyers whom I imitate: / And justly too; for I will shew you more / Than ever they vouchsaf'd to shew before: / I will both represent the feats they do, / And give you all their reasons for 'em too. / Some honour to me will from this arise. / But if, by my endeavours, you grow wise, / And what was once so prais'd you now despise; / Then I'l cry out, swell'd with Poetique rage, / 'Tis I, John Lacy, have reform'd your Stage.

As used by Villiers, rook refers to neither the crowlike European bird nor the chess castle, but instead to a cheat at games of chance. B.E., New Dictionary of the Canting Crew (1699) conveniently provides slang definitions for both hedge and rook:

Hedge, to secure a desperate Bet, Wager or Debt[.] By Hedge or by Style, by Hook or by Crook.

...

Rook, c. a Cheat, a Knave. To Rook, c. to Cheat or play the Knave.

As the Oxford English Dictionary observes, "hedging in" can serve the purpose of confining or of protecting:

Hedge, v. ... 1. trans. To surround with a hedge or fence as a boundary or for purposes of defence. Also with in, about.

The ambiguity of "hedging in" as between confinement and protection is evident from instances that antedate the earliest instances of "hedging in" one's bet. For example, James Fergusson, A Brief Exposition of the Epistles of Paul to the Galatians and Ephesians (1659) includes this passage:

How often do we mistake our way, and little lesse than quarrel with God? only because He hedgeth us in with thorns of affliction, that we cannot find out our lovers; and therefore that man is truly blessed whom the Lord doth not only chastise, but also instruct out of His Law, Ps. 94. 12. and thereby make him understand and hear the voice of the rod, and of Him who hath appointed it, Mica. 6. 9.

Do the thorns of affliction imprison us or keep us from worse danger? Fergusson seems to believe that they do both.
Although the instance "hedging in one's bet" The rehearsal is the earliest such match that a search of Early English Books Online finds, a second instance appears just one year later. From anonymous, "S'too him, Bayes, or, Some Observations upon the Humour of Writing 'Rehearsals Transpros'd'" (1673):

The Pope is a Worthy Prince, and lives in Italy, and long may He live and injoy his health at Castle Gundolpho, before ever I'le begin to disturb him first: But if Cardinal Chigi covets Bansted Mutton, and Colchester Oysters, and can't be contented with Muscadine and Eggs, but must have Mornings Draughts out of our Herefordshire Red-streak and Kentish Pipins; in this case I must (like Frier Iohn) take up Arms for my Vineyard, and if I catch him there (as sure as his Cap's made of wool) I'le knock him down with a Hop-pole. Therefore pray hence forward let alone my Mistress, for if you come to fooling with Her, I must hedge my Bet, and be revenged (if I can) upon your Wife.

This instance is of quite a different kidney from the one in Villiers's prologue.  Villiers frankly equates himself with a cheating gambler—since he aims, through his tactic of burlesquing bad tragedies, to win the favor both of audiences who like the original works (by imitating them) and of audiences who consider them absurd (by mocking them). Either way, the gamester wins.
But the anonymous pamphleteer responding to "Rehearsals Transpos'd" doesn't seem to mean hedge in the sense of "have it both ways"; rather he seems to mean hedge as something like "protect" or "counterattack on behalf of" and his bet seems not to be a desperate wager (as the New Dictionary of the Canting Crew puts it) but simply an investment or prize property. In this respect, the pamphleteer's usage seems much closer to the modern sense of "hedge one's net" than the usage by Villiers.
A third instance, in Andrew Marvell, Mr. Smirke; or, The Divine in Mode (1676) returns the gambling sense of the expression to the fore:

But the Clergy having got this once in the wind, there was no beating them off the scent. Which induced Constantine to think the convening of this Council the only remedy to these Disorders. And a woful ado he had with them when they were met to manage and keep them in any tolerable decorum. It seemed like an Ecclesiastical Cock-pit, and a man might have laid wagers either way: the two parties contending in good earnest either for the truth or the victory, but the more unconcerned, like cunning Betters, sate judiciously hedging, and so ordered their matters that which side soever prevail'd, they would be sure to be the Winners.

Marvell seems to be splitting the difference between the wily cheater of Villiers's usage and the sturdy yeoman defender of Herefordshire Red-streaks and Kentish Pipins against the depredations of Italian apple thieves. The milieu once again involves betting on the outcome of a game of chance, as in Villiers, but the hedgers are cagey practitioners of realpolitik who are looking to their self-interest above all else, not card sharps or dice cheats.
Two other instances of "hedging bets" appear in the Early English Books Online database, which covers the period from the 1400s to 1700. From anonymous, "The Murmurers, a Poem" (1689):

Plain Cowards others, Egypt's Threats they hear, / And backwards look, not out of love, but fear. / (Ridiculous Fools, — nor e'er were Cowards wise.) / Lest Pharao and his Host again shou'd rise. / Their hands to Bricks, and not to Swords enur'd, / They'd hedge their Betts, on either side secur'd. / True Bats, whom yet no Side nor Standard knows, / Those Beasts of Birds are neither Friends nor Foes.

This excerpt expresses disapproval of certain Israelites who accompanied Moses out of Egypt but were ready to surrender without a fight if confronted with Pharaoh 's soldiers; in the poet's view "hedging one's bets" in this instance amounted to a form of moral equivocation, which he equates with the ambiguous status of bats—mammals that act like birds and yet are neither reliable friends nor determined foes of either class.
And finally, from "Hearty lover of King William and Queen Mary," "Some Modest Reflections upon Mr. Stephens's Late Book, entituled, A Plain Relation of the Late Action at Ssea, Between the English, Dutch, and French Fleets, from June 22 to July 5 Last with Reflections Thereupon, ..." (1691):

The unfortunate business of the Fleet; the general Mismanagement of Affairs; the Debauchery of the Nation, and those in publick Employments; the Behaviour of Church-men towards Dissenters, and others; his own Bill at the end.

For the first of these: The Affair of the Fleet. Here the Author of the Reflections needed not to have hedged in his Bett so carefully, and to fright any one from Answering what he writes on that Head, ...

I say he's safe enough in that Lock, and needed not have denounc'd so terribly against any one who should endeavour to force him out on't.

The hearty lover of the king and queen uses the expression "hedged in his Bett" to indicate that the author whose work he is critiquing seems unduly concerned with challenging the honor and patriotism of anyone who might challenge his comments regarding the "Affair of the Fleet," and to suggest that his doing so is an attempt to establish credit for himself as an honorable and patriotic observer prior to making comments that are far more controversial than these initial ones.

Conclusions
Of the first five instances of "hedging one's bet" that my search of the Early English Books online database uncovered, only one—the 1673 instance by the anonymous pamphleteer warning against inroads into England by the Catholic church—uses the expression in a positive sense. The others—from the gambling cheat in Villiers's prologue to the cynical synod participants in Mr. Smirke to the batlike equivocators in "The Murmurers" to the straw patriot of A Plain Relation—involve at best unprincipled and at worst criminal regard to the hedgers' perceived self-interest. And yet in the long run, "hedging one's bets" has come to be treated as an expression of common prudence and practical wisdom.
Still, the origin of "hedging one's bets" as a figure of speech seems clearly to have originated in the notion of putting a hedge around one's land or livestock to prevent them from escaping or from being plundered.
Answer: I can't back this up with reference but, from experience, when planting a hedge, it wise to plant some "spare" plants elsewhere. A common rule of thumb is one spare for every twenty plants in the hedge. This 5% of spares are there to replace any failures in the hedge plantings as, obviously, the occasional failed plant is going to seriously detract from the value of the hedge. I've often wondered if this is the origin of the expression?
You are making a small investment in potentially unwanted plants to protect your larger investment in the hedge.
Comment: But the metaphor of the idiom is using a hedge to protect something else, not protecting the hedge itself.


Is it true all sins(even the worst one) are forgiven when a non Muslim accept Islam by heart?

Question: I have heared  and also when I was accepting Islam they told me that now "your all past sins are forgiven can anyone tell me any verse from the sunnah or Quran .
Answer: In the name of God, the Most Merciful, the Most Kind.
I assume that you have converted to Islam? What you have heard from others telling you that Islam wipes all sins from your past no matter how big it is your sin is 100% true. There's a verse or Hadith that speaks about that.
It was narrated that Abu Sa'eed Al-Khudri said:

"The Messenger of God (peace be upon him) said: 'If a person accepts Islam, such that his Islam is good, God will decree reward for every good deed that he did before, and every bad deed that he did before will be erased. Then after that will come the reckoning; each good deed will be rewarded ten times up to seven hundred times. And each bad deed will be recorded as it is, unless God, the Mighty and Sublime, forgives it.'" [Sunan an-Nasa'i]

And also prophet Muhammad (ﷺ ) said:

"Islam wipes out whatever sins came before it" - Ahmad (17159).

But after you have converted to Islam, and you have done a sin, you can seek God's forgiveness each time you do a mistake or a sin.
Comment: Thanks I am happy to become muslim my life is changed  fully thanks for your answer I just wanted to know so that I can tell my friend the references.


Does the official length of a movie include the credits?

Question: When we see the description of a movie at databases such as IMDb and Letterboxd, does the available length contain the credits? What's considered the official length of a movie?
Comment: Just for context, in some movies there are post-credit scenes merely as a funny joke, but there are others where a post-credit scene can be relevant, like a sequel hook (showing the supposedly slayed monster stirring or opening its eyes). And yet others where important story is unfolding *during* the credits. A prominent example is WALL-E, where not watching the credits can make the ending darker, questioning whether the returned humans will survive at all, given the lack of resources, physical fitness, and survival skills. The animation during the credits reassures us that they do survive.
Comment: Letterboxd gets their running times from TheMoviesDB. Those times are self-supplied by the studio.
Answer: IMDb defines the running time as per the description below. In brief, yes, the running time includes the entire credit sequence.

The IMDb running times section records the duration in minutes of titles in the database. For theatrical releases the timing begins from the first distributor logo and ends at the last frame of the end credits. If there are any mid or post credits scenes, these should also be included in the running time. For TV-series we prefer to include the time without commercials, but we appreciate such timings are not always easily available so total running times may be submitted instead as long as the attribute (including commercials) is used.
We prefer to list one single running time for all titles which corresponds to the default running time. This is the running time of the original release version in the country of origin and is indicated by an entry with a blank country field.
IMDB - Running Times


Pardot engagement studio is sending emails with a delay

Question: I set up engagement studio for our newsletter opt in. After submitting a form, the user is added to a list which is the starting point of the engagement studio. Then the user is supposed to receive an email with a confirmation link. But the email is sent with a delay of about 20 minutes. How can I make it that the email is sent immediately after the form is submitted and without a delay?
Answer: Engagement Studio and most Pardot routines are not real time, they usually happen within a few minutes but can sometimes take longer.  If you want immediate responses for your signups, then you should add a 'Completion Action' step to the Pardot form/form-handler to send your auto-responder email.  These are sent immediately.


JRI from Hive UDF / UDAF

Question: I have R installed on some data nodes and can write Map reduce jobs to invoke R through JRI.
Next, to get R to be invoked through a hive query, I override the terminate method in GenericUDAFEvaluator and create Rengine objects there.
The old mapred job required me to do -Dmapred.child.env="R_HOME=/usr/lib64/R" before it could work.
When I do this in hive (via set mapred.child.env="R_HOME=/usr/lib64/R"; ) and then run a query, the job fails at setup.
More generally this succeeds from hive:
 select count(*) from some_table limit 10;

but this fails:
 set mapred.child.env='abc=pqr';
 select count(*) from some_table limit 10;

I have hive-hwi-0.9.0-cdh4.1.1.jar and hadoop-2.0.0-cdh4.1.1
Answer: I removed the quotes from the set statement and it worked. So do:
set mapred.child.env=abc=pqr;
select count(*) from some_table limit 10;
This works

JRI from Hive UDF / UDAF


Master Boot Record failure

Question: We have failures at work on our compact flash drives where the MBR gets corrupted (zeroes written to its Sector 0). The CF cards are industrial grade, but are subject to high vibration/stress environments. It has not been duplicable in our own lab even with a vibe table. I was wondering if there were "common" ways that MBRs get corrupted in order to be replicated in the lab. Thanks.
Comment: I think serverfault.com would give you a little more insight. It's stack overflow for sysadmins :)
Answer: Most common way to corrupt a CF card is to remove it during a write.  To do this with the MBR, you would need to do it while the MBR is being written.  In Vista/W7, from a command prompt you can:
bootrec /FixMbr

For W2K/XP:
fixmbr \Device\HardDisk0

Those commands write to the MBR, so you need to pop the card out as soon as you run them.
Comment: Would there be any difference between this happening on Windows vs Phar Lap OS?
Comment: TBH I am unfamiliar with Phar Lap.  I did some checking and couldn't find an online reference for it for the commands we need.  If you have a doc, see if there is an equivalent command to rewrite the MBR and if there is you can try that.
Answer: I think there's little chance of a mechanical problem resulting in exactly a sector of 0's in sector 0.
If I had to bet, I'd bet on a software malfunction, i.e. a failure that causes the sector calculation to end up pointing at 0. Normally the opsys should keep the underlying numbers in a safe location, but something else running at kernel level (e.g. a video driver) could accidentally step on a critical location and cause funky behavior.
Alternatively, I'd consider the possibility that folks have viruses on their boxes.

Master Boot Record failure