How can I set the Secure flag on an ASP.NET Session Cookie?

Question: How can I set the Secure flag on an ASP.NET Session Cookie, so that it will only be transmitted over HTTPS and never over plain HTTP?
Answer: In the <system.web> element, add the following element:
<httpCookies requireSSL="true" />

However, if you have a <forms> element in your system.web\authentication block, then this will override the setting in httpCookies, setting it back to the default false.
In that case, you need to add the requireSSL="true" attribute to the forms element as well.
So you will end up with:
<system.web>
    <authentication mode="Forms">
        <forms requireSSL="true">

        </forms>
    </authentication>
</system.web>

See here and here for MSDN documentation of these elements.
Comment: You can avoid other web.config settings over-riding your  setting by including the 'lockItem' attribute. Like so: . More info here http://www.dotnetnoob.com/2010/11/how-to-secure-aspnet-cookies.html
Comment: In addition, if there is a `roleManager` element its attribute `cookieRequireSSL="true"` should also be set to true. Ref. https://msdn.microsoft.com/en-us/library/system.web.security.roles.cookierequiressl(v=vs.110).aspx
Comment: by adding the above changes in related files, session objects are not working in my application, they are becoming null. how can I rectify this problem then?
Comment: Are you using HTTP or HTTPS for your app? The "secure" flag that we're setting here prevents cookies being sent over non-encrypted (i.e. HTTP) connections
Answer: There are two ways, one httpCookies element in web.config allows you to turn on requireSSL which only transmit all cookies including session in SSL only and also inside forms authentication, but if you turn on SSL on httpcookies you must also turn it on inside forms configuration too.
Edit for clarity:
Put this in <system.web>
<httpCookies requireSSL="true" />

Comment: +1 To clarify, this is what you should add to the web.config to set the secure flag on the auth cookie to true ``
Comment: Note that this depends on your (server-level) configuration. I brought the Test Region down with the error "The application is configured to issue secure cookies. These cookies require the browser to issue the request over SSL (https protocol). However, the current request is not over SSL." This was because we have a reverse proxy in place and browsers connect to it via SSL but the reverse proxy to IIS server is over port 80, so the application didn't think it was secured.
Comment: @Bargitta We handled the Application_PreSendRequestHeaders event and if a certain application setting is true, we set _all_ cookies to secure. This app setting is only set for our HTTPS external sites.
Comment: I see, so all your external site will use HTTPS, thanks.
Comment: I'd seen elsewhere that after IIS7 system.web had been replaced by system.webserver, so I tried putting this setting there. On IIS 8.5 this caused a config error though, but it all worked if I added a system.web section to the config file and put the setting in there.
Comment: If the cookies are already created in browser, they won't have secured flag. After adding this line in your web.config, remove your cookies in browser and refresh your page, then the new once will get effected and have secure flag.
Answer: Things get messy quickly if you are talking about checked-in code in an enterprise environment.  We've found that the best approach is to have the web.Release.config contain the following:
<system.web>
  <compilation xdt:Transform="RemoveAttributes(debug)" />
  <authentication>
      <forms xdt:Transform="Replace" timeout="20" requireSSL="true" />
  </authentication>
</system.web>

That way, developers are not affected (running in Debug), and only servers that get Release builds are requiring cookies to be SSL.
Comment: ^^^This^^^ is the way. More information re: Web.Config transforms: http://go.microsoft.com/fwlink/?LinkId=125889
Answer: Building upon @Mark D's answer I would use web.config transforms to set all the various cookies to Secure. This includes setting anonymousIdentification cookieRequireSSL and  httpCookies requireSSL.
To that end you'd setup your web.Release.config as:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web>
    <httpCookies xdt:Transform="SetAttributes(httpOnlyCookies)" httpOnlyCookies="true" />
    <httpCookies xdt:Transform="SetAttributes(requireSSL)" requireSSL="true" />
    <anonymousIdentification xdt:Transform="SetAttributes(cookieRequireSSL)" cookieRequireSSL="true" />
  </system.web>
</configuration>

If you're using Roles and Forms Authentication with the ASP.NET Membership Provider (I know, it's ancient) you'll also want to set the roleManager cookieRequireSSL and the forms requireSSL attributes as secure too. If so, your web.release.config might look like this (included above plus new tags for membership API):
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web>
    <httpCookies xdt:Transform="SetAttributes(httpOnlyCookies)" httpOnlyCookies="true" />
    <httpCookies xdt:Transform="SetAttributes(requireSSL)" requireSSL="true" />
    <anonymousIdentification xdt:Transform="SetAttributes(cookieRequireSSL)" cookieRequireSSL="true" />
    <roleManager xdt:Transform="SetAttributes(cookieRequireSSL)" cookieRequireSSL="true" />
    <authentication>
        <forms xdt:Transform="SetAttributes(requireSSL)" requireSSL="true" />
    </authentication>
  </system.web>
</configuration>

Background on web.config transforms here: http://go.microsoft.com/fwlink/?LinkId=125889
Obviously this goes beyond the original question of the OP but if you don't set them all to secure you can expect that a security scanning tool will notice and you'll see red flags appear on the report. Ask me how I know. :)
Answer: secure - This attribute tells the browser to only send the cookie if the request is being sent over a secure channel such as HTTPS. This will help protect the cookie from being passed over unencrypted requests. If the application can be accessed over both HTTP and HTTPS, then there is the potential that the cookie can be sent in clear text.


Visio data linked to excel to update the shape text

Question: I have used the native "Link Data to Shapes" feature in MS Visio however there is no way that I can get the shape text (i.e when you press F2 on a shape) to sync with a datafield.
The result is that I can visually hide the shape text when the data graphic is applied, however in the Visio file, the Shape texts are all unpopulated. I use a tool that imports the objects and is dependent on the shape text to be populated.
Is there any mechanism to sync the shape text to a custom property?
Answer: You can simply use Inert \ Field on your shape, and chose a Shape Data row to insert as a reference. In fact, you can insert multiple Data fields this way, if you so want to. You can also insert any other cell value and formulas.
See https://support.office.com/en-gb/article/Insert-a-text-field-into-a-shape-0225c22e-3e5e-4ea7-9ca0-1ec91386cb1e for more information.


$3\sigma$ rule for multivariate normal distribution

Question: I was wondering if the $3\sigma$ rule that holds for 1D normal distribution also holds for multivariate normal distribution?
Comment: Related: http://stats.stackexchange.com/questions/20083/density-of-normal-distribution-as-dimensions-increase/
Comment: It all depends on what you mean by "three standard deviations".  If you mean three times the square root of the expected square of the distance to the mean, then you get a different answer compared to your meaning three times the standard deviation of just one of the variates
Answer: Short answer: no, the rule does not hold in more dimensions.
In the general case (multivariate with arbitrary covariance matrix), the natural generalization of the "normalized distance from the mean", $d = |x -u|/\sigma$, is given by the Mahalanobis distance
$$d = \sqrt{ ({\bf x} - {\bf \mu})^t {\bf \Sigma}^{-1} ({\bf x} - {\bf \mu})}$$
Points of constant Mahalanobis distance lie on an ellipsoid.
If (and only if) the components are independent and with same variance, then $d=\frac{\|{\bf x} - {\bf \mu}\|}{\sigma}$.
The threshold value that contains most (say, 99%) of the distribution varies with the dimension. Or, put in other way, the probability that $x$ takes a (Mahalanobis) distance less than (say) $d=3.0$ decreases with the dimension.
This figure, taken from here ("Statistics for Imaging, Optics and Phtotononics", Peter Bajorski, fig. 5.21) (which explains all this in more detail), displays that probability as a function of the dimension, for distances $d=2.0$ and $d=3.0$ ("$2-$sigma" and "$3-$sigma").

For example, we see that in 5 dimensions the probability that $x$ lies 'under 3 sigmas' is about $0.9$ (instead of $0.97$), and for '2 sigmas' is around $0.4$ (instead of $0.95$)
Comment: Nice answer. You could improve it by giving a reference to the image (including page numbers) that does not depend on an external website.
Comment: Very nice point!
Answer: It is often said that in high dimensions the probability distribution is concentrated away from the center.  So although in 1 D a 3 sigma interval will contain more than 99% of the distribution a three sigma circle for a 2D gaussian with iid components will contain less mass than the 1 D counterpart and the same for 3D compared to 2D etc.
Answer: Yes, in a sense. For the 1D case, you need to standardize the normal variate to a standard normal variate $Z\sim N(0,1)$. For the multivariate normal distribution, each covariate must be not only normally distributed, but independent. You also need to know something more, the correlation matrix. Then, your question can be elegantly answered using the Gaussian copula. For the $8\times8$ intervals between $\{0,\pm1,\pm2,\pm3,\pm\infty\}$ in each coordinate, the 2D discrete probability distribution of discretized independent (zero correlation) standard normal variates would be:
$$
\matrix{1.82\times10^{-6}&0.0000289&0.000183&0.000461&0.000461&0.000183&0.0000289&1.82\times10^{-6}\\0.0000289&0.000458&0.00291&0.00730&0.00730&0.00291&0.000458&0.0000289\\0.000183&0.00291&0.0185&0.0464&0.0464&0.0185&0.00291&0.000183\\0.000461&0.00730&0.0464&0.117&0.117&0.0464&0.00730&0.000461\\0.000461&0.00730&0.0464&0.117&0.117&0.0464&0.00730&0.000461\\0.000183&0.00291&0.0185&0.0464&0.0464&0.0185&0.00291&0.000183\\0.0000289&0.000458&0.00291&0.00730&0.00730&0.00291&0.000458&0.0000289\\1.82\times10^{-6}&0.0000289&0.000183&0.000461&0.000461&0.000183&0.0000289&1.82\times10^{-6}\\}$$
The above was generated in sage with the code below: NormalCDF is the normal cumulative density function $\Phi$, $Z=\{z_i\}$ is the set of $9$ boundary values given above (as an array), $p=\{\Phi(z_i)\}$, and $P=\{\Phi(z_i)-\Phi(z_{i-1})\}_{i=1}^8$ are the 1D probabilities of lying within each of the $8$ intervals bounded by these $9$ points, $M=(P_iP_j)$ a matrix representing the CDF of the 2D discrete distribution of lying within interval $(i,j)$, $N$ is an array of array of strings representing each $M_{ij}$ numerically approximated to $3$ places, and $L$ is a string representing $N$ as an unbracketed matrix in LaTeX. The last command displays the LaTeX within sage, assuming you have your worksheet set to display mathematical typesetting.
<code>NormalCDF = lambda z: (1+sign(z))/2 if abs(z)==infinity else ((1+erf(z/sqrt(2)))/2).n()
Z = [-infinity]; Z.extend(range(-3,4)); Z.append(infinity)
p = [NormalCDF(z) for z in Z]
P = [p[i]-p[i-1] for i in range(1,len(p))]
M = Matrix(RDF,8,8,[[P[i]*P[j] for j in range(8)] for i in range(8)])
N = [[latex((P[i]*P[j]).n(digits=3)) for j in range(8)] for i in range(8)]
L = '\\matrix{' + (''.join(['& '.join(N[k])+'\\\\' for k in range(8)])) + '}'
LatexExpr(L)
</code>
Comment: Well, there must be an error somewhere, as your reading suggests. The density of a multivariate with independent univariates factors into the product of its marginals. I suspect you are integrating from $-\sigma$ to $\sigma$ in each dimension. This corresponds to the categorical variables *both* being in one of the two middle columns/rows, and has probability about $4\times11.7$%. This is correct, but it is a central, not a marginal, probability. Indeed, `4*M[3,3]` yields $0.466064942674$. Marginal probabilites must sum an entire row or column, to eliminate a variable.
Comment: From the table above it seems that the %age of values lie within one standard deviation is not 68% as is the case with 1D? Moreover,  is it fine to say that for 3$\sigma$ rule to hold, the each dimension should be independent and uncorrelated? Can you copy the 2D Gaussian function you have used for obtaining the above values.
Comment: To recover the 1D rule, you need to sum rows or columns. If you sum the $3$rd and $4$th (rows/columns), you'll get $68$%.
Comment: Thank you very much for your answer. I have one confusion if you can help please. I read at several places that when there is no correlation, [the n-dimension multivariate Gaussian is simply the  multiplication of n 1-dimensional Gaussian distribution][1]. When I am integrating the 2D function in the [document][1], i am getting only 46.6% within 1 standard deviation. [1]:http://www.stat.wisc.edu/~mchung/teaching/MIA/reading/diffusion.gaussian.kernel.pdf
Comment: Yes, I was integrating from $-\sigma$ to $\sigma$ in each dimension. Actually I am interested in probability of 2D Gaussian distribution within some radius from the mean. That is why I integrated from $-\sigma$ to $\sigma$ in each dimension. Now I understood the difference between the central and marginal probability. Actually I need central probability for my problem. Thank you very much for such a nice explanation.
Answer: This is more a caveat than an answer (@leonbloy's is more then good enough), but I fell for this trap and would like others to avoid it.
In $D$ dimensions, the fraction of samples within Mahalanobis distance $3$ is NOT $0.997^D$.
This is wrong even if the covariance matrix is diagonal (even, the identity). Yes, a multivariate Gaussian is separable; and yes, along each principal axis the probability of being within three standard deviations is $0.997$.
However, the region within Mahalobonis distance $3$ is a hyperellipsoid (hypersphere), while the the intersection of the $\pm3\sigma$ 1D regions is a hyperrectangle (hypercube). The latter has an integral value of $0.997^D$, while the former is considerably smaller (and more difficult to compute).
Answer: As a small helper for all that want to find the generic $m$-sigma rules of $n$-dimensional hyper-ellipsoids:
Simply fire up wolframalpha and type in:
$Q(n/2, 0, m^2/2)$.
$Q$ stands for the generalized regularized incomplete gamma function.
For $n=1$ and $m=3$ you will obtain $0.997300...$,
for $n=2$ and $m=3$ the result is:
$0.988891...$
and for $n=3$ and $m=3$:
$0.970709...$.
This answer is was inspired by the post of leonbloy.
Comment: Dear @Elarion, this answer appears to be the strongest generalisation while I want to use it in my research. I only need an isotropic normal distribution case where the dimensionality and the standard deviation vary. Could you please offer me the reference? Thanks in advance.


What is the best way to make a good but simple line follower?

Question: I am new in this site, and like you can see I want to do a line follower, not a clumsy and slow line follower, but a fast and "fancy".
I investigated about the PID method, but can someone explain me in simple words what is it.
Thanks for your answers.
Comment: Have you already chosen/built the robot? what kind of hardware do you want to use? BTW, I suspect that PID will only be useful if you have a continuous/fluid way to sense the line and not just 3 infrared sensors like many basic line follow bots have.
Comment: The chasis... I have not make it yet, and i have 8 sensors in an array.
Comment: This might be a good tutorial for you to look at:

http://letsmakerobots.com/node/39972
Answer: Did you check wikipedia, for example?
I doubt it is possible to describe a PID controller in simpler words than those used by the article.
The pseudocode is quite simple and should be also very good for understanding the concept, when applied to a digital system.
See also the limitations of PID controllers.


African palm oil locusts seasoning & preparation?

Question: In Africa, frying locusts in palm oil is common. What kind of stores might sell them? What's the basic technique for frying them, and how would I add seasoning?
Comment: I'm sorry but we don't entertain recipe requests here. The internet is a wealth of information, though, even for stuff like this. You should be able to find a recipe.
Comment: Are you asking about things like how to season them or just about the basic technique for frying them? The former is a recipe request as mentioned, the latter seems good though!
Comment: @Jefromi the latter
Comment: Where are you @Geremia? Availability will be very different depending on your location.
Answer: Good information at InsectsAreFood. Scroll down for a decent list of places to buy. There is also a site called BizarreFood.com that has a shopping page with all sorts of bagged and canned bugs. It appears that the UK has the best-developed edible insect markets. If you live elsewhere, you might want to research your country's laws, regulations and requirements before you order.


Global Precipitation Measurement (GPM) data download in R

Question: I would like to know if resources exist for downloading GPM data in R. I'm aware of the Hydrological Data Discovery Tools ("hddtools") package, which can be used for accessing Tropical Rainfall Measuring Mission (TRMM) data but does not include a library for GPM.
Answer: I created a function to download data IMERG HDF5 and convert them to raster GeoTIFF. You can see the code in https://github.com/AybarCL/GPM-data-management
Comment: Luis    Thanks very much for providing a solution to my question. I will try the code then get back to you. Many thanks.


Dropbox making duplicate files

Question: My Dropbox keeps making duplicate copies of files, e.g. Becker Job and saving it as Becker Job(1). What is causing this and how do I stop it?
Comment: I just had this issue after powering up a Galaxy Tab 3 after a couple weeks.  Didn't take it with me so it sat powered off.  When I turned it on, I started seeing files being added to dropbox rather quickly.  (1) and (1)(1) in the file names.  Seemed it was in a loop.  I just shut off wifi, signed out.  Signing back in seemed to solve it.
Answer: It's not Dropbox making those duplicates. (When Dropbox has an edit conflict it puts "(Username's conflicted copy yyyy-mm-dd)" after the filename.)
Most likely what is happening is that you, or you and someone you share a folder with, are copying files with the same names to the Dropbox folder and your operating system (I'm guessing Windows) is renaming the second file to avoid overwriting the file.
Check your Dropbox Events log to see when these files are being added, and by whom.
Answer: Is the file a Microsoft Office file? Or a file from a program that has auto save or auto backup features?
I was having the same problem and discovered that it was Microsoft Office's auto save feature creating the duplicates. On your normal file system, it just overwrites the file on disk, however, Dropbox must be saving the auto save file as a duplicate.

Dropbox making duplicate files


Why does Knob and Tube need an air gap?

Question: I know that knob and tube wiring needs an air gap to dissipate heat.
I know that modern sheathed cable does not need an air gap.
I know both are made of copper, one is grounded, one not. So why does one need an air gap and one does not?
Answer: The air gap isn't primarily about heat. It's about electrical insulation. The fabric mesh that was used as insulation was not reliable, and could allow arcing and short circuits (especially if moisture comes into play). It's sort of the same principle you see in overhead power lines.
One could argue that there is a safety factor in the air gap with respect to heat, but the simple fact is that an electrical overload will heat the wires much faster than air could cool them anyway. This could allow the wires to burn or melt, or ignite combustible materials which they contact.
Answer: If this is about blown insulation, several western states repealed their codes prohibiting blown insulation over knob and tube.
Better science showed the large pool of such houses were not bursting into flames as the prognosticators had claimed.
Answer: The "air gap" theory is a myth.
The size of wire used for K&T is the same as for modern wire, plus the joints are better.
The real issues are that most knob and tube circuits are undersized for the modern need, so many homeowners (and some electricians) upsized the fuses.  Rest assured if you have 12 gauge wire and a 20 amp fuse, you're fine.  If you have 14 gauge wire and a 15 amp fuse you're fine.
From Home Energy Magazine 'Knob and Tube Not a Fire Hazard':

Legislation was enacted in Washington state to allow insulating over
  knob-and-tube wiring per Bonneville Power Administration (BPA)
  specifications. This resulted because there were no documented cases
  of a fire being caused by knob-and-tube wiring, whether insulation
  covered it or not.

See also https://diy.stackexchange.com/a/20279/5960
K&T has huge advantages when it comes to driven staples and nails, and fire.  It has theoretical downsides if blown in insulation gets wet.  K&T wire insulation varies in quality from great to really bad -- but fortunately the K&T system does not require wire insulation.

Why does Knob and Tube need an air gap?


Whats the difference between unit cell and motif?

Question: The definition in my material is that motif and unit cells are both a repeating unit, but whereas motif is with respect to 2D lattice the unit cell is with respect to 3D lattice. But I can't find anything online with respect to that.
Answer: Conceptually, the unit cell is the larger object, the (if relating to 3D crystals), the parallelepiped containing the crystallographic motif.  It is the unit cell which, by mere translation along $\vec{a}$, $\vec{b}$, and $\vec{c}$ builds the crystal.  In an analogy, unit cells stash like shoe boxes next to / on top of each other.
In addition to the outer shape and apparent symmetry of the unit cell (the Bravais classes; i.e., triclinic, monoclinic, orthorhombic, tetragonal, rhombohedral, hexagonal, or cubic) the unit cell contains symmetry operators in its inner (the proper rotation axes, mirror planes, centres of inversion, screw axes, rotoreflection axes, glide planes) which act on the crystallographic motif.  In an analogy, these symmetry operators are instructions how to copy and paste the motif within the unit cell.  The motif itself is a smallest representative design pattern within the elected unit cell.
As an example, the illustration below shows how the $c$-glide plane relates two molecules of maleic acid in respect of their position within the unit cell, as well as in respect to their orientation relative to each other:

(credit: Hanson, R. M.; Jmol – a paradigm shift in crystallographic visualization in J. Appl. Cryst. 43, 2010, 1250-1260; doi: 10.1107/S0021889810030256 (open access))
Depending on the the space group symmetry within the unit cell, the position and the symmetry of the molecules within the unit cell, you may encounter motifs which on first inspection might look like incomplete.  For example, if a centre of inversion (molecular level) coincides with a centre of inversion (unit cell level).  The molecule then still is fully described in its geometry, because of the exact completion by the symmetry operators.  As an example, see the following triptych:

(entry COD 2102215)
Here, the left image depicts the crystallographic motif alone.  In the centre, you recognize the triazine molecule, «complete» as if you would draw it in a reaction scheme; but it has been «completed» by applying the symmetry operator of the unit cell.  In the right image, using the same perspective (i.e., again the same direction of observation) you see the complete unit cell when all symmetry operators are applied.  It depends on the software used how (if possible all three of) these levels are visualized with ease.
Primary reference for the crystal structure: Fridman, N.; Kapon, M.; Sheynin, Y.; Kaftory, M.; Different packing in three polymorphs of 2,4,6-trimethoxy-1,3,5-triazine in Acta Cryst. B60, 2004, 97-102; doi: 10.1107/S0108768103026284.
Comment: Here is a reference that is consistent with the meaning of motif that I understand: https://www.doitpoms.ac.uk/tlplib/crystallography3/structure.php
Comment: Thanks for the answer. I love how you went in detail to explain the relation between the two (in a depth much better than my textbook too), but could you add a short definition of the two as well in the beginning?
Comment: I can't seem to find the definition of a motif on the net that I can compare with the definition of a unit cell. Thanks once again.
Comment: Unlike unit cell, motif is not a thing that can be defined rigorously.
Comment: Unit cell is a volume that can build the entire crystal if only the lattice translations are applied. Asymmetric unit cell is a set of atoms that can build the entire crystal if *all* space group symmetries are applied. Motif usually means, as far as I have seen, a set of atoms that can build the entire crystal if only the lattice translations are applied. So I do not quite agree with what @Buttonwood has written. Maybe motif is not always used with the same meaning. It is not so common as the other two concepts.
Comment: @10ppb The help of an elder version of CCDC's Mercury program, archived e.g., about [asymmetric unit](https://bip.weizmann.ac.il/course/structbioinfo/databases/CCDC_Mercury/appa_glossary.4.3.html) as the smaller, and [unit cell](https://bip.weizmann.ac.il/course/structbioinfo/databases/CCDC_Mercury/appa_glossary.4.72.html) as the larger object.


What is the highest DPS weapon that can be used behind a shield?

Question: Some weapons can be used behind shields even when someone is attacking you. Even in mid attack, if you are hit, you won't get hurt. What is the highest dps weapon that can be used behind a shield?
Thank you.
Comment: It Depends on how you advance them. there is a Spear called a Hiede Knight Spear which does lightning damage but there is also really powerful halberd from the knight of the blue in Hiedes tower of flame after the old Dragonslayer. but advancing the regular halberd with an ailment of some sort E.G. fire or poison etc.. may be stronger I haven't progressed enough to find stronger thrust weapons.
Answer: The weapon that inflicts the highest base damage, while being able to attack with your shield up, is the Black Knight Halberd. It can be found in the Shaded Woods as treasure near the third bonfire (Shaded Ruins). It requires 17 strength and 25 dexterity.
It inflicts 213 physical and 90 fire base damage and scales E with Strength, C with Fire and B with Dexterity. Most spears and halberds have a very low scaling, the only one scaling A with Dexterity is Syan's Halberd,  most scale C or lower.
Fully upgraded, the Black Knight Halberd does 320 physical and 130 fire damage. I recommend this weapon if your primary "attacking" stat is dexterity and you possibly invested some points into Faith or intelligence for a fire bonus. If you were going more for strength, I recommend the Old Knight Pike, which has a B scaling with Strength and does 340 physical damage fully upgraded. Unlike the Black Knight Halberd, this one doesn't need Twinkling Titanite, so the upgrading components might be easier to acquire, depending on how far you are in the game.
I'm not sure about the following, but Halberds might need more stamina for attacks than Spears. All spears have a generally lower damage rating, but you might have more hits with them. Also, take into account that halberds mostly have a swinging moveset and are slower when attacking normally. You cannot always rely on attacks from behind the shield and should find a weapon that you are comfortable with in other situations too.


Activity notifications of groups my page joins are turned off, but why do I still get them?

Question: I join several groups as page, and make sure that the notifications of group activities are turned off, but I still get them. Why is that?
Answer: Go to https://www.facebook.com/pg/YOUR_PAGE/groups/ there will be another button to hide notification:

However not all the groups are shown in this list, and not always a group has this option. I don't know why


Should it be easier for employers to see your information once you have allowed it?

Question: I have received messages from potential employers asking for my contact information or a copy of my resume after I have indicated that I am interested and allowed them to see my contact information. What does it look like for them at that point? Why isn't my contact information readily available along with the option to download a copy of my profile as a PDF?
Answer: It looks the same for you as it does for them, in the header details for the message.

This is shown by hovering over it, much like gmail.  I'll bring this up today and see if we can come up with something more obvious for this.
On the employer side, there is a direct link to download the profile right from the message thread.

I'm afraid I cannot think of something more obvious for this one however.
Comment: Cool! Hovering for the contact information isn't immediately apparent, I guess, but I agree that the giant blue button is pretty obvious.


Extended face-planes of an Octahedron

Question: When extending the face-planes of a regular Octahedron, how many cells (bounded and unbounded) are formed in space?
Comment: Brilliant puzzle! So deceptively difficult: at first glance it seems like it should be a trivial geometry exercise, but it's really hard to visualise the problem well enough to figure out the solution. I've spent more than 30 minutes struggling with this, and might have to leave it for some 3D modelling guru.
Comment: @msh210 - yes, it is a regular octahedron, I added it - thanks for that comment.
Comment: Does the octahedron itself count as one of the cells?
Comment: What's the definition of "extending face planes"? How is each triangular face modified (Divided to N smaller triangles in 2d? Replaced with a 3 sided pyramid? Extended to an infinite plane? Something else?)
Answer: (No spoilers for most of this; they'd be too clumsy. There are a few "diagrams", if you can call them that, and I've spoilered those. The rest will only spoil things for you if you read it carefully.)
Let's say our octahedron's vertices are at the six points in space with one coordinate $\pm1$ and the others $0$. Consider what a horizontal slice $z=\textrm{constant}$ looks like. At height $0$, of course it's just a square (with all its edges turned from line segments into lines), so we see 9 cells there, one bounded and the others unbounded. As we move up a little, between height $0$ and height $1$, the edges of that square "split" -- there's one square that gets larger as we move upward, whose edges come from the faces below $z=0$, and one that gets smaller as we move upward, whose edges come from the faces above $z=0$. At any such height we see 25 cells. Nine of them are the same 9 cells we saw at $z=0$ and the others are new. Similarly, as we move downward between $z=0$ and $z=-1$ we have 25 cells meeting each horizontal plane; nine of these are again the same as the ones at $z=0$ and the others are new (and not the same as the new ones at positive $z$). Returning to our upward sweep, the only new thing happens at $z=1$. Here, our central cell shrinks down to zero size so that at $z=1$ exactly we have only 16 cells, which are of course 16 of the same 25 we had for smaller $z$. Then as $z$ increases past $1$ we once again have 25 cells (and this clearly persists for all larger $z$ in the obvious way); again, 16 cells are the same as the ones at $z=1$ and the rest are new. Similarly for negative $z$. The one thing that isn't yet clear, if you've followed all that, is what overlap if any there is between the cells at large (let's say positive) $z$ and the cells at $z=0$. Answer: only the four corner ones.
The following little diagrams may (or may not) help. At large negative $z$ we have

A B C D E
F G H I J
K L M N O
P Q R S T
U V W X Y

and as we approach $z=1$ the central cells get "squeezed" leaving only

A B D E
F G I J
P Q S T
U V X Y

after which replacements for them appear:

A B c D E
F G h I J
k l m n o
P Q r S T
U V w X Y

Now as we approach $z=0$ the "B and D columns" and "F and P rows" get squeezed out instead, so that at $z=0$ we have only this:

A c E
k m o
U w Y

Then, between $z=0$ and $z=1$, all of the above happens in reverse.
Putting all this together, we have:

 $25-16=9$ cells at large negative $z$ that aren't present at $z=-1$; $16$ cells that are present at $z=-1$; $25-16=9$ cells at intermediate $z$ that aren't present at $z=-1$; nothing new at $z=0$. That's 34 cells so far. We have the same things at positive $z$, so 68 cells, but now we've counted the nine present at $z=0$ twice so the actual number is 59.

(There is every chance that I have made an error in my bookkeeping, but I'm pretty sure about the geometry.)

Since this is fiddly and there's another answer giving a different number, I did a little computerized check. Not guaranteed to give the right answer but I'd be awfully surprised if it didn't.

import itertools, math, random
def sign(x):
  if x<0: return -1
  if x>0: return +1
  return 0
# we represent points by (x,y,z) and planes by (a,b,c) meaning ax+by+cz=1
planes = list(itertools.product((-1,+1),(-1,+1),(-1,+1))
def side(pt, plane): return sign(sum(x*c for (x,c) in zip(pt,plane))-1)
def same_side(pt1, pt2, plane): return side(pt1, plane) == side(pt2, plane)
cells = [] # actually a list containing one point from each cell
def in_new_cell(pt):
  for other in cells:
    if all(same_side(pt, other, plane) for plane in planes): return False
  return True
for i in range(10000):
  pt = tuple(4*(random.random()-0.5) for i in range(3))
  if in_new_cell(pt): cells.append(pt)
print(len(cells))
When I run this, it does in fact print out the number I give above.
Answer: My first answer was wrong for 3 independent reason.  Fixing these my new answer is

 59 cells, just as Gareth said.

Because

 There is the center.  1.
 There are 8 tetrahedra on each face.  +8.

 The rest are unbounded cells delimited by the 8 planes of the faces.
 These can be counted by checking how many regions the planes cut on the surface of a large enough sphere around the octahedron.

 An octahedron is defined by 4 sets of parallel planes.
 The first 2 planes cut the surface of the sphere in 3 regions.
 The next 2 planes intersect the 2 previous planes.  They cut a total of 10 regions, two "square" regions on opposite sides and 8 regions between them.
 The 3rd set of 2 planes intersect twice each of the previous planes.  They cut as many new regions as there are intersections.  That is 2x2x4 = 16 more regions.

 At that point there are 10+16 = 26 regions.
 This is exactly the number of apparent pieces of a Rubik's cube.  This is not a coincidence.  The pieces of a Rubik's cube are also the result of 3 pairs of parallel cuts.

 The last 2 planes cut all 6 planes twice each.  It actually doesn't matter how.  There are as many new regions as there are intersections.  That is 2x2x6 = 24 more regions.

  That makes a total of 10 + 16 + 24 = 50 regions cut on the surface of a large sphere around the octahedron.

 If you add it up you get:
 1 + 8 + 10 + 14 + 26 = 59 cells.
Comment: +1 for your answer as well
Answer: I see this has been well-solved, but I have a different kind of solution that I used to find the answer fully in my head with little visualization. The idea is to convert everything from geometry to coordinate algebra.
(No spoiler tags because this is already solved.)
Each face of the tetrahedron is opposite a parallel face, so we can group its 8 faces into 4 groups of 2 parallel planes. Each group of two parallel planes divides space into 3 regions, one in between and two on either side. So, all 4 groups divide space into at most $3^4=81$ regions. We'll figure out which combinations are present.
Turning to coordinate algebra, the eight planes of a tetrahedron are given by equations of the form $\pm x \pm y \pm z =1$. The equations of opposite faces have the left-hand-sides as negations of each other, so we can flip one by negating the right-hand-side to group the equations as:
$$\begin{eqnarray}
+ x + y + z &= \pm 1 \\
+ x - y - z &= \pm 1 \\
- x + y - z &= \pm 1 \\
- x - y + z &= \pm 1 \\
\end{eqnarray}$$
The planes of each equation divides spaces into 3 regions depending on whether its left-hand-side is in $(-\infty, -1)$, $(-1, 1)$, or $(1, \infty)$. (We'll ignore exact equality where a point lies on one of the planes.) So, the region containing a point $(x,y,z)$ is described by which of the three cases contains each of the four expressions $(+ x + y + z, \thinspace x - y - z, \thinspace - x + y - z, \thinspace - x - y + z)$.
A priori, there are $3^4=81$ potential combinations, but we need to find which are actually possible. Note that the four left-hand-size expressions $(+ x + y + z, \thinspace x - y - z, \thinspace - x + y - z, \thinspace - x - y + z)$ are constrained in having a sum of 0. Moreover, as 4 linear expressions in 3 unknowns, they are free to take on any combination of values subject to this one constraint. So, we can forget about these expressions and re-ask the question as:

Given four numbers that sum to zero, how different ordered lists of intervals$(-\infty, -1), (-1, 1), (1, \infty)$  can they respectively lie in?

For example, not all four can lie in $(1, \infty)$ because this forces their sum to be positive rather than zero. Let's count the impossible combinations. Note that if we have two opposite unbounded intervals $(-\infty, -1)$ and $(1, \infty)$, we can make their sum be anything we want for any choice of the other two and be all set. So, any impossible combination must have all the constraints on one "side", say as either $(-1, 1)$ or $(1, \infty)$.
From here, we see if that 2 or more constraints are $(1, \infty)$, then the other two values in $(-1, 1)$ can't be small enough to counterbalance the two $>1$ values. Otherwise if $(-1, 1)$ is the majority, it's easy to find a working solution like $(0, 0, 0, 0)$ or $(-1/2, -1/2, -1/2, + 3/2)$.
So, the number of impossible combinations on the positive side is ${4 \choose 2} + {4 \choose 1} + {4 \choose 0}$, which, remembering Pascal's Triangle, is $6+4+1 = 11$. Counting the corresponding negated impossible constraints on the negative side, we have $22$ unsolvable combinations of constraints, so the total number of solvable ones and thus regions is $81 - 22 = 59$.
Comment: +1 for this solution as well

Extended face-planes of an Octahedron


Do we need to show 1x if there is only one item in a cart?

Question: Do we need to show 1x (quantity) if there is only one item in the checkout summary?
Answer: Yes.
Your users are interested in the value of their purchases as much as they are interested in the quantity.
If the value of my cart suddenly jumps by an unexpected amount I can go and check that I only put one of that particular item rather than two.
This is especially useful if you're operating with a price system that changes often (due to discounts, offers, promotions, etc): Lets say on week one I purchase Item A at $4 during a half-price offer that I didn't notice. On week two I return to purchase the same item again but now my cart total says $8. It looks like I purchased two so I want confirmation that I only purchased one.
Answer: Short answer "yes". Long answer, there are few other things customer would want to do when on cart page:

Increase or reduce the quantity.
Remove the product.
Move it to somewhere else (list or buy later).

I won't try to reinvent the wheel here instead of using the conventions followed on different eCommerce portals -
Amazon

Walmart

Target
Answer: Based on the above
Short:
I don't think you need to. I think its fairly obvious from the name and pricing that its 1 item.
tldr:
I don't think you need to. I think its fairly obvious from the name and pricing that its 1 item.
I would only show items with x2 and above it makes it easier to distinguish the two. This makes it easier when the user is scanning the list to see what they have bought and if they need to correct it, they can do so quicker as its easier to miss things in a long list of item quantities. Thus reducing errors.
A good analogy is if someone taking an order (whether it be a waitress/waiter or the morning office breakfast run). If you have ever seen someone do this you, often notice they either tally (or ad x2 etc) after the items that have been asked for more than once, they don't need to put x1 in front of the rest.
This way makes it cleaner in the UI and easily distinguishable to the user.
BUT
I would make it so that users can increase/decrease the quantity rather than leaving the cart to do it.
Answer: I'd also answer on top of everyone else's great answers the following:
Yes, you need to be consistent. What's your alternative?
Apple         $1
2x watermelon $10?
Your users will be wondering why the apple doesn't have a number next to it, if they added a single apple or a bushel, especially if your site is a site where each checkout includes a lot of items and users may forget what they have done before.
Being consistent spares them from having to think more about a small otherwise-should-be-seamless checkout screen.


How do I make the menu bar opaque when invoking the Dash?

Question: This is an experiment with Unity. Everybody tried to make top panel in Unity transparent. I don't. I want to make top panel always opaque, even when the Dash is open. Is it possible? Or are the Dash and transparent menu bar united?
Answer: Currently, this is not possible. Once the Dash is open, Unity is programmed to make the panel transparent and the icons white.
You could suggest an alternative behavior in a bug report.


Using variables in a nested class JAVA

Question: I am very new to programming and have a question about using variables in what I believe to be called "nested classes."
class BeginningGameTest {

    int attack;
    int defend;

    public static class James
    {
        attack = 25;
        defend = 15;
    }

    public static class Janet
    {
        attack = 45;
        defend = 1;
    }
    public static class Jackson
    {
        attack = 10;
        defend = 20;
    }

    public static void main(String[] args) {

        System.out.prinln(James.attack);

    }
}

Do I have the general idea down? I would like to save variables that are the "same" thing, but are different from class to class and are accessed differently like in the print line. I do get a few errors, what should I do to keep the same concept and still keep it fairly simple so I could understand it? Are there any easy to understand tutorials for people who are new to programming in general?
Thanks in advance!
Comment: What are the compiler errors?
Comment: Why don't you compile and run your code and see if it does what you expect? Then if it doesn't meet your expectations, you can read a [tutorial](http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html) (<- that's a link btw).
Comment: Like I said, I'm kind of new. Is there anywhere you could point me to get some understanding on the way classes work?
Comment: @user2057930 Start with Google. There are a *lot* of basic Java tutorials out there. The official ones from Sun/Oracle are a great place to start.
Answer: The design of this seems incorrect.
What you're trying to go for when working in an object-oriented language is the basic model of something you wish to represent.
Those three static classes seem to represent the same type of object, so let's create a simple model for them.  Think of models like a cookie-cutter.  Every cookie cut with this will be the same generic "shape", but will have different characteristics about it (sprinkles, frosting beard, etc).  This model should be in its own separate file.
public class Player {

    private String name;
    private int attack;
    private int defense;

    public Player(String theirName, int theirAttack, int theirDefense) {
        name = theirName;
        attack = theirAttack;
        defense = theirDefense;
    }

    // create getters and setters for their attack and defense
}

To actually make use of it, you'd want to instantiate the object.
public class BeginningGameTest {
    public static void main(String[] args) {
        Player p1 = new Player("James", 25, 15);
        Player p2 = new Player("Janet", 45, 1);
        Player p3 = new Player("Jackson", 10, 20);
        // interactions with the objects below
    }
}

Some superb beginner resources already exist in the Java tag wiki; give those a thorough reading.  Try new things out, and don't be afraid to ask (good) questions about things you don't understand.
Answer: You should create an inner class then define instances of that class within the main method.
public class BeginningGameTest {

    public static void main(String[] args) {
        Player james = new Player(25,15);
        Player janet = new Player(45,1);
        Player jackson = new Player(10,20);

        System.out.println(james.getAttack());
    }
}

class Player{
    int attack;
    int defend;

    public Player(int attack, int defend){
        this.attack = attack;
        this.defend = defend;
    }

    public int getAttack() {
        return attack;
    }

    public void setAttack(int attack) {
        this.attack = attack;
    }

    public int getDefend() {
        return defend;
    }

    public void setDefend(int defend) {
        this.defend = defend;
    }

}

Answer: You should use the concept of instances to distinguish persons, rather than defining a class for each person. You can define a single class "Person" and instantiate James, Jackson etc. To give them each different attack/defence values, you can use constructors with arguments.
I feel that you might benefit from reading an introduction to object oriented programming. Try searching for "object oriented programming".
Answer: You can go two ways about this. You could create subclasses such that James, Janet and Jackson are all classes of the same type, being BeginningGameTest. For example, James could be:
public class James extends BeginningGameTest
{
    public James()
    {
        attack = 25;
        defend = 15;
    }
}

What I think you want James, Janet and Jackson to be, are not subclasses, but rather instances of the same class BeginningGameTest, like this:
BeginningGameTest James = new BeginningGameTest();
James.setAttack(25);
James.setDefend(15);

There are a few concepts you should read upon:

Classes vs instances
Inheritance

And I also implicitly introduced you to the concept of setters (and getters), typical for Java beans.
Answer: This will work:
public static class James
{
    static int attack = 25;
    static int defend = 15;
}
// ...

Then this would work:
public static void main(String[] args)
{
    System.out.prinln(James.attack);
}

This is probably a better design:
public class Player()
{
   public static enum NAME { JAMES, JANET };

   int attack, defend;
   public Player(NAME name)
   {
      switch (name)
      {
         case JAMES:
            attack = 25;
            defend = 15;
            break;
         // ...
      }
   }

   public static void main(String[] args) throws Exception
   {
      System.out.println(new Player(NAME.JAMES).attack);
   }
}

This is a better design for realistic requirements: (allowing run-time creation of players)
int attack, defend;
String name;
public Player(int attack1, int defend1, String name1)
{
   attack = attack1;
   defend = defend1;
   name = name1;
}

Comment: ...what if I want a player named "Makoto"?
Comment: Said player may be dishonest and lie about his/her attack/defend (but has access to call the function?) and we may want to avoid that. Or Makoto is simply not allowed to play. It all depends on the requirements. My last edit probably makes the most sense for practical requirements.
Answer: What you can simply do is create different objects of your class that will hold different values of variables attack and defend. Here is the code for the same.
/* package whatever; // don't place package name! */
class Main
{
    int attack,defend;
    public Main(int attack,int defend)
    {
        this.attack=attack;
        this.defend=defend;
    }
    public void show()
    {
        System.out.println("attack: "
        +attack+" defend: "+defend);
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        Ideone James = new Main(125,15);
        James.show();
        Ideone Janet = new Main(45,1);
        Janet.show();
        Ideone Jackson = new Main(10,20);
        Jackson.show();
    }
}

Using variables in a nested class JAVA


Make .jar executable on Chrubuntu via command

Question: Im running chrubuntu, im trying to run a minecraft jar file via command (as is not possible via properties page) Whatever command Im using its telling me that no such file exists, I think this may be to do with incorrect ownership of the file? Any advice, thanks!
Answer: The minecraft.jar file is actually just a launcher, it downloads the neccessary files for minecraft and puts them in the .minecraft folder of your home directory.
I'm also running minecraft in chrubuntu, and it works fine. Looking at the file I downloaded, it is actually called "Minecraft.jar" (capital M), so make sure that your file is actually called "minecraft.jar".
The jar file does not require executable permissions (it only has rw permissions on my system).
Try moving the file to your home folder, make sure that it is called "minecraft.jar", start a new terminal window and run
java -jar minecraft.jar

If that does not work, make sure that your user owns the file. If your username is "myuser" type
sudo chown myuser:myuser minecraft.jar
chmod +r minecraft.jar

to make sure that the file is owned my you, and that it is readable.
To make sure that the file is actually there, type
ls -la minecraft.jar

which would print something like this
-rw-rw-r-- 1 myuser myuser 280212 mar 15 16:44 minecraft.jar

If everything else fails, try downloading the file again. Good luck.
Answer: You can change permissions like this.
sudo chmod 700 minecraft.jar

Than run this with java environment:
java -jar minecraft.jar

Make sure that you use the right path to .jar file. You can always drag and drop (a) file/files into terminal, instead of typing the path.
So in this case type:
sudo chmod 700

followed by dragging minecraft.jar into terminal. Then hit Enter key.
Comment: I just tried, its saying cannot access "minecraft.jar" no such file or directory
Comment: @user265958 Are you in the location of the .jar file? Is it called minecraft.jar?
Comment: yes its called minecraft.jar and is on my desktop, so path would be home/myuser/desktop/minecraft.jar?
Comment: @user265958 Yes. Try this command: `sudo chmod 700 ~/Desktop/minecraft.jar`.
Answer: This is the easiest way:
sudo chown $USER:$USER minecraft.jar
chmod +x minecraft.jar


Convert reference to a specific style online

Question: Is there any online tool to convert references to a specific style (of a journal)? Preferably, it is better that no Latex knowledge is needed!
Answer: It isn't clear from your question (and perhaps you could clarify it) exactly what you are wanting to convert from. I think it's highly unlikely that there is something that will convert from any arbitrary format that you choose as input. That said, however, there are several things that might help you.

If you can locate the reference on Google Scholar, then you will find
that there is a link labelled Cite below each reference that is
returned from a search. When you click the Cite link, you will find
the reference you searched for formatted for MLA, APA, Chicago, Harvard and Vancouver
styles. In addition, there are methods for exporting the citation to
Bibtex, Endnote, Refman, and
RefWorks. One or other of those formats can also be used to import
into Zotero.
If you know the DOI of the paper you want to cite, then you can use Crossscite.org to give you the citation in your desired format
If you locate the paper online, even if access is behind
a paywall, you will frequently find that there is a pre-formatted
citation waiting for you. For example, if you look at this paper
called "Interactive Data Exploration with Smart Drill-Down" (DOI
10.1109/TKDE.2017.2685998) you will find that there is a link on the page that is provided by the publisher to help you. The link is
in a box saying "Cite this", and when you click the link, you are
given the same kind of options as in Google Scholar. Not every publisher provides such a simple citation option, but many do.
Finally, it
isn't clear whether you are already using a citation manager such as
Zotero. If not, then even if you do not need all the features that
Zotero offers, you will find that it can import references from a
host of sources and then format them into almost any journal format
you can imagine.

Added later: If you have many references to format, and you don't like the idea of installing and managing a citation manager on your own computer, consider just creating a Zotero account. Your online Zotero library (up to 300 Mb) will be managed for you, and you will be able to get it to display a correctly formatted reference for most journals.
Comment: +1 for Zotero, reference managers are such a boon. And you can disable syncing files to the library, making the list of references effectively infinitely large.


how i can appear multiple well in a list view

Question: I work on a mobile application. I have to post a list. The client wants to display several information about each item. This will not give a good appearance of the interface. I am looking for a solution that can complement the customer. This is a draw that can explain the demand.
The circle that contains a "?" The symbol means a pop-up window.
Answer: Think about what information is part of one item. Check with your users what information is most important. Show this in the list. Show the other information only after the user clicks on the item.
Give your items more 'breathing room'. Increase the margins. It will give your list a much clearer look. When text is too long, truncate it.
See the image below. The items have a lot of room and show only three things (title, subtitle and date). The rest will be visible when users click the item.


Creating a View for just SharePoint Lists

Question: Is there a way to create a Web Part that would only show lists in SharePoint 365? I know how to add a web part that would show Document Libraries, etc., but I wonder if there a way to just show lists. The issue is that my site has a lot of Lists, Documents Libraries, etc, and when users go to Site Contents, it shows all of them, and I can't find a way to filter them by Type. Any hint would be appreciated.
Comment: yes, you can. Try it and let us know if/when you get stuck on something.
Answer: It's true that we cannot filter site contents in SharePoint Online.
The direct way to display all lists would be to create a site page and then manually add all list web parts on the page. This process can be automated with PowerShell.
You can also use Highlighted content web part. Add the web part on a Site Page and apply custom query under "Query text (KQL)".
This is the query text I use:
<code>(contentclass:STS_List) -contentclass:STS_ListItem_  Path:https://{siteURL}/Lists/
</code>

References:
Create Web Part in Modern SharePoint Online: PowerShell.
Use the Highlighted content web part.
SharePoint 2013 Keyword Query (KQL) Content Class Property Restrictions.
Comment: Brilliant. I haven't used the Highlighted Content Web Part option before, thanks for the suggestion. Just for curiosity, I wonder if would be better to just use REST instead (`_api/web/lists`).
Comment: @cubanGuy I'm not familiar with Search REST but of course you can give it a try.


Can a holder of a Commercial Pilot License be compensated for business flight expenses?

Question: I'm buying a plane with business partners as we travel often for business.  If I obtain my commercial license can I then be reimbursed or technically "compensated" for all flight expenses whether one, two or no partners are on the airplane with me.  I have zero interest in taking compensation for non-business related flights.
Answer: To answer your question.  Yes, you can be compensated for all those scenarios provided your company owns the aircraft.  You will fall in the second bullet point below.  You can use your commercial certificate to fly under Part 91 and get compensated for it.

If you have a commercial pilot certificate you are allowed to get paid to fly an airplane.  The rules for commercial pilots differ on who is offering the aircraft.

Either you or your company is offering an aircraft to transport passengers who pay your company for that transportation.  This will require a Part 119 operating privilege issued under either Part 121 (airline) or Part 135 (contract) operations.

You are flying an aircraft that is provided by the passengers or their company.  In this case, you can operate under Part 91 rules and do not need an operating privilege under Part 119.

The second example is done all the time with corporate flight departments.  The company owns the aircraft to fly their employees to meetings and such.  They hire commercial / ATP pilots to fly those aircraft for them.
They even take passengers / family members who are not a part of the company to their desired location.  The difference here is those passengers do not pay the company for the flight.
If I purchase a Cessna 172 and want to hire a pilot to fly me to my destination that would be legal under Part 91 as I own the aircraft and I hire the pilot.  If the pilot owns the aircraft and I hire them and their plane, they will need a Part 119 operating privilege.
Some may say there are exceptions where the pilot owner shares the pro-rata cost of the flight with me.  That only works if the owner pilot has a bona-fide purpose of going to that destination airport that originally didn't include your wishes.  That would be a private pilot privilege and not a commercial pilot privilege though.
Even though you will have a commercial pilot certificate you are not always acting as a commercial pilot when you fly.  Sometimes you will be acting like a private pilot.  Think of a truck driver who parks their 18-wheeler semi-truck for the day and then hops in their SUV and goes home.  One is a commercial operation, and the other is a private operation.
Comment: Great and clear answer! I like that you make a distinction of "acting like." I've heard the term of art "exercising the privileges of..." For example, you could exercise your private pilot privileges and expense the flight under 61.113, or your could be hired by your company to fly the company plane and exercise your privileges afforded by your commercial pilot certificate.
Answer: Yes, you don't even need to wait until you get a commercial certificate either.  CFR part 61.113 states:

(b) A private pilot may, for compensation or hire, act as pilot in command of an aircraft in connection with any business or employment if:

(1) The flight is only incidental to that business or employment; and

(2) The aircraft does not carry passengers or property for compensation or hire.

You don't give up private pilot privileges when you earn a commercial certificate, so if a private pilot may be compensated under the stated conditions it makes sense that a commercial pilot could as well, for confirmation we look to CFR 14, part 61.133 which states:

(1) General. A person who holds a commercial pilot certificate may act
as pilot in command of an aircraft -

(i) Carrying persons or property for compensation or hire, provided the person is qualified in accordance with this part and with the applicable parts of this chapter that apply to the operation; and

(ii) For compensation or hire, provided the person is qualified in accordance with this part and with the applicable parts of this chapter that apply to the operation.

So yes, you may reimburse yourself for flying expenses related to your and your partner's business.
Comment: @wbeard52, did you read and process the entire message of my answer?  He asked "IF" he obtains a commercial cert.  I pointed out first that you don't even need to have a commercial certificate to do what he is asking, and finished by quoting the commercial regs for good measure.
Comment: Why the downvote? Please have the courtesy and fortitude to provide constructive feedback whoever you are...
Comment: I took his question as he will have his commercial certificate and wants to know if he can be compensated after getting his commercial certificate.  I didn't read your answer all the way.  I saw the reference to private regs and moved on.  I think though the commercial regs you quoted are incomplete to fully answer why he can be compensated from his company.
Comment: I didn't downvote but you are quoting private pilot regs when the OP is asking about commercial operations.
Comment: @wbeard52, well, he did say "if"...
Answer: 14 CFR 61.113(b) allows pilots to receive compensation when acting as PIC "in connection with any business or employment."
Note, this only works if you're the sole occupant of the airplane. If you have passengers, even if you're all flying to the same business meeting, the most you can do is split the expenses between all passengers. The Mangiamele ruling has this to say:

Thus, because you are transporting people to the meeting, you may not
seek reimbursement from your employer for this flight under 14 C.F.R.
§ 61.113(b ).

There might be another scenario that works for you since you mentioned getting your commercial pilot license: Have the company purchase the airplane and hire you as the pilot to fly it. (See @wbeard52's answer)
Here is another good resource from the AOPA if you want to read more about expensing a business flight.
Comment: 61.133 covers Commercial licenses.
Comment: Your answer is a good one, and technically correct, but the "passengers" in this case are both owners of the aircraft, and owners of the business.  I don't think your suggestion that the company purchase the aircraft and hire him as a pilot is really necessary, or correct.
Comment: @MichaelHall I think it depends on how the ownership is actually structured and where the reimbursements are coming from. You can be both the owner of the business and an owner of the aircraft, but if the _business_ itself doesn't own the aircraft, but paying the owner/operator for the expenses associated with the use of the airplane, the owners of the aircraft (even though they own the company receiving the services) would need a Part 135 license.
Comment: I'm not an aviation or corporate lawyer, but pretty sure you only need a part 135 license to haul paying customers.  If you are business partners and co-owners of an airplane you use in the furtherance of your business, why would you burden one partner's personal salary with aircraft operating expenses and not write it off as a joint business expense?  I don't see anything in the regs requiring you to do so.
Answer: Yes, in your case it might be better to get hired, a contract could be put in place to avoid cost confusion of these business trips, while your efforts can't be neglected, it's a workaround in a way that should be legal.
What's most important is that you need an operator to operate the plane, maintenance, airworthiness, parking, registration etc.. That's the hectic part.
It depends if you are under FAA or JAR to see which parts and licensing etc, to be applied. I am using ICAO concepts here, that are above anything.
Nevertheless I will quote from faa.gov : from this handout

While a commercial pilot certificate grants you the privilege to carry
persons or property for compensation or hire, you must also meet the
requirements of the applicable parts (e.g. Part 119; 133, 135, 137
etc.) of the regulation. This means that you might need to obtain an
operating certificate or fly for someone with an operating certificate
(e.g., an air carrier)


Cloud-solution for wordpress server overload

Question: I have wordpress site on Linode VPS (Ubuntu 11.04). Site working fine, but sometimes i have Digg-effect (large numbers of simultaneous visits) and my site has down. I looking a cloud-solution that worked only when the linode-server can not process a large number of requests. Thanks for help..
Answer: Simplest thing to do is place a caching server infront of wordpess, such as varnish-cache
Or there are nginx + memcache setups that are also viable, at any rate reducing the amount of dynamic content generation will help alleviate a lot of the strain on your solution.
Update:  voretaq7's comment reminded me of the W3 Total cache plugin, this is a great plugin that allows you to take database and objects and cache them within word press using a variety of technologies.
Comment: Reducing your dynamic content generation should be step 1.  You'd be amazed how much your VPS can serve if it's only got to take the data off disk/out of RAM and hand it to the client.  It's the database-querying PHP-processing bit that kills sites.
Comment: http://fennb.com/microcaching-speed-your-app-up-250x-with-no-n
Comment: I tried to install varnish but it is not yet so.
Comment: @BohdanHdal You of course need to configure it, to run on port 80, cache lifetimes etc.
Answer: Have you considered using something like CloudFlare as a CDN?
Comment: Thank you. I have already paid attention to CloudFlare. You know any alternatives of this service?
Comment: I think that if you google for CDN, you will find a lot of commercial alternatives. The wikipedia page on it has lots of alternatives listed too.
Answer: My first instinct mirrors Oneiroi's position... but to try and be creative, spin up cloud instances when under load and start issues temporary redirects to the cloud server's DNS name. Of course, anything generated still has to be sourced from over there, and thus already copied across the network.


Magneto 1.9: checkout strange behavior

Question: Very often I observe customers adding to cart then moving to the checkout then disappearing. It looks like a bot or maybe competitors searching for our products and trying to hit us with fake purchases. Google charges us anyway so it cost us money. Very annoying. Any suggestions on what can I do with it or if it is a bot how to make sure and eventually block?
Comment: I would review the web server logs for patterns in the user agent and IP address(s) that will help you make your case that this is illegitimate traffic. Ultimately, it seems like you will need to appeal to Google to remedy this abuse of their system.
Answer: Check the robots.txt and add restriction to bots.
User-agent: Yandex
Disallow: /

User-agent: baiduspider
Disallow: /

User-agent: AhrefsBot
Disallow: /

User-agent: BLEXBot
Disallow: /

User-Agent: *

Check you logs , if you see strange ip accessing your site .
Get in contact with your hosting provider , see what they can help you on this , while getting server logs.
Comment: Added agents to my robots.txt. However it looks like someone is going tough the whole process from selecting page selecting product, add to the basket then go to the checkout entering some data (address, email, phone) then disappearing .... strange.

Magneto 1.9: checkout strange behavior


How to prevent Synaptic Package Manager from asking for password?

Question: This is similar to How to prevent system applications (like the Software Center) from asking for password? However that solution does not work for Synaptic Package Manager in 10.04.
Comment: I know you what you want to achieve, and you might have heard this before, but: This is not a good idea.
Comment: @chauncellor --  Why is this *necessarily* a bad idea?  Is this not a situation where rational risk assessment can be employed?
Comment: Like all things, assessment is up to the administrator. Normally I could understand disabling such a thing for offline boxes but obviously you are online. Policies are there for a reason and when you circumvent security measures you are sacrificing a portion of safety. Whether or not it's worth the risk is up to you. But you are asking to be granted infinite root access for a program - something that could be exploited should any with malicious intent decide to target you.
Answer: The Software Centre falls on PolicyKit for its permissions. This allows the fine grain permissions you've seen. Synaptic does not. Like the command line tools, it needs to run as root.
The most simple way to allow a user access to it without having to type their password is by editing /etc/sudoers. This would allow you to set certain sudo commands to not require a password.
username  ALL=(ALL) ALL, NOPASSWD: /usr/sbin/synaptic

Nabbed from here.
You might then have to edit the launcher from gksu synaptic to sudo synaptic. But you might not.
Comment: I have no root password on my Raspberry Pi and it still asked for it. Only adding `sudo ` to the beginning of the launcher fixed it for me.


MySQL for Commercial Web Application

Question: We have created a web application hosted on virtual machine for client access through web only, no distribution . The database we have used is MySQL Community Edition under GPL 2. The application is connected to MySQL though MySQL Java connector. Are there any impediments in this case considering GPL 2.
Answer: The use of a MySQL database server has no effect on your software. The GPL only extends to derivative works of the GPL-covered software. Most likely, just communicating with a separate process is not enough to create a derivative work.
However, the use of a GPL-covered library in your application means that your application would be subject to the GPL as well. You do not have to publish your software, so this is typically not a problem for server-side software. However, if you give anyone else a copy of the software then you can only do so under the terms of the GPL.
If this is a problem for you, you could look for an alternative MySQL client library, or put the code that communicates with MySQL into a program that is clearly separate and independent of your main code, e.g. a kind of storage microservice. Or you could buy a commercial license, which seems to be the point of keeping the official Java connector under the GPL.
An even better solution might be to look at MariaDB (a highly compatible fork of MySQL after Oracle acquired MySQL). The MariaDB connector is available under the LGPL license, which imposes no license requirements on you as long as you keep the connector in a separate JAR. The MariaDB connector might still be compatible with a MySQL server, but of course this is not guaranteed.
Comment: It is not axiomatic that cross-process communication doesn't create a derivative work.
Comment: @user253751 full agreement, which is why I qualified that statement as "most likely". The [FSF analysis on this aspect](https://www.gnu.org/licenses/gpl-faq.html#GPLInProprietarySystem) suggests that communication should be "at arms length", but I would generally expect this to be the case for a database wire protocol.
Comment: maybe for a generic protocol, but it's not obvious that communicating with a MySQL server using the MySQL protocol and MySQL command syntax doesn't make your program a derivative of MySQL

MySQL for Commercial Web Application


Why to put unstructured data in NoSQL DBs?

Question: The statement that NoSQL databases are better for unstructured data because of their schemaless nature can be found everywhere. Frankly, I don't understand that. A human voice recording is often be used as an example for unstructured data. I can store it in a relational database with datatype BLOB, in a well defined schema. Can somebody explain?
Comment: Care to provide at least one authoritative source of that broad claim? "Can be found everywhere" is not very useful.
Answer: In case of CLOB or BLOB, you can not perform any query on the data looking for a key value.
What if someone has sent you a comment on your article with some racial words in between and you haven't read the comment logs at all.
How will you analyze your logs content looking for a key word if each comment is stored in CLOB or blob?
Answer: Check the comparison where NoSQL has better results.
NoSQL databases can store structured, semi-structured and unstructured data. Their main advantages focus on semi-structured (JSON, XML, not all fields are known) and unstructured.
But, you can safely store BLOB in a RDBMS, e. g., Oracle Database and many others relational databases.

The people talking about NoSQL be a better sollution to store
  unstructured data, not always had built an IT infrastructure, and
  they're replaying what they heard.
Also the trend to think that newer is always better push to this.

But some scenarios NoSQL+unstructured data could be better: to scale out, hundreds of db instances, big data and cloud.
Comment: Well... I know, that NoSQL-DBs can store all kinds of data. That was not my question. And I know, that I can store BLOBs in RDBMS. I wrote that. My question was, WHY everywhere on the internet the statement can be found, that NoSQL-DBs are a better solution for unstructured data.
Comment: Now I got and I agree with your point. I'll edit the answer.
Comment: I agree that `NoSQL` data can scale better as you dont have to define the schema upfront. But I am not necessarily sure whether its valuable to store all data. There is cost associated with storing a lot of data, security considerations. What will happen when you keep collecting data, and then you are afraid of throwing away that data, because in some distant future you could gather some insight out of that data?
Answer: The term "unstructured data" has many connotations and probably may mean different things for different people. And a voice recording is definitely not the best example for "unstructured data". As you said, it can simply be represented as a blob in an RDBMS. Similarly a large text document can be stored as text type in RDBMS. When it comes to unstructured/semi-structured data, you may not know all the attributes of the data upfront. As RDBMS expects you to define everything upfront (esp the column name and datatype), it will be hard to manage this kind of data in an RDBMS.
Lets us say, you want to track per user when is the last time he visited a country. You also want to look up the date quickly given a country name. In a NoSQL database you can model the table in such a way that country name is a column and the cell will have the last visited date. You do not need to create all the columns (with all possible countries) upfront. As and when you want to add information for a user, you can add the country column and the last visited date. When you want to know when the user visited a country 'x', you can query only for that column for the userid (primary key).
Comment: There are use-cases where the NoSQL approach is better, but in the example given with users visiting countries and storing the last visited date: In an RDBMS that's just a table user_country with primary key (userid, country) and an additional column last_visited_date. SELECT last_visited_date FROM user_country WHERE userid = ? AND country = ?;
Comment: Agreed. There are pros and cons in both models. In this RDBMS datamodel, if you want to read all countries of a user, the query will result in 1 I/O per country in the worst case as they are separate rows. Whereas, in a typical row-oriented NoSQL, it will be a single I/O, as the primary key is on userid only. In case of NoSQL, the updates to a single country pay more cost as the entire row will get updated. So, it is 1 I/O but larger I/O compared to your RDBMS datamodel where the I/O size is small. Composite primary keys also comes with baggage of how you can partition the table.


In SharePoint Online, is it possible to filter a standard View based on the documents that specific group(s)/user(s) have been granted access to?

Question: I'll be creating sensitive financial documents for 20 locations worldwide.  I'll stop inheriting permissions and granting permissions at the file level.  I would like the permissions I grant for each document to drive what is displayed in the View of each location.  How can I make that happen? I tried the metadata 'Shared With' but it's not working, it doesn't seem to be the one I need. Thanks for helping
Answer: As far as I know using out of the box features are not allowing you for that. There are multiple 3rd Party solution providers that allow you for something similar.
Comment: Can you name a few 3rd party solutions?


Car sputtering with the engine hot at start (or within ~2 minutes)

Question: My 2004 Hyundai Sonata cold starts great (i.e. when I first get into the car for the day, morning or afternoon).  The problem I have is that when I stop the car after driving around for a while it sometimes sputters at start up.  It only happens if the motor is warm, and it has been parked for a medium period of time (i.e. about an hour).  Sometimes the sputtering doesn't occur immediately at start up, but when backing out of the parking spot, or I've even had it occur when pulling out of the parking lot itself.  After the sputter I give it a little more throttle, and it takes off.  It runs great after that.  Any ideas?
Answer: Hot-start problems are indicative of loss of pressure in the fuel line. This is usually caused by a leaky fuel injector.
The reason why this happens only for hot starts is because the fuel is more likely to vaporize as temperature increases. In order to avoid vaporization problems the fuel lines are expected to be pressurized during a hot start. Of course, if there is a fuel leak then the fuel may have partially vaporized by the time it reaches the fuel injectors, resulting in the "sputtering" symptoms that you have experienced.
Comment: I was thinking along this same line.  This car had a problem a few years back with not wanting to start after filling up at the pump.  If I stood on it when starting it would take right off.  I ended up changing the fuel line purge valve, and it worked like a charm.  Talked to a local mechanic and that was what he thought as well.
Answer: The first thing that comes to mind is an ignition problem. As in, either your coilpack, HT leads (the cable running from the coilpack to the spark plug) or a spark plug is faulty. THe symptoms are consistent with what you describe.
Comment: Would bad ignition go away after initial startup like what the OP describes?
Comment: Yes. In the early stages at least. My car behaved like that at first, then got progressively worse until I replaced the coilpack.


Why don't electrons pair in [Fe(NH3)6]2+?

Question: Why doesn't electron pairing take place in $\ce{[Fe(NH3)6]^2+}$ though $\ce{NH3}$ is a strong ligand field producer?
Comment: Because $\ce{NH3}$ isn't a strong-field ligand.
Comment: Good thing I found this page, for an entire year I thought $\ce{NH3}$ was a strong ligand.
Answer: (If you know the basics, go to last paragraph and skip the introduction part)
There are two types of ligands. Strong field ligands and weak field ligands. Those which only cause a small extent of crystal field splitting is called weak field ligand and those which cause large splitting is called strong field ligand.
Why does crystal field splitting take place?
Let's take an octahedral complex. The $d_{x^2-y^2}$ and $d_{z^2}$ point along x,y,z axis and the $t_{2g}$ orbitals point between the axis. When the 6 ligands approach along the three axes, the energy of the $e_g$ orbitals increase more than the increase in the energy of $t_{2g}$ orbitals. Hence the d-orbital splits into two. Filling each electron in $t_{2g}$ orbitals decrease energy by $0.4\Delta_0$ and filling electrons in $e_g$ increase energy by $0.6\Delta_0$
Coming back to your question, you know how electrons are filled in the orbitals (according to hund's rule of course). But how does electron pairing take place in your case?
Let the energy required to pair an electron be P.
Let's say there are 4 electrons. The two arrangements are one electron in each sub-orbital (no pairing) and 4 electrons all in $t_{2g}$ itself (instead of 4th electron going to $e_g$, its paired up in $t_{2g}$).
In the first case, the total energy is $-0.6\Delta_0$ and in second case, its $-1.6\Delta_0+P$. So, only strong field ligands can form the second arrangement. $P$ value is constant for a given metal ion.
Finally, ammonia is weak field ligand but in certain cases, it acts as a strong field ligand (example: for Cobalt). For Fe, ammonia is a weak field ligand. Hence no pairing takes place.
Comment: I know I'm **quite** late for this party, but is there a specific reason why $\ce{NH3}$ is a weak ligand toward $\ce{Fe}$ but strong toward $\ce{Co} ?$
Comment: @PrittBalagopal No you cannot. A certain combination of metal and ligand can exist in **both** a high and low-spin configuration. One of my [tag:coordination-chemistry] answers has the data which I am too lazy to dig up right now. All I remember is that the ligand is nitrogen-based.
Comment: @Jan actually, you can classify them based on whether $\Delta$ is greater or less than pairing energy for the electrons.
Comment: There are not two types of ligands. At the very best, there are two extremes and a very broad range of in-betweens between them.
Answer: The dichotomy between weak- and strong-field ligands that I have often seen constructed here is false and physically inaccurate.
Complexes can be in a low-spin state or in a high-spin state. The high-spin state is the one according to Hund's rule where electrons are filled into the five d orbitals one after the other. A low-spin state is any complex in which the Hund rule is not strictly observed, but some orbitals are filled with two electrons while others remain empty. Classic examples for high-spin complexes are, e.g. $\ce{[FeCl6]^3-, [CoCl4]^2-}$ and others. Examples for low-spin complexes are, e.g. $\ce{[Fe(CN)6]^3-, [Cr(CN)6]^3-}$ and others.
While these examples may seem to exemplify your stated dichotomy (with chloride being on the weak-field side and cyanide being on the high-field side), reality is much more complex and the spin state of a complex depends on ligands, metal, oxidation state, counterions and so on. In fact, for 2-picolylamine ($\ce{2{-}pic}$) as a ligand to iron(II), both the low-spin and the high-spin $\ce{[Fe(2{-}pic)3]^2+}$ complexes have been isolated and characterised by crystal structures. The $\ce{Fe-N}$ bond length differs by $19~\mathrm{pm}$ with the high-spin complex obviously having longer bonds.
Complexes have a tendency to be in the low-spin state if

the metal is not a 3d metal
the metal's oxidation state is higher
metal to ligand π-backbonding can take place.

Especially that final point is important. Ammonia is very bad at π backbonding (and amide is even π-donating). So calling it a high-field ligand is misappreciating physicochemical reality. It is just ammonia's strong σ bonding ability that causes a slightly larger field split than water. As such, ammonia is best termed a medium-field ligand. (The same is true for most neutral nitrogen donors.)
Comment: Nice thank.! So for third point, N does not have empty orbital in Nh3 is that reason for no pi back bond. Thank generous soul
Answer: $\ce{NH3}$ is placed in the middle of the spectrochemical series.
It mostly acts as SFL but sometimes may act as WFL.
When a metal ion having higher charge is interacting with ligand NH3 it acts as a SFL.
When the metal ion has lower charge it acts as WFL.
EG: $\ce{Co^2+}$ and $\ce{Co^3+}$
In $\ce{Co^2+}$ $\ce{NH3}$ acts as WFL.
SFL:Strong field ligand
WFL: weak..


What is the musical form of Stravinsky's Rite of Spring?

Question: What is the musical form of The Rite of Spring by Stravinsky? I'd like to know the form and where each section is so I can better understand it. What sections define motifs? And what sections are development of motifs?
Thanks for any information.
Answer: You should work this out yourself. This is how you learn. If you go off someone else's analysis you may learn something that is not the best or even correct.
Get the best audio recording and performance you can and get the best score.  Follow along the music with the score many times to get a feel for what is going on. Make notes for the various motifs, phrases, sections, etc.  This is not hard. You might feel when you start that nothing makes sense, but as you fill in the dots things will materialize.
When you connect the visual with the aural you'll be more in tune to know what is happening. When you hear a developed motif but don't see it, you can see what is going on then adjust your visual interpretation. Similarly when you don't hear a motive but see it. There is a high correlation between the visual and aural(obviously, since the visual(the score) is used to create the music).
Since you are unique and your understanding of music is different than everyone else's, it is in your best interest to figure it out on your own. you can dive as deep as you need in to the music and score. You can notate all the chords if necessary, notate the motives and motifs, the non-chord tones, etc. When you come upon something that seems to not-make sense, skip it and come back later... usually your brain will have figured it out by then.
With something like Stravinsky, you can except to have non-standard things. (after all, each of the "masters" are different and this is what sets them apart from the copy cats who just blindly apply formulae).
The divisions between sections must be "obvious"... else they would not be sections. Contrast is what produces the sensation of change. So getting the larger sections down usually is relatively easy. (e.g., key changes, rhythmic changes, motive changes, etc... usually many occurring simultaneously to enhance the effect of something new)
Sometimes different sections have virtually nothing different except one key element that makes it obvious. Again, it has to be obvious or else there is no change but just a variation/development.
Answer: Stravinsky's Rite of Spring is an entire ballet; as such, it's difficult to say what the form of the entire work is. Furthermore, it's in two distinct parts, which makes it even more difficult to think of it as a single form. (Though we could be really obnoxious and call it a simple binary AB form...)
We can discuss and describe individual "movements" within the ballet, but not the entire work itself.
What may be helpful is to find a CD of the piece---I recommend Gergiev conducting Kirov---and using the individual tracks to get a grasp on the piece.


Would you be able to use mountain bike/straight bar cable brake levers as auxiliary/inline brake levers on drop bars?

Question: Really dumb question, but would this be possible, with or without practicality? Drill a hole in them, perhaps?
Comment: Do you mean cable or hydraulic? I assumed you meant cable, but there's already an answer assuming hydraulic
Comment: How are your workshop skills?    Modifying existing brake levers would require decent accuracy, not a bodge job.  Brakes are kinda important.
Answer: It's possible, unequivocally. The first ones were just this, run by Dieter Runkel.

The specifics of how you would do it depend on the levers you're working with. Generally speaking it's going to involve making a little counterbore for the housing on the lever part and removing some of the internal parts (the cable head cradle area etc) to make room for the cable. Whether it's safe or reasonable to do this is up to you.
Importantly, flatbar brake levers are nearly universally made to clamp to a 22.2mm section of handlebar. Drop bars and aero base bars never have this diameter anywhere on them. The stem clamp area on drop bars can be 25.4, 25.8, 26.0, or 31.8, and the smaller section diameter is always 23.8. Depending on the bar and the rider's preference, you might clamp the aux lever to either the stem clamp area or the tapered down area. You will always need to modify the clamping radius of an aluminum 22.2mm part to do this; if you just squish it on, it will very likely crack sooner or later. Whether or not it has the material to give will be up to you to determine.
Comment: *the smaller section diameter is always 23.8*  [Not if it's not round](https://media.chainreactioncycles.com/is/image/ChainReactionCycles/prod187394_Black_NE_01?$productfeedlarge$)  ;-)
Comment: The cable routing looks a bit awkward
Comment: @ojs Yep, the cable routing situation wants to be awful.
Comment: (Although that's also usually true of off-the-shelf ones.)
Comment: Off the shelf levers are more or less seamless with cable under bar tape. For other routing options maybe not so
Comment: @ojs Yes but (depending somewhat on the bar width and where you choose to clamp them) they often have issues with both housings trying to occupy the same space such that one of them wants to push against the other one, unless you run the levers at different angles.
Comment: I can't find any much better pictures of Runkel's prototype, but it appears from what I can see that the actual lever - not the lever assembly, just the part(s) that pull the inner - might be custom-made.  It wouldn't be hard for a competent machine shop to mill a whole new part that uses a clamp screw.  I could easily design one.  As with the ideas in my answer, it would cost more than buying the modern manufactured part
Answer: It's not feasible.
I'm not saying it couldn't be done with levers means for cable brakes, but it would be really rather hard and/or cost more than just buying interrupter levers.
Park Tools page on interrupter levers says:

The in-line lever pushes on the housing, effectively making it longer,

while standard levers pull on the inner cable. The pictures at that article show how in-line levers are different.
To do that they catch a cable end stop, but the end of the cable in your case is in the brifter so there's nothing to get hold of.  Thus you'd have to design and fabricate something suitable (it might be possible to clamp the cable, with some considerable force).  Bear in mind this is a safety-critical system and not something you want to fail, even if the failure doesn't prevent the main brake lever from working.
Problem Solvers make a device to control one brake with two levers (and a similar device to control two brakes with one lever).  That starts getting interesting, but then you get into issues of differing cable pull between drop-bar and flat-bar brake levers, which need to be matched to appropriate brakes.  It might be possible with levers for cantilever brakes, looking at the accepted answer there. It might also be possible to provide adequate braking performance for what you're riding even with the wrong pull, but it would take an expensive experiment to find out.  When I say expensive, a single Problem Solvers brake doubler costs 4× as much as a pair of inline levers.
Comment: Thanks for the answer! Yeah I figured it probably won't work since the mechanisms are different, but I thought that if you could use interrupters as your main levers that maybe it might be possible to do it the other way around. The cable doubler from Problem Solvers is very interesting!


Navigator for ArcGIS: search by coordinates

Question: I just installed Navigator for ArcGIS and start testing it. I tried to search using coordinates and it was not possible. It seems to search only addresses. Search by coordinates is not an included functionality?
Comment: This site alludes that you can search by coordinates, "Search—Searches for a place-name, address, coordinate location, or feature." https://doc.arcgis.com/en/navigator/iphone/navigate/quick-reference.htm#.  Can you provide an example coordinate you are trying to search by?
Comment: I have seen the website, but it is not what happens in reality. I have tried:
52.493914, 7.873873 &
7.873873, 52.493914 &
N52.493914, E7.873873 &
E7.873873, N52.493914
Answer: Found it. Navigator expects to use comma as decimal separator and space in between.
ex: 52,493914 7,873873


How do I re-patent a product similar to one that's had its patent expire?

Question: In reference to the patent: US5809590
It appears as though this patent is expired, and I wish to re-patent a similar product. How do I go about doing this?
Answer: That's, unfortunately, illegal.
From that link,

The public should . . . be able to act on the assumption that upon the expiration of the patent it will be free to use not only the invention claimed in the patent but also modifications or variants which would have been obvious to those of ordinary skill in the art at the time the invention was made, taking into account the skill in the art and prior art other than the invention claimed in the issued patent.

You can't try to extend the term of a patent.
What it comes down to, then, is "similar."
How similar are we talking? You're certainly permitted to patent improvements on existing products, as long as you don't try to claim something that's already been around for a while, or that would be "obvious to one skilled in the art."
It's probably best to speak with a patent professional (attorney or agent) to review your specific invention in comparison to what is claimed by the expired patent. You might be able to protect the difference of the two, which would give you control over others attempting to use your innovations, but it wouldn't give you control over anyone trying to use the invention as stated in the original, now-expired, document.
Answer: A similar product does not sound as if it was the same subject-matter.
You are in a comfortable situation, because you seem to have the closest prior art at hand (important for your application) and you may produce it since the patent has expired.
You simply need one or several improvements that you can show your produnct has over this prior art. These improvements however need to be non-obvious considering other prior art.
In principle it is always best to check this with a patent attorney knowing the patent law and procedures for the country or countries where you would like to protect your invention.
Good luck!


lagrange multiplier determinant

Question: Can someone please explain why in my textbook they write lagrange multiplier like this :
$$\begin{vmatrix}
\frac{\partial f}{\partial x}& \frac{\partial f}{\partial y}\\
\\
\frac{\partial g}{\partial x} &\frac{\partial g}{\partial y}
\end{vmatrix}=0
$$
I don't understand where did this determinant come from and why is this determinant equal to zero? I just know that the lagrange multiplier is : $f_x(x_0,y_0)=\lambda g_x(x_0,y_0),f_y(x_0,y_0)=\lambda g_y(x_0,y_0)$
Comment: Which problem is the textbook trying to solve with Lagrange multipliers? Edit it into your question. (Presumably, we have a constraint for which $f-\lambda g$ depends on neither $x$ nor $y$.)
Answer: Note that $f_i=\lambda g_i\implies f_xg_y=\lambda g_xg_y=g_xf_y$, so the determinant is $f_xg_y-g_xf_y=0$.

lagrange multiplier determinant


what can i do whilst on the sick

Question: I phoned in sick on the Monday complaining of a sickness bug, vomiting and stomach cramps, by Wednesday the sickness had gone off a little but not entirely.
On the Thursday I was scheduled for an interview for a senior post which I couldn't re-arrange.
I went to the interview still not well, that evening I was vomiting a little more but by the Friday it had almost gone.
will I get into trouble for being off sick and going to an interview???
Comment: Was the interview an internal one with your existing employer or with another company?
Comment: This is a question best answered by your employer (try reaching out to HR, or look at your employee handbook or policies), since it's a matter of their policies. We can't tell you what will happen.
Answer: Not if you don't tell anyone.
if the interview was internal and someone asks you, just say you felt brave enough to risk it although you were not completely well, and had to recoup in the following days.
If the interview was external I don't see why your employer needs to know about it.
Answer: Whether you may get in trouble for being off sick depends on your company's sick policy (i.e. whether you have enough available sick days for the days missed).
As for the interview, as long as your current company does not know about it you will not get in trouble for attending.

what can i do whilst on the sick


Java Eclipse: Difference between exporting as a JAR and exporting as a Runnable JAR

Question: What is the difference in eclipse between exporting as a JAR file and exporting as a Runnable JAR file? Aren't they both runnable? What are the pros/cons of each?
Answer: The runnable jar contains a MANIFEST.MF file, which defines the Main class to be executed when the jar is run.
Non-runnable jars are just libraries of classes, that can be added to the classpath so that code is reused (it also contains the manifest file, but no main class there)
Comment: When we export file just as a jar instead of runnable jar we have to specify main class and library classpath in manifest.mf.
Answer: With the standard JAR file, you have to specify the class with the main method on the command line when running the jar. With a runnable JAR, there is a manifest file that will hold that information so you can just type java -jar myRunnable.jar, or simply double click it.
Answer: A runnable jar is a jar file that has an embedded Manifest file that includes the "Main-Class:" declaration.  The "Main-Class" must be defined so the java runtime knows which class to call when the jar is "run."  If a jar does not include a manifest with the "Main-Class:" it is not considered a "runnable jar" - it is just a library of Java code.
I would guess this is the difference in how Eclipse exports the jar, but not 100% sure.
See this link for more info:  http://www.skylit.com/javamethods/faqs/createjar.html
Answer: In my case, I used to export as a jar when I had all main class and all the libraries path directory specified in the manifest.mf . If many applications are using same library it is unnecessary to export shared library for each jar. It makes running jar faster. But, many times due to configuration issue in different server class-path cannot access library and in that case it makes sense to export the runnable jar that makes file slow to execute and large.