Let's say I create a function in a module file:  function _get_test() {   return 'test'; }   How can I call this in any Twig file? For example *.html.twig, page.html.twig, node.html.twig etc.   OR   How can I pass a variable from PHP to Twig and display in any Twig file.  For example *.html.twig, page.html.twig, node.html.twig etc.
I work in D8, I create a custom module first_module. By modules create a url and display all nodes by *.html.twig file.  Write code in controller.php  public function contentthree() {    $connection = Database::getConnection();    $query = $connection-&gt;select('node', 'n');   $query-&gt;fields('n', ['nid', 'type']);    $groups = $query-&gt;execute()-&gt;fetchAll();    foreach ($groups as $group) {     $events[] = [$group-&gt;nid, $group-&gt;type];   }    return [     '#theme'  =&gt; 'first_module_display',     '#events' =&gt; $events,   ]; }   In *.module  function first_module_theme($existing, $type, $theme, $path) {    return [     'first_module_display' =&gt; [       'variables' =&gt; ['events' =&gt; NULL],       'template'  =&gt; 'first-module-list',     ],   ]; }  function _get_node_details() {    $output = 'Welcome D8';    $output .= 'Node Details';    return $output; }   and create templates first-module-list.html.twig and display data  {%for key, data in events %}  {%for key1, data1 in data %}     {{ data1 }}  {% endfor %}  {% endfor %}   work fine and showing data correct. But, my question is how to call function _get_node_details() and how to render node details in first-module-list.html.twig files?
How can I find help for new Ubuntu users? I've just started using Lubuntu 13.10. It's the first time I've ever used Linux.  Can any of you send me a tutorial-video for new users or explain the basics to me? How to group distinct values from a list using odata rest api The spell was cast without words, simply a flick of the Death Eater's wand, and a 'streak of purple flame' that lanced across her chest. It was later mentioned that the spell was weakened because of the lack of a verbal component, but still 'did enough damage as it was'. She was in the infirmary healing from the damage for some time. What spell was this? Verify that $4(29!)+5!$ is divisible by $31$. How do I restore an accidentally deleted initrd image? Suppose $f(x)$ is linear i.e. $f(x + y) = f(x) +f(y) $ and monotone on $[-\infty, +\infty]$, then $f(x) = ax$, a real. Suppose $f(x)$ is linear i.e. $f(x + y) = f(x) +f(y) $ and monotone on $[-\infty, +\infty]$, then $f(x) = ax$, a real.  We know $f(0)=0$, and if one assumes differentiability it is quite easy.      But how does monotone make up for differentiability? Proof of Convergence: Babylonian Method $x_{n+1}=\frac{1}{2}(x_n + \frac{a}{x_n})$ a) Let $a&gt;0$ and the sequence $x_n$ fulfills $x_1&gt;0$ and $x_{n+1}=\frac{1}{2}(x_n + \frac{a}{x_n})$ for $n \in \mathbb N$. Show that $x_n \rightarrow \sqrt a$ when $n\rightarrow \infty$. I have done it in two ways, but I guess I'm not allowed to use the first one and the second one is incomplete. Can someone please help me?  We already know $x_n \rightarrow \sqrt a$, so we do another step of the iteration and see that $x_{n+1} = \sqrt a$.  Using limit, $x_n \rightarrow x, x_{n+1} \rightarrow x$ (this is the part I think it's incomplete, don't I have to show $x_{n+1} \rightarrow x$, how?), we have that   $$x = \frac x 2 (1 + \frac a {x^2}) \Rightarrow 1 = a/x^2 \Rightarrow x = \sqrt a$$ b) Let the sequence $x_n$ be defined as $x_{n+1}= 1 + \frac 1 {x_n} (n \in \mathbb N), x_1=1$. Show that it converges and calculate its limit. &quot;Tip: Show that sequences $x_{2n}$ and $x_{2n+1}$ monotone convergent to the limit.&quot; I didn't understand the tip, how can this help me? Does it make a difference if the number is odd or even? Thanks in advance! Java is one of my programming languages of choice.  I always run into the problem though of distributing my application to end-users.  Giving a user a JAR is not always as user friendly as I would like and using Java WebStart requires that I maintain a web server.  What's the best way to distribute a Java application?  What if the Java application needs to install artifacts to the user's computer?  Are there any good Java installation/packaging systems out there? Using sets of arguments from a list Is it possible to scale up an image to increase the the pixel density? I have taken a picture whose resolution is less. I can resize the image easily (i.e I can scale to higher resolution) but the image quality goes for a toss, which is true because the image might not have enough pixels to scale properly.   Is resizing a means of increasing the resolution of the image ? Is it possible to increase the pixel density of the image and then resize, so that quality of the image is not affected much?   I mainly use GIMP and Picasa. Gmail filters/labels: Force email to stay in Inbox? In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as , but for MySQL. Possible Duplicate:          I'm looking for a good book on commutative algebra covering most of (but not limited to) :   Basic Galois theory and Module algebra Primary decomposition of ideals Zariski topology Nullstellensatz, Hauptidealsatz Noether's normalization Ring extensions "Going up" and "Going down"   The emphasis is on the approach, as I would like a book giving a good geometric intuition of ring theory that I could use as a solid basis to start learning algebraic geometry.  All in all, do you remember a book that gave you a deeper geometric insight of commutative algebra ? As I understand it, there are several models for what the universe could look like from the “outside”. I don’t know if any of these are outdated, so if they are please tell me if they are.   Expanding bubble. This model says the universe will never stop expanding, and the universe will die because the energy all turns to photons and gets spread out so much. Bubble that will eventually collapse. In this model the universe will stop expanding, and collapse. Everything merges into super-massive black holes, and the universe dies with fire. The universe is a torus. I'm not clear whether the size of the universe in this model is changing, but the central idea is that space is donut-shaped.   Those are the major ones that I have heard of. My question involves what I have heard to be the most popular of the three, #2. In this model, eventually something will "touch" the edge of the universe. Obviously, the first thing to "touch" it would be photons as they travel at, well, the speed of light. This involves all forms of energy in the universe, but I thought it might be easier to explain for something without mass.  What happens if some form of energy "touches" the edge of the universe? Logically, the energy cannot be lost without violating the law of conservation of energy. The only thing I can think of, is that it would "bounce" or be refracted off the edge.  I realize that it sounds silly, however if model #2 is correct then this situation will arise some number of billions of years from now.  I can only assume that there is either a new model that accounts for this, there is some complex explanation, or that model #2 is incorrect. Poincaré inequality for a subspace of $H^1(\Omega)$ The following is the well known  for $H_0^1(\Omega)$:       Suppose that $\Omega$ is an open set in $\mathbb{R}^n$ that is bounded. Then there is a constant $C$ such that   $$ \int_\Omega u^2\ dx\leq C\int_\Omega|Du|^2\ dx\quad \textrm{ for all   }\ \ \color{red}{u\in H_0^1(\Omega)}. $$   Here is my questions:    Can the condition $u\in H_0^1(\Omega)$ be relaxed so that the inequality is still true? More precisely, suppose $H$ is a subspace of $H^1(\Omega)$ such that for any $u\in H$, $u|_\Gamma=0$, where $\Gamma$ is a ([Added:]nonempty) closed proper subset of the boundary $\partial\Omega$ and the idenity is in the sense of trace. In other words, $u$ is only zero on a part of the boundary. Do we still have the Poincaré ineqaulity in $H$?    [Added:] This question is motivated by the following exercise Suppose every subsequence of X converges to 0. Show that lim(X)=0 Question: Suppose that every subsequences of $X = (x_n)$ has a subsequence that converges to $0$. Show that $\lim(X) = 0$   My attempt:   Suppose that $\lim(X) =L \neq 0$  Let $\epsilon &gt; 0$, and let $K(\epsilon)$ be s.t. $n \ge K(\epsilon)$   then $|x_n-L| &lt; \epsilon$  let $n_k \ge k$, and then $k \ge K(\epsilon)$ and $n_k \ge k \ge K(\epsilon)$ s.t. $|x_{n_{k}}-L| &lt; \epsilon$, which is a contradiction. therefore $\lim(x) =0$ As linguistics student, I have to put more than one thing on a character every now and then. For example, I need to type ā̆. I thought I could simply do that by typing \={\u{a}}, but then the macron is placed above an empty space in front of the character.  How can I solve this? Thanks  P.S. I'm using MiKTeX 2.9, running on Windows 8; in case it might be of use. Context: I prepare my scientific documents using LaTeX and compile to a PDF. I often need to seek comments on drafts from collaborators who do not use LaTeX. Most of these collaborators use Windows OS. Assume also that the collaborator does not need to edit the document.  They only need to be able to add comments to the document. Most would be familiar with the commenting system in MS Word, for example. I'd like to be able to give the collaborator some clear instructions about what software and system they should use to comment on the draft.  This should involve free software and an easy to use interface.  Question: What is a good strategy for getting comments on draft documents when the collaborator does not know LaTeX?  Initial thoughts: I know Adobe professional allows you to add comments to a PDF.  However, some collaborators don't have this software and it costs money.  I could send the raw LaTeX to the collaborator. However, given all the markup, the collaborator may find LaTeX source a bit mysterious.  UPDATE: After posting I noticed  to a similar question. Along with a number of other good tips (such as printing and getting paper comments), he mentions jarnal, xournal, and gournal as free cross-platform PDF annotators. I'd be curious to know whether experts have found them adequate for the above mentioned purpose and whether any of them are to be preferred. Others mention FoXIt. And yet others discuss the option of exporting to MS Word or Open Office and using the reviewing system within these programs. phpinfo() and php -v shows different version of PHP I wanted to know which php version I am using so I wrote the standard script:   phpinfo();   Which gives me  PHP version 5.6.10   The correct PHP version needed for my application. When I tried in terminal:  php -i   or  php -v   It shows me:  PHP version 5.3.2   Which I don’t need. Then I tried with:  which php   It shows me:  /usr/bin/php   Now I am confused which version of PHP I am using. The files are uploaded to the hosting website and I cannot make any changes to the config files like httpd.conf or php.ini. Playing a remote movie on the remote computer