How much does a spaceship cost?

Question: Going through the spaceship building chapter of Starfinder I'm rather impressed with the versatility in there, but I seem to not be able to find what these spaceships cost. The header "Building a Spaceship" (p. 293) suggests that the first spaceship for the party is free, but if they want to obtain a different ship or need a larger/smaller one, the party would have to buy one. Except I seem to be unable to find what the price tags for these are. Do I keep missing something, or is this intentional on the designers' part?
Answer: It seems that Spaceships aren't supposed to be monetary assets, but operate in a similar manner to how characters level up and learn new skills.
Page 305 says

As the PCs go on adventures and gain experience, they need an increasingly powerful starship to face tougher challenges. When the characters' Average Party Level increases, so does the tier of their starship… The PCs receive a number of Build Points equal to the Build Points listed for their starship's new tier – those listed for its previous tier, which they can use to upgrade their starship.

Instead of buying new parts and ships, the book suggests characters are finding salvage, making arrangements or calling in favours.
This is facilitated by Build Points that are granted according to the Average Party Level (see Table 9-1 on page 294, for players, the APL is equivalent to Tier, for enemy encounters, tier is the method of determining difficulty). Tables of parts and upgrades list "Cost (in BP)" that the players should sum up to design their ships.
From page 305, it appears that the majority of changes to ships will be via upgrades, keeping the total Build Points of components on the ship within the Build Points the party is allowed via their APL. Players add to the ship whenever they've got spare BP. The section on Upgrading Systems isn't too clear, but removing one part grants you all the BP that part is worth which you can spend on other parts.
The party can also "get a new starship" by rebuilding from scratch with a new base frame (say upgrading from a Light Freighter to an Explorer). While the rules don't say this explicitly, it appears that this functions like any other upgrade. If you get rid of your original starship, you have all your Build Points to spend on a new one.
Regardless of whether your upgrading or replacing your starship, Build Points aren't expended like credits. You "level up" your ship to match the Build Points your party has been allocated.
Comment: This doesn't answer the question, specifically this part:  "...but if they want to obtain a different ship or need a larger/smaller one, the party would have to buy one. "
Comment: @ShadoCat BP are used whenever you are doing anything to your starship, whether starting from scratch, upgrading or buying a whole new one. I made some changes in my answer to try and clarify that.
Comment: That makes more sense.  Good edit.  That leaves me wondering if there is any way to have multiple ships or a fleet.
Comment: @ShadoCat I was wondering that too. The core rule book seems to expect the party has access to _a_ starship, singular, though if you've got big enough ships you can install hangars and shuttle bays. I can't find any rules specifically for it but I wonder how unbalanced it would be to just subtract a second ship from whatever BP the party has left over.
Comment: Well, I just posted that question.  So, maybe we'll find out.  Leadership may end run around it but it isn't very satisfying.

How much does a spaceship cost?


Gears for Hero Cyclone

Question: I have a Hero Cyclone bicycle that is a single speed. Can I add gears to it? If so, can anyone suggest me a good gear?
Answer: No you cannot. The Hero Cyclone does not appear to have a hanger / mounting holes for a dérailleur. You may be able to install an internal gear hub, but it would likely cost far more than the bike.
You may be able to find something used though.

Gears for Hero Cyclone


band name for landsat surface reflectance product

Question: I'm looking for any link/documentation where the centre wavelengths of Landsat surface reflectance product are  stated/written (i.e. the value for each centre band). Specifically, I wanted to be sure the band names are same as Landsat 8. All I've seen so far is the band 1, band 2, band 3..... naming convention without the exact value.
Answer: This USGS page contains the wavelength range per band per sensor:
https://landsat.usgs.gov/what-are-band-designations-landsat-satellites
Answer: As, @jbdcode says, you can find wavelenghts in What are the band designations for the Landsat satellites?
Also, check LANDSAT 8 SURFACE REFLECTANCE CODE (LASRC) PRODUCT (available for Landsat 5 and 7 too). This product guide describes almost all the info that you need (range, valid range, fill value, scale factor, quality band, etc).
Finally, check <code>.xml</code> for each scene to be sure:


Hazard ratio curves

Question: Does anyone know of a method to calculate and plot [absolute] hazard ratio curves over a continuous variable? I know of the 'smoothHR' package in R, but it uses an arbitrary reference value and I cannot get it to plot the absolute HR. What I am after is something like the figure 3 in this article: https://www.ncbi.nlm.nih.gov/pubmed/23900696 .
Also, does anyone know if this is an acceptable method for presenting HR? In my opinion it has a clear advantage over regressions with arbitrary cut-off values and presents a very informative curve for continuous variables.
Answer: Methods that categorize continuous variables are invalid from many standpoints, and decidedly inefficient.  You can use a regression spline to model the continuous predictor effect and then plot it against log relative hazard, median survival time, 2-year survival probability, and other transformations of the outcome.  The R rms package makes this easy and there are extensive examples in my course notes you can find linked from http://biostat.mc.vanderbilt.edu/rms
I wouldn't use the term "absolute hazard ratio" but rather "relative hazard or relative log hazard".  You can't plot an actual hazard ratio without choosing a reference value.  I often choose the predictor median but plotting relative log hazard does away with that problem, i.e., plot the linear predictor $X\hat{\beta}$ for the model holding other predictors constant and varying the predictor of interest.
Dichtomizing a continuous variable is only appropriate if the variable has a discontinuous relationship with the outcome that is flat on both sides of the cutpoint.
The use of cutoffs involves improper conditioning, e.g., computing the probability of surviving 10 years given age > 70 as opposed to computing what is really needed: probability of surviving if age = 70.
Comment: No I realize you cannot plot a HR without a reference point. But as healthcare professionals are so obsessed with cut-off values, what if you plot a curve where you test every cut off value? So in the plot in the above mentioned article; QRS 120 or more against all below 120, then QRS 121 or more against all below 121? Would you have a problem with multiple testing?
Comment: No, with smooth fitting you don't test ANY cutoff.  Smooth fits assume (rightfully) that cutoffs do not even exist.  Clinicians who seek cutoffs defy how nature works.  The plotted curve with confidence bands tells all.
Answer: Instead of using the hazard-ratio, you may use the survival probability directly. Fit a suitable model (such as the Cox proportional hazards regression model) first. If you need to adjust for confounding variables, include those in the regression model as independent variables. Use this method to perform g-computation for a lot of different values of time and specific variables of the continuous variable. This can then be plotted in different ways.
For example, this is a survival area plot, created using the method described above:

It shows the survival probability on the Y-axis, the time on the X-axis and distinguishes between values of the continuous variable using a continuous color scale.
This and other types of plots can be created using the method described above using the contsurvplot R package (https://cran.r-project.org/package=contsurvplot), as described in our preprint on this topic: https://arxiv.org/abs/2208.04644

Hazard ratio curves


Is it possible to have a front end tag entry form that is responsive? How?

Question: I'm trying to create a front-end channel form using bootstrap and I have a Tag Module field in it. I'd like to make the field responsive so it could be used on a phone. Is there any way to do this?
Answer: You could use CSS rules that override the rules applied to the Tag widget.
If you don't want to use the Tag widget, you could have a simple textarea form with name="your_tag_field_name":

<textarea name="your_tag_field_name"></textarea>

This lets you customize the form field the way you want (eg. make it responsive). Each tag would have to be on their own line in this case.


Perpendicular bisector in a different metric

Question: Consider two points $a, b \in \mathbb{R}^2$. Then from elementary geometry, the set of points that are equidistant from both $a$ and $b$ is precisely the perpendicular bisector of the line segment $ab$. Now suppose we put some other metric on $\mathbb{R}^2$ that generates the standard topology. Then what can we say about the set of points that are equidistant from $a$ and $b$? Intuitively, it seems to me that this set should be "one-dimensional" and cannot contain an open set. Is this true?
Comment: Can you think of examples of such metrics which are equivalent to the usual metric? It would be helpful if you came up with an example of such a metric , and then tried to plot the perpendicular bisector. Scalar multiples of the usual metric would still give the perpendicular bisector.
Comment: I agree with @астон вілла олоф мэллбэрг : you should take an example of such a metric and then try first by yourself to find out what such a set looks like (and - why not - show the result within your question).
Comment: A reference (taxicab geometry = $\|\|_1$ geometry) : http://jwilson.coe.uga.edu/EMAT6680Fa06/Sexton/GeoFinalProject/Taxicab/ellipse.html
Comment: @ Jean Marie Thanks! For all the standard metrics I have tried the assertion is true. However, I am unable to prove the general assertion.
Answer: Very interesting question!
Metrics
For an arbitrary metric on $\mathbb{R}^2$ that generates the Euclidean topology, the set of all points equidistant from $2$ distinct points does not necessarily have to be "one-dimensional".
Consider the metric $d(p,q)=\min\{\|p-q\|_2,1\}$ where $\|(x,y)\|_2=\sqrt{x^2+y^2}$ is the Euclidean norm. Do convince yourself that this is a metric. (non-negative, non-degenerate, symmetric, triangle inequality) However, for any two points, there is only a bounded (in the sense of the Euclidean metric) set of points that are not equidistant from them.
Norms
Even if we require our metric to be induced from a norm, the set of equidistant points does not have to be "one-dimensional".
Consider the norm $\|(x,y)\|_\infty=\max\{|x|,|y|\}$. Do convince yourself that this is a norm. (non-negative, non-degenerate, scaling, triangle inequality) However, if we take the points $(1,0)$ and $(-1,0)$ then all points $(x,y)$ with $1-y\leq x\leq y-1$ are equidistant from $p$ and $q$.
Strictly convex norms
However, if we require our metric to be induced from a strictly convex norm, then we can prove that the set of equidistant points is homeomorphic to $\mathbb{R}$. Strictly convex means there is no line segment in the unit sphere. Algebraically, for all $p\neq q$ with $\|p\|=\|q\|=1$ we have $\|p+q\|<2$. Examples of strictly convex norms are all $p$-norms for $1<p<\infty$.
Proof (Not very rigorous, but hopefully convincing enough.)
Let $\|\cdot\|$ be a strictly convex norm on $\mathbb{R}^2$ and let $p\neq q\in\mathbb{R}^2$. Define $s:=\|p-q\|$.
Claim 1 For all $r\geq\frac{s}2$ on each side (non-strict) of the line through $p$ and $q$ there is exactly one point equidistant from $p$ and $q$ with distance $r$.
Proof of Claim 1 Assume for the contrary that there are two distinct points $a$ and $b$ to the right of the line through $p$ and $q$, both equidistant from $p$ and $q$ with the same distance $r$. We then find that all of the points $p-a$, $p-b$, $q-a$ and $q-b$ and their inverses lie in the sphere of radius $r$. However, all of the line segments $(p-a)(p-b)$, $(q-a)(q-b)$, $(b-p)(a-p)$ and $(b-q)(b-q)$ are different, are parallel, and have the same length. We are forced to conclude there is a line segment inside the sphere of radius $r$. This proves Claim 1.
Notice that from the triangle inequality it follows that for $r<\frac{s}2$ there are no equidistant points from $p$ and $q$ with distance $r$. Also notice that there is a unique point on the line through $p$ and $q$ equidistant from $p$ and $q$, namely $\frac{p+q}2$ with distance $\frac{s}2$. It follows that we can define a bijection $f:\mathbb{R}\to E$, where $E$ is the set of points equidistant from $p$ and $q$. Namely $f(0)=\frac{p+q}2$, $f(t>0)$ is the unique point on the right of the line through $p$ and $q$ equidistant from $p$ and $q$ with distance $\frac{s}2+t$, and $f(t<0)$ is the unique point to the left of the line through $p$ and $q$ equidistant from $p$ and $q$ with distance $\frac{s}2-t$.
I don't quite have an idea how you can rigorously prove that $f$ is continuous both ways, but this is my intuition. Since the norm is strictly convex, for all $\epsilon>0$ the spheres around $p$ and $q$ through the current equidistant point curve away from each other some $\delta>0$ units. Then changing the radius by $\delta$ can only move the intersection of the spheres $\epsilon$ units.
Final notes
Finally, I want to emphasise how important this strict convexity is. If the norm is not strictly convex, then you can always find two points $p$ and $q$ for which the equidistance space is not "one-dimensional". Just take the end points of the line segment in the unit sphere.
Comment: +1 very interesting answer. I think you should upvote the question.
Comment: @SmileyCraft gave a very complete answer, but I just want to point out a slight error in their $L_{\infty}$ example. Note that the point $(2,0)$ is in the allowed interval, but it is closer to $(1,0)$ than $(-1,0)$. The constraints should be $1-y \leq x \leq y-1$ instead.
Comment: @XinYuanLi You are correct, I fixed it.


Convert a 'content document' to attachment (ideally in flow)

Question: I have a managed application that creates files (PDF) as content documents attached to a custom object (source).  I also have another object where files from another process are interfaced to the object as an 'attachment' (target).  These files are visible on a custom VF page that is visible externally to users.  Basically, any file attached to this object (as an attachment) is visible.  I can create a content document link via flow which creates a reference to this content document in the target but this doesn't work for me needs as its not an attachment (thus not visible on the VF page).  Is there a way to 'convert' a content document to an attachment, ideally in flow?
Answer: It sounds like this installable extension will enable you to carry out the conversion in a flow: https://unofficialsf.com/new-flow-action-convert-files-to-attachments/


Simple Commerce - don't want to use PayPal

Question: I'd like a simple ecommerce solution, but don't want to use PayPal. I already have authorize.net set up, so I would rather use that option. Simple Commerce seems to be designed to work around PayPal. Is there a way to make it work with authorize.net? Are there alternative solutions to Simple Commerce that do not cost?
Comment: Could you provide an update to this, or mark one of the answers as accepted if it helped?
Answer: I don't know of any free alternatives for Authorize.net.
Charge (http://devot-ee.com/add-ons/charge) is an affordable ($45) method to integrate Stripe.com and might be a good middle ground solution between Simple Commerce and a true eCommerce add-on such as CartThrob or Exp:resso Store.
Comment: +1 for Charge; the support has been outstanding, and it's fairly easy to work with.


How light splits up into different colours when passed through prism using QED?

Question: I want to know how light gets splits up into different colours when it is passed through prism? How light interacts with atoms and electrons of the prism? Can someone explain this to me using Quantum Electrodynamics?
Answer: I assume that you mean you want the general idea to be presented "Oppan Feynman-style" rather than for me to start talking about a QED Lagrangian that describes the sort of prism which would generate refraction.
Photons which go into the prism will in general have the same frequency $f$, because wave-fronts and troughs cannot enter the material any faster than they enter it: but they will effectively change their wavelength due to effectively traveling at a different velocity through the medium. Now it would be nice if we could say that there was just one velocity $v$ such that every new wavelength was $\lambda = v / f$, but for the materials which make good prisms, there is instead dispersion, which is a fancy way of saying that there is some complicated $\lambda(f)$ function rather than such a simple one.
Now suppose we have an emitter E at some point $(0, Y)$ and a detector $D$ at some point $(X, -Y)$ inside the prism, and we want to sum up all of the amplitudes seen for light going through the surface at point $(x, 0)$. We'll assume that the light shines towards the surface with some wavefunction $\gamma(\phi)$ where $\phi = 0$ goes towards $x = +\infty$ and $\phi=\pi$ goes towards $x=-\infty$.  Together, this gives us an integral:$$\psi = \int_{-\infty}^\infty dx~ \frac{\gamma(~\tan^{-1}(x/Y)~)}{\sqrt{(x^2 + Y^2)[(X - x)^2 + Y^2]}} \exp\left({2\pi i \sqrt{x^2 + Y^2} \over \lambda_0} + {2\pi i \sqrt{(X - x)^2 + Y^2} \over \lambda_1}\right)$$The term on the right is a phasor that rotates wildly in general; assuming $\gamma$ and the other term vary slowly relative to this, the main contribution to this amplitude will be come from the narrow band around the point $x$ where the parenthesized stuff changes least:$$\frac{d}{dx}\left(\sqrt{x^2 + Y^2} + {\lambda_0\over\lambda_1} \sqrt{(X - x)^2 + Y^2} \right) = 0$$ Assuming that $\lambda_{0,1}$ are independent of $x$ this gives just:$$\left(\frac{x}{\sqrt{x^2 + Y^2}} - {\lambda_0\over\lambda_1} \frac{X - x} {\sqrt{(X - x)^2 + Y^2}} \right) = 0$$which if you like trigonometry is actually just Snell's law in disguise:$$\sin\theta_0 - \frac{\lambda_0}{\lambda_1} ~ \sin\theta_1 = 0.$$This now has the meaning, "the main contribution comes from two angles $\theta_0, \theta_1$ which have the above relationship." You can hypothetically solve for both of them by first solving for $x$ and then using the $X$ and $Y$ that you presumably already know. But of course we are also free to choose $\gamma$ to be very localized at some angle $\phi_0$, kind of like a laser beam. The jargon term is that such light is "collimated". Then the combination of these two effects means that we won't see a large amplitude unless we happen to place our detector at the exact $\theta_1$ such that $\theta_0 = \phi_0$, so you can also interpret this the "conventional way", that a beam of light gets "bent" on entering the medium.
If the first medium is sufficiently vacuum-like, $\lambda_0 \approx c/f,$ and for a nondispersive medium $\lambda_1 \approx v/f$ and the factor relating the two is $c/v$, having nothing to do with frequency or wavelength at all.
However, supposing that $\lambda_1$ has some dependency on $f$, and $\gamma$ is collimated white light centered at some particular $\theta_0$, then different colors (frequencies) will have different $\theta_1$s which optimally refract them, and the incoming white light will "split" into different colors. That's all that's really happening.
Now if you want to know why the sum of all of the paths from $x$ through the glass to the detector might have this dispersive character, there are some models of that, too, but the basic thing to ask yourself is, well, why wouldn't it have this dispersive character? Surely there is some complicated relationship which has some Taylor expansion of $1/\lambda_1$ at roughly optical wavelengths, which are such a tiny fraction of the electromagnetic spectrum: you can certainly expect some $\alpha + \beta ~f$ expansion or so for these frequencies.
Answer: As you know white light is made of many different wavelengths. Each wavelength of light takes a slightly different path through the prism. In QED we have a spinning clock which turns at different rates for different wavelengths of light. We calculate the probability of a certain path the light can take using these clocks which have associated probability amplitudes. It turns out that because blue light has a clock which turns at a different rate than red that it bends more or rather is more likely to travel through the prism along a more bent path.


What is the number of extensive variables needed to characterize a system?

Question: How is it that in the absence of an external field a system can be characterized by its energy, volume, and the number of particles of each species? Why is this number sufficient?
Answer: In general, this is not true. In the absence of external coupling, a system can be "characterized" by the values of all conserved quantities*. For the kinds of systems studied in introductory thermodynamics classes, energy, volume, and number density are usually assumed to be the only relevant conserved quantities*.
*I'm including parameters of the Hamiltonian (e.g. volume of a box) in the set of conserved quantities. These parameters don't change over time (by assumption), so they are mathematically equivalent to extra conserved quantities in a system with corresponding extra degrees of freedom.
Now, what does "characterized" mean? It means that the long-run average values of all observable quantities are fully determined by the values of the conserved quantities. Under some conditions, this also implies that the large-$N$ behavior of the system is fully determined by the values of the conserved quantities.
If we're willing to be careless with edge cases, this statement is not so hard to prove. The long-run average value of an observable $f(q,p)$ is given by $$\langle f \rangle = \lim_{T \rightarrow \infty} \frac{1}{T} \int_{0}^{T}  f(q(t),p(t)) dt$$
We can split the phase space up into the different trajectories of the system. Once we take the limit $T \rightarrow \infty$, the long-run average shouldn't depend on when along the trajectory we started. It should depend only on which trajectory we are on. But which trajectory we are on is fully determined by the values of any complete set of conserved quantities. We can see this by defining a special conserved quantity for each path of the system which is $1$ along the path and $0$ elsewhere.


Can I associate Multiple campaigns to a web to Lead form?

Question: I have a single web to lead form, based on the lead's picklist value input i would like to associate that particular lead to a campaign is this possible ?
Comment: For your question, the realistic answer is **YES**.  And if you have any implementation/approach to your requirement, please let us know where you stuck. People are really looking forward to help you out.
Answer: Yes.
Yes, it could be done several ways. You could write JavaScript on the web2lead form to specify a hidden field. You could build a Process Builder to assign a campaign record based on the picklist value, either directly, by Apex Code, or by a Flow. You could write a trigger on Lead to assign the campaign based on the picklist value. Whichever method you prefer is up to you, they're all about the same.


Boundary condition for PDE

Question: I've been asked to come up with a way to numerically solve the differential equation $$\frac{\partial T}{\partial t} = \frac{\partial}{\partial x} \left( \chi(T) \frac{\partial T}{\partial x} \right)
$$
for a function $T(x, t)$ with the boundary condition $\chi(T) \frac{\partial T}{\partial x} = P$ at $x=x_R$, where $P$ is some constant. My thinking at this point was that \begin{align} \frac{\partial T}{\partial t} \biggr|_{x=x_R} & = \frac{\partial}{\partial x} \left( \chi(T) \frac{\partial T}{\partial x}\biggr|_{x=x_R} \right)\\
&=\frac{\partial}{\partial x} \left( P \right)\\
&= 0 \\
\implies T(x_R, t) &=constant
\end{align}
and in particular that $T(x_R, t) = T(x_R, 0)$ but when I asked my lecturer about it they said that I "couldn't just apply that equation to that point" and I'm not sure what he means. Should I instead be evaluating $$\frac{\partial T}{\partial t} \biggr|_{x=x_R} = \frac{\partial}{\partial x} \left( \chi(T) \frac{\partial T}{\partial x} \right)\biggr|_{x=x_R} $$
Comment: You first need to define the domain. And then define the boundary condition on that domation as well as the initial condition for $t=0$.
Comment: You should also clarify how nice $\chi$ is.
Answer: The problem is not applying the heat equation to the boundary point. The problem is a more basic one that has nothing to do with PDE:
Your argument basically is that if $ f (0)=0$ then $ \frac{d}{dx}_{|x=0 }f (x)=\frac{d}{dx} 0=0$. This is obviously nonsense.
EDIT: Woops, just read the final part of your question. Yes, that's what you should be evaluating.

Boundary condition for PDE


Transfer Between LCM, GCD for Rings?

Question: I am starting a chapter on divisibility in commutative rings, and I was wondering if there was a way to translate theorems about gcd to lcm and vice versa. I know the concepts are considered "dual" in some sense, so perhaps the theorems relating to them are also dual.
Answer: A  prototypical example is proving $\ \rm gcd(a,b)\:lcm(a,b) = ab,\ $ using the $\,\overbrace{{\rm involution}\,\  x'\! =\, ab/x}^{\rm\large cofactor\ duality\ \ }\ $ on the divisors of $\rm\:ab.\ $ Notice that $\rm\ x\mid y\color{#c00}\iff y'\mid x',\ $  by ${\,\ \rm\dfrac{y}x = \dfrac{x'}{y'} \ }$ by $\rm\, \ yy'\! = ab = xx'.\, $ Thus
$$\begin{align}\rm c\mid\gcd(a,b)\!\iff&\rm\ c\mid a,b\\[2px]
 \color{#c00}\iff&\ \rm a',b'\mid c'\\[2px]
\iff &\ \rm lcm(a',b')\mid c'\\
\color{#c00}\iff &\ \rm c\mid lcm(a',b')'\\
{\rm Thus}\rm\quad \gcd(a,b)\, \ =\ &\rm \,  lcm(a',b')'=\ \dfrac{ab}{lcm(b,a)}
\end{align}\quad $$
The black arrows above are the universal property (or definition) of  gcd and lcm, and the red arrows follow by cofactor duality.
Notational abuse alert: the gcd, lcm "equalities" are up to unit factors (i.e. "equal" if associate), to keep the post accessible to beginners working in $\Bbb Z$.
Comment: Is your "involution" basically a formal division? I know there is no division per se without an identity, but what you wrote seems to make sense anyway as equivalent to x'x=ab.
Comment: I don't know what you mean by "formal division" and "division per se without an identity". Please use standard math language. Do you know any ring theory, or only elementary number theory?
Comment: I know some ring theory. I have never heard "involution" used in ring theory (up to the point I have studied). Are you assuming the ring is with identity here and x has an inverse?(If so, it isn't worthless but I would like to know of the limited scope). You say x'=ab/x which only makes sense as written with an identity, and x having an inverse. But we can alternatively define x'=ab/x to just mean x'x=ab to make it more general.
Comment: @Jacob In any domain, if $\,x\mid ab\,$ then the cofactor $\,x'\,$ such that $\,xx' = ab\,$ is uniquely defined. You may also find of interest lattice-theoretic viewpoints, e.g. for starters see this [Wikipedia article.](http://en.wikipedia.org/wiki/Least_common_multiple#Lattice-theoretic)
Comment: See also [this answer.](http://math.stackexchange.com/a/921108/242)

Transfer Between LCM, GCD for Rings?


magento2 developer mode not properly set

Question: I would like to change the workflow type to client side, but when I navigate to this configuration option, it tells me that this option is not available in production mode.

I've set magento to developer mode with magento deploy:mode:set developer multiple times, I've cleared everything in var/cache, var/view_preprocessed, pub/static and cleaned the cache, but no change. I've also set it to production mode and then back to developer mode, that didn't help either. Last but not least I just changed the config in app/etc/config.php and imported the config, but then the app just keeps telling me The configuration file has changed. Run app:config:import or setup:upgrade command to synchronize configuration.
I don't know what else to try, can somebody help?
Answer: the comment "not available in production mode" is just a hint, that this setting will not be used in production mode - developer mode will not make this field editable.
So setting the developer mode with the console command was the correct first step.
To verify if developer mode is enabled you can use the following command:
bin/magento deploy:mode:show

The field being not enabled / greyed out is another thing from the pipeline deployment feature, introduced with magento 2.2.
You can change the setting via a console command:
bin/magento config:set --lock dev/front_end_development_workflow/type client_side_compilation

Comment: thanks, `deploy:mode:show` shows that the mode is set to developer. I just noticed that my whole config tree seems to be locked somehow. I can't uncheck any of the `Use system value` checkboxes and other changes just don't take effect, although I get a confirmation after saving the config. Is it possible to lock/unlock the whole config tree?
Comment: ok, that seems to be why: https://magento.stackexchange.com/questions/196912/appconfigdump-locks-everything-in-configuration. I could set it with `config:set` and then dump the config again, all good. Thanks a lot.


rvml To svg convert using php 5.3

Question: I am using raphael.js which generate rvml on IE. what i want is to convert this rvml to svg so that it can make png images for that svg.
Answer: This page has solution using C# but still you can utilize it by porting the regex logic to PHP native form.
Converting RVML to SVG using XSLT in C#
hope it helps u out.

rvml To svg convert using php 5.3


Why would a food that is harmful to the environment be widely consumed in a society?

Question: In a previous question, I asked why a taboo would develop around a food that grows well in a civilization's climate and has no harmful effects. However, I will now ask the opposite question: why would a civilization embrace a food that does not grow well in its environment when other foods that are equally tasty and have roughly equivalent nutritional properties grow well in its climate?
Comment: Have you ever heard of almonds or pecan nuts? They are delicious.
Comment: like pigs, sheep, cattle , corn, and a dozen other crops. Cultural baggage, taste, cost, ease of transport, seasonality, take your pick.
Comment: I would like to point out something - your initial question seems to be a little different from your extended explanation. Your question asks about harmful foods, but your explanation asks about some sort of food that just doesn't grow well. These aren't the same thing, so I was wondering if I should edit my answer, as it matches more to the latter than the former.
Answer: Your question isn't a hypothetical, it's a serious real world issue.
Beef production in the western world has extremely negative impacts on our environment due to massive methane emissions, deforestation and disproportionate water use. (https://www.nationalgeographic.com/distribution/public/amp/environment/2019/01/commission-report-great-food-transformation-plant-diet-climate-change)
So why do people continue to eat a very environmentally destructive product by the billions of tons? Simple, it's tasty and it was sustainable back when cows were being moved over range rather than being force fed corn and soy that people could eat instead.
So perhaps you have a crop that is extremely water intensive, and this was fine before the climate started to change, but now semi annual droughts are preventing the aquifers from being refilled, so the crop's water consumption is now unsustainable and is drastically lowering the available  water. But people refuse to adapt because it's something they make money on and they love the taste.
TL;DR: Just take a look at climate change and food, especially in California
Comment: Isn't avocado the crop you describe?
Comment: Corn and grains are another group of garbage crops. Bad for the environment and aren't particularly nutritious.
Comment: @Jan Dorniak Yes, avocados are exactly what I was referring to
Comment: @Aezyc evidence says otherwise
Answer: There are several reasons why one food would be preferred over equally nutritious alternatives.  They might apply singularly or in groups.
Historical Preference:  The food could hold a strong place in the cultural identity of members of the society.   The Coca Cola of my fore-fathers as it were or All True Hurkeshmen eat Blarn!
Emblem of Wealth and Status:  Consumption sends a social cue that that you are rich and powerful.  Robin Leech eating caviar on Lifestyles of the Rich and Famous sort of thing
Signifies Sanctity or Religious Purity or Sexual Purity:  The holier than thou eat the stuff to show their ways are the old ways.
Fashionable:  Eating it shows just how down with your bad self you really are.  It demonstrates that you are one fruggy drude who knows where her towel is.
Comment: Given how badly you mangled that (intentionally?), I wonder if you meant to say "*t**r**owel*"? (I'm pretty sure you also meant "on**e**", not "on".)
Answer: The rarity factor alone is enough.
Beef doesn't necessarily taste any better than pork, but if you eat pork all the time, then beef becomes a rare and sought-after delicacy. Socially, those able to afford it will serve expensive beef at their feasts to signify their superior status, and look down on pork-eaters, regardless of which is better or more nutritious.
Novelty in diet is extremely important, as any restaurateur will tell, you -- even McD's and KFS keep shifting their menu around.
In a far more appalling real-life example, many people in West Africa drink expensive imported colas with negligible nutritional value rather than the cheap, vitamin-packed fruit juice from fruits that grow well locally. The multinationals profit, the local fruit growers struggle, and it doesn't do any good for children's health. It's not rational, it's real life.
Answer: The crop is the only thing the people there can grow
As other people have pointed out this is a very real problem with large ungulate farming in many places across the world. What they haven't pointed out are some of the other reasons why it keeps happening despite being environmentally detrimental. In some cases despite being negative on a global level the crops or livestock in question are the only thing that can reliably grow there.
Case in point in the U.S. there is a region in North America west of the 100th meridian west where there is very little water. Crops grow very poorly here, and are either dependent on widescale irrigation or are restricted to the few rivers and streams around there. Trying to farm there has actually screwed the environment up worse than cattle ranching, increasing desertification (the line previously at the 100th meridian is moving east and the Ogallala aquifer is messed up) and is screwing up the Colorado River. About the only thing you can reasonably do with the land is raise sheep and cattle, otherwise it's useless for settlement. Big ungulates basically fill the niche that bison used to, though it does nothing about the methane emission problems.
Australia is in a similar situation. Australia historically had a huge sheep industry, but sheep are problematic because they are descended from mountain ungulates and so tend to strip land bare in search of food. This is why sheep farmers and other livestock farmers often do not get along, to the point of armed conflict and murder between the two. The fact that sheep get the maximum use out of plant matter makes them good at surviving in the Outback, but it also means they tend to destroy the environment. This is really bad for Australia, whose ecosystem relies on native vegetation keeping water locked up on land. Australia's ecosystem is screwed up due to sheep farming and the desertification it causes, and a lot of the problems blamed on foxes, cats, and rabbits are at least partly due to livestock raising (e.g., providing water and food for invasive pests, accidentally making the ecosystem more favorable for them, clearing out brush the native animals need to hide in, people killing native predators for fear that they eat sheep, sheep stripping the ground bare leaving the native animals little to eat and increasingly fewer places to go). However at this point outright banning sheep farming in Australia would probably result in the country starving (either directly or due to the economy crashing).
It's a cash crop
This is a big problem in California. The state has a semi-arid Mediterranean climate which makes it good for year-round farming but comes with a drawback of a very limited water supply. Despite the droughts, a few years ago (unsure if it is still the case) almonds started getting popular due to the high demand for them, and a lot of farmers started switching from less water-intensive crops to almonds. This, unsurprisingly, made the water issues worse.
They claim it as part of their cultural heritage
I.e., whaling and Japan and Norway. Whaling is definitely detrimental to the environment, a lot of the species hunted are endangered, it's definitely not sustainable in the case of species like right whales, and the average person in these countries doesn't even seem to like eating whale meat, the demand is so low the Japanese government has started selling whale meat in school cafeterias (and when that happens you know demand is low).
Mostly the reason these countries do it is they claim it is part of their cultural heritage, and there is a lot of pressure from the governments to keep it up. One of the few things that seems to get the average person in these countries to support whaling is ironically pressure from other countries, because it makes them feel like outsiders are trying to tell them what to do and erase their culture.
Other examples of unsustainable agriculture or hunting include farming salmon in Chile, and a lot of aquaculture in general. Bluefin tuna aquaculture actually makes their situation worse because they remove juveniles from the environment instead of actually raising them in captivity, but demand is so high it's unlikely to stop.
This isn't just a modern civilization thing, the Mayans built their civilization on the very limited water supply of the cenotes surrounding the Chicxulub crater, the Garamantians relied on "fossil water" from non-refilling springs in north Africa and when the springs dried up they disappeared, there are thoughts that some of the Mesopotamian civilization crashed when they farmed the area around the Tigris and Euphrates so hard it built up salt and farming efficiency ceased. Humans have a habit of trying to grow food in risky places and subsequently getting bitten by the consequences.
Answer: I'm going to drop this here first: https://www.mcdonalds.com/
Yes that wasn't your question, but I thought it was humorous - imagine if your world had burger trees that were rare and would definitely make you fat, but still became a delicacy.
Anyhow, there's a few reasons for it:

It's rare: That's it. That's the selling point. If it's rare, only the rich can have it.
Symbolic: Maybe this plant is rare, but at the same time it is not only rare in your region, but in the world. In fact, this mystery plant only exists in your nation (for whatever reason). You don't have bounties of this plant, but its rarity is interpreted as significant by the people, and are reserved only for the holiest/elite people in the nation.
Difficult terrain/difficult to grow: Maybe this plant only grows when it rains over an active volcano as lightning strikes exactly once a foot away from it. Is this oddly specific? Yes, and for no reason. This plant is ridiculously hard to find and is rumored to have special properties. Your sorcerers and scientists argue that this plant is a freak of nature but has nothing special about it, but all three of those things combined is really cool so hey why not - people are into it now.
I owe my nation to this plant: Athena's gift to the Athenians was the olive tree. Poseidon's was a salty spring. One of those was useful, and gained the favor of the city-state. Maybe up the stakes a little bit - this plant is something all of your nations are afraid of (maybe they're allergic or something). Even if this plant is completely insignificant/inconsequential for your people, if it hurts your enemies it is definitely important.
Basic tourism things: You have to try this dish/see this plant - you can only find it here! This plant is a tourist trap. Maybe your locals don't care about it but hey it lets you sell over-expensive hiking trips to see 3 of these rare and mostly useless plants. Pineapples, for example, are not found in Europe, and are not needed for a person to survive. Didn't stop it from becoming a souvenir people kept trying to bring back from the colonies. Was also a symbol of wealth that way.

Throw some magic in these explanations and you'll have even better answers. Hope this helps!


Add logic if Shift is pressed nothing to do if not speed=100 to my BP

Question: I have followed tutorial on how to make 3rd person game but I cant figure out how to implement logic if Shift is pressed nothing to do and if its not set speed to be some value lets say 100
Answer: I'm not sure in the scripting you're using but shift being pressed or not is a Boolean so 0 or 1, you can set the speed to 100 times by NOT that Boolean, so if shift is pressed it'll be 0 but if it's not it's going to be 100.
Speed = 100 * (not)shift_pressed_boolean
If it gives you an error when you times a number by Boolean just parse it as integer
Answer: The first thing you're going to want to do is set up an input action that's bound to the Shift key. If the tutorial you followed showed you how to set up a third person game from scratch, some of this will probably look a little bit familiar.
If I'm understanding you correctly, it sounds like what you want is to have the character sprint when you hold down shift, and to run at normal speed when you're not holding down shift? If I'm wrong, this advice should still point you in the right direction.
First you're going to want to set up an input action bound to Shift:
Go to the "Edit" menu in the Editor and select "Project Settings"

The settings for adding new Input Actions are in the Input section, under Engine:

Create a new Action Mapping (call it "Sprint" or something suitably descriptive. The engine doesn't really care what it's called), and select "Left Shift" from the dropdown. You can ignore the "Toggle Sprint" one I added if you're not using a controller, I just added that one for completeness, typically in most games where you can play on controller the clicking in the left thumbstick button will toggle sprint on or off, so I made a separate input action for that case.
The next step is to handle this new input in your Blueprint. Create a new Boolean variable and give it a suitable name. You can see here I've called mine "Is Sprint Active?", but ultimately it doesn't really matter what you call it as long as it's descriptive (so that you can remember what it's for later)
As you can see from this picture, when the "Sprint" action is Pressed, we set the "Is Sprint Active?" variable to true, when the "Sprint" action is Released, we sit it to false.
The Toggle Sprint action you can ignore, but it's basically the same thing for the "Toggle Sprint" action, except every time you press it, it takes the current value of "Is Sprint Active?" and flips it to the opposite value.

This isn't pictured in the above example, but every time you modify this variable, you'll want to modify the maximum walk speed on the CharacterMovement component. This controls how fast your character can go.
In this screenshot, I have two variables here (both with "Is Instance Editable" ticked in their settings, so the values can be modified from the settings of the Character Blueprint), these two settings represent the maximum speed when sprint is off, and the maximum speed when sprint is on.

This should give you a very basic version of sprint. To make it look good you can set up your Animation Blueprint to play a different running animation when sprint is active, to give you something like this (sorry for the image being a little washed out, I forgot to turn off HDR colour settings on my desktop)
YouTube Video - Unreal Run Sprint Example
Comment: So I can ignore Input Action TogleSprint ? What is "SET" set to be at upper picture.
Is Max Run Speed and Max Sprint Speed just variable ? And what is SET at bottom picture
Comment: https://imgur.com/a/GOVbzj6?
Comment: This node is setting "Is Sprint Active?" To true when triggered from the Pressed pin, and false when triggered from the Released pin. If you look at the node closely, there's a little tick box on the node that shows up when there's nothing connected to the pin. That indicates the value that's being set
Comment: Max run speed and max sprint speed are variables I added, with "Is instance editable" ticked in their settings. They're intended to allow you to configure what the run and sprint speeds should be.
Comment: Note I didn't set up any actual values for those in my example, as I created some of this just to show what to do. 600 is probably a good ballpark for run speed, as I think that's the default speed. Sprint speed you can experiment with different values to see what feels right
Comment: How can I insert last node "SET" on right side on bottom picture I cant find it ?
Comment: Oh yeah the Max Walk Speed on the character movement component. I forgot to explain that. If you drag out from the "As Character Movement" pin, it'll let you create different nodes based on what the character movement component supports
Comment: The node you want in this case is "set max walk Speed"
Comment: Ok here is my setup but I cant change default Max Run and Sprint Speed and I ignored Togle sprint since I dont use joystick https://imgur.com/a/cl8W4u4. Also character does not change speed when I press Shift it always run same as before
https://imgur.com/a/cl8W4u4


How can I capture VGA (640x480) frames with RGB565 format from OV7670+FIFO (AL422B)?

Question: I made a platform with LPC1788 (Cortex M3) which had external 8MB NOR flash and external 32MB (16bit) SDRAM. I connected them a CF7670C-V3 (OV7670+AL422B (FIFO)) camera module and I capture QVGA,QQVGA frames in RGB565 format to FIFO and then I save images data to SDRAM perfectly. also I wrote a software on PC and save image data via USART and then show that. I have a big problem with VGA(640x480) resolution. At VGA resolution with RGB565 format, All the time I have picture ,like a on "OV7670 frames are 640x308 not 640x480" post. I search about a Algorithm that I capture a whole color VGA(640x480) frame data in the SDRAM. What can I do?
How can I control FIFO_WEN and FIFO_RRST signals to get image data and save in to the SDRAM?
CF7670C-V3 Schematic link
Answer: My guess would be that although the FIFO chip can hold a complete VGA frame, your CPU isn't fast enough to unload the data before it gets overwritten. Therefore, you'll be limited to capturing single frames, rather than continuous video.
You'll need to synchronize the frame capture with the video sync signal from the camera. The easiest thing to do would be to connect the VSYNC output of the camera to an interrupt input on your CPU, and toggle the WEN signal high in the ISR for one frame only. After the second interrupt, when you turn WEN off, is when you can transfer the captured frame from the FIFO to your SDRAM.
You could also set up a simple sequential circuit using a couple of flip-flops to do the same thing in hardware, triggered by a pulse of some sort from the CPU.
Comment: Thanks Mr. Dave Tweed, I had implemented exactly what you say about syncing and using interrupt to detect start and end of a frame. It's OK for QVGA (320x240) resolution and down scaled size with RGB565 (2 byte for each pixel) format, but about VGA (640x480) resolution, It's not OK because of FIFO size.
Sequential circuit, It was good idea for hardware implementing.
Answer: I often wonder why people don't read the datasheet. You will find that the al422 has 384kb of ram (384*1024)<(640*480*2). You need to get the module to output raw bayer data so that (384*1024)>(640*480) and use a demosaicing algorithm to get a full color image. You have plenty of ram and a fast processor to do such.
Comment: Using even a somewhat naive demosaicing algorithm will get you better results than rgb565 because you will end up with an rgb888 image. There are libraries that can do the conversion if you do not want to implement your own.
Comment: Thanks for your good hint; Of course I don't know about Raw Bayer format and its quality compare with RGB565 format because of its size (VGA, RGB565 => 640*480*2 bytes but Raw Bayer => 640*480 bytes). I haven't any sample source code about OV7670 raw Bayer format data and its configuration And how to convert ray Bayer Image format to RGB888 to show in PC after data transmission.
Alternatively, I think about a way to read 480 rows of a VGA frame in several step.
Comment: I want captured images for image processing such as EDGE detection, so I don't know raw Bayer format is OK for that or not?!


How do I send SMSes from Salesforce?

Question: What would be the approach to create an SMS application (either in Salesforce or other language) to send SMS from Salesforce? Is it feasbile if the client-side process is done through a streaming API (from the client side)?
Answer: A number of companies provide SMS services that you pre-pay for and invoke using a REST API. To send an SMS is usually quite simple e.g.:
<code>private static final String ENDPOINT = 'https://api.twilio.com';
private static final String VERSION = '2010-04-01';

public void send(String toNumber, String message) {

    // Custom setting containing SMS service information
    SmsConfiguration__c config = SmsConfiguration__c.getInstance();

    HttpRequest req = new HttpRequest();
    req.setHeader('X-Twilio-Client', 'salesforce-' + VERSION);
    req.setHeader('User-Agent', 'twilio-salesforce-' + VERSION);
    req.setHeader('Accept', 'application/json');
    req.setHeader('Authorization', 'Basic '+ EncodingUtil.base64Encode(Blob.valueOf(
            config.AccountSid__c + ':' + config.AuthToken__c)));
    req.setEndpoint(ENDPOINT + '/' + VERSION + '/Accounts/' + config.AccountSid__c
            + '/SMS/Messages');
    req.setMethod('POST');
    req.setBody(''
           + 'From=' + EncodingUtil.urlEncode(config.FromNumber__c, 'UTF-8')
           + '&To=' + EncodingUtil.urlEncode(toNumber, 'UTF-8')
           + '&Body=' + + EncodingUtil.urlEncode(message, 'UTF-8')
           );
    HttpResponse res = new Http().send(req);
    if (res.getStatusCode() >= 200 && res.getStatusCode() < 300) {
        // OK
    } else {
        // Error
    }
}
</code>
You could expose your own simple @RestResource endpoint that you call from the client side to in turn call the above code on the server:
<code>@RestResource(urlMapping='/sms')
global with sharing class SmsRest {
    @HttpPost
    global static void doPost(String toNumber, String message) {
        new SmsSender().send(toNumber, message);
    }
}
</code>
or that could say accept the ID of the Contact to send to and query to get the number and then send.
Comment: In addition to Twilio like others have suggested, there's also an excellent app exchange app called "SMS Magic"  As one of the first implementers of the package, had a few kinks to work out in our instance, but their support was responsive and the package worked very well.  Linky: https://appexchange.salesforce.com/listingDetail?listingId=a0N300000024XvyEAE
Comment: @manza I've added those to the code.
Comment: @Rob Thanks I've fixed. Note that you probably have enough points to make such edits yourself.
Comment: Keith -- shouldn't the last line read `new SmsSender().sendSms(toNumber, message);` ?
Comment: @crop1645 Yep - thanks I'll change it.
Comment: Hi, what format version and endpoint is?, String version = '1';?  || String ENDPOINT = 'http://twilio.com'; ?
Comment: FYI @KeithC - typo "Strign" in the "send" method signature
Answer: I built a solution for an NPO using Twilio - you can see the code on GitHub
Twilio has a pre-built library for Salesforce that enables you to invoke their REST API for sending messages that the code above takes advantage of.
Answer: You may want to cast a glance at 360 SMS App. The app allows users to send single and/or bulk SMS to Contacts, Leads or Custom Object and possesses wide array of functionalities like Auto forwarding, Un Subscribe, Messages in Inbox, Call Routing, Automated Transactional Messages, Easy Template Creation and Many more.
For detailed Information, you can visit the following link:
https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000DpSyIEAV
Answer: You can use built in libraries  like TWILIO API,@BritishBoyinDC has specified. I have used the twilio in SFDC last 6 month it working fine.It receive  SMS from the customer's and send SMS to Customers dynamically.Can you Rererences of this post .
Install the packages:https://login.salesforce.com/?ec=302&startURL=%2Fpackaging%2FinstallPackage.apexp%3Fp0%3D04ti0000000XkE0
Answer: If you know the provider of the person you're sending the text to you can just send an email

Step 1: Using the email client of your choice, compose your email as
  you would normally. You can use either your smartphone or your
  computer to do so.
Step 2: Instead of entering an email address in the recipient box,
  insert the 10-digit phone number of the person you're trying to reach.
Step 3: Once entered, tack on the appropriate "@gateway" address
  behind it. Below, we've put together a list of some of the most common
  service providers in the United States and their corresponding gateway
  addresses.

This would save you from having to go through a paid service like Twilio
Answer: You can check Girikon Smart SMS App which allows its user to send Single / Bulk SMS / MMS messages from the Salesforce.
Answer: You can check Salesforce SMS APP by Girikon- Smart SMS App which allows its user to send Single / Bulk SMS / MMS messages from the Salesforce.

How do I send SMSes from Salesforce?


Stack Overflow T-Shirt: where can I get one for now?

Question: I did my search and found only this link, which is broken
Answer: Newer Edit: The shop is closed again :(

Edit: This answer was quite out of date. There is a shop again that sells SO shirts, among other things

There was a store, but it was discontinued pretty fast. They're given out occasionally for miscellaneous things (e.g. the person who guessed when SO would hit 1m questions got one), but I think that's the only way now, they're not sold anymore
Answer: You could make one yourself, lots of online places print t-shirts (not sure which country you're in, otherwise I'd pre-Google some links)
Comment: -1: " __Do not__ use our logo unless you have been granted special permission by Stack Overflow Inc." - [trademark guidance page](http://meta.stackoverflow.com/legal/trademark-guidance)
Comment: @popular - you really think SO are gonna come after me for printing up the SO logo on a one-off t-shirt for the wife to wear in bed? I can understand if I'm flogging bootlegs but I think it's pretty obvious the OP is looking for something for 'personal use'. Your downvote is a bit extremist.
Comment: You could always print an anti-stackoverflow T-shirt. Parody is generally well protected in the US
Comment: @popular - pyjamas with "closed - off topic" on them perhaps?
Comment: @mgb - a better parody would be some stackunderwear
Comment: @popular - that was a joke to put my point across (does everyone under 30 take things so literally these days?). Anyway...I think me knocking up a t-shirt for knocking about around the house is fair use because, and I quote from the guidance page: *"because you were not using it "in trade."*
Comment: @mgb: How about [air quotes around the logo](http://i37.photobucket.com/albums/e77/kpeaton/air_quotes.png)?
Comment: @Kev, I didn't say they'd come after you. But wrong is wrong, whether it's one t-shirt for personal use or ten thousand for what I can only assume is a burgeoning SO merch black market. (And, really, pyjamas for your wife? Are you _that_ addicted to SO?)
Comment: @josh, you'll need a lawyer if you actually want to move this from "pithy comment thread" to "serious legal discussion." You mentioned the logo, I pointed out that some logo guidance exists. That's all. Since I am not a lawyer, I'll leave it at that.
Comment: @Popular - He wouldn't be selling it, would he? Would it be illegal to print out a StackOverflow page? Or should I email SO for special permission to use their logo on a print out? ;)
Comment: @Kev I wasn't sure before, but now, [Anna Lear says so](http://meta.stackexchange.com/a/157244/131713).
Comment: stackunderwear....really?


Did Suou lose her human emotions in Darker than Black?

Question: I finished episode four just now. When Suou became a contractor in the train yard, did she get the rationality of a contractor, or did she retain her emotions like Hei? This is confusing for me.
Comment: It's been shown in the later series that by various contractors that they have emotions. It's not that contractor lose their emotions when they gain their powers, it's that  those feelings do not play a prominent role in their thought processes. In other words, they but logic before their feelings and typically only think for themselves, unless there is benefit to them helping others.
Answer: Contractors don't lose their emotion, they just become more logical which conflicts with emotion, there is evidence to support this but obvious one is with Mina whose sexual preference is towards women however her obeisance is sexual contact, such as kissing, with men only yet she will kiss women, while most of the time it's to "get rid of the taste" from kissing a guy she has feeling towards Yoko.
With Suou, later in the series when her, Hei and July are in the hotel, when she and July are in bed and July has fallen asleep she admits to Hei that despite being a contractor she hates him.
Also Hei and Suou is that they're not proper Contractors as both obtain their powers from Bai who first merges with Hei during Heaven's War using her contractor powers and is then drawn into the Meteor Core around Suou's neck when Hei was caught in that trap and Hei has always been rational since before becoming a Contractor so he could support Bai so his personality isn't the result of Bai


Symfony business logic

Question: In symfony, I see some coders put business logic in the actions ( controllers that is ), and some coders put it in the models ( Doctrine ). Where should the business logic belong, in the controller or model? What if I didn't use Doctrine, and it was just plain text files?
Answer: Put the business logic in the controller is a bad pratice, the model is home for it.
If you don't have Doctrine, you can still have entities, model classes of your own (you should). Your files can be abstracted, and then put their business logic in their own classes, not in the controller.
It's all about MVC, and the M is really up to you.
Answer: Standard Symfony and MVC conventions would have the controller only doing what is necessary to receive information passed from the view or to the view. Any data processing of that information, for the most part, should sit inside your model and library classes where they could be set up for optimal reuse or structured code organization.
One of the greatest strengths of Symfony is the fact that any other good Symfony developer can quickly code into a project of any other good Symfony developer, mostly because of the MVC conventions and the organization that Symfony forces upon your development with good coding standards.
Answer: Bus. logic should not live in controllers. Controllers should well, control or direct the flow of control in the application they live in.
Bus. logic should live in domain level objects where they could be shared amoung various applications.

Symfony business logic


What's the single word to describe the smell of the perfume of someone who just walked by?

Question: I read the word sometime ago and can't remember it.
the smell of the perfume of someone after he/she walks by..
Comment: "obnoxious", generally.
Comment: Probably something like "fragrance", or a more generic word such as "aura" or, better, "emanation".  A technical word would be "efflux".
Comment: @GraphicsResearch: Indeed, and frequently "pong" would fit as well. :-)
Comment: The word is "odor".
Comment: If you like it, it's a _fragrance_ or _aroma_. If it bothers you, it's an _odor_.
Comment: My brother and I always call it the "danger zone" :)
Answer: The word is unsurprisingly from French: sillage.

Sillage (pronounced as see-yazh) is a term used to describe a scented trail left by the fragrance wearer. It comes from the French word for "wake," as in the trail left in the sky by an airplane or on the water by a boat.  Sillage defines how fragrance diffuses around the wearer, and a strong sillage means that a fragrance projects well.
http://boisdejasmin.com/2011/02/perfume-vocabulary-fragrance-terms-sillage.html

Though, sillage technically defines the degree of the scent of a perfume left behind also and it is a term used in perfumery jargon1. There are different levels of sillage and there is even the term monster sillage to define the strongest fragrance trail. This Elle article talks about sillage in detail.
1 [oxforddictionaries] sillage - the degree to which a perfume's fragrance lingers in the air when worn

Additionally, wake, slipstream or trail (of a perfume) is used also and they are more suitable for everyday or novelistic speech.
Examples:

He started to mumble a phony apology when the wake of her perfume struck him like a strong whiskey.
[The Stewards: A Fight to the Death of Animal Survival by Robert Sherretta (2010)]

She returned the crystal bottle with the rubber squeeze ball and its silken tassel to her dresser, and grabbing her nutria jacket, she breezed out of the apartment,leaving us in the trail of her perfume.
[Good-bye to the Mermaids: A Childhood Lost in Hitler's Berlin by Karin Finell - 2006]

I followed behind her in the slipstream of her perfume, past a polished wooden staircase and into a long, wainscoted hallway.
[The Last Heir: A Mystery by Chuck Greaves (2014)]
Comment: I've smelled silage before and I wouldn't consider it perfume (unless you're a cow).
Comment: @TimLymington: Added more details. Is it convincing enough now? :)
Comment: Do you think *sillage* is likely to be understood by readers outside the fragrance industry?
Comment: I'd love to beieve this, but it's not in Chambers, Collins, or the OED.
Comment: @NateEldredge: No. But it is the word and context is everything. I gave details in the answer also along with more understandable words.
Answer: You may want the word waft as it carries the sense of the movement of air carrying the smell along:
It can be used as a verb:

Pass or cause to pass easily or gently through or as if through the air.
The smell of perfume wafted out of the department store.

or as a noun:

A gentle movement of air.
I detected a waft of cheap perfume.
Answer: The word scent could fit here, as it can be used to describe a (often pleasant) smell which fills the air as the result of someone or something.
For example, "as the woman passed by, we caught the scent of her perfume".
Comment: Mr. Pacino spent a whole movie focusing on [*The Scent of a Woman*](http://www.imdb.com/title/tt0105323/)
Answer: Some words that might describe it:
Whiff or Fragrance. Hope that helps.
Answer: If you wish to connote that the smell is unpleasant, you could consider miasma, which the American Heritage Dictionary defines as:

A noxious atmosphere or influence.
a. A poisonous atmosphere formerly thought to rise from swamps and putrid matter and cause disease.
b. A thick vaporous atmosphere or emanation

(Puns on "my asthma" are left as an exercise to the reader.)


clicking/knocking sound when trying to start car

Question: when trying to start my car.  (Peugeot 207) one turn of the key produces 4 clicking/knocking sounds, noises, one after the other. 1,2,3,4..the car doesn't attempt to start.  I've had jump leads on for over half an hour this morning.  Nothing?!
Comment: Assuming you have the jumper cables connected properly, then the next step is to check things other than the battery itself.  Check the battery cables/connections, check the starter solenoid, check the starter itself.
Comment: I've most often found the body ground connection to be problematic for corrosion.
Answer: If you're hearing the rapid clicks I think you're hearing, something is definitely wrong with your battery or starting system... but you've obviously already deduced this.

With the car's headlights on, when you try to start it, do the headlights dim? If they do not, there is likely a problem with the wiring or connection to your starter motor. What you hear clicking is the starter solenoid, which is what makes the starter connect to your engine's flywheel to start the car.
Do you have a multimeter? If so, when the multimeter is set to "20 VDC" or just "VDC," touching the negative and positive battery terminals with the leads should read anywhere from 12.0 to 12.9 volts. Anything less is not sufficient.
Inspect your battery terminals, and ensure that they are not loose or dirty. If they are loose, tighten them. If they are dirty, clean them with a wire brush or abrasive pad and reinstall them tightly.
Make sure the jumper cables are connected in a secure fashion, with plenty of contact onto the battery post or terminal.
Follow the battery cables to where they end. The negative wire will likely attach to the engine block, the car's body, or both. Where this connection is, make sure there is not a buildup of corrosion, or that the connector is loose.
Finally, if possible, connect a battery that you KNOW to be good. You can use any 12 Volt car battery, as long as it has the same or higher CCA (Cold Cranking Amp) rating than the one already in the vehicle. If it starts with that battery, you know your old battery is discharged to the point that it likely needs replaced or tested.

If none of these produce results, a mechanic will need to do some tests to see if your car's starter motor is functioning.
Additionally, if you wish to try it, you can do a voltage drop test to verify that your battery terminals are functioning correctly. To do a voltage drop test, hold one lead of a multimeter, in volts DC, to the battery post. Hold the other end to the battery terminal connector itself, and any exposed copper cable coming out of it. You should see 0.00V, as it is measuring the difference in voltage between the two points.


Software to wake up the PC at a specific time in future (just like alarm do for mobiles when they are switched off)

Question: To me the best internet speed is available at 2-6am, and for that purpose I want to wake up my PC automatically at 2. Can you suggest any such software to accomplish this.
Comment: Why the downvotes? It seems like a perfectly cromulent question to me (+1)
Answer: Use Windows Task Scheduler - create a task, schedule it for 2am, and tick the power option, Wake the computer to run this task.
If there isn't a particular program you wish to run, just enter cmd /c "exit"
To make it go to sleep again at 6am, best I can think of is to make sure all applications are closed by 5:45am so the computer is idle and setup your power options in Control Panel to send your computer to sleep mode after idle for 15 minutes etc.


Rails messaging system (fetch received messages)

Question: I have a messaging system for Owner and Renter to communicate. Owner owns a Vehicle.
If Renter has any questions he can send a Message.
NB! A new Discussion is created automatically along with posted Message.
Discussion has many Messages.
Discussion has following sturcture: (id, title, vehicle_id, user_id)
Message has following structure: (id, text, discussion_id, user_id)
It was pretty easy to fetch all messages, sent by the User:
in User class:
has_many :sent_messages, :class_name => "Message", :foreign_key => "user_id"

but now I can't find out how to fetch all received messages for the User - user.received_messages
It, basically, means that it is necessary to look through all the Discussions that either belong to the User (he created that discussion and there are messages which don't belong to him) or the Discussions that belong to his Vehicle (someone else created this discussion and Discussion.user_id == Message.user_id).
Can someone help me out with this one ? Cannot figure out how to make this association query.
Thanks in advance!
Answer: Solved it, using :finder_sql parameter for the has_many association. Just raw SQL-query with the algorithm, I've described in my question.


What is the algorithm for generating a Ripple address from a ecdsa public key?

Question: I know it is some combination of sha256 and ripemd160 that is used on the public key component to obtain the Ripple wallet address, but what is the specific algorithm?
Answer: The process of going from a Ripple secret to a specific ECDSA private/public key (which you didn't ask about but I included it here anyway) is documented on the Account Family wiki page.
From a ECDSA public key, {X,Y}, you do ripemd160(sha256(CompressPoint(X,Y)).
That's then encoded in base58 (using the Ripple alphabet/dictionary).
You can also look at the rippled implementation or a Go implementation.


Qualitative discussion about entropy and disorder

Question: Many discussions about entropy and disorder use examples of decks of cards, pages of books thrown in the air, two gases being mixed in a container, even the state of a nursery at the end of the day compared to the beginning of the day in order to explain the idea of order (and disorder).
In all these examples it is pointed out that the disorder of the system increases, or that the system is in an ordered state and finishes in a disordered state after something has happened. Take the case of throwing the pages of the book in the air. You start with the pages numbered in sequence (I didn't want to use the for "order"), you throw them in the air, they land on the floor, you collect them up and notice the pages are not in sequence anymore. ANd the point is "They are not in the sequence I call ordered. Nonetheless, they are in a new sequence." And, it appears to me that the probability to find the pages in this precise new sequence is equal to find them in the original sequence".
In that sense, 'order' seems to be something that us humans define and it doesn't appear to be a property of the system.
On the other hand, I can see that in the case of two gases mixing, empirically we find more states where the two types of molecules are occupying the entire volume of a container than one type of molecule in the left side and the other type in the right side of the container. Nonetheless, the precise state of each molecule, its position and therefore the entire state of the mixed up system is qualitative the same, isn't it? Isn't it equally difficult to make each molecule occupy that precise position in the mixed up state as in the unmixed state?
Does this make sense?
Comment: "Order" is a rather individual notion. It also depends on what's immediately useful and what's not, so at different times faced with different problems you might call different arrangements ordered or disordered.
Comment: The same is when you're faced with frequency distributions. It depends on which distribution is achievable and most useful to you, so you might be tempted to call that one "order".
Comment: "Order" is a very subjective notion. You give the example of mixed gases which tend to intermingle, but of course examples elsewhere such as emulsions are notorious for separating into their constituent parts. The human-centricity of certain scientific concepts does not undermine their usefulness - it's simply necessarily to acknowledge that they are not a "hard science".
Answer: I think a key observation here is that entropy is used when you are trying to describe a system on a macroscopic scale, which means you want to make predictions about macroscopic quantities.  Using your example of two kinds of gas in a box (call them red and blue), before we talk about entropy of various states, we should consider what kinds of quantities are meaningful at a macroscopic scale.  One set of quantities that are not macroscopically relevant are the exact positions of every molecule in the box.  That information is not accessible when the system is "coarse-grained," or viewed macroscopically.
To see what information is accessible, lets assume that your coarse-graining only allows you to divide the box into two cells, a left half and a right half.  You are interested in knowing if the gas tends to be "mixed" or "separated."  The individual positions of the molecules are not observable, but what is observable is the number of molecules of each type on each side of the box.  We could define a quantity that measures the mixedness $M$ of the particles as something like $M=(N_B-N_R)/N_\text{tot}$, where $N_{B/R}$ is the number of blue/red molecules in the cell, and $N_\text{tot}$ is the total number of particles in the cell.
Now we can ask which state is more probable: the one with blue on one side and red on the other (unmixed), or the one with nearly equal numbers of red and blue molecules (mixed).   There is only one unmixed state (or I guess two since you could have all the red on the right or all the red on the left), but many many mixed states--remember you don't get to measure positions of individual particles, but just how many of each type are in each cell.
So it boils down to identifying what states are meaningful on the macroscopic scale, and then counting how many different ways there are to produce the macroscopic state.  Then you can assign an entropy to the state which is bigger for states that are more probable (i.e. can be made in many different ways).
The example of pages in a book being mixed up is a bit more difficult to see how entropy could enter, but the key point is to identify the macroscopic quantities which characterize the state.  For this, we shouldn't ask about the precise position of page 1, page 2, and so on.  Instead, a good macroscopic quantity for measuring disorder could be the number of pages which ended up in the correct location.  Then we see that there is only one possibility where all the pages are in the correct position, but many more possibilities where none of them are in the correct position, and hence the latter option is a state of higher entropy.  You could be more sophisticated about how you define a disordered state (maybe look at how many even numbers are next to another even number and odd next to odd), but the key is to focus on macroscopic properties of the system, and not on the individual position of each page.
Answer: The basic assumption of statistical physics is, as you correctly assume, that all states are equally probable (there may be external reasons why some are less probable than others, but in the simplest case this holds). The concept of order and disorder, then, arises only when we "squint" and look at the system at a more abstract, macroscopic, level.
Example:
Imagine that you divide the box of gas into two (imaginary) containers. If you have $N$ particles in total, and $k$ of them are to the left (hence $N-k$ to the right), there are $N \choose k$ or $\frac{N!}{k!(N-k)!}$ ways of defining such a state. For even moderately large numbers of particles, this is a huge number. Compare this to the case where you have all particles on one side; there is exactly one state describing this situation.
As for the example with the pages, you are correct in you assessment that the concept of order is not unique, but it is well defined: there are $N!$ ways of ordering $N$ pages, but only one where they are in a predefined order, and the deviations from this order can be assigned different probabilities.
A high entropy state is then a state which does not surprise us when we find it, whereas a state (such as all molecules being in one corner, or the pages being in a steadily growing order, when there are vastly more states where this is not true) is one of low probability, and thus surprising.
Comment: Hi Skymandr, hit Enter too soon.

What really confuses me is why we are surprised when we see "blue" molecules on the left side of the box and "red" molecules on the right side, and "we are not surprised when all the blue molecules (and red ones) are in the precise positions they are, in the mixed state. Like the "ordered" state, there is only one "mixed" state where the molecules occupy those precise positions.
Comment: Yes, there is only one such case. The surprise comes first, when we look at the system from a distance, going from looking at individual particles to ensembles of particles. What would be a typical mixture of blue and red, for a particular set of imaginary boxes? If we make the boxes sufficiently small, the entropy does indeed vanish with out statistics.
Comment: (I too pressed too quickly...) This is what is called effect of having to small boxes is in practical situations referred to as the "coarse graining" problem. This article has a nice discussion of it, and of what it means for the entropy/disorder concept: [link}(http://arxiv.org/abs/quant-ph/0403034).
Comment: Thanks for the paper; I'll read it as soon as I can.
Still, I think there is something wrong with my view of entropy and order/disorder. Without getting too philosophical, the confusion may be on "state of the system" or "number of states". I'm not comfortable with nature itself making a distinction between "separate blue and red" and "mixed blue and red". It is obvious that it "matters" to humans, but not to nature.


Is there a version of Robertson-Seymour's graph minor theorem known to apply to signed graphs?

Question: Here a signed graph is one where each edge is signed either odd or even. A cycle is odd or even according to the sum of the signs of its edges. For a given signed graph, a resigning may be performed by flipping the signs of all edges in the cutset of some vertex subset. Clearly this does not change the sign of any cycle. All possible resignings form an equivalence class. When taking minors, any edge may be deleted, but only even edges may be contracted (but an odd edge may be changed to even using any appropriate resigning and then a contraction may be performed along that edge).
Comment: "Clearly this does not change sign of any cycle" --- what about the sign of a 3-cycle $ABC$ after flipping the signs of the edges in the cutset of the set $\{A,B,C\}$? If you flip the signs of all 3 edges in this cycle, the sign would change.
Comment: @Victor Protsak: by *cutset*, user31016 means to take a subset $X$ of the vertices and to take all edges with exactly one endpoint in $X$ (this set of edges is usually called $\delta(X)$).
Comment: Exactly. @Tony, many thanks for your clarifications and answer.
Answer: Yes.  This is one of the results of the Matroid Minors Project of Geelen, Gerards and Whittle as part of their proof of Rota's Conjecture.  In fact, they prove that for any finite abelian group $\Gamma$, the class of $\Gamma$-labelled graphs is well-quasi-ordered. Signed graphs correspond to the special case of $\Gamma=\mathbb{Z} / 2 \mathbb{Z}$.  I believe this result is still being written up though.  However, the generalization of the Graph Minors Structure Theorem (which is a key ingredient of the proof of the Graph Minors Theorem) to group-labelled graphs has already appeared.  See this paper of Geelen and Gerards.


How to see followers profile on Google+

Question: I'm a new Google+ account user.  My account displays 15 followers yet when I go to 'People' it only reflects 14
profiles.  How can I find out (SEE) who the 15th profile belongs to?
Comment: Your numbers don't make sense. If you have 15 followers and can see 15 profiles, there aren't any missing.
Comment: I'm sorry.  I can only see 14 followers.
Comment: Then please [edit] your question.
Answer: There are two options.
Either someone unfollowed you and the count on your profile is stale and hasn't been updated yet.
Or the other account has changed their privacy settings so the people in their circles are private. This conversely also covers the other direction of seeing them as followers of a profile.
Comment: I don't believe the number is stale.  So, basically, someone can follow me secretly and there is no possible way I can see who it is?  (Thank you). I guess I ask because it means I don't have the option to block them if they are an undesirable follower, correct?
Comment: You can block anyone you want and they can't follow you. In this case you would have to identify them as undesirable via a different method than looking at your followers list.

How to see followers profile on Google+


How to fix: "zipalign: error while loading shared libraries: liblog.so.0: cannot open shared object file: No such file or directory"

Question:
The zipalign is installed but it is not working. I installed it from a .deb file by : "root@kali:~# sudo dpkg -i zipalign_21-4_amd64.deb" Please help
Comment: Why are no repositories configured? Did you remove or edit `/etc/apt/sources.list`, or files in `/etc/apt/sources.list.d`? `zipalign` is available [from the Kali repositories](http://pkg.kali.org/pkg/android-platform-build), you should install it from there.
Comment: @StephenKitt No i didn't edited anything in the sources.list, but i can't install it directly, it says unable to find the package. Can you show or tell me the contents of the sources.list
Answer: The fact that all your package lines (from apt list) end with "[installed,local]" means that you don't have any configured repositories, so the first thing to do is to fix that, using the appropriate Kali repository:
echo deb http://http.kali.org/kali kali-rolling main non-free contrib > /etc/apt/sources.list

(Note that this will replace all your /etc/apt/sources.list.)
Then, update your repositories:
apt update

You'll probably need to remove zipalign at this point, temporarily:
dpkg -r zipalign

But you'll then be able to install the current version from the repository:
apt install zipalign

See also What should be in the sources.list for Kali Rolling Linux?

How to fix: “zipalign: error while loading shared libraries: liblog.so.0: cannot open shared object file: No such file or directory”


Packets stuck between two routers

Question: I am trying to send a ping from one subnet to another in cisco packet tracer. The PC sends the packet to the switch, and then to the router of the same subnet via gigabitEthernet (192.168.24.1) and then is sent to the main router of the network on serial connection, from the serial address 192.168.16.1 to the serial on main router 192.168.16.2. The router should then send it to the next subnet, 192.168.24.1, but instead it continiously bounces back between the original subnet router and the main subnet router. Any help with this would be appreciated, thanks!
Comment: It sounds like you have a routing loop.  But in order for us to help you, you need to post your switch and router configurations.  A simple diagram would also be helpful.
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: The answer will almost certainly be found in the routing table of the router that sends the packet in an unexpected direction. In your case that seems to be the "central router".

Is there a route for the network in question?
If so does it point to the right interface and nexthop?
If so are there any other routes with the same or greater specificness that could route the traffic in a different direction.

Assuming you are using static routes I suspect the most likely explanation is that you made a typo when setting up the route.

Packets stuck between two routers


Maximum amount of time I can spend in France and not be considered a fiscal resident

Question: I would like to know what the maximum amount of time I can spend in France and not be considered a fiscal resident.   I rent a house full time but do not live in France full time or file taxes in France as I am a US resident. I do pay the local taxes d'habitation which has to do with the rental tax on the house I rent.
Answer: There seems to be a rule that spending more than 183 days a year in France makes you a fiscal resident :
Résident fiscal en France
But it is more a rule of thumb than a law.
The French tax website lists some points that make you a fiscal resident :

your 'home' (foyer) (meaning partner, childs, ...) is in France,
even if you travel a lot.
you have a professional activity in France
your main economic interests take place in France (business,
investments, ...)

There's one mysterious sentence on this page :
Dans certains cas vous pouvez être imposés en France si vous disposez directement ou indirectement d'une ou plusieurs habitations dans notre pays.
In some cases, you can be taxed in France if if you benefit directly or indirectly of a housing in our country.
(although that might refer to the Taxe d'habitation).
Comment: Thanks audionuma, I rent a home for the moment and will next year be paying a taxe d'habitaion But have no financial interests in France. It looks like I might need to find a professional international tax consultant for a definitive answer. All the documentation I have found is very ambiguous!!!! And as an American the laws that apply to UK residents won't apply for me… Thanks for you answer!!!!
Comment: When in France, if you do speak french or can be helped by a french speaker, you can have a free appointment at your Centre des Impôts to get more information from the tax administration.
Comment: Thank you I will call to make an appointment to see what information They can give me.