I've created a content type with a link type field. When an user add this content type I want to prefill the link field with the user email. I've a create a new module named prefilllink with an alter hook :  function prefilllink_alter(&amp;$form, &amp;$form_state, $form_id) {   dsm($form);   switch($form_id) {     case "job_node_form":       $form["field_apply"]["und"][0]["value"]["#default_value"] = $user-&gt;mail;       break;   } }   But it doesn't work... Any idea?
Drupal 7. Custom module. I have a content type 'RFI' with a handful of fields I created with Drupal UI. I want a user to: fill out a form &amp; click submit while drupal: saves fields to database, creates a new node of 'RFI' and populates the fields of the node with the content provided by the form's corresponding fields.  From what I understand:  Build a form with fields (taking from the 'DBTNG examples' module just for clarity):  function rfi_build_form($form, &amp;$form_state) { $form = array();  $form['add'] = array( '#type'  =&gt; 'fieldset', '#title' =&gt; t('Add a person entry'), ); $form['add']['name'] = array( '#type'  =&gt; 'textfield', '#title' =&gt; t('Name'), '#size'  =&gt; 15, ); $form['add']['surname'] = array( '#type'  =&gt; 'textfield', '#title' =&gt; t('Surname'), '#size'  =&gt; 15, ); $form['add']['age'] = array( '#type'  =&gt; 'textfield', '#title' =&gt; t('Age'), '#size'  =&gt; 5, '#description' =&gt; t("Values greater than 127 will cause an exception. Try it - it's a    great example why exception handling is needed with DTBNG."), ); $form['add']['submit'] = array( '#type'  =&gt; 'submit', '#value' =&gt; t('Add'), ); return $form; }   Here the form fields are saved to database with database API.  function rfi_build_submit($form, &amp;$form_state) { global $user;  // Save the submitted entry. $entry = array( 'name'    =&gt; $form_state['values']['name'], 'surname' =&gt; $form_state['values']['surname'], 'age'     =&gt; $form_state['values']['age'], 'uid'     =&gt; $user-&gt;uid, ); $return = dbtng_example_entry_insert($entry); if ($return) { drupal_set_message(t("Created entry @entry", array('@entry' =&gt; print_r($entry, TRUE)))); } }   Now here is how I know how to create a node of RFI type. How do I take the values of the fields above [name], [surname], [age] and have them related to corresponding fields in my content type?  function rfi_build_type($form, &amp;$form_state){ $node = new stdClass(); $node-&gt;type = 'rfi'; $node-&gt;name = ''; $node-&gt;surname = ''; $node-&gt;age = ''; $node-&gt;language = 'en'; $node-&gt;uid = 1; node_save($node); }   I was thinking that since the fields have been saved already, that I could use a database query to get these values, but intuition tells me I'm overlooking something.  Thank you!
Make Bash autocomplete guess the closest approximation I have a somewhat uncomfortable keyboard on my laptop, resulting in that I sometimes misspell things in Bash and when pressing Tab for an auto-completion nothing happens.   Is it possible to have Bash guess what I meant to type, by for example when wanting to change directory to Documents and then mistyping cd ocum[TAB], given no other folder beginning with "ocum" is present, Bash interprets it as cd Documents/ since it is the closest possible action to do?   Or is this idea terribly complicated to achieve? What is the sum of this series: $\displaystyle\sum_{n=0}^{\infty} \dfrac{a^n}{(3n)!}$ I tried getting it into a closed form but failed. Could someone help me out?  $$\sum_{n=0}^{\infty} \dfrac{a^n}{(3n)!}$$ VB6 IDE cannot load MSCOMCTL.OCX after update KB 2687323 How many ways can $b$ balls be distributed in $c$ containers with no more than $n$ balls in any given container? "have" vs."have got" in American and British English Every partial order can be extended to a linear ordering My problem is simple. I think that the strange deformations on the top are there because there are so many vertices in one face. How do I fix this while maintaining nice topology?  Although I triangulated the top polygon, the problem still persists. Not getting edit's +2 rep after reaching 2k rep After reaching 2k rep , I'm not receiving  +2 rep per edit. Why? How do I restore a Places folder I accidentally deleted in Nautilus? How to change programmatically exposed filters in views I have a page view with exposed filters. One of the filters is term vocabulary, and that's dropdown list, user can select only one category (term).   I want to set programmatically one term from dropdown list when I came from specific URL. I tried with views_query_alter where $category is tid.    $set_exposed_input  = array();  $set_exposed_input['field_category_tid'] = $category;   if ($set_exposed_input) {     $view-&gt;set_exposed_input($set_exposed_input);  } Transit visa at Istanbul Airport, Turkey, during a Turkish Airlines arranged stopover? Do I need a transit visa at Istanbul Airport to enter Istanbul for city sightseeing or hotel accommodation?. All services provided free by the Turkish Airline. I am Nigerian citizen and booked Turkish Airline flight to Nigeria with 12hours layover at Istanbul Airport. I guess that energy will be used up and, at the end, will contribute to heat the earth, so I see no big differences...  please explain your point of view. "Writ large", "Writ small", and others I have seen this used with other words besides "large" and "small".  What other words can be used? Can this structure be used more generally with other adjectives? Does "non-" prefixed to a two word phrase permit another hyphen before the second word?  If I want to refer to an entity which is defined as the negation of another entity by attaching "non-" it seems strange to attach the "non-" only to the first word when the second one is really the word naming the entity. For example,     non-control freak   looks like a person obsessed with not being in control rather than one who is simply not obsessed with control.     non-control-freak   actually looks better because the "freak" is attached to the "non-" as much as it is to "control-", without the space implying the presence of a phrase break.    and its answers make it sound like totally detaching the "non" could be an option, but if I were following the convention of hyphenating "non-" could I add a hyphen after the next word to resolve this problem? I would like to achieve this effect using my Nikon P510:      Are there any suggestions or tips that would help me do that? Why is the sky not purple? I realise the question of why this sky is blue is considered reasonably often here, one way or another.  You can take that knowledge as given.  What I'm wondering is, given that the spectrum of Rayleigh scattering goes like $\omega^4$, why is the sky not purple, rather than blue?    I think this is a reasonable question because  (or, strictly, violet or indigo) in rainbows, so why not across the whole sky if that's the strongest part of the spectrum?  There are two possible lines of argument I've  and I'm not sure which (if not both) is correct.  Firstly, the Sun's thermal emission peaks in the visible range, so we do actually receive less purple than blue. Secondly, the receptor's in our eye are balanced so that we are most sensitive to (roughly) .  Our eyes are simply less sensitive to the purple light than to the blue. Arabic Stack Exchange? I have been learning some Arabic mostly for fun. I am looking for the Arabic Stack Exchange site but cannot find it. I am sure I saw it lying around a few months ago or so. Any idea what happened to it? Review Audit failed when "late answer" answer is a duplicate I just got a review audit where the "late answer" was a duplicate of the accepted answer, but flagging it on that basis failed the review. That seems like a bug to me.  Question here:   I found that by clicking the question to view the entire Q&amp;A, and noticed that the copy was from a generic "user12345" account (probably with 1 rep as well) and the original from a real-looking account. Viewing the whole Q&amp;A is often useful when reviewing, especially late answers (which are often repeats of earlier points, disagreements with those, or random addendums better submitted as edits). I looked at the duplicate and thought "weird, rep harvesting maybe?" so I clicked "needs moderator attention" and wrote "copy and paste of accepted answer". FAIL!  I think that this review type can't ever work, because to avoid the problem I found you'd need to make up whole new "late answers" which by definition the review bot can't know anything useful about. Either that or to pass you'd just need to take any action at all, including upvoting the original of the duplicated answer. Which I didn't do, BTW, because I had no idea or opinion about the question or answer.  (this is not a duplicate of "What are review tests", it predates that and focuses on a particular defect within the process. See the comments below). When creating accounts on Windows 10, you get a choice between "Your family" and "Other users".  If you choose "Your family" you are forced to use a Microsoft account to sign in. There are various reasons why one wouldn't want to do that, such as too much sharing of private information with Microsoft, etc.  If you choose "Other users" you can create regular accounts just fine. However, if you need to setup time limits for some accounts, it is impossible to do so. It is a feature exclusive to "Your family". Not all time-restricted users I want to create are my family, and not everyone is okay with sharing their info with Microsoft.  So, is there a way to setup login time limits for the "Other users" type of accounts? Let $r$ be the smallest positive integer such that $a^r \equiv 1 \bmod{n}$. Prove $r \mid \phi(n)$. Let $a \in \mathbb {Z}$, $n &gt; 1$ a natural number with $\gcd(a, n) = 1$, and let $r$ be the smallest positive integer such that $a^r \equiv 1 \bmod{n}$. Prove that $r \mid \phi(n)$.  Euler's generalization of Fermat's Little Theorem: If $n \in \mathbb {N}$ and $m \in \mathbb{Z}$ such that $\gcd(m, n) = 1$, then $m^{\phi(n)} \equiv 1\bmod(n)$.  By Euler's generalization I would have $a^{\phi(n)} \equiv 1\bmod{n}$.  Then I could say $a^r \equiv a^{\phi(n)} \equiv 1 \bmod{n}$. At this point I can see that $r$ clearly must be some multiple of $\phi(n)$.  If I want to show that $r \mid \phi(n)$, then I can show that $\phi(n) = rk$, for some $k \in \mathbb {Z}$.  However, I am a bit stuck about how to make this last step showing that  $\phi(n) = rk$, where $k \in \mathbb {Z}$.