Convexity of a complicated function

Question: Let $\mathbb{S}$ be a $2$-D convex set in the positive quadrant. Let us define
\begin{align}
y_L=\min_{(x,y)\in\mathbb{S} }y \\
y_R=\max_{(x,y)\in\mathbb{S} }y
\end{align}
 For any positive number $p\in[p_L,p_R]$ where $p_L=\frac{1}{y_R}$ and $p_R=\frac{1}{y_L}$, define the function
\begin{align}
f(p)=\min_{(x,y)\in\mathbb{S} }px~,~\text{s.t.}~~py\geq 1
\end{align}
where s.t. means "subject to". What is the nature of $f(p)$? Is it convex or concave?
Comment: Is $S\subset R^2$? Or just the positive orthant? Specially sign of $y$ is important because first $\frac{1}{0}$ is not defined, secondly, I think you should constrain $p$ in the following form: $p\in [\min(p_L,p_R),\max(p_L,p_R)]$, unless you know $y<0$. A last question is about $S$, do you have idea about the shape of this convex set, for example, is it an ellipsoid or a polyhedron?
Comment: You can assume $\mathbb{S}$ is always a subset of the  positive quadrant (all co-ordinates are strictly positive), as I already said in the question (first line).
Comment: $\mathbb{S}$ can be any 2-D convex shape.
Comment: I have deleted an answer I had made, which was false.  My apologies.
Answer: $$\begin{eqnarray}
f(p) & = & \min_{(x,y)\in\mathbb{S}\text{ s.t. }py\geq1} px \\
& = & \min_{y\geq1/p} \left( \min_{x\text{ s.t. }(x, y)\in\mathbb{S}} px \right) \\
& = & p \min_{y\geq1/p} \left( \min_{x\text{ s.t. }(x, y)\in\mathbb{S}} x \right) \\
& = & p\,h(1/p)
\end{eqnarray}$$
where
$$\begin{eqnarray}
h(y') & = & \min_{y\geq y'} g(y) \\
g(y) & = & \min_{x\text{ s.t. }(x, y)\in\mathbb{S}} x
\end{eqnarray}$$
All dependence of $f$ on $\mathbb{S}$ factors via the functions $g$ and $h$.
Since $\mathbb{S}$ is convex, $g$ is convex, by which I mean that a straight-line function of $y$ can exceed $g(y)$ only in a connected interval of $y$. For any convex function $g'$ in the relevant quadrant, we might have $\mathbb{S} = \left\{ (x,y) \mid x\geq g'(y)\right\}$ and therefore $g = g'$. Therefore we know nothing else about $g$; it is an arbitrary convex function.
$h$ inherits the convexity property, and in addition is non-decreasing. For any convex non-decreasing function $h'$ in the relevant quadrant, we might have $g = h'$ and therefore $h = h'$. Therefore, we know nothing else about $h$; it is an arbitrary non-decreasing convex function.
So what can we say about $f(p) = p\,h(1/p)$? It is easy to fine examples where it decreases and examples where it increases, so we cannot say anything interesting about its monotonicity. However, it is convex, as I will now show.
Suppose, if possible, that $s(p) = mp+c$ is straight line that disproves the convexity of $f(p)$, i.e. there exist at two values $p_1$ and $p_2$ such that $s(p_1) = f(p_1)$ and $s(p_2) = f(p_2)$ but $s(p) < f(p)$ for all $p_1<p<p_2$.
Let $y_1 = 1/p_1$ and $y_2 = 1/p_2$ and define the straight line $t(y) = c'y+m'$ through the points $(y_1, h(y_1))$ and $(y_2, h(y_2))$.
By convexity of $h$, we have $h(y) \leq t(y)$ for $y_2 < y < y_1$.
Therefore, $f(p) = p\,h(1/p) \leq p\,t(1/p)$ for $p_1 < p < p_2$.
Let $u(p) = p\,t(1/p) = m'p + c'$, also a straight line. Since $u(p_1) = s(p_1)$ and $u(p_2) = s(p_2)$, we have $u = s$.
Therefore $f(p) \leq s(p)$ in this range. However, we assumed $s(p) < f(p)$ in this range. This is the required contradiction.
Comment: "$=\min_{y\geq 1/p}(...)$" what is $y$ in the outer minimization? It is very easy to show that this equality doesn't hold.
Comment: @Alt I am  somehow convinced with that line. Can you show why that doesn't hold?. I think what he meant is that you fix $y$ and then select the best $x$. Now you do this over all $y$ and you will get the solution.
Comment: @apt1002 I am working on verifying your proof. Did you mean $h$ is non-decreasing in $p$ or $y$?
Comment: @apt1002 and dineshdileep: You are right! sorry I had misunderstood the notation.
Comment: $h$ is non-decreasing in its argument, be it $y$, $y'$ or $1/p$. Please tell me which parts of the proof you would like me to expand, and I will improve my answer.
Answer: I think $f$ has to be convex. Let
$$
\mathbb S=\{(x,y)\mid x\ge 0\text{ and }0\le y\le g(x)\}
$$
where $g$ is increasing and concave. I believe we may assume $\mathbb S$ is of this form, in the sense that $\mathbb S$ is contained in a minimal such set which will have the same function $f$.
Then in terms of $u=1/p$,
$$
u \cdot f(1/u)=\min \{ x : \exists y\ge u\; (x,y)\in\mathbb S\} = g^{-1}(u)
$$
so
$$
f(p)=p\cdot h(1/p)
$$
where $h=g^{-1}$. Since $g$ is concave, $h$ is convex, which implies $f$ is convex:
$$
f'(p)=h(1/p)+p\cdot h'(1/p)\cdot (-p^{-2}) = h(1/p)- h'(1/p)\cdot (p^{-1})
$$
$$
f''(p)=h'(1/p)(-p^{-2}) - h''(1/p)(-p^{-2})\cdot (p^{-1})-h'(1/p)(-p^{-2})
$$
$$
-p^2 f''(p)= h'(1/p) - h''(1/p)\cdot (p^{-1})-h'(1/p) = - h''(1/p)\cdot (p^{-1})
$$
$$
p^3 f''(p) = h''(1/p) > 0
$$
Actually I found this question at MathOverflow, and my answer only deals with the differentiable case.
Comment: "where $g$ is strictly increasing and concave" - please can you explain why?
Comment: "I believe we may assume $\mathbb{S}$ is of this form, in the sense that $\mathbb{S}$ is contained in a minimal such set which will have the same function $f$" - again, please can you explain why? I think you need an argument that starts from an arbitrary $\mathbb{S}$, computes $f$, and then shows how to construct an equivalent $\mathbb{S}'$ of the form you want.
Comment: I think maybe it would be clear if you defined $g$ for an arbitrary $\mathbb{S}$.
Comment: actually it's just increasing, not strictly increasing

Convexity of a complicated function


How do I efficiently navigate the command line interface to Mathematica?

Question: I would like to perfom such feats as cycling through previous commands, editing commands in place, etc.  My expectation would be a readline-like interface, but this appears to not be the default.
Comment: you could also just use emacs as a frontend for mathematica (there are modes for that)
Comment: Just curious: Why would you use the command line? Even for remote kernels, working with a frontend would be possible.
Comment: @SjoerdC.deVries sometimes configuring remote access can be painful, especially over ssh.
Comment: @acl there are [modes](http://www.emacswiki.org/CategoryModes) for everything in emacs.
Answer: If you want readline-like behavior you can of course use a readline wrapper. This works on all operating systems. On Ubuntu Linux (and other distributions I'm sure too) it can be installed easily through the package management. On Max OSX this can be installed using for instance MacPorts and I'm sure, there is an easy option on Windows too. Anyway, on all systems you can compile it yourselft. The usage is then
rlwrap math

on Linux or
rlwrap /Applications/Mathematica.app/Contents/MacOS/MathKernel

on Mac OSX. Try it and be surprised ;-)
Comment: Very cool! I didn't know about `rlwrap` (and I had the same experience as the OP when I tried the CLI out of curiosity).
Comment: @rm-rf sometimes I wonder whether it's because the most guys at Wolfram are Windows-guy. They really just give a  about the command line.
Comment: I used to use the kernel interface extensively, and for a while there, I got quite good at it. Of course, the notebook interface didn't exist when I started using mma, but that dates me a little to well, I think.
Comment: @halirutan I'd assume that this is because most people use the notebook interface for daily work. Then the command line interface doesn't get much love.
Comment: @halirutan: Thanks, I was able to build this from source and use it.
Comment: @halirutan in fact in Mathematica 9 there are some improvements in this regard. At least some things like cycling through history do work.
Answer: If you're on Windows: which command line interface are you talking about?
The "math.exe" program is a console mode (i.e. "DOS prompt") interface to the Mathematica kernel.  If you use that, you have access to the standard Windows console command-line editing; it is automatically provided by the OS to all console mode programs.  You can use the arrow keys to move around in previous commands, and you can edit, insert, and delete, copy, cut and paste using the traditional DOS-style editing and function keys.
The "MathKernel.exe" program -- which is what appears as "Wolfram Mathematica 8 Kernel" in your Start Menu -- is a very simple GUI windowed interface without any line editing or other special features.
I usually use the Mathematica kernel by running "math.exe" inside a console, which I have set to be as tall as the screen and with a very large scrollback buffer (set using the console's "Properties" menu).
A LATER UPDATE: In Mathematica 9, the "math.exe" program uses a new and different keyboard editing system that it did before, one based on GNU readline.  But you can get rid of that and go back to standard Windows console command-line editing by removing or renaming the file term.dll in $TopDirectory\SystemFiles\Kernel\Binaries\Windows (32 bit) or Windows-x86-64 (64 bit).
AN EVEN LATER UPDATE: term.dll is now in $TopDirectory\SystemFiles\Libraries\Windows or ...\Windows-x86-64


Loss function for volatility forecasts from GARCH

Question: What are the options for loss functions, when trying to compare the volatility (sigma) forecasts from different GARCH models? I was thinking about the Qlike function but am not sure if this would give the loss on volatility or the mean values.
Answer: In principle, you should always use a loss function which is strictly consistent for the property you are trying to predict, in your case the variance/standard deviation.
As explained in my answer to this question such loss functions do not exist for the variance, unless you are willing to make the assumption that the mean of your target is zero. Under this assumption, the variance is simply an expectation (it is the second moment of the distribution) and strictly consistent loss functions for expectations can be used, e.g. the QLIKE you mentioned.
You can have a look at Patton's Volatility forecast comparison using imperfect volatility proxies, who uses the zero-mean assumption and discusses many loss function candidates for evaluating volatility forecasts.


AJAX search as you type?

Question: I'm trying to implement a kind of "search as you type" feature with the Search bar.  Essentially, I'd like to have the user begin to type, make some kind of ajax request after each key, and then populate a div with "Related searches" as they type.  Any good plugins for this or should I bake it up from scratch?
Comment: Something like this? *How to create live autofill search?* - http://wordpress.stackexchange.com/q/42891/12615
Comment: I like your question, as I would like something similar, however, the mods will probably be around to shut this thread down, as WPAnswers no longer allows plugin suggestion questions... UNFORTUNATELY
Comment: Well it doesn't necessarily have to be a plugin.  It could just AJAX to the built-in search page, get some JSON back and parse it.  I just don't know how to make this efficient enough that it won't bomb my server.
Comment: @brasofilo perfect, I was able to edit that for my exact needs.  Did a search but didn't stumble upon that.
Comment: Glad it worked. Would be nice if you published your solution as an Answer, so this Q don't hang in the unanswered list :)
Answer: I have developed an ajax search plugin a few weeks ago. There is a free version available at the wordpress plugin repository. Feel free to explore the source code :)
You can find it here: Ajax Search Lite
There is also a commercial version, maybe you are interested: Ajax Search Pro
You can check out the demos and see if it fits your need. Also, I provide quick and free support if something goes wrong.
Im not sure if this is what you are looking for, but I hope I could help.

AJAX search as you type?


How can I take screenshots with two cameras simultaneously in Unity?

Question: I am trying to capture different parts of a scene created in Unity. I have two cameras capturing different parts of the scene. Now, I need to take screenshots using these two cameras simultaneously. Right now, every time take a screenshot, it only captures scene from one camera.
Thank you!
Answer: A screenshot is done at the hardware level.  It only knows what is visible on your hardware screen.  It is not camera dependent.
What you are looking for is the camera rendering.  Unity documentation provides us with a nice code snippet of how to do this:
<code>using UnityEngine;

public class Example : MonoBehaviour
{
    // Take a "screenshot" of a camera's Render Texture.
    Texture2D RTImage(Camera camera)
    {
        // The Render Texture in RenderTexture.active is the one
        // that will be read by ReadPixels.
        var currentRT = RenderTexture.active;
        RenderTexture.active = camera.targetTexture;

        // Render the camera's view.
        camera.Render();

        // Make a new texture and read the active Render Texture into it.
        Texture2D image = new Texture2D(camera.targetTexture.width, camera.targetTexture.height);
        image.ReadPixels(new Rect(0, 0, camera.targetTexture.width, camera.targetTexture.height), 0, 0);
        image.Apply();

        // Replace the original active Render Texture.
        RenderTexture.active = currentRT;
        return image;
    }
}
</code>
Comment: How does this work if my camera doesn't have a render texture assigned? I want to capture the view of an AR camera.


go through U.S. passport control with non-U.S. citizen?

Question: me (US citizen) flying into JFK from my home in Germany with my German girlfriend, and my three teenage kids from an earlier marriage (dual citizens). can Martina, the German girlfriend, pass through the U.S. line with us, or does she need to go through on her own?
Yes, she's a big girl and can handle it, but if it's not necessary then I want to stay as one group. Thanks for your insight!
Comment: I'm voting to close this question because the answer to a similar question https://travel.stackexchange.com/questions/71374/what-line-can-i-use-at-immigration provides an answer.
Comment: This question is not a duplicate of said question.
Answer: I've done this on several occasions, without the kids.  My then-girlfriend and I did not reside together (nor even in the same country).  On one occasion, the CBP officer told us we should ignore the airport security staff who told us we had to separate ("they don't know what they're talking about").
If your girlfriend lives with you then you actually must use the same line, because you're supposed to use one customs form for the whole family, and the applicable definition of family includes cohabiting partners:

Effective January 17, 2014, Customs and Border Protection (CBP) broadened the definition of  "members of a family residing in one household" to include long-term same-sex couples and other domestic relationships.

Emphasis added; source: https://help.cbp.gov/app/answers/detail/a_id/441/~/travelers-eligible-to-file-a-joint-or-family-declaration-on-a-cbp-form-6059b
Answer: The first thing you should investigate is if she qualifies for Automated Passport Control.  You and the kids can use Mobile Passport
Using these services, you (almost) bypass the lines.
Beyond that, the CBP Officers themselves can process any person so any Officer can process your whole group.  The question is whether or not they consider you a 'family' since you're not married.  Again, it really doesn't matter technically but 'just a girlfriend' and the kids might seem a bit suspicious.
The separate lines are mostly about traffic flow.  I think it would be easier to use the appropriate lines but if you really want to stay together, she should go with you and the kids to the Citizen queue.
Comment: This is incorrect.  I've done the same with non-US-citizen girlfriends on numerous occasions.  CBP officers have even advised me that we should not pay attention to the airport security staff who told us that we needed to separate.
Comment: @phoog I posted that quickly to get an answer in before the close hammer hit.  I've since updated it.  Please re read.
Comment: Well for one thing if they all live together they're supposed to use the same customs form, which means that they *have* to use the same line.  There's no reason to separate.
Comment: @phoog Please, I've always asked for comments so answers can be improved before downvoting.
Comment: @phoog OP makes no mention of cohabitation though.
Comment: That's why I said "if."


Fieldpack 2.01 - Switch not working

Question: I'am trying to create a new Field of type "Fieldtype - Switch", but I'am getting this error:
Unable to load requested field type file: ft.pt_switch.php.
Confirm the fieldtype file is located in the expressionengine/third_party/ directory
Which is weird, because the correct file should be ft.fieldpack_switch.php.
I had the old 1.x version installed, but I uninstalled everything and removed the files. My EE version is 2.6.
What can cause this and how to fix it?
Answer: Fieldpack 2.02 fixed this problem.

Fieldpack 2.01 - Switch not working


Automatic MySQL Replication Fail-over Strategy

Question: I want to know that if replication is down due to some reason as if master is down then what strategy should be followed so that the replication is up instantly without manually intervening the process , i.e if replication is down when no DBA is available then how the automatic fail-over will take place.
Comment: could you complete the question?
Answer: MySQL 5.6 introduces Global Transaction Identifiers to replication, and complements these with new failover and switchover utilities which can automate fault recovery
You can learn more about replication in MySQL 5.6 here:
http://dev.mysql.com/tech-resources/articles/mysql-5.6-replication.html
You can also watch a tutorial demonstrating how these utilities work to provide self-healing clusters:
http://dev.mysql.com/tech-resources/articles/mysql-replication-utilities.html
Answer: There is no direct or simple answer to your question.
MySQL replication provides one thing: replication.  It's a mechanism that maintains replicas of your live data set, usually in very-near-real-time, on more than one server.
Replication is used for a number of different purposes, including (but not limited to) fault/failure tolerance for your application in case of a master server outage; however, what MySQL provides is the synchronization of the data.
Failover can only be be provided by resources and systems external to MySQL, and these vary widely.
From the documentation:

How you implement redundancy is entirely dependent on your application
  and circumstances. High-availability solutions (with automatic
  failover) require active monitoring and either custom scripts or third
  party tools to provide the failover support from the original MySQL
  server to the slave.

-- http://dev.mysql.com/doc/refman/5.5/en/faqs-replication.html#qandaitem-B-13-1-9

There is currently no official solution for providing failover between
  master and slaves in the event of a failure. With the currently
  available features, you would have to set up a master and a slave (or
  several slaves), and to write a script that monitors the master to
  check whether it is up. Then instruct your applications and the slaves
  to change master in case of failure.

-- http://dev.mysql.com/doc/refman/5.5/en/replication-solutions-switch.html
Answer: Believe it or not, I just answered a question like this 5 days ago: MySQL Replication and High Availability
From that answer I provided, I advise against automatic failover with pure MySQL Replication unless your specifically script it to check for replication lag or totally unavailability of the old master (STONITH)
As an alternative, just setup a DRBD pair and run mysql on the DRBD Primary using HeartBeat to detect the DRBD Primary's unavailability.
Once a real failover happens, there must be manually intervention to setup the failover in the other direction.


Decrease in entropy in a fluid flow

Question: Let's imagine a section of a pipe through which a fluid, gas for example, flows. When there is no pressure gradient, there is no flow. However, that does not mean that the molecules are at rest. They are "Maxwell-Boltzmann" distributed but the net macroscopic velocity is zero. When the pressure gradient is turned on, the velocity prefers to be (opposite) to the direction of pressure gradient. Do you agree that this is a more ordered state then a gas at rest and therefore has a lower entropy? Is a lower entropy (one of) the cause of flows getting unstable?
Comment: btw, there might be a flow without pressure gradient --- you can just move to another reference frame. So just the fact that fluid is flowing does not make it more ordered, but you might have already came up with that argument.
Answer: I'll explain how the entropy is calculated in fluid dynamics. For ordinary fluid flows the assumption of local equilibrium is valid. That it is assumed that the fluid can be diveded into many small volumes each of which being at equilibrium with say temperature $T$ and density $\rho$. This model also suggests that the specific entropy $s$ [J/(K kg)] is given by the equilibrium relation $s = s(\rho, T)$. Thus the entropy of the overall flow is
$$
S = \int_V s\left[\rho(\boldsymbol r ), T(\boldsymbol r ) \right]\, d \boldsymbol r
$$
As you see the difference in entropy in the two cases is not due to the flow (velocity). It is due just to the fact that the thermodynamic quantities upon which the entropy depends in two cases are different. There is no ordering coming from the fact that flowing fluid is somehow more ordered.
However this is true only if the assumption of local equilibrium is valid and it is valid for particularly all flows you see in everyday life. But there are indeed formalism that go beyond the assumption and suggest entropy is the function of fluxes --- heat flux, diffusion flux and stress tensor. One such approach was introduced by Jou, Lebon and Casas-Vâazquez.
Comment: You're right, in fact, with your reply I now understand Jan Lalinsky's response as well. The formula I wrote in my comment is actually for a gas rotating as a whole and not the one that is having a vorticity. Thank you both for clarifying the point.
Answer: The connection between disorder and entropy is more complicated than that; it is made in statistical physics on the level of a microscopic model of the system, not macroscopic model.
Entropy is a more general concept, applicable even if there is no microscopic model at hand, but then the connection to disorder is not applicable.
Flowing fluid is not in a state of equilibrium, so strictly speaking it does not have thermodynamic entropy.
In continuum mechanics, one can extend the notion of entropy to such non-equilibrium flows if locally the fluid is close to equilibrium. Then the entropy of unit mass depends on its internal state, described by e.g. pressure and temperature. In this approximate theory, the velocity of the fluid does not have direct connection to its entropy.
Comment: Even I had thought so until I came across this example of Landau and Lifshitz's volume 5 (Problem 3 in section 42). They calculate the Helmholtz free energy of a rotating gas as $F = F_0 - NTlog\left[\frac{2T}{m\Omega^2R^2}\exp\left(\frac{m\Omega^2R^2}{2T} - 1\right)\right]$. Entropy is just the $-\partial F/\partial T$. I am wondering, if such a formula can be derived for a gas flowing through a cylinder.

Decrease in entropy in a fluid flow


Hidding source control files within Visual Studio's solution tree

Question: We use Visual Studio 2008 and Surround SCM for source control. SCM drops files into each directory named ".MySCMServerInfo" which are user specific data files that shouldn't be checked into source control.  They are similar to the .scc files dropped by Visual Source Safe.  We also have several WAPs (Web Application Projects) that we develop.  All these .MySCMServerInfo files show up in the solution tree and the Pending Checkins window when they should not.  There has to be some way to force VS to ignore files of a given extension because it ignores .scc files.  How do I get VS to ignore .MySCMServerInfo files within a WAP?
Answer: I have new information about this issue. Setting the hidden bit on .MySCMServerInfo file causes Surround SCM to loose track of the modification state for files. It starts thinking files are out-of-date when they are not, and it always attemps to get new versions.
Instead, set this registry key if you're using Visual Studio 2008:
<code>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\
{8FF02D1A-C177-4ac8-A62F-88FC6EA65F57}\IgnorableFiles\.MySCMServerInfo]
</code>
Set this registry key if you're using Visual Studio 2005:
<code>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Packages\
{8FF02D1A-C177-4ac8-A62F-88FC6EA65F57}\IgnorableFiles\.MySCMServerInfo]
</code>
These will tell Visual Studio to not display .MySCMServerInfo files within the Solution tree and the Pending Checkins view.
Comment: I was unable to get this to work in VS 2010, granted nobody should be using website projects, but can someone confirm this still works?
Answer: Using the file system hidden bit should work.
Comment: I also found this work-around. From my web application project root, search for all .MySCMServerInfo files, select, and set their hidden attributes. They no longer show up in the solution tree or the pending checking list. However, It has to be redone whenever SCM gets a new .MySCMServerInfo file.
Answer: Late Answer but hopefully useful to others.
I began experiencing this problem when using Visual Studio 2015 with the new ASP.Net 5 Project templates. (I presume this is because the new templates automatically include everything in the folder rather than only showing the things that are listed in the project file).
Showing these files in the Solution explorer change be prevented by right clicking the file and selecting "Hide from Solution Explorer" but this didn't prevent SCM from including them in the Pending Check-ins Window.
The correct way to deal with this problem is:

Select the file(s) in Solution Explorer
Select the File > Source Control > Exclude from Source Control

Reference

NOTE:  Right Click in the Solution Explorer DOESN'T have this option.


Website content is pushed left when viewed in Android browsers

Question: This website's content is bunched to the left when viewed on android browsers, as demonstrated in the two screenshots below. I feel like I've come across other websites with this issue when using my mobile browser, so I'm thinking it isn't an uncommon issue.
The site isn't responsive (yet) and there are no media queries. I am not using the viewport meta tag, to prevent initial zoom-in on a non-responsive site (as detailed here).
The issue isn't happening on:

iOS Simulator, Safari Browser
Opera Mobile Emulator (emulating opera running android devices like Kindle Fire and HTC phones)
Android Samsung Smartphone, Firefox and Opera browsers

The issue is happening on:

Android SDK, (emulating an android browser on a Nexus S)
A Samsung Galaxy S2 (pictured below), in Chrome, Dolphin, & Default browser

Here are the details for the device in the screenshot:
<code>device_model = samsung SGH-T989
device_res = 480x800
orientation = portrait
os_name = Android
os_version = 4.0.4
pixel_density = 240 dpi
url = http://bryanbraun.com/
</code>
Mobile Version

Desktop Version
Answer: Try adding a background-color on the tags which contain the text. This way, android will (hopefully) consider these some kind of blocks and (probably) will render them fine.


What does 'let the idea go begging' mean?

Question: What does 'let the idea go begging' mean? Does it mean someone hesitates when making a decision?
Answer: The Free Dictionary gives the definition:

go begging
  Fig. to be left over, unwanted, or unused. (As if a thing were begging for an owner or a user.)

They are citing the McGraw-Hill Dictionary of American Idioms and Phrasal Verbs as a source for that and also give a quote from Around The World In Eighty Days by Jules Verne as an example that points towards a meaning of postponing an idea (with the option of abandoning it completely):

Passepartout was not the man to let an idea go begging, and directed his steps towards the docks.
Answer: No, it means to give up on an idea that has been proposed or put forward, in favor, perhaps, of another, new idea. As for the old idea, it can seek acceptance elsewhere. In other words, it can go begging to be accepted by someone else, somewhere else!
It does not, by the way, necessarily mean a new idea came along, in which case the person who suggested the idea in the first place might be a little disappointed and say,

"So, what should we do with my idea? Should we simply let it go begging? I for one don't think we should."


What is Difference between Have to and Should?

Question: I have a question that what is the difference between following statements.

You have to do this.
You should do this.

I am confused.
Answer: "Have to" implies the necessity behind the requirement of doing a particular task.
''Should'' finds usage to refer to an ethical responsibility.
While ''have to'' sounds more like a compulsion to which there may even be penalty / punishment, ''should'' signifies the onus of doing something that may display how responsible someone is.
From what I interpret, use of the two differs on the basis of responsibility and compulsion.
Comment: +1, but "should" is not necessarily an "ethical responsibility". You can say "should" to refer to a practical advantage also. Like, "You should wear gloves if you go outside in winter." There's nothing unethical or immoral about not wearing gloves. The speaker is just warning you that your hands will be cold if you do.
Answer: "Have to" is an obligation, "should" is a (strong) recommendation
Answer: We use 'have to' when something is an obligation, it is necessary to be done. As in: We have to win this match to qualify for the next round.
'Should' is used to

Give suggestions or advice:You should brush your teeth every day.
To indicate probability:If I should be late, go without me.
Answer: This type of wording is often used in requirements manuals, specifications, policies, and procedures.  Each such document should clearly define its terms to avoid ambiguity.
If this is from a policy manual that you need to adhere to, you should clarify the exact meanings of these terms.
A somewhat "famous" set of specifications for geeks of the world is the RFC specifications used for the Internet specs and include typical definitions for these types of terms.  Here's an excerpt from https://www.ietf.org/rfc/rfc2119.txt, for "MUST" and "SHOULD".
MUST - This word, or the terms "REQUIRED" or "SHALL", mean that the definition is an absolute requirement of the specification. [This is the equivalent of your "have to". - CoolHandLouis]
SHOULD -    This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course.
The RFC defines the following words/phrases: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL".


How to compare post tags?

Question: I want to compare post tags. If the tags match, then display the matching post. For example, I have a post called "ONE" with some tags and another post called "TWO" with some tags. I want to compare both post's tags and if they match, then display that post.
Comment: Do you mean you want to compare _the_ specific post, or to find _a_ some post with matching tags?
Comment: i want to compare all the posts with matching tags
Answer: Working off the assumption that you're already on Post One, and want to add Post Two below it, as a "Related Posts" type feature, you can use a standard WordPress function to get an array of One's tags, then do a query to grab and display posts with tags that match.
//get just the IDs of Post One's tags
$tag_ids = wp_get_post_tags($post->ID, array('fields' => 'ids'));

//perform a query looking up any posts that have all the same tags.
//note: 'tag__and' will look for posts with ALL the tags, you can replace
//this with 'tag__in' if you want a less strict search to find ANY of the tags.
$tag_query = new WP_Query( array( 'tag__and' => $tag_ids ) );

//standard loop fare to display posts that are found
if($tag_query->have_posts()) : while($tag_query->have_posts()) : $tag_query->the_post(); ?>

<?php echo get_the_title(); ?>

        <?php the_content(); ?>

<?php endwhile; endif;

//reinstate original WordPress query
wp_reset_query();

How to compare post tags?


Did I find a (little) bug (empty space in the Nautilus context menu)?

Question: I know that it's just a tiny graphic problem but do you also get a white line (or extra padding) after the last entry in the context menu?
Comment: Do not know about Unity, but in Xubuntu this (little) bug does not exist.
Comment: I have bigger fish to fry and wouldn't worry about it.
Comment: This isn't the place for bug reports. Even if it were, you'd have to provide a lot more info.
Comment: Exactly which release of Ubuntu?
Comment: I suspect it's 19.04 because of "Preferiti" which I'm guessing is "Starred" and that is related to Tracker being on by default in 19.04. Of course, OP, as a perfectionist, should have provided that information.
Answer: It's quite possibly a bug. Using Ubuntu 19.04, I see the extra space in one context menu but not in another:
Extra space at the bottom of this context menu

No extra space at the bottom of this context menu

If you want to file a bug, there are things you could do first to make sure the developers' task is made easier.

Verify if the issue exists in another distribution you know uses the latest vanilla GNOME such as Fedora 30. If the issue appears there as well, you'd be better off approaching upstream and not the Ubuntu team here.
See if the problem goes away using the built-in Adwaita theme. In this specific case, I've used Adwaita-Dark and so it doesn't appear to be a theming issue caused by using a "non-standard" theme.
If you see the issue only when not using Adwaita, you should get in touch with the developer of the concerned theme. The reason for doing so is detailed in Please don't theme our apps.
Comment: Issue is also present with Adwaita indeed. It is good nevertheless to point to the possibility of a custom theme causing the issue.
Answer: https://gitlab.gnome.org/GNOME/gtk/-/issues/1996
This bug seems to be triggered by the "paste into folder" feature.
If you copy a file/folder to your clipboard, then there's no empty space.


Extract (rip) DVD in Chapters and not in Title

Question: I'm ripping a Mozart DVD, but I only need to extract a few chapters (tracks) from it. I try to use dvdrip but it only extracts me the Title (the whole video). Is there any program to do this? Thanks
Answer: There are several applications that allow you to do that, as I listed in a previous answer, see here: What is the best tool for converting and reading video to be played on DVD players?
Of those, I have successfully tested HandBrake for that and other purposes.

Give it a try and let us know how did you manage this situation.
Good luck!
Comment: Thanks! It works great, but I have a question.
It says: Chapters 1 trough 8, so it cuts the tracks automatically?
Comment: Nice to know you succeeded... Yes it does... you will get individual video files for each track as you request.
Comment: unluckily, HandBrake does not have an Oneiric release yet..
Comment: + there's no 64-bit version
Comment: Not listed but handbrake is installing and running perfectly on 64 bit systems using the ppa information provided right here: https://launchpad.net/~stebbins/+archive/handbrake-releases
Answer: try dvd ogmrip, you can choose the chapters you want
Comment: `ogmrip` managed to extract everything perfectly from a troublesome DVD, which failed when used with 3 other tools.


How do I increase the logging level for Puma?

Question: Currently I am only getting ActiveRecord and view-rendering output in my Rails application log file, since I switched to Puma from WEBrick.  I haven't been able to find where I can modify the output level of Puma's logging.  Thoughts?
Comment: Have you looked at the configuration.rb settings?  It looks like you can send the standard error and out to a file.
Answer: From http://guides.rubyonrails.org/debugging_rails_applications.html#log-levels:

The available log levels are: :debug, :info, :warn, :error, :fatal,
  and :unknown, corresponding to the log level numbers from 0 up to 5
  respectively. To change the default log level, use
config.log_level = :warn # In any environment initializer, or
Rails.logger.level = 0   # at any time

This is useful when you want to log under development or staging, but
  you don't want to flood your production log with unnecessary
  information.
The default Rails log level is debug in all environments


Does being a Blood Mage make everyone hate you?

Question: Blood Mages are almost universally hated in Dragon Age Origins.
Does choosing that specialization affect the story line?  Will people hate me if I pick it?
Comment: Even though Jowan is hated in the game, I think that's because he's a bit of a twat, and your character could do the exact same things and not get in a spot of bother. Mind you, not sure what would happen if you're a blood made, and you copulate with Leilana, while *in* the Tower. That might bring bad some bad memories with Gregor.
Answer: No, they won't know, and or won't care. Feel free to go Blood Mage and wreak havoc.
Comment: if you need an RP perspective, perhaps they overlook it because you are a Grey Warden
Comment: As pointed out by @brolin-mislef, it should be noted that doing the quest to become a blood mage will result in Wynn leaving the party - although it is for the actions taken to become a blood mage, not for being a blood mage.
Comment: @Wipqozn - I finished the game multiple times with Wynne in the party playing as a Blood Mage. There are multiple ways to unlock the specialty, and not all of them result in her departure.
Comment: Another edit... my third. I kept getting the blood mage quest mixed up with the reaver :/
Comment: In the lore you wouldn't be the first grey warden blood mage.
Answer: It was originally planned for Wynne to call you out on being a Blood Mage while in the presence of Knight Commander Greagoir and First Enchanter Irving at the end of the Broken Circle quest. Dialogue was recorded, but was cut from the game. It can be seen in this fan-made reconstruction:

Wynne: Before we go any further, I would like to bring something up if I may. [turns to Warden] I must thank you for what you have done, but I have watched you and seen some things that cause me concern. The spells you use are unfamiliar and not taught by the Circle. They are powerful, and disturbing. Where did you learn to do this magic?
Warden: (Persuade) They were not my spells. You are mistaken.
Wynne: Oh, please. Credit me at least with the ability to tell different casters apart. I know what I saw.
Warden: (Persuade) The Grey Wardens taught me.
Wynne: But there is only ever one mage Warden at a time, and you are that mage. Who taught you?
Greagoir: I can believe that the Grey Wardens teach their recruits spells that would be…frowned upon by the Circle. Desperate times call for desperate measures.
Irving: The Wardens have many books reserved for themselves alone. They contain the wisdom of all Grey Wardens past and present, mages included.
Warden: Yes. That's right.
Greagoir: The Grey Wardens' methods may be questionable, but I must believe their intentions are, ultimately, good.
Wynne: I hate to say this, but some of the things you were doing were hardly distinguishable from what those blood mages were doing.
Greagoir: This is a serious accusation, Wynne.
Warden: Everything I've done has made me better at battling evil.
Greagoir: Tell us now…are you a blood mage?
Warden: Yes, I am.
Greagoir: You know what happened to Jowan and you saw what they did to the tower.
Irving: It pains me to see you've fallen so far. You were strong enough without blood magic…
Warden: Why do you let the Chantry dictate the extent of your power?
Irving: It's not about power, but respect for life—your own, and others. Do what you wish, Greagoir.

Because you did spare the tower, Greagoir then gives you the option to peacefully surrender and go on trial with the Chantry, with him saying that he will plead for the grand cleric to spare your life. The Warden can choose to refuse, which leads to Greagoir saying that you must be eliminated.
I imagine that this conversation was cut for two reasons. First, it creates a new outcome in which both the Mages and the Templars turn on you, meaning you don't have either faction as an ally. Second, when you say that they are Grey Warden spells, Wynne notes that "there is only ever one mage Warden at a time" so you had nobody to teach you (with Irving reasoning that you learned from Grey Warden books). It seems that the developers decided they didn't want to limit themselves in this way, so they cut the reference to it.
Unfortunately, this means that in the final version of the game your allies, Wynne included, don't seem to care that you're using Blood Magic. However, you can accept this from a roleplaying perspective by imagining that you had an off-screen conversation and managed to convince your companions that they were Grey Warden techniques. If you go so far as to actually make Wynne a Blood Mage, then you can reason that she doesn't fully recognize blood magic (since the only time she has seen it has been briefly during combat) and that she wants to believe the lie that you really are teaching her secret Grey Warden techniques.
Answer: I hear that in the beta, if you were a blood mage, Wynne would refuse to group with you. That probably got changed for obvious reasons, so now you can be a blood mage and use your blood spells in front of anyone, even the Circle of Magi.
Comment: Even more hilariously, you can turn Wynne into a blood mage.
Comment: Wynne would leave or fight the warden to death if they were a blood mage


Will you be installing Windows 7 RC as your primary OS?

Question: Will you be installing Windows 7 RC as your primary OS?  Or be waiting for the RTM version?
Comment: Keep in mind that this is a poll - please don't add a new "yes" "maybe" or "no" answer - add a comment instead and vote up the one you chose.
Comment: I think that's another question that can't be actually answered. Maybe should be a community wiki.
Comment: +1 to community wiki; also if Nick really wants the "yes/no" answers he should seed those responses.
Comment: yes, definitely community wiki
Comment: @Portman: community wiki
Answer: I've been running the Beta as my primary OS for months now and its been great. There were a few issues early on but most have since been fixed. So yes, I will be running the release candidate as my primary OS.
Answer: I'm considering it.
It can't be as bad as this RTM version of Vista I currently have!
Answer: If initial feed back is good, I will be installing as my primary.  The increased performance over Vista will be a big win for me.
Answer: If and when I get a new PC I will make the switch over (current desktop is still on XP 64 bit edition). I don't honestly see the need to upgrade my two laptops from Vista at this time, since they are primarily used for internet browsing and other minor activities. The necessity to go through a new install with them isn't there.
Answer: I'm planning to move my main desktop machine at home onto it, but on a new hard-drive and in dual-boot mode...
Comment: Could you elaborate on how to go about doing this?
Comment: when I find out, I'll let you know... :)
Answer: Absolutely - I already run Windows 7 (64-bit) on absolutely all my machines. There is no reason not to.
Answer: i tried out the test on my MediaCenter pc.
and that worked really fine.
my only problem are the rumors that there will be a final in the summer.
reinstalling all the stuff again in 2 months is not what i prefer.
but i think after a long weekend, i definitly would be on the RC ;-)
Answer: I'm in the process of testing one of my applications full-time in Windows 7, so I will be running Windows 7 RC as my main OS. Dog-fooding FTW.
Answer: No.
I haven't had time to evaluate the beta version, and I don't have time to deal with the inevitable loss of time upgrading older systems and dealing with quirks.
I will be using it for any new systems I build, but will not be upgrading.
-Adam
Answer: I already have the beta as a primary OS since December, I think. I haven't had a single problem with it yet - it's working super. Much faster than both XP and Vista; Readyboost is far improved; etc.
All in all, I'm extremely pleased with Windows 7. I don't need the RC since I have the beta and it's working great - so I'll wait for the full version before formatting.
Answer: Yes, I ghosted my previous partition, so as to give myself a good disaster recovery backup plan.
Then I went and fully installed 7100, and it's like butter. Absolutely no problems so far. Everything installed smoothly, EXCEPT for SQL Server 2008 Management Studio. That gave compatibility warnings, and the solution was to install SQL Server 2008 SP1. Worked fine.
The best part is that Xbox 360 streaming of avi/xvid/divx files actually works! Windows Media Player, in the betas, was not picking up those files correctly for display to the Xbox 360.
I am extremely pleased with Windows 7 build 7100. Very speedy, the eye candy is nice, and it's faster than Vista, IMO.
Answer: I've been using the beta for over a month. I really like it, I will most likely be installing the RTM to see what's new. The software seems stable and I have not had any issues using it as my primary OS.


Can I convert from a JSON object graph to a .NET class without an intermediate string conversion?

Question: My C# application receives JSON data which needs to be deserialized to strongly-typed objects, but I need to manipulate the JSON properties during conversion. Ideally I would like to deserialise to a JSON object graph, manipulate properties, and then convert the resulting graph to the .NET type. However, there seems to be no way of doing this except by serializing the modified graph back to a string, and then deserialize that string to the .NET type, which seems wasteful.
An example might explain why this is useful. The Twitter API sends lists of ids in the following form:
<code>{"ids": [1, 2, 3], "next_cursor": 0, "previous_cursor": 0}
</code>
It sends lists of lists in a very similar form:
<code>{"lists": [...], "next_cursor": 0, "previous_cursor": 0}
</code>
The obvious .NET equivalent of this is a CursorList<T> type with NextCursor, PreviousCursor and Contents properties, where Contents is IEnumerable<T> and contains the deserialized contents of the array. However, the standard JSON deserializers cannot deserialize to CursorList<T> because the JSON tag varies depending on T. I would like to take that JSON, deserialize to the object graph, extract the type-dependent property (ids or lists as the case may be), and hand it to the standard List<T> deserialization process. Having gone to all the trouble of creating an object graph, it seeems a shame to have to serialize that property to a JSON string before then redeserializing to List<T>.
I have looked at JSON.NET, System.Json and System.Web.ScriptSerialization.JavaScriptSerializer, but none of them seem to allow conversion between the JSON object graph and a .NET type. Does anyone have a way of doing this, or do I have to go via strings?
Answer: What is the source of your data?
There is no standard format for serializing POJOs to JSON. JSON representation of a Java POJO would be different from the one generated by Ruby.
Thus you have no choice other than handling it manually.


Geodjango, Openlayers 2: Override default fillColor in OpenLayers.Feature.Vector.style

Question: Update
I would certainly hard-code the source file
and change it as follows:
OpenLayers.Feature.Vector.style = {
    'default': {
        fillColor: "blue",
        ...
    },
    ...

... but this is rather a hack I would like to a avoid.

I am trying to change the fillcolor of a point shown in a django admin map.
I have already managed to change the color of a new point when I click on the map, following this solution, but I am unable to understand how I could change the color of an existing point that programmatically is inserted into the map when fetched from the database.
I have found several posts that describe how to override the StyleMap of a vector layer or how to dynamically style a map, but I do not understand how I could change the color of the dot when it is already on the map.
I attach a picture. The yellow dot is already in the database.
How can I paint it blue?
Answer: I have overriden the relevant settings as such:
OpenLayers.Feature.Vector.style.default.fillColor = 'blue';
OpenLayers.Feature.Vector.style.default.fillOpacity = 0.5;
OpenLayers.Feature.Vector.style.default.strokeWidth = 2;
OpenLayers.Feature.Vector.style.default.strokeColor = "red";


How can I get transform matrix for QQuickItem?

Question: I worked for a long time with QGraphicsItem and it has transform() function. Now I wont to do same thing with QQuickItem but unfortunately it misses transform(). So my question - how can I get transform matrix for QQuickItem?
Answer: Actually the QQuickItem provides the transform() method, however it returns the list of all transformations assigned to given item. It is because multiple transformations can be assigned to a single Item. The return type of QQuickItem::transform is QQmlListProperty<QQuickTransform> — it is a wrapper to QML list<Transform> type (see documentation for Item). It can be iterated over, yielding QQuickTransform * elements. QQuickTransform is a base class for a transformation that provides a virtual method applyTo taking a QMatrix4x4 * argument and applying the transformation upon it.
The QML allows instantiating several QQuickTransform subclasses (for translation, rotation and scale) and user is allowed to defined custom transformations (eg. for skew).
To obtain a single transformation matrix you need, you have to start with identity matrix and sequentially apply all the transformations of given QQuickItem.

QMatrix4x4 transformOfItem(QQuickItem *item)
{
    QQmlListProperty transformations = item->transform();

    const int count = transformations.count(&transformations);

    // Prepare result structure, it will be default-initialized to be an identity matrix
    QMatrix4x4 transformMatrix;

    // Apply sequentially all transformation from the item
    for(int i = 0; i applyTo(&transformMatrix);
    }

    return transformMatrix;
}

Note that the function returns a tranformation matrix as QMatrix4x4 — it is more than old QTransform that was based on 3x3 transformation matrix, so it cannot be converted without loss. If you want, you may use QMatrix4x4::toAffine to get the QMatrix (3x3) and use it to create QTransform object. However, if your QQuickItem transformations contain non-affinic elements, they will be lost.
Edit
There's one more thing to note: the method I posted works only for transformations defined by assigning to transform property. It does not check for scale and rotation properties. If you use them, you should check their values with appropriate QQuickItem methods and adjust returned matrix to include these two additional tranformations.
Comment: Thanks, @Michał W. Urbańczyk.I will try your suggestion.
Answer: Here's a correct solution, based on the code provided by Michael earlier, but fixed to work actually, so you don't have to spend 20 minutes figuring out how to use QQmlListProperty
QMatrix4x4 YourQQuickItem::get_model_matrix() {
    QMatrix4x4 result;

    // Compose model matrix from our transform properties in the QML
    QQmlListProperty<QQuickTransform> transformations = transform();
    const int count = transformations.count(&transformations);
    for (int i=0; i<count; i++) {
        QQuickTransform *transform = transformations.at(&transformations, i);
        transform->applyTo(&result);
    }

    return result;
}

In my use case I use this to get the model matrix for my object, then multiply together with view and projection matrixes to calculate the model-view-projection matrix.
Answer: The QSGTransformNode class implements transformations in the scene graph. In updatePaintNode function, argument updatePaintNodeData provides a pointer to the QSGTransformNode associated with this QQuickItem.
QSGNode *MyQuickItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data)
{
     QSGTransformNode *transformNode = data->transformNode;
     qDebug() << transformNode->matrix();

Comment: it seems that I've asked my question in incorrect way. So I created a new one - http://stackoverflow.com/questions/28540057/keep-position-of-qquickitem-while-transformation-although-origin-point-was-chang


active_admin-sortable_tree causes error when trying to use it

Question: Assuming the following:
ActiveAdmin.register Section do
  menu :label => "Sections used in the menu"
  menu :parent => "CMS", priority: 1
  permit_params :name,:section_type, :visible,sections: [], sections_id: []

  sortable tree: true,
           sorting_attribute: :position,
           max_levels: 1,
           collapsible: true

  index as: :sortable do
    selectable_column
    id_column

    column :name
    column :section_type
    column :visible do |section|
      section.visible ? status_tag("yes",class: :ok) : status_tag("no")
    end
    actions
  end
end

incase it's needed, section.rb:
class Section < ActiveRecord::Base

  belongs_to :parent, class_name: self.to_s, foreign_key: 'section_id'
  has_many :children, class_name: self.to_s, foreign_key: 'section_id'

  scope :roots, -> {where(section_id: nil)}
end

I get the following Error:
undefined local variable or method `selectable_column' for "

\n":ActiveAdmin::Views::IndexAsSortable

This goes away if I remove as: :sortable but this is of course not going to work (obviously as I can't then use the sortable tree).
I'm guessing the error happens because by doing as: :sortable causes the execution context for the index block to change and the new execution context doesn't have the index methods.
Regardless, how do I fix this?
Answer: Ok, so I was right, the execution context changes from a standard index to a IndexAsSortable as a result I wrongly assumed that the same methods would exist but they don't, hence things like column and so on don't exist.


How to get the Debug.WriteLine?

Question: is there a possibility to get all things that are write in Debug.WriteLine in a TextBox or something like this?
Answer: Yep. You can implement your own TraceListener class and direct the output to any textWriter
Answer: You can create a class that inherits from TraceListener, and add an instance of that class to the Debug.Listeners collection.
Answer: It's conceivably possible to write a custom trace listener that could do this.
Alternatively, why not explore something like log4net -- this gives some very flexible approaches to logging that are much more sophisticated than the default logging in the framework. It can even send its output over UDP to an external listener...

How to get the Debug.WriteLine?


Print custom HTML between Exposed Filter Area and Results in Views

Question: I set up a view in drupal 7 that displays all my content.  I exposed filter criteria's Title and Taxonomy, so now there's a title and taxonomy search field that appears above the result set.  How do I print custom text like "Search Results:" between the filters and the results?
Answer: This can easily be achieved using themeing.

In the edit view for your view click on advanced
At the bottom of the section is "theme information"
Look for the line "Display output" and from left to right the themeing becomes more specific
Decide how specific you want the themeing to be (hint if unsure go to the right)
Copy the theme file name (which should be something like views-view--example--page.tpl.php) and create a new file in your theme folder with that name
Click on the display options link and copy the contents of the file from the <?php through to the bottom of the fixed width text and paste that into the new file
Add your text after the code block that looks like this:

<?php if ($exposed): ?>

<?php print $exposed; ?>

<?php endif; ?>

Save the file
Click the "Back to theming information" link
Click the rescan template files link
Save your view
Visit the page your view is on
Answer: Quick edit to the previously provided response:
Copy the views-view.tpl.php provided by the Views module into your templates folder of your theme, and rename it views-view--example--page.tpl.php
After:
   <?php if ($exposed): ?>

 <?php print $exposed; ?>

<?php endif; ?>

add:
  <?php if (!$empty): ?>
    <?php print t('Your search results are below.'); ?>
  <?php endif; ?>

Save the file. Make sure to rescan you template files within the view.
This ensures that your custom text is only displayed when results are found. Without the check to see if the view is empty, your custom text will display even if no results are found, which is not good UX.


Using old F1 visa due to Administrative Processing

Question: I recently applied at the American Embassy, New Delhi, for a new F1 visa for my PhD program. After the interview, my passport was collected by the embassy and my case was put under Administrative Processing - 221(g).
Now I don't know if I will get my visa in time for my classes. However, I still have an F1 visa valid until 2018 from my previous program (different university, same SEVIS), so I was wondering if I could just withdraw my application, get my passport back and fly on that visa. Would this create any problems for me in the future? Or maybe has the embassy canceled my old visa when I submitted it?
Comment: What degree was that if you can include? Did you already graduate from that program? Have you considered applying for OPT?
Answer: You can request a temporary withdrawal of your passport for the purpose of study, your 221g application will be put on hold. It is up to the embassy whether they allow your visa to be valid or cancel the already valid visa. Also, if you are able to travel back to the US, it is uncertain by what time you need to return so that your 221g processing can resume.
Please share your experience and what you eventually ended up doing. I am in a similar situation as yours.
Thanks!


Can you say "sur la reto" for something you found in the Internet?

Question: Is Mi trovis ion sur la reto a valid way to say that you found something in the Internet? Should prepositions such as en and per be prefered?
Answer: Mi kutimas diri "en la reto", same kiel "en la libro"
Answer: For sure en la reto.
A quick search of the Tekstaro only turns up one or two references to sur la reto and none of these are related to the internet.
To clarify the above. In the Tekstaro, there are the following references to en la reto:

Six (6) from Monato - all six refer to the internet.
Thirty three (33) from La Ondo de Esperanto - All the ones I've looked at closely refer to the internet.

Contrast this with sur la reto. There are only two hits total. Neither one has to do with the internet.
Further, there are two hits for en la interreto and none for sur la interreto.
So, based on my subjective impression of what expression is more common, the logic explained in other language, and actual usage as captured in the Tekstaro, my recommendation is for en la reto.
Comment: I have added an explanation of what I found in my "quick search of the Tekstaro" - along with some information from a more detailed search. I hope this has convinced you to change your downvote to an upvote. (Currently +3, -1.) If not, please let me know what is missing.
Comment: most of the books in Tekstaro were written before the internet existed so of course none of them are related to the internet.
Comment: Thanks for the comment. It's interesting that this answer has gotten fewer upvotes and more down-votes (currently +2,-1) than mondano's answer which says the same thing with less justification. Would you like me to discuss the specific examples in the Tekstaro? My judgement is that they are indeed relevant to the question - and there are quite a few references to *en la reto* that are indeed related to the internet. For sure, the correct expression is ***en** la reto*
Comment: I downvoted when I realized the evidence was misleading.
Answer: Sur la reto is perfectly fine. Just ask yourself whether the mental image is meaningful and unambiguous. If so, trust it.

This has been downvoted, so here's why it's correct: a reto is a net. Does a net have a surface? Yes it does, even as a figurative network, which is why an object caught in the net (en) is also on it (sur). The Internet is a network on the surface of the Earth, and thus anything in the net can also be visualized as on it.
If the expression sur la reto is good enough for the skilled poet Steven Brewer, it should be good enough for anyone. And please note that the Tekstaro consists of material from before 2005, the bulk of it much older.
Comment: I would argue that the *reto* part of *interreto* is due to the net-like structure that is the wires that connects us all (or originally rather). If something is 'on the internet', it is in fact contained inside those wires (and transistors etc.) that make up the internet. Therefore, I think *en la reto* makes more sense.
Comment: My point is that both are valid; speakers' visualizations may differ.
Comment: Right, I see. To me *sur la reto* doesn't make much sense, but several languages seem to have an equivalent expression; I agree that it is fine. (I didn't downvote you by the way.)
Answer: I think it is okay to say sur or en. I prefer saying en myself because the info is stored inside computers/servers.
Here are a few examples for sur la reto:

Esperanto sur la reto https://www.esperanto-usa.org/en/node/177
Rezultoj de KER-ekzamenoj jam aperas sur la reto! http://www.esperanto-mexico.org/eo/rezultoj-de-ker-ekzamenoj-jam-aperas-sur-la-reto
...ni klopodas pliigi nian prezenton sur la reto,... http://www.espero.com.cn/2014-02/24/content_31575257.htm

Here are some for en la reto

Esperantaj vortaroj en la reto https://eo.wikipedia.org/wiki/Esperantaj_vortaroj_en_la_reto
Lerni Esperanton en la reto http://www.esperanto.net/veb/lerni.html
La kaŝita katastrofo - Kontakto 2016:2 en la reto http://kontakto.tejo.org/2016/04/la-kasita-katastrofo-kontakto-20162-en.html
Answer: Prepositions in Esperanto should be understood quite literally.

en means, that something must be inside something. For instance en la tablo means, that there must be a drawer at bottom surface of the table to hold something or the thing is between the upper and lower surfaces of the tabletop. Being inside implies, that you usually cannot see it.
sur means, that something lays on a surface. For instance sur la tablo means, that the thing is on the table, above the tabletop touching it. Being on implies, that you usually can see it.

While one can argue, that internet is a net with a surface, on which you can have/hang things, for most people the internet is more like a box or a drawer, in which you have things. For this later metaphor speaks the fact, that the content of the internet is not visible right by looking at your device (computer, tablet or a phone) unless you go and search for it. Contrast this to a street, the "content" is there in plain sight.


Need to create a separate mobile homepage. Does anyone know how?

Question: I have Magento 2 store and I like the desktop theme but I do not like the mobile look of my homepage. How can I edit the mobile look of my homepage without altering the desktop version? At the moment if I alter the code both are changed. Is there any extension or method I can use to maybe create a separate mobile homepage and lead my customers there when they are on mobile devices?
Answer: you can create new theme by agent wise.
You can create new theme and call block using xml.
Hope it works for you
Comment: Any other way? I just need a mobile homepage. Is there anyways that I can just create a page and maybe redirect my homepage to the mobile version?
Comment: you can do something like you can find user agent of browser using php and make event for home page and rediect to home page to other page for mobile agent
Comment: how to detect :
https://stackoverflow.com/questions/15228937/php-check-if-the-page-run-on-mobile-or-desktop-browser
Comment: @SunilPatel, can you share some references about this.
Answer: use the design rules (ADMIN - content - design - configuration) to detect the mobile devices
Answer: You can do this by using widgets and call the page based on the theme that is loading, however you still need to have 2 different themes. But with this method you can simply extend the theme and use user agents to show a different style, instead of creating a new theme with modifications.
This is also more flexible and easier to update if need be, else you need to amend the theme.
See sample setup below.


Show attached files in mobile app: Screen vs Pop-up

Question: We has a section in our mobile app that designed as user feedback service. And faced with question - how the best way to show user their attached files on screen with new form creation? User can attach maximum 10 files.
On our form we already use three input fields (two fields for choose only one value from several items and one for simple text input). Also one of fields for choose one value from several items we design to show this values inside popup because value has complex structure (not only title but also a little description for each item).
And then when we design a feature with optional attach files to our form - we faced with a question - how the best way to show already attached files to our user - continue to show it inside a popup at the same form screen (similar to our context with already used popup for one of our form filed) or using for this scenario separate screen?
Requirements for showing attached files:

Show a list of attached files;
Delete attached file;
Open attached file.
Back to screen with input form.

And also, does anyone know any examples of implementing a popup in mobile applications that provide a list items inside and support delete action for every item?
Thanks in advance!
Answer: "does anyone know any examples of implementing a popup in mobile applications that provide a list items inside and support delete action for every item?"
A traditional popup on mobile is no place for a scrollable list because it results in bad UX: scrolling for lack of screen real estate while sacrificing valuable screen real estate just to provide context plus making it a little harder than usual to navigate away...however some modern alternatives exist such as the Chips/Pills pattern [1] which you could use in a BottomSheet that can be swiped to expand or shrink. Care should be taken to hint that there are more attachments than currently visible (if there are). That way the primary content is actually visible, the attachments take up a small amount of space and are secondary but can be accessed without limitations on display width plus minor limitations on display height. You may need to make the list of attachments itself scrollable, certainly if there is no limit to their amount.
[1] https://material.io/components/chips/


In a simple electric circuit with battery and lamp, how does the lamp light up?

Question: I watched Veritasium's video on big misconceptions of electricity, i remember when we learn how does lamp light up in the circuit, our teacher said it is the kinetic energy of electrons transfer to metal ion of filament lamp, then convert to heat and light. but in the video, it talked about poynting vertor, does that mean the energy is transferred to the lamp in electromagnetic radiation form?
Comment: Related - [How is the answer to this question 1/c
seconds?](https://physics.stackexchange.com/q/678359/37364)
Answer: No. The energy is not transferred through electromagnetic radiation. Poynting vector is a notion not exclusive for EM radiation, but also works for circuits like battery, wires and lamp.
In the case of the video, what these vectors show is a source of electromagnetic energy (battery) and a sink (lamp). It is a kind of account balance.
Answer:
does that mean the energy is transferred to the lamp in electromagnetic radiation form?

Electrons in a wire are moving about in two different ways. First, they are moving randomly, due to thermal energy. Second, superimposed upon this random motion there may be a drift, or a net movement of the sum total of electrons moving in some direction. This net movement superimposed upon the random motion is conduction current, usually just called current.
When an electric field acts upon electrons which are free to move, the electrons are accelerated, creating such a current. That is the electric field gives kinetic energy to the electrons. Then through "collisions" with atoms, ions, or other electrons, the motion of the accelerated electrons becomes randomized again. This randomization process converts the extra kinetic energy given to the electrons by the electric field into thermal energy. This is known as Joule heating. As long as the electric field is present, electrons with random motion, will be accelerated in a given direction, collide, have their motion randomized again, and then be accelerated again.
An electric field that imparts energy to electrons may be the electric field component of an electromagnetic wave, i.e. electromagnetic radiation, as in your question. However, the electric field that is present in low frequency circuits (such as power common lights) is generally not thought of as "radiation", just a field. So, in common parlance, the answer to your question is NO, the energy is not transferred to the lamp in electromagnetic radiation form. But it is transferred in the form of an electric field.
EDIT:

i still confuse about whether the current (i.e. electrons) carries the energy towards lamp?

The electrons do carry energy toward the lamp. However, they do not carry that energy very far, or very long. The mean free path for electrons in copper is something in the vicinity of 40 nm. A nanometer (nm) is a billionth of a meter. So, on average, an electron only carries energy forward for 40 nm before it's direction becomes randomized. Unless an electron re-accelerates in a common direction with other electrons every 40 nm or so, the current will simply die out in very short order. The electric field is what re-accelerates these electrons. Without an electric field at every point along the current path, the common motion of the elections at one point (a current) would not result in a common motion further down the current path.

and how to understand the energy is transferred in form of electric field? electric field of what? charge on the wire or other things?

There are net charges along the surface of wires (and also in areas where the conductivity of a conductor changes, or the current density changes). These net charges create an electric field within the wire. As mentioned before, current will soon die out if there is no electric field to be constantly re-accelerating electrons whose forward motion becomes randomized in short order. If there were no electric field, and the electrons entered an area where their motion became randomized, then electrons would start accumulating in that area. A combination of the microscopic version of Ohm's law and Maxwell's (Heaviside's) equations, results in the accumulation only "sticking" on the surface (or other exceptions mentioned above). But it is these surface (+ exceptions) charges that are responsible for the electric field that constantly re-accelerates electrons in a wire.
The electric field created by these surface charges doesn't actually transfer net energy to the electrons. The electric field created by charge density is conservative. It is like gravity. Imagine skiers taking a ski lift to the top of a mountain, and then skiing down. Although gravity accelerates the skier going down, that same gravity must be overcome while going up. It is the ski lift that imparts the energy to the skier that is released when the skier goes down. In the same way, some source of energy external to the wire's electric field is responsible for the energy that is released when the electrons accelerate under the influence of the (conservative) electric field caused by surface charges along the wire. That external source of energy is commonly called an electro-motive force. It could be chemical in nature as in a battery, mechanical as in a van de Graaff generator, or due to relative motion between a magnetic field and a conductor, as in a electric generator.
Comment: thanks for your answer, but i still confuse about whether the current (i.e. electrons) carries the energy towards lamp? and how to understand the energy is transferred in form of electric field? electric field of what? charge on the wire or other things?
Comment: @DORA I have expanded my answer. I hope that expansion helps.


Is 'I want your sex' grammatically correct?

Question: I heard "I want your sex" on YouTube and the phrase kept bugging me. I realized George Michael had a song titled that way after googling. Is this grammatically correct? I want to laugh at it but I'm not sure...
Answer: In George Michael's case, 'your sex' probably means 'your penis'. This is a rather old fashioned usage, sometimes used in novels up to the 1960s or so - 'I touched his sex' because 'I touched his penis' was considered to be too explicit. Of course, it could also mean 'I want to have sex with you'. The lyrics and titles of songs and poems do not have to strictly follow the rules of grammar, as their purpose is mostly to suggest thoughts and feelings. Also, for practical and business reasons, it is usually preferred that titles of songs conform to conventions of decency, etc.
Comment: So it's not just to check the box on the ID card form...
Comment: Thanks for the reply. So it can really mean that he wants to have sex? I prefer to misinterpret lyrics when they are grammatically incorrect haha.
Comment: @absolutelyclueless27 - do you understand that if someone says "I want your sex", of course they mean "I want to have sex with you"? The one implies the other.
Answer: Grammatically correct slang
The Oxford English Dictionary has this definition for sex:

Slang or euphemistic. A person's genitals.

The definition has examples like "The narrow white briefs that barely captured her sex" (1977) and "And he put in a fake sex (penis) because he wanted to make the scene more real, more rude" (2003).
So it is a grammatically correct way of referring to sex organs. It is slang that is not in common use.
Comment: Hey thanks. I appreciate the answer.


Can I reprint obscure OGL rules in my campaign setting book?

Question: I am presently writing a campaign setting for Pathfinder 1e, in which several rules from the adventure paths and third-party books are used.  For example, it uses rules for modern firearms, and city modifiers from a third party source.  All of them are already available for free on d20pfsrd.org.  But I want to sell this in a paper book, and would like to include the OGL rules in sidebars for small quotes, and in the main body text if they are too long for a two-page sidebar.  Am I allowed to do this, and if so, is there anything that I will need to do to make it compliant, other than list it in the references after the OGL itself?
Comment: Welcome to RPG.SE! Be sure to check out the [tour](https://rpg.stackexchange.com/tour) and the [help center](https://rpg.stackexchange.com/help) if you have any questions.
Answer: Yes, you can
What you described is how OGL works (see Pathfinder's OGL), you must put a note with every other OGL reference that you use, usually at the end of the book. For more information, there is an excellent podpast from the guys at the Know Direction podcast talking about third-party publishing and OGL in general.
Publishers only refer to page number and book to save word count, otherwise, they would reprint the referenced rule. We could see this happening a lot on the earlier Pathfinder books, when they were still using 3.x and not their own system. Nowadays, we only see a stat block if that book is no longer in print or if there is any changes, correction or errata since that material was released.


Are there homomorphisms $SU(2) \xrightarrow{} SU(2)$ with higher homotopy?

Question: I am quite new to the subject, so I apologize in advance for anything sloppy which I may write.
The homotopy group $\pi_3(SU(2))= \mathbb{Z}$ classifies maps of the form $S^3 \simeq SU(2) \xrightarrow{} SU(2)$, where $\mathbb{Z}$, roughly speaking, measures how many times $SU(2)$ wraps onto itself.
These maps, and their homotopy classification, appear in the standard construction of instantons via bundles. For example, we have that the map $g_0: x \in S^3 \mapsto e \in SU(2)$, with $e$ being the identity, belongs to the class $0$ of $\pi_3(SU(2))$.
The following map belongs to the class $1$: $g_1: (x_1,x_2,x_3,x_4)\in S^3 \mapsto \frac{1}{r} (x^4 \mathbb{1} + \sum_i x_i \sigma_i) \in SU(2)$, where $r^2=x_1^2 + x_2^2 + x_3^2 +x_4^2$, $\sigma_i$ are the Pauli matrices and $\mathbb{1}$ is the identity.
For $n>1$, the map $g_n: x \mapsto r^{-n}(x^4 \mathbb{1} + \sum_i x_i \sigma_i)^n$ belongs to the class $n$ of $\pi_3(SU(2))$.
Clearly, all these maps can be thought to be maps from $SU(2)$ to $SU(2)$. $g_0$ and $g_1$ are homomorphisms, i.e. $g(x y)=g(x)g(y)$. However, since $SU(2)$ is not abelian, it is evident that $g_n$ with $n>1$ is $not$ a homomorphism.
Now, finally to my question: are there homomorphisms $SU(2) \xrightarrow{} SU(2)$ that belong to the class $n$ of $\pi_3(SU(2))$ for $n>1$? If so, could you give me an example?
Thanks in advance!
Answer: No, there a no homomorphisms belonging to class $n$ for $|n| > 1$.
More generally, we have the following:
Proposition:  Suppose $G$ is a connected simple Lie group (meaning all proper normal subgroups are finite).  Then every homomorphism is either trivial or an isomorphism.
Proof:  Suppose $f:G\rightarrow G$ is non-trivial.  Moving to the Lie algebra level, the induced map $f_\ast$ must also be non-trivial.  So $\ker f_\ast$ is a proper ideal, and hence is trivial.  This implies $f_\ast$ is an isomorphism, which, in turn, implies $f$ is an isomorphism.  $\square$
Of course, a trivial map induces the $0$ map on $\pi_k$ for any $k$.
On the other hand, an isomorphism must induce an isomorphism on $\pi_k$ for any $k$.  Thus, in your particular case, only $n\in \{0, \pm 1\}$ is possible.
In fact, $n = -1$ is not possible when $G = SU(2)$.  Probably the easiest way to see this is to note that $SU(2)$ has trivial outer automorphism group, so all automorphisms are isotopic to the identity map, which clearly is the $n=1$ case.
Comment: yes, that is the case
Comment: $SO(3)$ is connected, but not simply connected.  It is still a simple group, so the above argument applies.  For disconnected groups, one must worry about basepoints, etc, but the Proposition still holds with the obvious modification.  E.g., if $G$ is disconnected with identity component $G^0$, any homomorphism must map $G^0$ to $G^0$, the induced map on $\pi_k$ will be an isomorphism.
Comment: Thank you! I guess that the opposite is true for $U(1)$, where there are homomorphisms belonging to class $n$ for any $|n|>1$. Is that the case?
Comment: Thanks again. As a final follow up, would things change if I were to look at $SO(3)$, which is not connected, instead of $SU(2)$?


Will Allah forgive a muslim who used to claim that he is allah?

Question: Will allah forgive a muslim who used to claim that he is allah or no? If thr muslim did a sincere repentance will allah forgive him??
Answer: Say, "O My servants who have transgressed against themselves [by sinning], do not despair of the mercy of Allah. Indeed, Allah forgives all sins.1 Indeed, it is He who is the Forgiving, the Merciful." [ Az:Zumar:53]
Allah will forgive any sin if he wills.
Infact, it is haram for you to think that you have committed a sin that Allah will not forgive.
Allah is Ar-Rahman Ar-Raheem Al-Ghafoor,
And Allah knows best


Azure website IE10/11 error SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3

Question: We are experiencing this error in IE10/11 and have spent the last 2 days researching about it and have not been able to find a solution. We are running a asp.net mvc 5 web application utilizing signalR in specific areas hosted on a azure website that is scaled up to 2 instances. We are using the Redis backplane mod to make sure our SignalR talks back to all instances of the application. The error is intermittent and causes the rest of the application to hang. We do not believe this is a SignalR issue because we removed the invocation of SignalR from the page and was still able to get the issue to occur.
We have tried the following

GET request before POST
Setting the charset=utf-8
Our JS libraries are update to date

We need to find a fix for this issue quickly so if anyone has any ideas I would be really greatful.
thanks in advance
Answer: One problem when scaling a SignalR application on more instances is that clients  connected to a server only receive updates from other clients from  the same server. (The messages are not automatically broadcast between all servers).
http://www.asp.net/signalr/overview/performance/scaleout-in-signalr
One solution is to have a backplane that automatically sends the messages between servers, so  that any server has any message at any time so it can push updates to their connected interested clients.
There are two implementations that Microsoft explains in the link above, one using Redis Pub/Sub and the other using Azure Service Bus.
With Redis you simply get an instance running (it can be on Linux, Windows or in Azure) and configure each server to push messages and subscribe to messages on the same channel.
I hope it helps your problem (since you said that the problem is intermitent, I can assume that it appears when clients are connected to different instances of your application).
Good luck!
EDIT:
Thanks for updating your question.
Have a look at this SO post:
IE10/11 Ajax XHR error - SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3
And at this post:
http://www.kewlcodes.com/posts/5/SCRIPT7002-XMLHttpRequest-Network-Error-0x2ef3-Could-not-complete-the-operation-due-to-error-00002ef3
Good luck!
Comment: Yes. I am already using the Redis backplane so I don't think that is the problem.
Comment: And where in the question have you stated this?
Comment: And how would I have known it? If you are not giving us the details  of the problem,  we cannot help! I suggest you edit your question!
Comment: Sorry, I edited by question. Still new at asking questions on here. thanks for the help though
Answer: I also ran into this issue. In my case, I used IOwinContext.Request.ReadFormAsync() in my server code. I found out that if I send a post request with json content type, ReadFormAsync() hangs.
I solved it by checking if the request's content type is json, and if so, I use a different method to parse the body.


How is momentum conserved in this example?

Question: Suppose a sticky substance is thrown at wall. The initial momentum of the wall and substance system is only due to velocity of the substance but the final momentum is 0. Why is momentum not conserved?
Comment: The final momentum is not $0$!
Comment: What about the momentum changes of the system **as you throw** the substance? Is momentum conserved? Answer: momentum is always conserved, because conservation involved currents into and out of a system. Impulses change the momenta of systems, transferring momentum from one to another. Conservation does not equal constancy.
Answer: You should also consider what the wall is attached to. And obviously it is the Earth. If we assume the Earth's velocity is zero after the substance is thrown, since there is the force that slow down the substance at the moment of impact, there is also the reaction force on Earth with the same magnitude and opposite direction. So Earth will gain velocity and final momentum of combined Earth and substance system will be equal to the intial momentum of the substance.
And also we can look at the situation in a bit different way. When we stand on the floor and throw the substance, there appears a friction force between our feet and the floor and it acts on us in the throw direction. So the friction force on Earth will be opposite to the throw direction and Earth will pick up speed towards the substance, too. And at any moment, Earth plus substance system will have zero momentum. The substance and the Earth will move towards each other and after the impact their speed will be zero.
Answer: If you assume that you throw the sticky substance from rest at the wall then your assertion that the total final momentum of the Earth/wall/you and sticky substance system is correct. Indeed that is also the initial momentum of the Earth/wall/you and sticky substance system before you threw the sticky substance.
In the act of throwing the sticky substance, the Earth/wall/you impart momentum on the sticky substance $\vec p_{\rm ss}$, and as a consequence of Newton's third law, the sticky substance exerts an equal magnitude opposite direction momentum on the Earth/wall/you $\vec p_{\rm Ewy}$ such that the initial momentum of the system $0$ is equal to the final momentum of the system, i.e.
$$0 = \vec p_{\rm ss}+\vec p_{\rm Ewy}\Rightarrow \vec p_{\rm ss}=-\vec p_{\rm Ewy}$$
Assuming no air resistance, etc. the reverse happens when the sticky substance hits and sticks to the wall with $$\vec p_{\rm ss}+\vec p_{\rm Ewy}=0.$$
Of course you do not notice the movement of the Earth, etc. because it is so much more massive than the mass of the sticky substance.
In terms of magnitudes: $$m_{\rm ss} V_{\rm ss}= M_{\rm Ewy} v_{\rm Ewy} \Rightarrow v_{\rm Ewy} = \frac {m_{\rm ss}}{M_{\rm Ewy}}\times V_{\rm ss}\text{ and }\frac {m_{\rm ss}}{M_{\rm Ewy}}\ll1.$$

If you just consider the sticky substance already in motion, and the Earth/wall/you not moving before the sticky substance hits the wall, you have in terms of magnitudes:
$$m_{\rm ss} V_{\rm ss}= M_{\rm Ewyss} v_{\rm Ewyss} \Rightarrow v_{\rm Ewyss} = \frac {m_{\rm ss}}{m_{\rm ss}+ M_{\rm Ewy}}\times V_{\rm ss}\text{ and }\frac {m_{\rm ss}}{m_{\rm ss}+ M_{\rm Ewy}}\ll 1$$
with there being no noticeable movement after the collision.
Mind you, would you notice if the wall, still intact and connected to the Earth, did move given that you would also be moving whilst standing on the Earth?
Answer: The wall will move a little bit as well as exert a small force on whatever it's attached to, etc., etc., until you get to applying a force to the Earth. Everything else is so massive, so we can't see this happening. You are assuming an immovable wall, which is not physically the case.
Answer: Remember Newton's 3rd law. The change in momentum is $F \: \Delta t$ (also known as impulse). So, since by Newton's 3rd law the forces are equal and opposite then the change in momentum must also be equal and opposite.
Therefore, Newton's laws guarantee conservation of momentum, and to see where the momentum goes all you have to do is look for the Newton's 3rd law pair. So here momentum is transferred between the sticky substance and the wall, and the wall (being so massive) gains a little momentum which makes it move imperceptibly.


Why did Dr. Strange make the comment "You look more like a Thanos"?

Question: When Thanos arrived at Titan Dr. Strange said "You look more like a Thanos" as if he had seen him for the first time. On the contrary Dr.Strange went ahead in time to see the possible outcomes and he must have seen Thanos in it. Is this a movie plothole?
Comment: Can you provide more details (use spoiler markup if necessary)? It would help to answer the question if we fully understood the context of the comment... I seem to recall Dr. Strange saying something else before he said "You look more like a Thanos".
Comment: "He must have seen Thanos in it."  Must he have?  Unless the movie explicitly showed you the futures Strange looked into, you don't know what he actually "saw" or experienced in this process. Was it like watching millions of high-def movies? Or a scrambled movie channel? Was it like feeling the strings of a guitar vibrate as you strum them?  Was it an emotion? Standard trope for prophecy/future sight, even those actually from the real world, is that there is vagueness and limits involved.  Perhaps he only saw a shadowy blob for Thanos, maybe everything was allegory and symbolism, who knows?
Comment: From what i can recall, he exclaimed "you look more like a thanos" when he first saw thanos om titan, as if he didn't know how thanos looks like
Comment: This question seems to presume that no one ever says anything witty or clever in the MCU and instead must fully mean what they say. It's hard to find any scene (with anyone but the baddies in them) where this is even the case.
Answer: I can't find the exact quote, but I believe this is in reference to the initial arrival of Bruce Banner and then Maw. When Bruce first lands on Earth he warns that Thanos is coming, soon after Maw arrives in NYC. I think (and this is the quote that I can't find) that Dr Strange asks if Maw is Thanos. So in the scene, you mention Dr Strange is making a callback to this initial confrontation. This is also supported by Thanos's line after Dr Strange speaks:

Dr. Stephen Strange: Oh yeah. You're much more of a Thanos.
Thanos: I take it that Maw is dead. This day extracts a heavy toll, still he accomplished his mission.
Comment: I had assumed they were referring to running into the guardians from when they arrived on Titan. They ran into the guardians, assumed they were thanos/his men, and fought. After they cleared it up Thanos showed up and strange said his line.
Comment: No offense but I don't know why this answer is upvoted so much. Sure it answers the title as written but the OP is saying that he saw the future already so he should already know what Thanos looks like.
Comment: That's a good point, could easily be a reference that.
Comment: @KodosJohnson Probably because it feels like it completes the loop when someone who made a gross mis-identification previously would later comment when the actual person showed up. Interestingly (or perhaps *strangely*? :P), Strange's line still works even if we accept that he recognised Thanos from glimpses into the future.
Answer: I don't think he was actually surprised by Thanos's appearance; in-universe, it was probably just a bit of banter.  You mention that this was an exclamation, but I recall it being said rather calmly.
Of course, the Doylist reason is that it amuses the audience.  If he's seen Thanos some 14 million times, even saying that as a joke doesn't make sense.  On the other hand, maybe it was necessary to get that one future where they defeat Thanos...
Comment: I like this one, because that line just seems like a clever way of saying "There you are!" or acknowledging that this was the person who was originally expected.
Answer: The name Thanos has meaning itself.
Thanatos was a god of death and Thanos is a derivative from that name.  Thanos (and Thanatos) both translate to "death" in Greek.  One might expect a bad guy named "Death" to look the part.  In the movie Dr Strange finds that to be the case for Thanos.
Answer: So, we can now easily check to see if Dr. Strange said anything to Maw when he arrived and the answer is no, he doesn't ask if he's Thanos. Maw makes it clear that it is the children of Thanos that have come to take the stone. This is further clarified in the ship when Strange is held by the surgical needles. Therefore, the answer that he thought Maw was Thanos at any point in time is definitely not correct.
The correct answer could be that he thought the GOTG were somehow Thanos initially, but Strange is a smart guy and none of those people are even remotely Thanos, plus Thanos had already sent Maw after him who proclaimed as mentioned above that the children of Thanos essentially do all his work for him, so he probably thought that they were WITH Thanos. This makes more sense anyway as the general conversation goes when Spidey is caught by Starlord at gunpoint; i.e. "we're the Avengers man!" Therefore, this answer is also likely not correct (although closer to correct than the top answer).
The only answer I can come up with is that Strange is breaking the 4th wall, something that a master of the mystic arts could possibly do, and is referring to Cable. This would be well-within the realm of the self-deprecating humor of Deadpool and acceptable to Marvel, because they would want to maintain that Brolin was always Thanos and not Cable.
Answer: I believe that it was a Cable/Deadpool joke.  Since Josh Brolin plays both Thanos and Cable, Doctor Strange (and the Russo brothers) is (are) taking a shot at Deadpool 2 by saying "oh, yeah.  You're much more of a Thanos..." (than a Cable).
Comment: Deadpool 2 was released after Infinity War.
Answer: Thanos is a Greek slang word meaning "immortal".  Strange was either patronizing or acknowledging his power.
Answer: Dr. Strange might've been breaking the 4th wall referencing how Thanos used to be cgi in the post credit scenes.
Answer: That was my thought: that it was a dig at Deadpool, saying Brolin is much more 'Thanos' than 'Cable'.  Just a guess though - someone should asked Benedict Cumberbatch!
Comment: Hello! Welcome to Movies & TV Stack Exchange. This answer currently looks like a speculation and more like a random comment. Can you expand it to a proper sources ideally with some citations? Otherwise, it might get converted to comment or deleted.


dual boot windows 7 home premium and ubuntu 14.04

Question: I have a Sony Vaio laptop with 4 GB RAM.It has Windows 7 home premium by default.I want to dual boot it with Ubuntu 14.04.How do I do it?My laptop does not boot Windows properly and shows logon initialization failure error.I cannot use safeboot as it hangs as soon as I select the option.It also cannot detect Wifi,USB,CD/DVD.How can I dual boot it?I also do not have the Windows disk.
Answer:
Just download the image file and write it into a DVD.
Then boot the laptop with it and let Ubuntu install on RAM.
When virtual desktop comes, It goes to install Ubuntu icon and then click on it.
Choose the option Install Ubuntu with windows side by side.
Follow the instruction like user name, language , time zone, etc.
Let it install.
After installation, reboot the system.
Update the system and use. Enjoy.
Comment: Note though that they said their system doesn't boot Widnows properly. It could well be that doing a side-by-side install will actually fix that, it could make no difference, but in all I'd be less confident a dual boot install was going to go well if the existing OS was showing problems. At the very least, anything important should be backed up first: Installing beside a set-up that isn't running correctly can be a bit like building on sand; even if you do a good job, it can still fall down.
Answer: You mentioned it cannot detect USB and CD/DVD drive. Is it the Windows that cannot detect these or they aren't detected at all (at BIOS level)?
If it's the latter, then you'd better put the hard drive in another machine & get Ubuntu installed on it, then put the hard drive back in your laptop. Unlike Windows, Ubuntu will still boot up even if the installation is made on a different machine.
Comment: It is Windows that cannot detect this.The BIOS can detect it.But when I use a USB,it says NTLSR missing.What is that?
Comment: I guess you meant NTLDR. If by booting through USB you're getting that error I assume your laptop supports USB boot, it's just that the Live USB is corrupted. There could be 2 reasons here, either the Ubuntu image you're using is corrupted or the Live USB wasn't done properly.

Could you try recreating a Live USB using https://launchpad.net/win32-image-writer, but try re-downloading the Ubuntu ISO image.


Functions applied from the right

Question: In some of the older books by Nathan Jacobson (like Lie Algebras and Lectures in Abstract Algebra), a convention is used that is quite uncommon at least today: Functions are applied from the right. For instance, a map $\theta$ applied to an object $x$ is written $x\theta$, sometimes even $x^\theta$. I do indeed see the benefits of this notation: Functions are applied from left to right, which is a nice analogue to the notation
$$
\theta\gamma\colon x\stackrel\theta\longmapsto x\theta\stackrel\gamma\longmapsto x\theta\gamma.
$$
However, it does not make the notation any less difficult to get used to. I was wondering if this notation was ever very common, or if it is just some Jacobson thing? Has anyone seen it elsewhere, and do you know its origin (if it has one)?
Comment: As a side note, Jacobson appears to have abandoned the convention in his later works. In *Finite-Dimensional Division Algebras over Fields*, functions are applied from the *left*.
Comment: I would say it was more common in the 1960s and early 1970s. I have not seen it in any recent works.
Answer: The use of functions on the right i.e. f(x) = xf is fairly common among algebracists. It confused the crap out of me in honors algebra when I studied out of I.R. Herstien's Topics in Algebra. (It really hurt me in that course because the teacher wrote functions on the left in his notes and never explained the difference.By the time I caught on to the fact the functions in the text were written on the right, my grade was damaged.So I have a bit a personal annoyance with it to be honest.)  The thinking among algebracists is that it makes composition order of functions simpler to understand and since they deal with compositions on a regular basis, this is rather important. Consider g(f(h(x))). Writing it on the right:
                 (((x)h)f)g
does seem to make the order easier to work with. But for those of us who learned the "calculus" notation of writing functions on the left, it's confusing as hell, especially at first.
Answer: In coding theory, codewords are often expressed as row vectors.  Mappings are sometimes done by matrices.  So the input (row vector) is on the left and the function (matrix) is on the right.  $\vec{v}M$.
It takes a bit of getting used to from a standard linear algebra course where usually one works with column vectors, and linear transformations (matrices) on the left.

Functions applied from the right