I am trying to have one tpl file per view mode inside a module folder. But I can't get drupal to pick up the right tpl file.  I have been trying solutions on these pages:     /**  * Implements hook_theme_registry_alter()  **/ function nwd_press_room_theme_registry_alter(&amp;$theme_registry) {     global $theme_key;     $mod_path = drupal_get_path('module', 'nwd_press_room');     $theme_registry_copy = $theme_registry;       // munge on a copy     _theme_process_registry($theme_registry_copy, 'phptemplate', 'theme_engine', $theme_key, $mod_path);     $theme_registry += array_diff_key($theme_registry_copy, $theme_registry);     $hooks = array('node');      foreach ($hooks as $h) {         if (!isset($theme_registry[$h]['theme paths'])) {                 $theme_registry[$h]['theme paths'] = array();         }         nwd_press_room_insert_after_first_element($theme_registry[$h]['theme paths'], $mod_path);     }      dpm($theme_registry);  }  /**  * Helper function for re-ordering arrays (needed by theme_registry_alter)  */ function nwd_press_room_insert_after_first_element(&amp;$a, $element) {      if(is_array($a)) {         $first_element = array_shift($a);         if ($first_element) {             array_unshift($a, $first_element, $element);         } else {             array_unshift($a, $element);         }     } }   Since I still want the tpl file to be overridable in the theme. Does anyone have an example that works?
I'd like to provide template implementation in my module and allow themes to override it. Basically, I add a suggestion by this simplified code:  function attach_preprocess_node(&amp;$vars) {   $vars['theme_hook_suggestions'][] = 'node__test'; }   (I don't want to use hook_theme to add a new theme because I want to reuse preprocess node functions. The theme name are awkward but I don't want to write node_attach_% to avoid confusion with node type.)  Then I use hook_theme_registry_alter() to add module path:  function attach_theme_registry_alter(&amp;$theme_registry) {   $path = drupal_get_path('module', 'attach') . '/themes';   $theme_registry_copy = $theme_registry;   _theme_process_registry($theme_registry_copy, 'phptemplate', 'theme_engine', 'node', drupal_get_path('module', 'node'));   $theme_registry += array_diff_key($theme_registry_copy, $theme_registry);   if (!isset($theme_registry['node']['theme paths'])) {     $theme_registry['node']['theme paths'] = array();   }   if (!isset($theme_registry['node']['theme paths'])) {     $first_element = array_shift($theme_registry['node']['theme paths']);     if ($first_element) {       array_unshift($theme_registry['node']['theme paths'], $first_element, $path);     }     else {       array_unshift($theme_registry['node']['theme paths'], $path);     }   } }   However it does not work. That means: the file themes/node--super.tpl.php is not used. It is used only if I copied it to the theme folder.
I just learned about the Monty Hall problem and found it quite amazing. So I thought about extending the problem a bit to understand more about it. In this modification of the Monty Hall Problem, instead of three doors, we have four (or maybe $n$) doors, one with a car and the other three (or $n-1$) with a goat each (I want the car).  We need to choose any one of the doors. After we have chosen the door, Monty deliberately reveals one of the doors that has a goat and asks us if we wish to change our choice.  So should we switch the door we have chosen, or does it not matter if we switch or stay with our choice?  It would be even better if we knew the probability of winning upon switching given that Monty opens $k$ doors. dist$(x,A)=0$ if and only if $x\in \overline{A}$ (closure of $A$) I overseasoned my food, what can I do to remove the strong smell? Schengen area 90 days limit: Can I leave on the 91st day? Let $s_n$ be a sequence defined as given below for $n \geq 1$. Then find out $\lim\limits_{n \to \infty} s_n$.   \begin{align}   s_n = \int\limits_0^1 \frac{nx^{n-1}}{1+x} dx  \end{align}  I have written a solution of my own, but I would like to know it is completely correct, and also I would like if people post more alternative solutions. How to call a function in a Twig file 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 applied for a 90-day visa and got a long-term visit, single-entry tourist visa. The date given is 09-March-2015, and it's valid until 07-May-2015.  My agent says the 7th is the latest date I can travel to Dubai; once I enter I need to count 90 days. I entered on the 10th of March.    Is it true, or where can I get it checked?    Can I stay for another month, or do I need to leave before the 7th of May? How do users navigate to Meta? How do you expect users to:   Know that a site's meta-site exists (and what it's for)? Find the hyperlink to the meta-site?   I know it exists, of course, and how to get there; I'm wondering how (or even whether) you expect new or naive users to do that.  I think there isn't a link to Meta from the main site, am I right (except one link in the "list of all 171 Stack Exchange sites" drop-down menu on the toolbar)?  Sometimes I tell people to post a question on Meta instead of on the main site -- I don't realise that they may not know that Meta exists, and that if they do (because they've been there before) they don't know how to get there (because they haven't yet investigated everything on the toolbar). Can a shadow move faster than the speed of light? I'm just a layman with no real science background  (a) I'm not really sure what a shadow is. Some people are saying that it's the absence of something (a photon?) and therefore it is not subject to laws of physics. But I know when I'm in a shadow and when in sunlight... that's "information", and I thought that information flow can't break the speed of light limit.  (b) Some others use the laser pointer/flicking wrist example to talk about laser dots moving faster than light speed. But that can't be right, can it? The photons from the laser point have to travel from A to B and (after wrist flick) from A to C ... but the photons are all moving at the speed of light - there's no law-breaking in moving the laser dot from point B to point C because the photons are moving either from A to B or A to C ... the distance from B to C is not material (is it?).  (c) Also, can a shadow be thought of as a gap in a photon flow? E.g. if I interrupt a beam of single photons then can I think of it as e.g. PPPSSSPPPSSSPPPSSSPPP, etc where P = photons and S(shadow) = no photon &amp;, if so, the "SSS" is effectively travelling at the speed of light ... no faster. How can I check which DNS server am I using (in Linux)? I am using network manager and a wired connection to my university's LAN. (I am trying to find out why my domain doesn't get resolved) The attached animated gif shows some frames of a video with a mesh box placed at each tracking marker used to successfully track (solution error &lt;.4) an 800 frame chunk of video.   The point is to illustrate just how poorly the camera tracker calculated: when the box is at a marker placed at the top of a faraway building on the left, it is actually visually much larger than when it is at the tracking marker closest to where the real camera was. I went to great lengths to be sure that the camera's sensor size and focal length are correct, and manually placed and followed all markers to be sure they were accurately tracking.   There is not a lot of parallax motion over the 800 frames, but there should have been enough to at least know that the point closest to the camera moved more than the point furthest away. Sometimes it seems to work, sometimes it doesn't. Does anybody know how to improve this? Having trouble finding Plantera's Bulb I have been playing on hardmode for a while and have beaten the three  a couple of times. But I have yet to find a . It's getting really frustrating.  Does anyone have any methods to finding a Plantera Bulb? Gravity in 2d space and inverse linear law In our three-dimensional universe, gravity obeys the inverse square law. In a four-dimensional universe, gravity would be expected to obey the inverse cube law et cetera.  In a two-dimensional universe, one would similarly expect gravity to obey an inverse linear law. I've seen it claimed that this is not actually true, when you work it out according to general relativity there would actually be no gravity at all in such a universe. Is this true? If so, is there a layman's explanation of why? Is it related to the fact that gravitational potential wells would be infinitely deep?  Would electrostatic forces follow the same law as gravity?  If there existed infinitely long strings in our universe, would they have the same gravitational effect as point particles in a 2d universe? How to create Unity indicators? I'm interested in Unity indicators and wonder if there is any tutorial on how to program them. I can use the sources of the existing ones as last resort, but I'd prefer a more friendly approach because my programming skills are quite limited. I was wondering if anybody knew a command that would allow me to open a Nautilus (if that's the right name for the Ubuntu graphic/window explorer) window from the command line at the current directory that the user is at.  So, if I open a command line, and type:  cd /home/myUser/some/long/path/to/a/directory   Then, I'd like to be able to issue some command:  nautilus open-sesame   And have a graphic window opened to /home/myUser/some/long/path/to/a/directory. Is this even possible? These HDDs will be used mostly for backups and data-storage (pictures, movies) which aren't often read. The price difference is 1.5 Euros in the case of these two:   HDD Western Digital Caviar Green Power 500GB, 7200rpm, 32MB, SATA2 HDD Western Digital Caviar SE16 500GB, 7200rpm, 16MB, SATA2   The only difference is the buffer size (16MB vs. 32MB). Is the larger buffer size worth the extra money? Force a rebuild of the start menu program index/database in Windows 10 With Windows 10 Microsoft migrated to a database-ish solution for indexing programs in search and the start menu, rather than just using a /startmenu/ directory. AFAIK the exact implementation is still pretty unclear, but there is something along those lines.  Updating from 8.1 to 10 causes it to migrate everything from /startmenu/ to the new system, which ignoring issues such as a (seemingly arbitrary) cap of 500 applications, works fine.  However this failed for me, and from googling seems to be an issue from upgrading with an older dev build, which then carried on to RTM.  So does anyone know a way to force a rebuild/re-index of the program library? Rebuilding the system wide index through control panel (also in &lt;=8.1) has no effect. Prove $kf(x)+f'(x)=0 $ when conditions of Rolle's theorem are satisfied . Prove that if $f$ is differentiable on $ [a,b]$ and if $ f(a)=f(b)=0$ then for any real $k$ there is an $ x \in (a,b) $such that $$kf(x)+f'(x)=0 $$  As all the conditions of Rolle's theorem are satisfied one can say that there is at least one  $c \in (a,b) $ such that $f'(c) =0$ How should I proceed furthur ? How can I use this to get to the required equation ? Find $\lim_{n\to\infty}\frac{a^n}{n!}$ Does $\pi$ contain all possible number combinations?