I'm writing a command for a customised enchantment that teleports a player holding a certain item to the direction that it's facing. However, according to my knowledge, there's no statistic in /scoreboard that could simply detect a player's left-click. The scores that I've though about include damage_dealt that detects whether a player causes damage. However, I don't actually need the player to cause damage to activate the teleporting, so this may not work because the player can click without causing damage also thought about the ITEM_USE score, but this does not include left-click either, only right click. Anyone could tell me how to detect the player's left-click please? Thank you!
Is there a way so that I make make it when I left click/right click with a certain item it applies an effect? I know that you can apply attributes to wearing armor and things but I want it so when you use the item it applies an effect on your player.  For example, let's say I want something so that when I right click with a certain item (let's say an iron ingot that was given to me) I'll then have a jump boost for 10 seconds. So kinda like a potion in a way.  Is this possible with command blocks/commands/any mods?
POSTFIX main.cf permission denied I am trying to set up a postfix server for smtp relay. Centos 5.5  I have followed  but am getting a FAILED error when trying to restart or reload postfix.  When I do:  cat maillog   I get:  fatal: open /etc/postfix/main.cf: Permission denied   Here is what I have tried:  chown postfix /etc/postfix/main.cf chmod u+rwx /etc/postfix/main.cf   After that, I do:  ls -l /etc/postfix/main.cf   Which gives me:  -rwx------. 1 postfix anotheruser 27531 Apf 29 12:19 /etc/postfix/main.cf   No dice. Same error. I even tried temporarily doing chmod 777 but got same error.  Any ideas on the permissions problem? I am assuming it is running the service as the postfix user.  Thanks In PHP, function parameters can be passed by reference by prepending an ampersand to the parameter in the function declaration, like so:  function foo(&amp;$bar) {     // ... }   Now, I am aware that this is not designed to improve performance, but to allow functions to change variables that are normally out of their scope.  Instead, PHP seems to use Copy On Write to avoid copying objects (and maybe also arrays) until they are changed. So, for functions that do not change their parameters, the effect should be the same as if you had passed them by reference.  However, I was wondering if the Copy On Write logic maybe is shortcircuited on pass-by-reference and whether that has any performance impact.  ETA: To be sure, I assume that it's not faster, and I am well aware that this is not what references are for. So I think my own guesses are quite good, I'm just looking for an answer from someone who really knows what's definitely happening under the hood. In five years of PHP development, I've always found it hard to get quality information on PHP internals short from reading the source. Can Git hook scripts be managed along with the repository? if $a,b,c$ are non zero positive reals prove $$\sum_{cyc}\frac{1}{a^3+b^3+abc} \le \frac{1}{abc}$$ I have used A.M  G.M  inequality as follows:  $$a^3+b^3+c^3 \ge 3abc$$ adding $abc$ both sides we get  $$a^3+b^3+abc \ge 4abc-c^3=c(4ab-c^2)$$ so  $$\frac{1}{a^3+b^3+abc} \le \frac{1}{c(4ab-c^2)}$$ But since $a,b,c$ are positive reals  $$4abc-c^3 &lt; 4abc$$ so  $$\frac{1}{4abc-c^3} \gt \frac{1}{4abc}$$  but i am unable to proceed here How do you clear a stringstream variable? I've tried several things already,  std::stringstream m; m.empty(); m.clear();   both of which don't work. for any ring $A$ the matrix ring $M_n(A)$ is simple if and only if $A$ is simple Let integer $n\geq 1$. I have obtained that for any field $k$, the matrix ring $M_n(k)$ is simple, i.e., $M_n(k)$ contains no nonzero proper two sided ideals. Now I want to prove that: for any ring $A$ (not necessarily commutative), the matrix ring $M_n(A)$ is simple if and only if $A$ is simple.   How to prove? How do I move child windows without moving or minimizing parent in GNOME 3? I have Ubuntu 17.10 with GNOME 3.  What happens: I have (for example) LibreOffice Calc open, with some data columns in it.  I highlight the columns I want to chart, then I select INSERT > CHART.  The chart child window dialog pops up on top of my data, so I want to move it to the side.  When I grab the top bar and move it, the parent (spreadsheet) window minimizes (I think it actually disappears).  Continuing the above example, if I click FINISH on the chart window, I can then see the minimized spreadsheet application, which is the window title bar plus the menu bar just below it.  This seems like really odd behaviour and certainly falls under the category of "not being useful to the user", since the whole idea of moving the child window in the first place was just to be able to better see the spreadsheet!  In other applications, for example the PDF viewer, a slightly different problem occurs.  When I try to move the child window (for example the print dialog) the parent does not minimize but instead follows the child window around.  This is less surprising than having the parent disappear entirely but equally useless in terms of allowing the user to see the information present in the parent window.  Update 2017/11/06  Pomsky's answer below fixes the problem, but leaves me wondering why the window manager is making the decision that all child windows have modal behaviour (or don't), and not the applications themselves; and further, why modal behaviour prevents moving the child screen around when it obscures useful info on the parent screen.  Neither of these seem like good design to me... Is there any good reason that an empty set of round brackets (parentheses) isn't valid for calling the default constructor in C++?  MyObject  object;  // ok - default ctor MyObject  object(blah); // ok  MyObject  object();  // error   I seem to type "()" automatically everytime. Is there a good reason this isn't allowed? I'm trying to write a script which creates a Nurbs path curve, bevels it, and then stores the location of each vertex/point in that curve. I've been writing it based on the code displayed in the info panel, but it doesn't show what the vertices are supposed to be called - so I can't refer to them in the script.  Update: After following Ratt's links, I modified  for Nurbs Path and am now stuck again, though it's still progress. Below is one version I tried out, but the error message says that Curve has no attribute path_points. Of course it doesn't, because I made that up because I don't know what the Nurbs Path equivalent for bezier_points is.  import bpy import random  def pathPointLoc(cu, typ, points):      for (n) in enumerate(points):         nurb = cu.path_points[n]         print(nurb.location)      return  cu = bpy.data.curves.new("MyCurve", "CURVE") ob = bpy.data.objects.new("MyCurveObject", cu) scn = bpy.context.scene scn.objects.link(ob) scn.objects.active = ob  cu.bevel_object = bpy.data.objects["BezierCircle"] cu.taper_object = bpy.data.objects["BezierCircle"]  pathPointLoc(cu, "NURBS", [(0,0,0,1), (0,0,1,random.randint(1,4)), (0,1,1,1), (1,4,1,1)] ) Are user accounts on data.stackexchange.com and Stack Exchange two different entities? I tried to search for similar questions, as I always do, but was not able to find one. I just created a new  on Data.Stack Exchange with my existing Google OpenID and it seems to be not associated with my regular Stack Exchange account. Is this by design? and if so, why? How to make partitions mount at startup? How do you make HDDs and partitions mount at startup on Ubuntu?  I always keep my media and data files on separate partitions - one 2tb HDD and a 400 odd gig partition.  I have been trying to swap the default folder location for the home directory to my other drives.  It works when I change the /home/user_name/.config/user-dirs.dirs file to the directories I want, but only until I reboot the system. I am only assuming that the drives not mounting is the problem with it, but it would be helpful either way.  If any one knows another reason for why the directories change back to default each time that would be good also. Why does a star beyond a certain mass limit (Chandrasekhar limit) only become a black hole? Why does a star beyond a certain mass limit () only become a black hole?   A star is first made of hydrogen, it undergoes nuclear fussion reaction combining into helium and releasing a large amount of energy. This process continues till star is made up of iron core as iron has largest value of binding energy per nucleon, after this if mass of the star is above the value of Chandrasekhar limit it becomes a black star, what is the reason for this and why is certain mass limit required? What is the name of the horizontal division line? What is the name of the horizontal division line? Is there a name for it other than "division line? Implementing a PIVOT query Why is SQL Server consuming more server memory? Is there is any way to prove the Faraday's law of induction? I want to know if there is any way to prove the Faraday's law or is it just an experimental observed phenomena?  More specifically, is there any reason why the proportionality constant is 1? How did Faraday discover it? I also heard that we can prove Faraday's law using the principle of least action, but is that true? Is it possible to get a fully transparent window in Pygame (see the desktop through it)?  I've found how to create a window without a frame, but there doesn't seem to be any obvious way to make it transparent.  I'd be willing to tie into system-specific technology/frameworks as long as there are solutions for both Windows and Mac OS X, but I'm not sure which direction to be looking.  The only topic I was able to find , which isn't something I can do for this particular project (needs to be Pygame). I have several entries in my list of references that include of the order of 40 authors. Is there a way to make bibtex automatically reduce these lists to e.g. the first name + "et al."?  I don't want to edit the BibTeX entries manually and I cannot use biblatex. If at all possible I would also make as little changes as possible to the bibliography style.  There are similar questions, but none of those had a concise answer:       natbib e.g. seems to change only the reference within the text, but not the entry in the bibliography.  EDIT: I am using \bibliographystyle{unsrt} as style definition. How to add Windows to GRUB I have my encrypted Archlinux installed on my SSD. Now I have one HDD with Windows installed. But in my GRUB just Archlinux is shown (no Wonder, because I just installed Windows on the other HDD, GRUB doesn't know of that by now.).  My Question is, how do I properly add my Windows-HDD to GRUB, so that I can choose which to boot when starting?  I am a little bit afraid of destroying my GRUB so I can't boot my encrypted Archlinux anymore.  Thanks! Why can't I capture my first Pokemon? I'm trying to just catch my first Pokemon and I can't for some reason. From what I've read I should be able to see the three basic Pokemon to choose from and catch one but I can't see them.  I can only see three pulsing circles and the app appears to be stuck on map view. I've tried clicking or walking over the circles but nothing happens.   Any suggestion on how to fix this?