Existence of Tripoles?

Question: With multipole expansions, we speak only of monopoles, dipoles, and $2^n$-poles. Why is there nothing like a tripole? So how would something like $rsin(3 \theta)$ be expressed with a multipole expansion? Is the reason for not having terms like this in a multipole expansion that it is redundant, or is there some more fundamental reason?
Comment: There is an infinite number of possible decompositions similar to multipoles. Multipoles arise as a natural (orthogonal) choice for the decomposition of solutions of wave equations in spherical coordinates, but there is no reason, why one couldn't chose a different decomposition, e.g. for a problem with a three-fold symmetry, in which a tripole term would make for a better base element. Those problems are simply not as common as the spherical problems, so we don't discuss them much in textbooks. A good place to look for 3,6,12- etc. poles may be the literature about electrical machines.
Comment: A multipole expansion is similar to a Fourier transform, which maps functions to an infinite number of Fourier coefficients. One can write any function as a linear combination over the Fourier (multipole) base functions. The coefficients in these series can be calculated by integrating over the function multiplied with the base functions. In case of a function with three-fold symmetry, the multipole-series would have infinitely many non-zero terms, though. I believe the non-trivial implications of that are handled by a mathematical theory called "functional analysis".
Comment: Where, specifically? I'm quite confused, on how even to represent a tripole in a multipole expansion.
Comment: I see. It seems like the multipole basis only contains even functions, though...
Comment: That's why there will be infinitely many non-zero terms in the expansion of a function with three-fold symmetry over base functions that lack three-fold symmetry. This is part of the problem that you can also encounter in molecular physics and chemistry, where molecules can form three-fold and six-fold symmetries just fine, while the base functions that are solutions to a Schroedinger equation with spherical potential don't have that symmetry. As a result, approximating certain molecular orbitals by adding a few terms of spherical atomic orbitals has significant convergence problems.
Comment: I feel that Anthony can use the different definition for $\theta$ than those who answer him. If $z=r\cos\theta$, then the $\sin 3\theta$ function isn't smooth on poles, but if one takes $z=r\sin\theta$ then it becomes a good function much alike to spherical harmonics. Anthony, please add some clarification to the question.
Comment: Right, firtree. I am personally always using $z=r\cos\theta$. In that convention, $\sin 3\theta$ isn't smooth near the poles and the function is a combination of infinitely many spherical harmonics (all odd $l$ $Y_{lm}$). If one uses the "latitude" $\theta$ going from $-\pi/2$ to $+\pi / 2$, then $\sin 3\theta$ i.e. roughly $\cos 3\theta$ in my normal language is smooth near the poles and the function is a simple combination of $Y_{10}$ and $Y_{30}$.
Comment: I'm a little confused as to what's going on right now, but what I meant was a potential that is $V(R,\theta)=rsin(3\theta)$
Comment: Oh I understand what you all meant now. @firtree I was indeed thinking that $\theta$ was the polar angle.
Answer: The function $\sin 3\theta$ on the unit sphere is not an eigenfunction of the Laplacian on the sphere, i.e. the angular part of the Laplacian, i.e. of $L^2$, so it is not convenient a basis vector in problems whose Hamiltonian involves the Laplacian.
The function $\sin 3\theta$ may be written as a combination of spherical harmonics $Y_{lm}$ with many different values of $(l,m)$ so it is a "mixture" of multipoles of different "rank". For the more natural basis of functions on the sphere that may see as basis vectors, see

The table of spherical harmonics
https://en.wikipedia.org/wiki/Table_of_spherical_harmonics

For example, the spherical harmonics $Y_{3,\pm 3}$ are proportional to
$$ Y_{3,\pm 3} \sim \exp(\pm 3i\phi) \sin^3 \theta $$
which is very similar to $\sin 3\theta$ but has the extra $\phi$-dependence. Similarly, one may look at the function $Y_{30}$ which is similar to $\sin 3\theta$ but prefers cosines and so on. Either $\sin^3 \theta$ or $\cos^3\theta$ (check it!) without any $\phi$-dependence is a combination of $Y_{30}$ and $Y_{10}$.
Once one realizes why the spherical harmonics are the preferred, more natural basis, we may carefully discuss the spherical harmonics' association with the multipole expansion. For example, we learn that $Y_{3,m}$ for any $m$, including the functions similar to yours above, are associated with octupoles, not "tripoles"!
More generally, $Y_{\ell m}$ is the angular part of the $2^\ell$-pole.
The powers of two are a natural way to describe the terms in the multipole expansions for reasons explained elsewhere, e.g. here:

https://physics.stackexchange.com/a/127496/1236

In the multipole terminology, a "tripole" would correspond to a triplet (e.g. vertices of a triangle) of charges. If their total charge would be nonzero, there would be a leading "monopole" term. If the total charge cancelled, the system of 3 charges would still have a dipole moment. Unless the three (nonzero) charges would lie on the same line, the dipole moment couldn't be canceled.
Comment: Does that mean that there is no potential that is of that form?
Comment: The particular potential you wrote down doesn't obey $\nabla^2 \phi = 0$ almost anywhere. It's easy to check. You can't fix this problem even by choosing a different dependence on $r$ exactly because the angular part isn't an eigenstate of the angular part of the Laplacian, i.e. the $L^2$ operator.
Comment: Sorry, I was inaccurate. You chose the function so nicely that the laplacian vanishes almost everywhere - but it doesn't on the $z$-axis i.e. for $\theta=0$ or $\theta=\pi$. Or maybe it's an eigenstate of the Laplacian with a nonzero eigenvalue? You may calculate those things.
Comment: So what would $sin(3\theta)$ be. in terms of multipoles? I feel like it's orthogonal to all the poles...
Comment: It is definitely not orthogonal to the other spherical harmonics, pretty much to none of them. The inner product with $Y_{l0}$ is nonzero for all odd values of $l$ - it's the integral over $\theta$ from zero to pi of the product of the functions times an extra $\sin\theta$. The spherical harmonics form a *basis* so they're complete - orthogonal to each other and you can't find any other that would be orthogonal to them.
Comment: @Luboš Motl Please see my comment above http://physics.stackexchange.com/questions/132881/existence-of-tripoles#comment271455_132881 , then it maybe resolve the problem with $\theta\in\{0,\pi\}$.

Existence of Tripoles?


If a European investor goes long or short the US ultrabond future, are they taking any forex risk or is it all interest rate risk?

Question: (The Ultrabond future is a bet on the price of 30-year US treasury bonds, which are dollar denominated.)
Answer: For a futures position with typical margin, the risk is almost entirely interest rate risk. This is because the interest rate risk is leveraged but the forex risk is not (another way to look at it: the leverage is achieved by effectively borrowing in USD). If the bond futures price in USD is unchanged but USD declines 1% relative to EUR, the investor has lost 1% on whatever margin deposit was made. On the other hand, if the bond futures price in USD declines 1%, the investor has lost much more than 1% on the margin deposit (approximately 20% loss on minimum margin).
Comment: Great answer - a simple example showing exact calculations of both scenarios with an assumed rate of leverage could improve it even further.


"That love is mean, and love hurts"

Question: I found an interesting line in "Blue Jeans" - Lana Del Rey. "That love is mean, and love hurts". And in this case, the word 'mean' means 'evil' according to the song's translation. Is it right interpretation or the origin meaning has been lost? And if it is true, could you please give me explicit explanation, when 'mean' uses to describe 'evil'.
Thank you!
Comment: The translation of 'mean' to 'evil' is bad.  'Mean' should translate as 'hurtful', or 'cruel'.  'Evil' is much harsher than 'mean'.
Answer: 'Mean' can be a difficult word to translate as it has several different meanings, none of which translate back correctly back into English as 'evil' as @JohnFeltz says above.
Have a look at these definitions, particularly the second set which define 'mean' as an adjective (you will have to scroll quite a way down to find it).
Is it possible that there is a word in your language that ranges in meaning from 'unkind' to 'evil'? That might have caused the misunderstanding.
Comment: I think in BoldBen's link this definition is seems the closest  - "Unkind, spiteful, or unfair." In particular, the "unfair" one seems apt.

"That love is mean, and love hurts"


Total energy of an object in motion in free space

Question: In order to impart motion (additional motion) to an object in free space, inertia "soaks up" an given amount of energy prior to additional movement,  which is related to its mass, irrespective of any gravitational field. If an existent gravitational field was present when the additional motion is imparted,  this amount of energy would also need to be "soaked up" prior to movement.  How is this carried (and temporarily stored) energy accounted for in measurement of objects total energy with respect to any gravitational field which may have been present when the force which imparted the motion was first applied? So my question is,  when a body travels in free space,  how can we ever know it's total energy without knowing from whence it came?
Answer:
In order to impart motion (additional motion ) to an object in free
  space, inertia "soaks up" an given amount of energy prior to additional
  movement, which is related to its mass, irrespective of any
  gravitational field.

There appears to be some misconception here. If the movement of an object is not obstructed, it starts accelerating as soon as a force is applied to it, i.e., it does not "soak up" some energy before it starts accelerating.
For any given force, heavy objects (big inertia) don't accelerate as much as light objects ($a=\frac F m$), so it may appear that they are not responding to the force right away, but they do, and, as soon as they start accelerating, their speed and, therefore, their kinetic energy changes.
In the presence of the gravitational field, the changing position of the object, due to the gravitational force or other forces, could also result in the change of its potential energy, which is determined by the position of the body relative to Earth or other celestial bodies.
In addition to the translational movement and the associated linear speed and kinetic energy, the object may rotate around its COM with some angular speed and have additional, angular, kinetic energy.

when a body travels in free space, how can we ever know it's total
  energy without knowing from whence it came?

As discussed, when a body, presumably with a known mass, travels in free space, its total energy (not including its internal energy) consists of its kinetic energy, which is defined by its speed (linear and rotational) and its potential energy, which is defined by its position.
So, the total energy of an object can be calculated without any knowledge of where it came from.
Comment: @safesphere Thank you for your feedback. I am really surprised that the word "misconception", in this context, could be perceived as unfriendly, but I'll keep it in mind in the future.
Comment: That calculated energy in your gravitational field... And the object would have hidden energy not in your calculations if imparted movement took place in another gravitational field of different strength. Obviously, the use of the term gravitational field is an over simplification, but do you get the question?
Comment: @RaSullivan If you are discussing kinetic energy, then this quantity only depends on the velocity of the object. It does not depend on what gave it this velocity. If you are discussing gravitational potential energy, then this is energy depends on the field the object is currently in. If the object "soaks up" (bad terminology) potential energy in this first field it becomes kinetic energy, and it doesn't matter where the energy came from. If we turn on a new field, then the object just has more potential energy from this field. Energy doesn't keep track of its history
Comment: @safesphere I see how you can argue the statement is not needed, but how does it violate the code of conduct? It doesn't seem like V.F. is being rude, negative, etc. in saying this.
Comment: @safesphere I don't think it is unfriendly. If I had a misconception I would want someone to point it out. The tone of the rest of the answer is very welcoming and informative, so based on the context I don't think it is unfriendly at all. Misconceptions are part of learning, and part of educating is pointing out where misconceptions are. V.F. is explaining why this specific part of the question is being selected in order to be helpful, not harmful.
Comment: @safesphere "There is however no need to rub into their faces that they are wrong". I do not believe this is happening here, but I see your point. We can let V.F. and the OP weigh in when they can.
Comment: @AaronStevens Thank you very much for covering for me - I would have said the same things - just less eloquently.
Answer:
how can we ever know it's total energy without knowing from whence it came?

A consistent version of "Total energy" requires that we have a defined reference for both kinetic and gravitational energy.  Neither are defined absolutely, but only in reference to some particular zero point.
Kinetic energy is defined by your observational frame.  When the object is at rest in the frame, we declare it to have zero kinetic energy.  Another observer in a different frame would measure it differently.
Gravitational energy in the vicinity of the Earth's surface is often measured as height above some reference plane, while in other situations might use the force integral when moving from a point "at infinity" as zero.
As long as these references are done consistently, then the history of an object is no longer needed to calculate the (current) value for total mechanical energy.  Instead it means that two objects that began their journey at different points in a gravitational field did not begin with the same energy.


Pathauto and dynamic branch depth

Question: I downloaded the Pathauto module to have the taxonomy aliases generated dynamically. The problem is that the pattern apparently expects a fixed depth, while my taxonomy is not that stiff - some items have one, and some up to 3 branches underway. Can such a scenario be addressed by pathauto?
Comment: Which drupal, token and pathauto versions do you use?
Comment: Drupal 7.0 (that's what Reports > Status shows, although I'd swear I downloaded 7.2), token-7.x-1.0-beta2, pathauto-7.x-1.0-beta1
Answer: Well, I'm really surprised such important functionality hasn't been implemented in D7.
Here we go: too much talk, not so much work.
In short: currently there's no token for dynamic taxonomy depth like termpath in D6.
Comment: I'm too fresh to Drupal to arbitrarily say it hasn't been implemented. What syntax have you used in termpath/D6? I would gladly give it a try.
Comment: In token-6.x-1.16 it's `catpath`.
Comment: OK, in catpath then - what expression did you have to handle variable depth paths? Let me try that in D7
Comment: `catpath` provides taxonomy tree so far. But there's no such an option in D7.
Comment: Frankly, it's a bit of disappointment.
Answer: I'm also quite miffed by this missing bit of critical functionality.
A workaround you could use for now is to use the token [node:field-section:url:relative] (replace "section" with the name of the taxonomy term that you've made a field on your node content type).
But then you must do a second step and that is to turn OFF the default handling of slashes in strings in the Pathauto > Settings tab.  It is all the way at the bottom under "Punctuation".  You must change the dropdown setting to "No action (do not replace)".
Although this should get you where you want, it is risky, as it now opens up the possibility of 404 errors if there is an unencoded slash in the title of a node or any other field that would find its way into your pretty URLs.
I'm also trying to get this quick and dirty module to work -- http://drupal.org/node/741914#comment-5025862 -- but thus far it is only outputting the deepest term in the URL and not the entire hierarchical chain.  I'll keep you posted if I do get it to work.
Comment: I did get the "quick and dirty" module to work, after all.
Answer: Since this question was asked a lot of things changed and this is possible now so for anybody that stumbles upon this question the way to go is using the "join-path" token for the full url including the current term
[term:parents:join-path]/[term:name]

It will output all the parent's names no matter if you have 1,2 or ..x making the depth dynamic.

Pathauto and dynamic branch depth


Work done in an isothermal irreversible process

Question: In calculating the work done in an isothermal irreversible process, why do we consider the external pressure only (using formula: $W_{\text{ext}} = P_{\text{ext}} \mathrm{d}V)$ but not the internal pressure? When the system expands, the internal pressure does the positive work, but even in this scenario, we use the equation as mentioned above. Why is this happening?
Answer: The ideal gas law (or any other equation of state) can only be applied to a gas at thermodynamic equilibrium.  In an irreversible process, the gas is not at thermodynamic equilibrium, so the ideal gas law will not apply.  The force per unit area exerted by the gas on the piston is comprised of two parts in an irreversible process:  the local pressure and viscous stresses.  The latter depend, not on the amount that the gas has been deformed, but on its rate of deformation.  Of course, at thermodynamic equilibrium, the rate of deformation of the gas is zero, and the force per unit area reduces to the pressure.  In this case the ideal gas law is recovered.
So, you are correct in saying that, for a reversible process, the internal pressure is equal to the external pressure.  But, for an irreversible process, even though, by Newton's 3rd law, the force per unit area exerted by the gas on its surroundings is equal to the force per unit area exerted by the surroundings on the gas, the force per unit area exerted by the gas on its surroundings includes viscous stresses; thus, the force can cannot be determined by simply applying the ideal gas law.  In this case, our only alternative (aside from solving the complicated gas dynamics equations for the gas, which include the viscous stresses) is the explicitly specify the external force per unit area imposed by the surroundings.
Comment: in irreversible isothermal expansion, formula for work done is    W=P(external)x change in volume. here why we are not considering  internal pressure? here expansion is caused due to internal pressure of gas  against external pressure and so work is done .please clarify me irreversible process formula
Comment: For an irreversible expansion process, a crude approximation to the force exerted by the gas on the piston  (where the work is done) can be provided by the equation $$\frac{F}{A}=P_{ext}=\frac{nRT}{V}-\frac{k}{V}\frac{dV}{dt}$$where $P_{ext}$ is the force per unit area of the piston on the gas and the constant k is proportional to the gas viscosity.  So the gas force per unit area is equal to the external force per unit area $P_{ext}$, but there is an extra term related to the *rate* of volume change.
Comment: @ChetMiller I have a doubt which I think I can ask here , as we know that irreversible processes are like sudden jerks or quick changes then in that case how can we call the process isothermal because we cannot specify temperature uniquely at each point inside system as piston moves out, I mean to call it isothermal the temperature at each point should be same but this is not the case during irreversible expansion
Comment: @ChetMiller or for irreversible isothermal process only initial and final temperature need to be same ?
Comment: @Lalit It depends on how you define an isothermal process.  It could be that only the initial and final temperatures are the same, or it could be that the system is in contact with a constant temperature reservoir at the same temperature as initially (and finally).  For an irreversible process, this still doesn't say anything about how the temperature is varying inside the system (only at its boundary with the reservoir).
Answer: The key word here is irreversible. Irreversible processes are more like sudden jerks or a quick change in the system and therefore the ${P_{\text{ext}}}$ is not same as the ${P_{\text{int}}}$ throughout the process.

Why do we NOT use the internal pressure (${P_{\text{int}}}$) to find the work done?
  It is very difficult to find the ${P_{\text{int}}}$ exerted by the gas in the container since ${P_{\text{int}}}$ is varying with time. For this, we would have to use integration. Something like this:$${W_{\text{int}} = P(V)_{\text{int}}\mathrm{d}V}$$
  (where $P(V)_{\text{int}}$ is a function of $V$)
  But we know the value of ${P_{\text{ext}}}$ and this is constant throughout the process. This is why we use ${P_{\text{ext}}}$ instead of troubling ourselves with integration. Something like this: $$W_{ext}= P_{\text{ext}} \mathrm{d}V$$

So if a system undergoes a decrement in volume suddenly, it is the external pressure that does the positive work throughout this decrement. The equation would be: $$W_{\text{ext}}= P_{\text{ext}}\mathrm{d}V$$ (However we can use ${P_{int}}$ as well, please read the NOTE at the bottom)
And if a system undergoes an increment in volume suddenly, ${P_{\text{int}}}$ is doing the positive work. However, to find the $W_{int}$ we would have to use integration since ${P_{\text{int}}}$ is varying with time. It is much easier if we just find the negative work done by ${P_{\text{ext}}}$ and since we know that $${W_{\text{int}} = - W_{\text{ext}}}$$ we can find the work done. This is why we consider the ${P_{\text{ext}}}$ and according to the situation in the question, we apply the signs.
NOTE: Magnitude of work done by the internal pressure and external pressure is always same. We only use ${P_{\text{ext}}}$ because it is constant whereas ${P_{\text{int}}}$ varies with time. If we use integration to find ${W_{\text{int}} = P(V)_{\text{int}}\mathrm{d}V}$, where $P(V)_{\text{int}}$ is a function of $V$, we will get the same magnitude as we would from $W_{\text{ext}}= P_{\text{ext}} \mathrm{d}V$. Only signs are opposite.
Comment: In irrreversible expansion,expansion is caused due to internal pressure and force is exerted by gas on piston causing expansion.External pressure in not responsible for expansion and then why do we  consider?
Comment: @MouryanPalla could you add your comment to your question as well so others can understand better?
Comment: @dr.drizzy if we have the initial and final pressure of the system, we can use the formula Pavg*(Delta V) ... So why don't we use that?
Answer: Expansion
Work is always done against the external pressure, because that's what opposes the expansion of the gas (and not internal pressure). It's just that in case of a reversible process, the internal pressure (or pressure of the gas in other words) is equal to the external pressure - so we can use it to find the work done. This is not the case for an irreversible process - the gas does not get time to make its pressure equal to the external pressure since the process is not being performed slowly. So, we need to consider the external pressure.
Compression
In this case, the opposing force is the internal pressure. But, since it's an irreversible process, I think we can't know the internal pressure. But, we know the temperature, so I'd use the FLOT to indirectly find the work done.
PS: I'm not sure about the compression part; it'd be nice if someone good at thermodynamics clarified this in the comments. :)
Comment: In irrreversible expansion,expansion is caused due to internal pressure and force is exerted by gas on piston causing expansion.External pressure in not responsible for expansion and then why do we  consider?
Comment: Have a look at my solution. I think the compression part is covered there. Let me know if it's helpful


Mac os X : load average

Question: I'm wondering I always see my load average on my computer, 1.76,1.31,1.08 at the moment. What does it mean ?
Answer: If your CPU were a hot dog stand, the load averages would tell you the average number of people standing in line to get served.  A load of less than 1.0 means that the hot dog vendor has some spare time between customers -- 1.0 means that, while a line never piles up, some customer is always talking to the vendor (who knows where all the hot dogs are going...).  Having a "low" load average doesn't mean that your computer isn't doing anything though, there could be customers who take a really long time to eat their hot dog before getting in line again (that is to say some process might be waiting on the disk or network to wake them up with some data when it arrives), having a faster disk or net connection could improves your total dog sales.
Enjoy.
Comment: I like the analogy but it would be good to extend it for multiple hot dog stands. If I have two stands does `1` mean a single customer waiting for one stand and the other is free or does it mean one per stand?
Answer: The load average tries to measure the number of active processes at any time. As a measure of CPU utilization, the load average is simplistic, poorly defined, but far from useless. High load averages usually mean that the system is being used heavily and the response time is correspondingly slow. What's high? ... Ideally, you'd like a load average under, say, 3, ... Ultimately, 'high' means high enough so that you don't need uptime to tell you that the system is overloaded.
When seeing the results of the load averages, they are for the past 1, 5, and 15 minute
Answer: The load indicates how man processes are waiting in the queue to be executed. You would have a load of 1 if your have that much processes that at least one process has always to queue up before it gets executed (is not executed immediately).
The numbers in uptime are average over some period.
Comment: Uptime averages generally run over 1, 5, and 15 minutes. The Mac OS 10.5 man page agrees.

Mac os X : load average


What is the best way to have pages displaying articles from our custom content table in Joomla 4.1?

Question: Related: Is it possible to make it so that authors can edit their own published articles creating a new unpublished version of them?
The answer to that question is "In Joomla 4 it is, but authors will be able to see unpublished articles by other authors", which we don't want.
Therefore we've been working with our custom content table where the primary key is given by id and version number. How should we go about the routing system, in order to have a page for each record of this table?
The easiest way would be to make adjustments into Joomla's Content component so to substitute everywhere Joomla-content pages with our custom ones, but that's not possible, is it? Is there some kind of "hack" or do we actually need to create a new component "com_articles" totally adhering to the conventions and structure found in: https://github.com/joomla/joomla-cms/tree/4.1.0/components/com_content ?
Answer: if you just want to use different content than the one stored in the com_content tables, why not creating a simple content plugin which replaces the content in the row before showing it?
That way you can use all the benefits from Joomla com_content and show your customized content.
There are lots of content plugins (in the core and in JED) which can guide you on how to do it and this article from official documentation might help (though it is specific for J3, almost everything will work in J4): https://docs.joomla.org/J3.x:Creating_a_content_plugin
Of course if there is not a one to one match between your tables and Joomla article tables, you probable better create your custom component to show this data.


Do I need a transit visa for Serbia?

Question: Do I need a transit visa while transiting through the Serbia for USA on a Pakistani passport and valid US visa?
Answer: Per TIMATIC, the database used by airlines:

TWOV (Transit Without Visa):
  - Passengers with a confirmed onward ticket for a flight to a
    third country within 24 hours.

So no, you don't need a visa.

Do I need a transit visa for Serbia?


Absolute path & Relative Path

Question: What's the difference between absolute path & relative path when using any web server or Tomcat?
Answer: Absolute paths start with / and refer to a location from the root of the current site (or virtual host).
Relative paths do not start with / and refer to a location from the actual location of the document the reference is made.
Examples, assuming root is http://foo.com/site/
Absolute path, no matter where we are on the site
/foo.html

will refer to http://foo.com/site/foo.html
Relative path, assuming the containing link is located in http://foo.com/site/part1/bar.html
../part2/quux.html

will refer to http://foo.com/site/part2/quux.html
or
part2/blue.html

will refer to http://foo.com/site/part1/part2/blue.html
Answer: Important to note that relative paths are also subjective.
ie:
<?php
  #bar.php
  require('../foo.php');
?>

/dir/bar.php
/foo.php         # prints a
/dir/foo.php # prints b
/dir/other/   # empty dir

$ pwd
>  /
$ php dir/bar.php
>  / + ../foo.php == /foo.php
>  prints a
$ cd dir
$ php bar.php
>  /dir  + ../foo.php = /foo.php
>  prints a
$ cd other
$ php ../bar.php
> /dir/other + ../foo.php  = /dir/foo.php
> prints b

This can create some rather confusing situations, especially if you have many files with releative references and multiple possible places that can act as an "entry point" that controls what the relative path is relative to.
In such situations, one should compute the absolute path manually based on a fixed known, ie:
<?php
    require( realpath(dirname(__FILE__) . '/../foo.php') )

or
<?php
   require( SOMECONSTANT . '/relative/path.php'  );

or
<?php
   require( $_SERVER['DOCUMENT_ROOT'] . '/relative/path.php' );

Answer: Through trial and error I have determined that the starting point of a path in Tomcat is the webapps folder.
In other words if your Java code is trying to read ../somefile.txt then the absolute path to that file would be %TOMCAT_HOME%/webapps/../somefile.txt i.e. %TOMCAT_HOME%/webapps/somefile.txt

Absolute path & Relative Path


Set custom folder icon for a network folder in Windows File Explorer

Question: I access a Windows share and the 'folder icon' section (the bottom one) is missing in its settings. It shows up properly in local folders. I would like to have it with both.
A folder properties window with the icon setting highlighted
Answer: You'll want to use a desktop.ini file to customize the icon. Usually, that's all your actually doing when you are using that "Change Icon" button above.
For full documentation see: How to customize folders with desktop.ini
An example desktop.ini file follows:
[DeleteOnCopy]
Owner=MyUser
Personalized=13
PersonalizedName=My Folder
[.ShellClassInfo]
email@example.com,-12689
IconFile=%SystemRoot%\system32\shell32.dll
IconIndex=-237

As an aside, if you want to do this without having to manually create the desktop.ini, you can create a folder locally, apply the desired settings, and steal its desktop.ini. (If you don't see it, copy over the entire folder; it should have a correct name originally.) The youtube video Apply a Icon to a Folder on a Network Drive shows this process but uses folder moves rather than creating a new folder.
Comment: [Here](http://andryprogramming.blogspot.ch/2008/07/desktopini.html)'s a more detailed list of `desktop.ini` options
Comment: Is it possible, that this is not working for SMB-shares which is hosted on Linux computer? I setup the desktop.ini on my windows computer and try to see the file tree in windows. My desktop.ini is not hidden and I dont see my custom icon :( –
Comment: There are several gotchas.  The directory must have the "read-only" attribute set; the `desktop.ini` must have "hidden" and "system".  I don't know how that can be done in Linux.  Also, the `desktop.ini` file must be Unicode-encoded.  This probably won't happen if you create the file with *nix tools like `vi`.
Comment: Note you also need to set the containing folder to read-only (or system), e.g. via `attrib +r` or `attrib +s`.
Comment: Is it possible your desktop.ini actually has another hidden extension appended that is causing it to not be used? I don't believe windows is sensitive to where the folder is being hosted, whether via native Windows CIFS or via Samba CIFS/SMB.
Comment: In Linux using Samba you can use the `map hidden` , `map system`, and `map readonly` and you can also `store dos attributes` if you'd rather have dos style attributes that aren't tied to POSIX file permissions.
Answer: It has been a long time since I have seen so much bull
:)

Right-click --> Properties --> Customize ---> Change icon is not available on SMB shares.
... ---> Change picture has no effect.
Desktop.ini is NOT processed by windows for SMB shares, because Linux interprets the (folder's) "Read Only" bit differently, and reports it back to Windows incorrectly:

In Linux, Read only means Read only !
In Windows, Read only (with folders only) means process Desktop.ini !!!

There is supposed to be a registry setting that forces Desktop.ini processing by using the "System" (super-hidden) flag instead of "Read Only" but I have never gotten it to work as expected.
The lack of desktop.ini processing on SMB breaks many other things, not just folder icons: Symbolic links and personalized name spaces also don't function. The bums at Microsoft are just refusing to deal with it, all the way back to Windows NT.
It is of course always possible to create indirect links to access the SMB folders, and give those custom icons instead, but that causes multiple other problems:

Short-cut links are evaluated and cached by default in Windows whenyou open the parent folder, causing "massive" delays in explorer if a folder contains shortcuts to slow or sleeping network shares.
Shortcuts in windows are absolute, not relative ergo not portable. This creates a lot of maintenance should the target root path change. Windows also has a habit of automatically converting environment vars to absolute links, defeating any attempt at working around this.
Their bird-brained "Distributed Link Tracking Client" service screws things up even further.

The best way to implement relative links in Windows is to use VBS script. In native (text) form, the VBS script will not have a custom icon, but you can assign a custom icon to the EXE file if you compile it.

That is a lot of work though, and the script will create "untrusted" warning messages every time you launch it from a network, unless the script is local or you find a way to sign it.
VBS Relative Link example:
============================
'  This is a VB Script, which emulates a RELATIVE file link/shortcut in Win XP
'
'  1) The first  line declares an untyped variable      ==> objshell
'
'  2) The second line instantiates a new object derived from    ==> Shell.Application
'
'  3) The third  line invokes the object's method       ==> ShellExecute
'
'     with the following parametters:   "target path"
'                                       "target's arguments"
'                   "starting directory"
'                   "action verb"
'                                       Initial window mode:  0 = Hidden Window
'                                                             1 = Normal Window
'                                                             2 = Minimized
'                                                             3 = Maximized
'                                                             4 = Most recent size and position, keep active window active
'                                                             5 = Current size and position
'                                                             6 =
'                                                             7 = Minimized, keep active window active
'                                10 = Default state specified by target application
'
'  4) The last line frees/destroys the shell object
'
'
dim objShell
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute                                 _
  "..\..\..\SomePath_Three_Dirs_UP_etc"              ,_
  ""                                                 ,_
  ""                                                 ,_
  "open"                                             ,_
  1
set objShell = nothing
===============================================================

Comment: There are options to samba which influence how Linux reports the "read-only" attribute to Windows and which allow Desktop.ini to be processed by windows for SMB shares
Answer: The customization method outlined by ssnobody assumes you have the capability to change the folder on the remote machine, and that you want the appearance to be changed for all remote and local users of the folder.  If either of these is not true, you might want to use this alternative:  create a local shortcut to the remote folder (e.g. right-click drag it to the local desktop and select "create shortcut"), and then use the normal "change icon" button of the properties dialog to change the shortcut's icon.
Answer: Create a icons folder e.g. C:\Icons on Server (you can hide folder from properties if you don't want to see it).
Put your .ico files in that folder.
Customize your shared folders on Server.
Now copy your .ico files to C:\Icons but in your PC client (as duplicate).
Now you'll see Network Share icons on both PC (server and client).
If you can't access the Server, you can only create shortcuts on the Client and change their icons.
Comment: This is hard to understand and suspicious.  What do you mean by "Customize your folders on Network PC."?  The OP says he can't.  Do you mean that he has to login directly to the machine that's sharing the drive?  Also, putting stuff in the root directory is not recommended.
Comment: Sure, you have to access the network machine if you want to customize folders icons.
Comment: Once you did it, copy all your ico files to another pc (in the same path, eg. c:\icons) and you'll see your network share icons on both machines.
Comment: (1) If you're saying that the user must *login directly to* the "network machine", then I suggest that you should have ***said*** "You must login directly to the remote machine (file server)."  Permission to use a share on a server does not necessarily imply permission/ability to login directly to it.  (And, IMHO, "network PC" is poor terminology.)  (2) I still recommend against putting things in the root directory.  `\Users\Public\Documents` or the equivalent is probably better.  And even that is necessary only if you want to use icons that aren't already on the file server.
Comment: Ok, but the user wanted to know how to customize icons on \\server\share; the answer is you have to access the server; and if you don't put the same icons in the same path on your machine, you will never see those icons (except on the server). Then we can discuss on everything else... terminology, directories, etc. I wanted to do the same thing and that is the only way :)
Comment: Edited answer as suggested (terminology was ambiguous) :)
Answer: A work-around is to rename your image file "folder.jpg" and place in the shared folder.
Anyone with access and using any of the "icon" or "tile" views in Explorer will see it.
Comment: Please read the question again carefully. Your answer does **not** answer the original question. This does not change the folder icon.


Different electrons, why aren't they all the same?

Question: Why do we say that there are different kinds of electrons when discussing different situations in physics? For instance the Weyl electron, Dirac electron etc. From my exceedingly basic knowledge isn't it a basic result of quantum mechanics that particles are indistinguishable? In solid state physics lecture courses I have had, we have always just said "electron" when talking about semiconductors and metals etc.
Answer: They are all identical electrons. Its just that for the purpose of the paper or whatever they are behaving according to the rules of Dirac's equation, etc, because of the circumstances the electron is in. 'Free electron' means an electron flying about on its own, while a bound electron is in an atom and a Dirac electron is one that needs to be modelled using Dirac's equation: http://spinograph.org/blog/what-heck-dirac-electron
Comment: Well that suddenly makes a lot more sense!
Answer: You are referring to different models, not different electrons. Like saying Newton's gravity and Einstein's gravity - it doesn't mean that there's more than one type of gravity in the nature.


Uncashed paycheck 13 years old

Question: I recently found an uncashed paycheck issued 13 years ago in a suit I had not worn until recently.  I went to the company's bank and they refused to honor it even though the account is still good and I have an account at the same bank.  The company refused to issue a new check as they say it is too old.  I feel time does not void the obligation and the company could have called me about the outstanding check.  Should I go to small claims court for the $768?
Comment: This question needs a country tag
Comment: Time may not void the obligation, but it can certainly void the law's ability to enforce the obligation.  Before thinking about court, find out the statute of limitations for such claims in your jurisdiction.
Comment: The important question to as is "how rich were you in 2004 that you could just **forget** $768?"
Comment: This article says that a bank is not obligated to pay a a check out of a customer's account that is more than 6 months old:
http://smallbusiness.chron.com/long-business-checks-valid-71753.html
Comment: Events like these make me wonder why some countries are still so fixated on using checks.
Comment: @glglgl I haven't received a paycheck since 1989.  My wife works for a firm of 10 lawyers and her check is Direct Deposit, too.  IOW, the US isn't as fixated on checks as you think it is.
Answer: Under US law, a bank is not obligated to honor a check that is more than six months old.

§ 4-404. BANK NOT OBLIGED TO PAY CHECK MORE THAN SIX MONTHS OLD.
A bank is under no obligation to a customer having a checking account to pay a check, other than a certified check, which is presented more than six months after its date, but it may charge its customer's account for a payment made thereafter in good faith.

Note the law says the bank is not OBLIGATED to honor the check, but they are not forbidden from doing so. I don't have a survey on this, but I think most banks won't honor a check after more than 6 months to a year. I've had a few occasions where early in the year someone accidentally wrote the previous year on a check, like on January 10, 2017 they dated the check January 10, 2016, and the bank has given me a hard time about cashing it.
The statute of limitations to challenge payment or non-payment of a check is 6 years:

§ 3-118. STATUTE OF LIMITATIONS.
(b) Except as provided in subsection (d) or (e), if demand for payment is made to the maker of a note payable on demand, an action to enforce the obligation of a party to pay the note must be commenced within six years after the demand.

I understand your frustration about being denied money that you presumably worked for and earned. But look at it from the other side. Suppose you wrote a check to someone, and years later they still had not cashed it. At some point you'd want to be able to clear this off your bank account. What if you want to close the account? What happens when you die? Would your heirs have to keep this account open for years ... decades ... centuries ... on the possibility that someday someone will cash this check? Realistically, there has to be SOME time limit. 6 months should be plenty of time for someone to make it to the bank with a check.
If the company still exists then you could argue they have a MORAL obligation to pay you. If they have records that show that they did indeed give you this check and you never cashed it there'd be no question that you were trying to cheat them. But a moral obligation and a legal obligation are two different things. Legally, they paid you, and it's your problem that you failed to cash the check. You could talk to a lawyer, but if you live in the US, I think you are out of luck. (Of course other countries have different laws.)
Comment: The question is not (or not only) whether the *bank* is obligated to cash the check.  The question is whether the *employer* is obligated to pay the money that was agreed upon as part of the past employment.
Comment: @BrenBarn Well, the text of the question was about the check. But okay, if we agree that the check is no longer cashable, a fair follow-up question is, Is the company legally obligated to issue a new check or other form of payment? At that point I'll defer to a lawyer. My guess is that the answer is no. The company fulfilled their obligation when they gave you the check. If you lost it, that's not their problem. If they paid you in cash and you lost the money, they surely wouldn't be obligated to pay you again. But I don't know, I'm just guessing.
Comment: Second thought: There's a statute of limitations on suing to enforce a contract. This varies from state to state in the US, but is generally 4 to 10 years. Other countries will have their own limits. So even if he could have sued to get a new check when he lost the first one, the statute of limitations has almost surely expired to bring a lawsuit. Unless the OP is lucky enough to live in Kentucky, where the limit can be as long as 15 years.
Answer: Even going to small claims court the burden would be on you to prove that they never paid you. The 13 year gap would be the core of the argument by the company that they have no obligation to keep records from 13 years ago. That is far longer than they need to keep them for tax purposes.
Even if they sent you a replacement check the next year, that happened to me once, the record of that transaction would have been 12 years ago.
The bank will not cash it because of the date being 13 years ago. As we move forward with more and more of the checks being deposited via phone/scanner the banks will be even less likely to handle stale checks because the fact you have the check in your hand doesn't mean it wasn't cashed.
Answer: If this is in the United States, there are laws governing business behavior when they have recorded expenses (checks, bills, etc) which are never withdrawn or deposited.  A business is required to turn over these funds after a certain time frame to the state government as a part of their business tax cycle.  (One caveat- these laws vary in age by state, and 13 years is a long time.  You might still be out of luck for an amount so old..)
There are even businesses which have cropped up to search for "lost money" (for a fee, of course) that your great uncle might have left behind and which now sits in a government holding account somewhere.  It's not necessary to go through the third parties though, because the United States posts this information for the world to see.  A good starting place is:
USA.gov Unclaimed Money Tool
Do as much legwork there as you can.  You could even attempt to contact the former employer (you said the business accounts still exist) and in a very friendly, non-confrontational manner ask them what their procedures are and would have happened to your paycheck funds.  As others have stated, they are under no legal obligation whatsoever to fix your problem for you, but who knows, you could get lucky and they might voluntarily help you out!  You're looking for information not cash, so politeness, patience and understanding are your tools.
If all else fails, you could try one of these 3rd party services.  Here you run into diminishing returns as paying fees to search for money which might not exist just puts you further in the red.
Comment: Ditto "diminishing returns". Like if you have to hire a lawyer, his fees could quickly exceed $700. My pastor once told me about someone who asked his advice whether he should fight his ex-wife for their car in the divorce proceedings. He estimated it was worth $2000. Pastor told him it wasn't worth fighting over, let her have it. His lawyer talked him into fighting. He ended up paying $6000 in legal bills trying to get the $2000 used car ... and lost.

Uncashed paycheck 13 years old


Why the last AS PATH item always is `I` or `?`?

Question: you see my snapshot from m Juniper Router, I want to find the routes of 18.104.22.168, but there always get Idle or a ?, why:
Answer: This tells you how this prefix was learned by BGP.
This is an attribute called origin, which may help BGP decide the preferred path to take (if all higher weight attributes are tied - local-preference, weight, as-path etc.)
"I"- tells you the NLRI was introduced into BGP directly using the "network" command (Not sure why its referred to as "IGP", if someone knows please leave a comment).
"?"- tells you the NLRI was redistributed into BGP from another protocol.
Answer: "I" Represented IGP. That mean iBGP is being used.
Internal Border Gateway Protocol (iBGP) is a term used to describe an area of BGP operation that runs within an organization or autonomous system. Internal BGP is a method employed to provide more information to your internal routers. iBGP could be said to be one of the peers of BGP routers.
Comment: Not true, it does not mean iBGP
Comment: IGP != iBGP (BGP is EGP)
Comment: can you explain??
Answer: I try to answer this question :-
For a route to be announced by BGP , there is a condition that must be satisfied which is that the 'route' must be present in the routing table of originating router. If a 'route' is present in the routing table of router , then it can advertise that route via BGP.
Now router can know about that 'route' via Interior Gateway Protocol. In this case we can use network command (or prefix list in Juniper and then call that prefix list in export policy) to announce that route to other peer. In this case when this router advertise this route it set 'I' with that route meaning that the route was known to Router  via Interior Gateway Protocol in AS (it may be OSPF , IS-IS , EIGRP).
Now for the case of '?' against BGP routes which comes with possibility that your router has learnt that route but it doesn't know the source of that 'route'. Meaning 'route' has been redistributed from IGP to some other IGP (like from OSPF to ISIS). In that case , router will think that ' I don't know how originally announce / own this route in the IGP domain as it has been redistributed . Again you can use network or (prefix list in Juniper and then call that prefix list in export policy) to advertise that route to other peers. But in this when the router advertise this route it set '?' to prefix it advertise to other peers.


How to switch https traffic from 1 web server to another one. IPTABLES issue

Question: Here is my configuration.
I have varnish listening to port 80 and 2 web server (tomcat) on port 8080 and 8081 and https 4430 and 4431.
HTTP traffic goes from varnish to 1 web server. When I need to upgrade my app, I shut down one tomcat, upgrade the code, restart and change the varnish configuration to go to the upgraded tomcat.
I need to do the same for HTTP traffic. It's a small amount of traffic and I don't need caching, so I though I could just use iptables.
So I added a rule like this:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 4430

and when I need to switch to the other tomcat, I do:
iptables -t nat -D PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 4430
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 4431

It seemed to work but after I few days all the machine has connection problems. Varnish is not connecting to tomcat, dns lookup do not work, etc.
I found in /var/log/messages thousands of:
Mar 27 10:04:15 ip-10-72-254-31 kernel: [2112599.753509] nf_conntrack: table full, dropping packet.

Shutting down iptables seems to work to fix the connection problems.
So, can I use iptables in the way I'm using it?
How can I prevent "table full, dropping packet" issue?
What else can I use to redirect my https traffic?
Answer: We use iptables extensively and never faced NAT tables filling up; The only difference I see is that we are using slightly different rules using the DNAT target (even for localhost) rather than REDIRECT.
/sbin/iptables -I PREROUTING -t nat -i eth0 -p tcp  --dport 443 -j DNAT --to :4430
(our kernels are 2.6.32 and higher - iptables 18.104.22.168 and higher)
EDIT
You can try making some adjustments to the nf_conntrack tacble (which tracks all opened connections).
The first one would be to reduce the time a connection can be tracked to a more sensible value, like one day. Something like:
sysctl -w net.netfilter.nf_conntrack_tcp_timeout_established=86400
You can also try to increase the size of the table
sysctl -w net.netfilter.nf_conntrack_max=65535
Restarting your network interfaces should be enough to use these new values.
Finally you will probably need to make those modifications to sysctl.conf to survive the next reboot.
Comment: I haven't tested this yet, I was waiting for other replies. Here http://www.netfilter.org/documentation/HOWTO/NAT-HOWTO-6.html I read that REDIRECT "is exactly equivalent to doing DNAT". What exactly mean that the NAT tables fill up?
Comment: See my edits above on adjustments you could try on the conntrack table.
Answer: To answer "What else can I use to redirect my https traffic?": You can use rinetd. Like iptables, it can be used to redirect TCP connections at port level, but it's way simpler to configure.
In essence, you would put this line to /etc/rinetd.conf:
10.72.254.31  443    10.72.254.31  4430

And exchange it for this when you want to switch over to the second web server:
10.72.254.31  443    10.72.254.31  4431

and after every such change, restart rinetd with:
service rinetd restart

Just make sure that nothing is listening on port 443 when enabling these, as else forwarding will fail and your /var/log/rinetd.log will be flooded with messages like 22/Mar/2013:19:35:47 0.0.0.0 0 (null) 0 0 0 accept-failed - [details].


Looking for a irrigation system leak sensor? Is there such a thing?

Question: I have an Orbit Wifi B-hyve controller and a three zones manifold.
I am looking for a way to determine if the water flows through the irrigation system when it should not (ex one of the valves fails or there is a crack in the system and the water leaks through that)
I am not very comfortable with the idea that I will have PVC in the ground parallel with my house. This could leak and cause a basement flood before I get to know (I night time leak or while I am away could be disastrous not for the amount of water wasted but for water leaking into the basement (old house -might have foundation cracks I do not know about)
What is a standard solution in situations like this ?
Answer: You could add a main solenoid valve and measure the pressure between that and the manifold, much less work then a sensitive flow sensor. Turn the manifold valves off then the main and monitor the pressure to the manifold. This could be connected to the pump output of the sprinkler controller for normal operation. This does give you redundancy so the main and one other valve have to fail.
Comment: Yes that would work but I am not clear on how the controller would handle two things at once. Apparently it can not fire up two zones at the same time. Not sure how the pump output is activated. There is also this solution that I found after posting here Gowfeel WiFi Smart Valve WiFi Control Water Valve Compatible with Alexa, Google and Application Program iOS/Android https://a.co/d/dzZLrYB
Comment: after reading it again, I am seeing that the manual says that circuit is turned on every time B-Hyve is active (that is when another valve is active) so I guess that will do it
Now I have a challenge and that is to feed that valve from the 5 wires cable run that goes  to the 3 valves I have and which runs close to the tap where the main control valve will be placed
Answer: You could use an inline flow meter


Use of determiner THE with a plural noun

Question: Is it more appropriate to say or write: "Canadian provinces and territories are much larger than American states." Or "THE Canadian provinces and territories are much larger than THE American states." Is the determiner necessary or dispensable without one modifying the meaning of the sentence.
Comment: @MichaelHarvey  But on average, Canadian provinces are much larger than US states.  For example, the 6th largest province, Alberta, is larger than 48 US states.  But the sentence is not very well-written if that's what was intended.
Comment: There is no need for a the there, even though the sentence is not true.
Comment: Out of 13 Canadian provinces, 12 are smaller than Alaska, the largest American state, so your example sentences don't make much sense with or without articles.
Answer: As MichaelHarvey points out, there are problems with the example sentence beyond articles, but you're right that using articles can make the difference between talking individual items and groups.

Apples weigh more than oranges.

This suggests that any given individual apple weighs more than a given individual orange.

The apples weigh more than the oranges.

Especially if I had already established a context earlier, like "I have a bag of apples and a bag of oranges," using the definite article shifts the meaning to talk about the [group of] apples and the group of oranges.
This breaks down in the example sentence about provinces and states, because the countries of Canada and United States are "more than the sum of their parts" in a way that bags of fruit are not. By mentioning the component provinces and states, it's hard to still create a meaning that talks about the total landmass of the two countries; it seems to shift the meaning back onto comparing Canadian provinces (individually, or in the abstract) to US states.
Comment: Agreed.  *The Canadian provinces are larger than the American states,* sounds like the total size of the provinces is greater than the total size of the states.
Answer: GENERAL STATEMENT = No the
"Canadian provinces and territories are much larger than American states."
SPECIFIC STATEMENT= use the the
"The Canadian provinces and territories we are studying are much larger than the American states."
[The truth of the statements are not relevant to the explanation of the grammar.]

Kids get very dirty playing in the yard. [general]
The kids got very dirty playing in the yard today. [specific]

The kids=the ones I am taking care of or that are mine.


Juju cannot deploy services with MAAS

Question: I would like deploy one or more charms with juju on MAAS environments (without OpenStack). The environment of the MAAS Controller is Ubuntu 12.10 with 2 NICs. One of the NIC is connected to a external DHCP and the other is holding by the MAAS-dhcp and is connected to a switch with 2 client servers (Ubuntu 12.04 LTS). The settings are as follows

$ sudo vim /etc/network/interfaces
auto em1
iface em1 inet static
address [out-ip]
netmask [out-netmask]
gateway [out-gateway]
dns-nameservers [out-dns]
auto em2
iface em2 inet static
address [inner ip]
network [inner network]
netmask [inner netmask]
broadcast [inner broadcast address]
$sudo vim /etc/sysctl.conf
uncomment net.ipv4.ip_forward=1
$ sudo vim /etc/rc.local
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ sudo iptables -P FORWARD ACCEPT
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ sudo /etc/init.d/networking restart
$ sudo dpkg-reconfigure maas-region-controller
[inner ip]
$ sudo dpkg-reconfigure maas-cluster-controller
http://[inner ip]:80/MAAS
$ sudo vim /etc/maas/ephmeralss
set  ARCHES="amd64"
$ sudo maas createsuperuser
$ sudo maas-impoart-pxe-files
open web UI (http://[inner ip]/MAAS)  & press setting button & set Cluster controllers
$ sudo vim /var/share/preseeds/preseed-master …
open computer to let clients set to ready status ( DO NOT PRESS 'START NODE' BUTTON )
check if nodes are all in READY status

MAAS clients are all in ready status:
setting juju environments.yaml

juju bootstrap ( check if one of the node -> allocated to *)

open the allocated Server to PXE boot and the setup a Ubuntu
after the installation

juju status

machines:
  0:
    agent-state: running
    dns-name: node-4487fc70b037
    instance-id: /MAAS/api/1.0/nodes/node-xxx
    instance-state: unknown
service{}

When I try to deploy one charm ( for example mysql ), the other client is booted and installed ubuntu. However, after the installation, the charm still wasn't deployed.
and I try:

juju status

machines:
  0:
    agent-state: running
    dns-name: node-4487fc70b037
    instance-id: /MAAS/api/1.0/nodes/node-64248652-6a9b-11e2-9347-842b2b6a17a3/
    instance-state: unknown
  1:
    agent-state: not-started
    dns-name: node-0025b31884f5
    instance-id: /MAAS/api/1.0/nodes/node-011c5b14-6a9d-11e2-9c04-842b2b6a17a3/
    instance-state: unknown
services:
  mysql:
    charm: cs:precise/mysql-15
    relations: {}
    units:
      mysql/0:
        agent-state: pending
        machine: 1
        public-address: null

I also checked /var/log/juju/machine-agent.log of machine 1 ( the non-started machine) and it shows that
2013-01-30 01:19:58,444: twisted@ERROR: Unhandled error in Deferred:
2013-01-30 01:19:58,454: twisted@ERROR: Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/juju/agents/base.py", line 238, in startService
    yield self.connect()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1181, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/juju/agents/base.py", line 208, in connect
    self.config["zookeeper_servers"])
  File "/usr/lib/python2.7/dist-packages/txzookeeper/retry.py", line 302, in connect
    return self.client.connect(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/txzookeeper/client.py", line 468, in connect
    self._servers, callback, self._session_timeout)
zookeeper.ZooKeeperException: Could not internally obtain zookeeper handle

I wait for one day and it keeps pending. The machine 1 is also remaining on not-started. I also checked to ssh two clients that they are quite ok. However, I cannot use juju ssh 1 to connect to the client. I really don't know what to do. Please help me.
Answer: machine 1 is unable to connect to the ZK process on machine 0.  There could be many reasons for this; DNS problems, firewall problems etc.
I would ssh into machine 1 and try to manually connect to the Zookeeper running on machine 0 (using telnet) to see if you can determine the exact problem.
Comment: I tried using `host **machine-0**` in machine 1 and got host not found. I also tried `telnet *machine-0** 2181` and got nothing. It just stuck in Connected to node-4487fc70b037. Therefore, I still cannot determine what is going on there
Comment: It seems that you don't have your DNS set up correctly then. You need to configure your DNS server in the DHCP config so that it uses the MAAS one, or at least one that knows how to resolve the machine* addresses.
Answer: After manually add the host name (/etc/hosts) in each of the machines, juju successfully deploy the service on machine 1.
Answer: I think this may have to do with mDNS.
I'm also running into this same issue.
With mDNS enabled as is default I can't resolve the machine-0/zk hostname!
My DNS however works fine, using dig.
It's only when it goes through the mdns layer that it causes timeouts/hangs.
It seems to work when using not FQDNs, when using an FQDN, even a known one, it for some reason looks for avahi first? Need to dig deeper.
Edit: I found the problem is avahi takes precedence over the .local domain, even it's subdomains. I'm looking for a way to make avahi blacklist a domain, we may have to come up with a patch for a blacklist-domain option.
Try changing /etc/nsswitch.conf to not use mDNS with NOTFOUND=return, ie, make the hosts: line:
hosts: files dns mdns4
Or edit the generic preseed for MaaS and remove avahi-daemon from the autoinstall list.

Juju cannot deploy services with MAAS


Adding a blank row between dates in Google Sheets

Question: I'm trying to make a very basic load schedule for work.  We don't know ahead of time how many loads we'll be adding on a given day, but I'm trying to add a formula or script that will add a blank row between the sorted dates (i.e., all the loads for 11/20 will be listed, and then there will be a blank row).  It's purely aesthetic, I just don't want this thing to be miserable to look at.  Is there a simple way to accomplish this?
Answer: A couple of assumptions:
1) You use the first column for the date.
2) The first row is reserved for headers.
You could achieve this with the following script:
<code>function myFunction() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = ss.getSheetByName("Sheet1");
    var i = sheet.getLastRow() - 1;
    var baseRow = 0
    while(i > baseRow){
        if(values[i][0]!=values[i-1][0]){
            sheet.insertRowsAfter(i,1);
        }
        i--;
    }
}
</code>
If you have a different sheet, change the name of the Sheet.
If the chunk of rows are not starting from 1, change the baseRow value.


Is there something a site can do to incorporate third party cookies

Question: I work for an e-commerce site.  Part of what we do is to offer customized items to some clients.  Recently some non-technical management promised that we could incorporate our check-out process into one such client's website.  The only way we've figured out how to do this is by using an iframe (I know, I don't like it either).  The issue is that most customers of this site are unable to check out because we use cookies to determine which custom items to display.  Browsers are recognizing our cookies as third party and almost everybody has third party cookies turned off, as they should.  I'm going to be shocked if the answer is yes, but is there any workaround for this?  ie can the site hosting our iframe somehow supply the necessary cookie?
Answer: Try an invisible, interstitial page.
Essentially the hosting site would issue a redirect to a site within your domain, which is then free to set cookies (because at this point is is actually the first party).  Then your site immediately redirects back to the hosting site.  At this point your newly-created cookies will be invisible to the hosting site but visible to your iFramed page henceforth.
Unfortunately the hosting site will have to do this every time a cookie is to be updated but the double-redirect can happen so quickly they'll hardly notice.  Hopefully your system only needs the cookies to be set once.
Comment: I'm banging my head into the desk for not thinking of this.  Thank you so much.
Answer: Instead of using a cookie, pass the information in the each url request as name/value pairs.
It is a bit of a pain to add the name/value to every url...I know...oh well...it will work.
Answer:
I'm going to be shocked if the answer is yes, but is there any workaround for this? ie can the site hosting our iframe somehow supply the necessary cookie?

Your iframed page itself, which is the third party in this scenario, could send a P3P Cookie Policy header – some browsers then accept third-party cookies by default, whereas others (mainly Safari) will not be convinced to do so at all if not by the user manipulating the default settings themselves.
What you could also do, is pass the session id not (only) by cookie, but as a GET or POST parameter as well – f.e. under PHP this can be done quite easily by configuring the session options. You should consider if that's worth the slightly increased risk of session stealing.
Comment: Thanks for the suggestion, but safari is actually our #1 browser, so the cookie policy header is out.  Also, the system using cookies is so ingrained that incorporating get or post would mean shutting down and overhauling a very large portion of our code, which I can't do.
Answer: The interstitial page solution should work but it might be a lot of trouble for your hosting site, so here's another solution that will allow you to work cookieless.
Write an HttpModule that responds to the BeginRequest event, reads the querystring, and inserts corresponding cookie headers into the Context.HttpRequest object (Note: you can't use AddCookie, you have to use AddHeader, because cookies added by a module directly are disposed of before they hit your application proper).  That way the hosting site can simply issue a request (within the iFrame) that contains the necessary value in the querystring, the module will convert it into a cookie (that only exists in memory, not on the wire), and your application will be deceived into thinking that there's a cookie there.  No code changes required, you just need to add the module in web.config.
This only works if you are using IIS 7.0+ in integrated pipeline mode.  If you're on an earlier version of IIS or if you have to run in classic mode, you'll need an ISAPI filter instead.
Answer: Ryan , John
For the Chrome v80 update with SameSite flags, want to set the samesite=none;secure for the site hosting our iframe and somehow supply the necessary  samesite=none;secure cookie. We have apache 2.2 and tomcat 6 setup, so would appreciate a solution and advice on how to make it work. Currently with flag enabled the iFrame is not punching out successfully.
Thanks


Fecundity per woman in early humans

Question: The average fecundity per woman varies a lot from country to country. I call average fecundity per woman the average number of born children per woman. In Homo sapiens, what was the average fecundity per woman during the paleolithic age for example? Is it about 2 offspring per woman or about 12 offsprings per woman?
Comment: @ChrisStronks I edited my post to clarify that I talk about Homo sapiens when I say "humans". It is plausible that we don't have the tools to answer this question... But I hope that might be wrong and someone could come up with some rough estimate. An estimate can maybe be derived from the number of surviving kids that can itself eventually be inferred from the increasing population through time (itself inferred from genetic data or from the geographical range over which fossils are found).
Comment: That goes back about 2.5 Ma - 12k am I right? I'm not an expert, and with all due respect, but my hunch is that the fossil record is very incomplete, and the geologic time frame pretty long. We don't know even how many species of humans there were, let alone reproductive rates during the period.
Comment: Do you mean offspring as in individuals reaching reproductive age or as in born children? If the latter it was certainly not 2, since disease, violent death etc were common. If it was close to 2, H. sapiens would have been extinct and we wouldn't be here.
Comment: I meant offspring = born children. I edited my post. THanks
Answer: Infant mortality was high during the paleolithic, so the fecundity of females had to be quite a bit higher than 2 to sustain viable populations.
A recent paper by White (2014) that explores how the ratio of young and old individuals in a population relates to demographic rates compiles data on hunter-gatherer societies from previous studies that you will probably find useful. Among other statistics, that paper reports a range in total fertility of 2.6–8.0. One of the source papers (Hewlett, 1991, pdf here) has data for individual hunter-gatherer societies (along with data from other types of pre-industrial societies). Many populations lie in the range 4-7 offspring. Note however that most (all?) of these values are from current or recent hunter-gatherer societies and not paleolithic societies. However, to give a ballpark estimate they are probably useful and fairly accurate. Also note that the child mortality rate of these societies are often between 40-50% (infant mortality ~10-30%)

Fecundity per woman in early humans


OpenLayers Projection and Datum Question

Question: I had a conversation with a co worker that was asking about an OL map I am developing. She asked me what the 'projection' was and I said EPSG:4326. She didn't know what that means, so I said it's based on WGS84, to which she replied: that is a mercator, what is the projection? Can someone clear this up for me please?
Answer: EPSG:4326 is not a projection "strictly speaking". It is a geographic coordinate system (also called lat-long) coordinate system. The reference datum is WGS 84, which is the most widely used datum nowadays (because of the GPS). So for many people, when you say "Lat/Long" they will understand.
In order to display Lat/long data on a flat screen, you need some kind of projection. The default "projection" associated with WGS84 is the Plate Carrée (which consists in diplaying lat long coordinates as if they were X Y coordinates.
Mercator is the name of a type of projection. When people do not specify which mercator they are using, it is more and more "WGS84 Web Mercator(auxiliary sphere)" (EPSG:3857 or, unofficially, EPSG:900913) which is used in many popular web mapping applications (Google/Bing/OpenStreetMap/etc).
Comment: To be correct, Web Mercator is not really a mercator projection: http://hydrometronics.com/downloads/Web%20Mercator%20-%20Non-Conformal,%20Non-Mercator%20(full).pdf


Is there a way to autopopulate MailingLatitude/MailingLongitude?

Question: My organization wants a report of all contacts living within 30 miles of our headquarters. I've created a custom field that uses the DISTANCE and GEOLOCATION functions to calculate the distance from our location to MAILINGLATITUDE/MAILINGLONGITUDE, but those fields are unpopulated. Is there a way to quickly autopopulate those fields?
Answer: There is an easy way to do this, assuming you're using either the Account, Contact, or Lead.
Here are the release notes: Summer 16 Release Notes
Under Setup->Data.com Administration->Clean->Clean Rules
Select which rule you'd like to activate, and it will rather quickly populate the data.
Answer: You will need to geocode all of your existing address information. ( beware of callout limits ).  Also you need to setup a trigger and call a service that will encode new/updated account information.
Are latitude and longitude saved automatically?


Why can't we have charge field?

Question: I learnt that everything is made of field, there is the electron field that occupy the entire universe and it will produce an electron which is an excitation of the field. This electron interacts with the higgs field that give it it's mass and it also carries a negative electric charge, I am wondering why can't an electron through interaction with a say charge field instead? I also know there is the electric field but you need to have a charge to create an electric field just like a mass creating gravitational field.
Comment: Are you asking if charge could be produced in the same way as mass i.e. by some process akin to the Higgs mechanism?
Comment: @JohnRennie: I believe particle have mass through interaction with higgs field so mass is not considered to be an intrinsic property such as spin, I am thinking why can't particle have charge by interacting with a field(I'm making up a new field called charge field) instead of intrinsic property.
Comment: Related: https://physics.stackexchange.com/q/4238/2451
Answer: Charge and mass are very different properties because charge originates from a fundamental symmetry while mass does not. Indeed a non-zero mass breaks a fundamental symmetry. This difference is why we believe the two properties have different origins.
Charge arises from a symmetry of the Dirac Lagrangian This is nicely described by JamalS's answer to What is charge actually? How to define it? In the Standard model it is associated with the $U(1)$ symmetry. Any theory with this symmetry will inevitably have a property homologous to electric charge. No external mechanism is needed to produce it.
By contrast mass is not a fundamental property and is not required by any symmetries. Indeed the $SU(2)$ symmetry of the Standard Model is only possible when all particles are massless. So we believe that all particles are fundamentally massless and mass only exists because there is some external mechanism to produce it. That of course being the Higgs mechanism.
So at least in quantum field theory the answer to your question is that no, charge is not produced by a mechanism akin to the Higgs.
Answer: We do have charged fields, such as the electron, which you mention. Do you mean can the electromagnetic force be attributed to a type of field called a charge field? Well it sort of can (at a stretch), it's called the photon field.
The photon field appears in quantum electrodynamics or QED, which is our quantum field theoretic description of the electromagnetic force. The photon mediates the electromagnetic force between charged fields.
I must stress though that the photon doesn't interact with itself. That means that it isn't itself charged. So calling it the charge field could be quite misleading.
The photon field, however, shouldn't be thought of as the ''origin of charge'', in the same way that the Higgs field could be said to provide the ''origin of mass.'' The mass and charge assignments of the known particles are both puzzles; we don't know why they have the values they do. However, whereas the existence of mass itself is a problem (solved by the Higgs), the existence of charge isn't a problem. Thus there is no reason to expect that any field plays the role of the Higgs with respect to charge.
Comment: How about the W boson? While it mediates weak interactions, their essence seem to be in transferring the electric charge from one particle to another. For example, a proton can interact with an electron by transferring the electric charge in the form of W. The electron left without the charge becomes a neutrino while its charge (W) converts the proton to a neutron. Can the W-boson field be called "an electric charge" field in the sense of the OP's question?
Answer: Charge is not a field; charge is a coupling constant measuring the probability of interaction between two fields: a matter field and a gauge field.
For example, the electric charge of an electron, $-e$, measures how strongly the electron field couples to the photon field... basically, how likely an electron is emit or absorb a photon.
Amother way to think about it is that fields correspond to particles, the particle being a quantum of the field. There is no "electric charge particle", so there is no "electric charge field". Instead, various particles have various electric charges depending on how strongly they couple to photons.
Comment: I see what you're getting at, but should we really say that charge is a coupling constant? or that it measures the probability of an interaction? That's a bit non-standard.
Comment: https://en.wikipedia.org/wiki/Coupling_constant
Comment: Well, I don't much like saying it's a coupling constant. The coupling constant governs the strength of the interaction, runs with energy etc. Charg is a conserved quantity associated with a symmetry. Different fields have different charge assignments etc, but all interact via the same coupling constant
Comment: https://en.wikipedia.org/wiki/Fine-structure_constant "Alpha is related to the probability that an electron will emit or absorb a photon." Alpha is simply the square of the charge in natural units.
Comment: Yes, indeed the coupling constant is related to probabilities but honestly, the way you've interpreted and rephrased that is quite peculiar.
Comment: "the electric charge of a particle is a coupling constant that characterizes an interaction with two charge-carrying fields and one photon field" - https://en.wikipedia.org/wiki/Coupling_constant
Comment: You seem to have learned QFT very differently than I did.
Comment: and taught it differently too ;)
Comment: don't be so rude. consider the possibility that your answer is genuinely peculiarly phrased. all the best.
Comment: I've deleted the comment that offended you.
Comment: @innisfree You are not alone in your assessment from both perspectives.
Comment: "Charge functions as a coupling constant." - Martinus Veltman, "Facts and Mysteries in Elementary Particle Physics", p.73. Are you two *really* going to argue with Veltman? I suspect that I could easily find similar quotes by Feynman, etc. This is a completely mainstream view.
Comment: @PM2Ring No. Real photons and virtual photons couple to electrons in exactly the same way. There is only one kind of electromagnetic vertex in Feynman diagrams, and the coupling constant in that vertex is $e$.
Comment: They seem useful.
Comment: I don't think I particularly object to Veltman's phrasing, though it would depend on the full context of the quote. Why do you think Veltman chose to write *functions as* instead of the simpler *is*?
Comment: Anyway, enough already, the answer isn't wrong, I just thought it sounded odd. I think we are finished, I think it is a matter of taste

Why can't we have charge field?


If an outdoor outlet is mounted flush and the cabling direct through the wall, can I use indoor cabling?

Question: If I drill a hole from indoors to outdoors and mount an exterior outlet directly over the hole, do I need to use outdoor cabling even though it's not exposed to the elements?
Answer: Although it's done that way all the time, it's my opinion that if the box is in a wet location, the cable inside the box must be rated for wet locations.  Sometimes an easy way to comply is set a box just inside the building, and transition from NM to UF in the indoor box, send the UF out to the outdoor box.
Comment: Or run it the last foot in conduit, and use THWN-2 individual wires.


How to show thumbnails of simple products in configurable products with Magento

Question: I want to show each simple product's thumbnail image and option name with a radio button to select in configurable products. Default behavior is showing  options in text with a widget like dropdown box. I am using Magento Community Edition 1.4.1. Are there anybody has done this before? Could you guide me for a right direction?
Answer: The default behavior is to have these in dropdown format with the images changing to that of the simple product's image using Javascript. If you want to change that functionality, you are going to need to change the helper that creates those options.
I don't have a clean install on mine, and I've got a module completely overwriting the options portion, but what you will need to do is find where the configurable product information is displaying those drop down fields and change them to radio with the simple product image. I'm sorry I don't have specifics for you, but that should get you started.
Answer: An example of what is being asked can be seen here in the form of a live demo:
Note: the thumbnails as options under the "Pick a vase:" section.
http://products.proflowers.com/tulips/MultiColored-Tulips-4811?ref=homenoref&viewpos=1&trackingpgroup=mdt&psrid=975370


Low Seg2Cat not working with category groups

Question: Am using Low Seg2Cat. Great utility. But having problems now using it with categories in a second category group.
For categories in the initial category group it works fine.
For categories in the second category group I created it generates no responses.
The behavior can be tested on a url generated by this code:
Segment 3 - {segment_3}

Segment 3 Group ID - {segment_3_category_group_id}

Segment 3 Category Name - {segment_3_category_name}

Segment 3 Description - {segment_3_category_description}

category source information

{exp:channel:categories}
    {category_name} (Category ID/url: {category_id}/{category_url_title})
    {if category_description}{category_description}{/if}
{/exp:channel:categories}

In my dataset, categories 1-10 are in Group 1, Categories 11 and up are in Group 2.
Here is a URL generated by the above code for a category in the first group:
http://2gc.eu/pages/_categorytest/presentations
Here is a URL generated by the above code for a category in the second group:
http://2gc.eu/pages/_categorytest/balanced-scorecard
You will see that the Low Seg2Cat tags generate no data for the second example, even though there is data available.
Any idea why this is happening?  I'm sure I'm doing something silly - but documentation for Low Seg2Cat implies that if you don't specify Group-ID in the tag parameters, the results are for all categories.
Grateful for whatever guidance you can offer on this.  Thanks!
Answer: Speedy response from Low - in case useful to anyone else - I had forgotten to add second group to the Low Seg2Cat CP settings.
Did this and all worked sensibly again :)
Thanks Low!


Why do developing countries adopt 21st century technology, but stay behind in output per capita?

Question: The economic growth rate of Latin America has been about 3% per year for decades; but if you have ever visited, many of the natives have: internet, smartphones, tomography, hybrid cars, etc.
Why don't they catch up when they adopt cutting edge technology?
Comment: just out of curiosity, is 3% p.a. growth in per capita terms?
Comment: "they have" is rather vague: surely it's relevant how widely these technologies are used, whether they are imported or (at least some) produced locally, how good the supporting skills and infrastructure are?
Comment: political economy constraints.
Comment: @Adam Bailey : That's probably the right way to think about it. Can you expand it and put it as an answer so I can accept it? Is there a way to measure technology adoption?
Answer: Probably if you go to almost any country in the world, however poor, you will find considerable use of relatively cheap cutting-edge consumer technology such as smartphones and some more expensive cutting-edge technologies used in manufacturing or service industries.  However, there is a big gap between 'adopting' cutting-edge technology at that level and the much more comprehensive adoption of such technology by developed countries.  The benefits of technology in developing countries may be limited by any of the following:

Lack of adequate supporting infrastructure, eg electricity supply
unreliable or subject to regular power cuts, unreliable internet service.
Lack of adequate skills to maintain and make best use of technology.
Limited adoption, eg of smartphones, so that network benefits are
not fully realized.
Lack of capital equipment, knowledge and skills to produce
cutting-edge technology equipment, so that all such technology has to be
imported using scarce foreign exchange; or, for slightly more
developed countries, production of high-technology goods is limited
to low-level assembly work within an international supply chain
where most of the value is added elsewhere.

Suppose, then, that (recognizing the above problems), a developing country tries to adopt cutting-edge technology in a comprehensive way, so as to quickly catch up with developed countries.  Such an approach is heavily criticized in Justin Yifu Lin's book The Quest for Prosperity, which argues, in outline, that developing countries should target industries in which they have a comparative advantage (or can achieve one via improved infrastructure) and which offer an opportunity for gradual upgrading of technology.  While countries differ, this will often mean labour-intensive manufacturing, and it is suggested that industries to be targeted should be those currently dominated by countries whose GNP per capita is about twice theirs.  By contrast, attempting to compete immediately with countries with the most advanced technology is likely to lead to a continuing need for subsidy, distortion of resource allocation, financial repression to channel scarce capital to the subsidised sector, and political problems in handling those profiting from or dependent for employment on subsidies.


Bottom bar v Hamburger in Android

Question: How exactly are the bottom bar in iOS and Android different?
Please give specific examples ..also exceptions and why the exceptions exist.
Comment: This link might be helpful. [Material design - Platform adaptation](https://material.io/guidelines/platforms/platform-adaptation.html#)
Answer: Google's guidelines for a bottom navigation bar are relatively new. It is believed they were against the use at first, because people could easily hit the wrong button with the touch sensitive hardware buttons at the bottom of most Android devices.

They never gave information about this, but my guess is they noticed just having the hamburger menu was hurting the discoverability of the app and the tabbar at the top wasn't sufficient for a lot of situations, plus it was hard to reach.

So much for the background information. You're asking what the exact difference is. I suggest you take a look at the guidelines for both Google Material Design and Apple.
https://material.io/guidelines/components/bottom-navigation.html#bottom-navigation-usage
https://developer.apple.com/ios/human-interface-guidelines/ui-bars/toolbars/
You'll notice Google suggests icons in combination with text labels and certain animations on active pages.
Apple suggests either icons for multiple links or text labels for three or less links (text is less likely misunderstood / more clear).
And that would be the biggest difference. There's more, but you can read that for yourself.
But be aware, these are just guidelines. When designing an app, you stand before the choice of designing the app platform independent so the style is uniform across both Android and iOS for brand recognition and your own full custom user experience. Or you style it according to the platforms' guidelines, creating an app that will be more intuitive for the user since they're familiar with the design patterns native to their phone.
Airbnb has the same components and design across Android and iOS.

Bottom bar v Hamburger in Android


How can I fix a liquidy choux pastry (Gougères) dough for piping?

Question: Last week, I attempted to bake Gougères for the first time. It was my first attempt at baking with Pate a Choux. The recipe I followed called for six large eggs, but I knew adding the last egg would make the dough runnier than the optimal consistency. When I added the mixture into a piping bag, it was watery and didn't hold shape. Is there a technique or something I can add to the dough mix to correct the dough from being so liquidy? May I add flour to the runny dough and mix it in an electric mixer to tighten the consistency, or is that not recommended because I already mixed the eggs into the dough in a previous step?
Comment: Suggested title change: "How can I fix a liquidy choux pastry dough?" Gougère is a specific pastry made with cheese added to the choux pastry, but I don't think it matters too much in that case, and your question applies also to other scenarios (eclairs, profiteroles, etc).
Answer: Most of the sources I've seen online say that you absolutely shouldn't add more raw flour to liquidy choux dough.
The recommended solution seems to be to make half a batch of dough without the eggs, and mix that with the overly-eggy dough, either a bit at a time until the correct consistency is reached, or all at once, and then add more eggs to the combined doughs if necessary.
Another solution is to put the dough back into a pot, and cook, stirring constantly, over very low heat until the dough thickens to the proper consistency.
Comment: I would be *terrified* of heating it on the stove at that point. Even a runny choux would be quite viscous and difficult to keep stirred up, and overheating the bottom by just a few degrees would turn the stuff to chunks.
Comment: @Sneftel I totally agree - knowing me, I might make it way more toasty than it needs to be, and it might taste really funny from the char. So will be careful if this ever happens, and I have to actually attempt back on the pot and reheat suggestion


How could a civilisation develop in a desert with little water and food

Question: I want to create a world full of different civilisations and I want one in a desert but how would I make it believeable.
Comment: Madel it on real-world desert civilizations.
Comment: Egypt?  The various civilizations of Mesopotamia?
Comment: Welcome to WorldBuilding! If you have a moment please [take the tour](https://worldbuilding.stackexchange.com/tour) and [visit the help center](https://worldbuilding.stackexchange.com/help) to learn more about the site. A tip for the future: you should wait at least 24 hours before accepting an answer to give people in different timezones a chance to have a look at your question and the answer. This might improve the quality of the answers you receive. Some people might be discouraged from answering if you already accepted something. Of course it's completely up to you when to accept. Have fun
Comment: Welcome to Worldbuilding!
Comment: Many would argue that a desert is the ideal conditions for a civilization to develop under.  The scarcity of resources becomes the motivating factor to need co-operation and technology to survive.
Answer: No particular problems in making it believable. You can take as reference the cultures which developed on our planet and in our deserts, like

Tuareg (for warm desert)

a large Berber ethnic confederation. They principally inhabit the Sahara desert, in a vast area stretching from far southwestern Libya to southern Algeria, Niger, Mali and Burkina Faso. Traditionally nomadic pastoralists, small groups of Tuareg are also found in northern Nigeria

Sami (for cold desert)

an indigenous Finno-Ugric people inhabiting the Arctic area of Sápmi, which today encompasses parts of far northern Norway, Sweden, Finland, and the Kola Peninsula of Russia.

There are many more all along the history, so based on your world level and climate you can choose what suits best your needs.
Answer: They would have had to start in a habitable zone and, after their water source dried up, had to rely on water farming and imports. They could also live beneath the earth where they have access to underground rivers, insects, fish and fungal growth.
Answer: Two alternatives I can think of:
1) Irrigation
They could have started as river folk, living in a small habitable zone next to a river flowing through a desert. Basically, they are living in the zone that floods yearly.
Then they could have expanded by irrigating. They would not be able to expand much past the distance from the river that they could effectively irrigate. That would encourage them to invent canals and dams and reservoirs and such. Maybe they learn to store water in sand-filled basins then pump it back out of wells. That reduces evaporation quite a bit, at the expense of needing to do a LOT more work at pumping.
But realistically, they probably can't go a lot more than about 50 km either side of the river. If the river is long enough, that could still be a very large empire. Belgium is about 30,000 km^2. So if this river was 300 km long they could have an area equivalent to Belgium.
Though it would have to start out as a quite wide river. Otherwise, they'd use it all up in irrigation. They would need to save a lot of water in the spring floods.
2) They are in a trade bottle-neck of some kind.
This assumes there are at least two other civilizations that want to trade through this desert.
Imagine they have a city that sits on the only source of drinkable water for a long distance. Maybe a river goes north-south through the desert, and the only sensible trade route is east-west through the desert.  Or imagine their desert is on a long narrow chunk of land between two oceans and that contains the only land trade route. And they have a nice lake fed by glaciers on the only mountain in that neighborhood. Or imagine there is alkali water and they have developed a technology that lets them purify it enough to drink. They are the only water on a trade route.
They can extract tribute from every caravan. This will encourage them to develop proficiency with weapons to keep the traders from trying to cheat. And that will encourage them to get up to lots of other things. Why should we be satisfied with keeping this gateway out here in the desert? We should go smack them around in their fat, water soaked cities, and be kings over there.