I want to remove duplicate values from array a and get a new array b without duplicate values. What  am doing wrong. HELP!!!  &lt;?php  $a = array('pasta','vegetables','vegetables','salad','salad');  $b=array();     for ($i=0;$i&lt;=count($a);$i++){       if(!in_array($b,$a[$i])){        array_push($b,$a[$i]);         }  }  print_r($b);  ?&gt;
How can I remove duplicate values from an array in PHP?
How do I access a field value for an entity (e.g. node) object? node_load((int) $nid) loads a fully-populated node entity. $node-&gt;title-&gt;value gets the title, but how do I access field values in Drupal 8? Show that conguence $\bmod m\,$ is an equivalence relation How can I edit two materials simultaneously? Whenever I open a new shading window, whatever I do in one is just mirrored on the other. If I click a node in one window, the same node and material get selected in the other. I can't edit two shaders at once. How can I edit two shaders simultaneously? Accidentally created directory named "~" (tilde) I managed to make a directory literally named ~.  (Apparently, Python's os.mkdir('~/something') does this.)  How do I remove it without nuking my home?  Also, if it helps, I have my real /home on a separate partition. And the duplicate ~ is located in (the real ) ~. "wait on" or "wait for"? Officials are waiting on autopsy results for Oscar-winning actor Philip Seymour Hoffman. New York police suspect a drug overdose, possibly heroin.   I am curious about the preposition on in the sentence, because I usually say "wait for" instead of "wait on". Does it still have the same meaning if I change on to for? Just as follows:     Officials are waiting for autopsy results for Oscar-winning actor Philip Seymour Hoffman. New York police suspect a drug overdose, possibly heroin. My network icon is always a question mark but I have acces to internet How many combinations can I make? let $n \gt 1$ be an integer, and consider $n$ people; $P_1, P_2,..., P_n$ let $A_n$ be the number of ways these $n$ people can be divided into groups, such that each group have either one or two people  determine $A_1, A_2, A_3$  So I have  $A_1 = 1$ way $A_2 = 4$ way $A_3 = 12$ way  But I am not sure if this is right... Can anyone confirm?  edit:  My way of getting this is  $A_1 = 1 $ because {P1} only has 1 way to sort  $A_2 = 4$ because {P1,P2} = {P1,P2},{P2,P1},{P1P2},{P2P1}  etc. Additional needed documents for UK trip if someone will shoulder all expenses Someone (a relative) from the UK (already a naturalized British Citizen) will be financing my trip, as well as taking care of my accommodation. What are the documents I need to submit aside from bank statements? Does the sponsor need to fill-out the Sponsorship Undertaking Form? ()  something to consider from my question: -my relative is a naturalized citizen in the UK. Is proof of naturalization needed? Volume control on asus zenbook 3 Using Ubuntu 16 LTS  I installed ubuntu on my new asus zenbook3 ux390. Nearly everything works fine except the volume controls don't work. The volume is either on or off. I can adjust volume in specific apps or websites (like youtube) successfully, but the internal volume control either wants to be muted or at 100%. Got French Schengen visa but no "VIS" after giving fingerprints I had my French Schengen visa interview 3 days ago (got the stamped visa and passport within two days, super efficient!). However there's no "VIS" written on the visa, even though I gave my fingerprints during the interview in US. I had presumed VIS would be written on the visa since I gave my fingerprints, or is it for something else? I do remember it took a while to take the fingerprints because the machine looked old and was taking a long time to read my fingerprints.  The next time I want to apply for a visa, do I need to go for an interview again just because the visa has no VIS on it? Mouse cursor doesn't change to pointer when hovering "full site" on mobile When (accidentally) clicking "mobile" in the footer, one gets the mobile site in a regular browser too. To switch back, one can click "full site" in that same footer:    However: when hovering it, the mouse is changed as to select text, rather than to indicate one can click (even though it's clickable).  All other links do change the mouse into a pointer.  (Not a big deal, except when somehow  getting into the mobile mode, I guess.) The problem is to prove the following equivalence:  $$2^{\aleph_0}=\aleph_1 \iff \exists\ A,B\in\mathbb{R}^2:\\ \textrm{a)}A\cup B=\mathbb{R}^2 \\\textrm{b)}\ \forall\ \textrm{lines } l\ \textrm{parallel to x-axis, } |A\cap l|\leq\aleph_0 \\\textrm{c)}\ \forall\ \textrm{lines } l\ \textrm{parallel to y-axis, } |B\cap l|\leq\aleph_0$$  I think I know how to prove "$\impliedby$":  Let's assume the RHS and that $2^{\aleph_0}\geq\aleph_2$. Now let's take a sequence $\langle x_{\alpha}:\ \alpha&lt;\omega_1\rangle$. Since $\bigcup_\limits{\alpha&lt;\omega_1}|B\cap x_{\alpha}|\leq \aleph_1\cdot\aleph_0=\aleph_1$ there is such a $y$-coordinate that neither of $(x_{\alpha},y)$ is in $B$. But hence we obtain $\aleph_1$ point which all lie on the same line parallel to $x$-axis. Since $A\cup B=\mathbb{R}^2$ they all must be contained in $A$ $-$ a contradiction as $A$ has at most countably many of those points.  But what about the other implication? Do I contruct these sets by induction? Over all lines or something else? I haven't come up with anything yet, perhaps you could help me. Why are image thumbnails cropped proportionally (not per dimensions)? For some reason WordPress is ignoring my thumbnail sizes and keeping thumbnails cropped proportionately instead of specific dimensions. Here is what I have in functions.php:  add_image_size( 'main-thumbnail', 728, 410, true );   and in content.php:  &lt;div class="thumbnail"&gt;     &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;        &lt;?php the_post_thumbnail( 'main-thumbnail' ); ?&gt;     &lt;/a&gt; &lt;/div&gt;   I added these two things and regenerated my images with the  plugin, but it doesn't seem to matter. The images don't change.  For some reason WordPress isn't recognizing the hard crop and is keeping the images proportional, so some of my images are way taller than 410 pixels. Why is this? Imported CSV data is not displayed in QGIS Coulomb's Law states that the fall-off of the strength of the electrostatic force is inversely proportional to the distance squared of the charges. Gauss's law implies that the total flux through a surface completely enclosing a charge is proportional to the total amount of charge. If we imagine a two-dimensional world of people who knew Gauss's law, they would imagine a surface completely enclosing a charge as a flat circle around the charge.  Integrating the flux, they would find that the electrostatic force should be inversely proportional to the distance of the charges, if Gauss's law were true in a two-dimensional world. However, if they observed a $\frac{1}{r^2}$ fall-off, this implies a two-dimensional world is not all there is. Is this argument correct? Does the $\frac{1}{r^2}$ fall-off imply that there are only three spatial dimensions we live in? I want to make sure this is right before I tell this to my friends and they laugh at me. At what time will the upcoming Ubuntu release be made available? Every six months a new Ubuntu version will be released. Does anyone know at which time this will be? Orange squares appearing on render? I'm trying to render a scene in Blender, and as of yesterday (it was not doing this when I was working on it 2-3 days ago), I am seeing orange squares dancing around the rendered image. Google tells me that these are render tiles (I think), but what are they, why are they there, and how do I get rid of them? Command "find -name" must be enclosed in quotes or it doesn't work. Why is that? find . -name *.rb   doesn't work on my ubuntu  I have to do  find . -name "*.rb"   to get it to work.  Why is that? Validate decimal numbers in JavaScript - IsNumeric() What's the cleanest, most effective way to validate decimal numbers in JavaScript?  Bonus points for:   Clarity. Solution should be clean and simple. Cross-platform.   Test cases:  01. IsNumeric('-1')      =&gt; true 02. IsNumeric('-1.5')    =&gt; true 03. IsNumeric('0')       =&gt; true 04. IsNumeric('0.42')    =&gt; true 05. IsNumeric('.42')     =&gt; true 06. IsNumeric('99,999')  =&gt; false 07. IsNumeric('0x89f')   =&gt; false 08. IsNumeric('#abcdef') =&gt; false 09. IsNumeric('1.2.3')   =&gt; false 10. IsNumeric('')        =&gt; false 11. IsNumeric('blah')    =&gt; false Is there a good word for a square-rectangle relationship? Any given square is always a rectangle, but a rectangle isn't necessarily a square, so squares and rectangles have a _ relationship. I've been noticing this sort of thing everywhere ever since I noticed that I didn't know a good word for it. I've been calling it a container relationship because one class of things is contained within a larger class of things. However, a "container" relationship doesn't sound very good and doesn't really convey the meaning on its own. A more elegant word would be helpful.  Edit: A specific definition would be something like: a is always b. b is sometimes a.