I have a custom post type that is created by an external plugin. This plugin uses the capabilities associated with posts. I want to add my own custom capabilities to this post type. I have seen plenty of examples of how to do this when registering a new post type but I can't add the capabilities at this point as otherwise the custom capabilities won't be there when I next update the plugin.  What would be the best way to add the capabilities after the custom post type has been created?  Thanks!
I'm using the plugin  which registers it's own post type but the capability is assigned to "post".   I want to change it to "manage_options".  Is there a correct way without altering the plugin to do that? Calling a hook, a function or whatever?   public function register_post_type() {      $labels = array (         'name'               =&gt; _x( 'Custom Code', 'post type general name' ),         'singular_name'      =&gt; _x( 'Custom Code', 'post type singular name' ),         'menu_name'          =&gt; _x( 'Custom CSS &amp; JS', 'admin menu' ),         'name_admin_bar'     =&gt; _x( 'Custom Code', 'add new on admin bar' ),         'add_new'            =&gt; _x( 'Add Custom Code', 'add new' ),         'add_new_item'       =&gt; __( 'Add Custom Code' ),         'new_item'           =&gt; __( 'New Custom Code' ),         'edit_item'          =&gt; __( 'Edit Custom Code' ),         'view_item'          =&gt; __( 'View Custom Code' ),         'all_items'          =&gt; __( 'All Custom Code' ),         'search_items'       =&gt; __( 'Search Custom Code' ),         'parent_item_colon'  =&gt; __( 'Parent Custom Code:' ),         'not_found'          =&gt; __( 'No Custom Code found.' ),         'not_found_in_trash' =&gt; __( 'No Custom Code found in Trash.' ),     );     $args   = array (         'labels'              =&gt; $labels,         'description'         =&gt; __( 'Custom CSS and JS code' ),         'public'              =&gt; false,         'publicly_queryable'  =&gt; false,         'show_ui'             =&gt; true,         'show_in_menu'        =&gt; true,         'menu_position'       =&gt; 100,         'menu_icon'           =&gt; 'dashicons-plus-alt',         'query_var'           =&gt; false,         'rewrite'             =&gt; array ( 'slug' =&gt; 'custom-css-js' ),         'capability_type'     =&gt; 'post', // &lt;--- I want to manipulate this         'has_archive'         =&gt; true,         'hierarchical'        =&gt; false,         'exclude_from_search' =&gt; true,         'menu_position'       =&gt; null,         'can_export'          =&gt; false,         'supports'            =&gt; array ( 'title' ),     );      register_post_type( 'custom-css-js', $args ); }   The above code is in custom-css-js.php lines 200-239.
"Reality" of EM waves vs. wavefunction of individual photons - why not treat the wave function as equally "Real"? In thinking how to ask this question (somewhat) succinctly, I keep coming back to a Microwave Oven.  A Microwave Oven has a grid of holes over the window specifically designed to be smaller in diameter than the wavelength of the microwaves it produces, yet larger than the wavelengths of the visible light spectrum - this is so you can watch your food being heated without getting an eye full of microwaves.  The "realness" of electromagnetic waves seems indisputable - both from the microwave example above, and also because if I want to broadcast a radio wave with a certain wavelength, then I need to make sure I have an antenna of corresponding length to produce the wave I'm looking for.  Furthermore, we discuss and treat these waves as real, measurable "objects" that exist and can be manipulated.     Now, if I want to describe the behavior of my Microwave Oven in the framework of QM (let's pretend my oven is going to only produce 1 photon of energy corresponding to a wavelength of the microwave spectrum for simplicity) then I'll describe the behavior of that photon as a wavefunction that evolves over time and gives a probability distribution within my microwave that similarly does not allow the photon to pass through the safety grid and exit the oven cavity giving me a retinal burn.  The difference is, the wavefunction is never treated as something "real" in this description.  When the safety grid is described as working to protect you because it has holes smaller than the wavelength of the classical waves it's blocking, this is a useful description that seems to describe "real" objects/be-ables.  While it is possible to describe why an individual photon has low probability of passing through the same grid but extended physical properties such as wavelength (in space) are treated as non-real because we're dealing with a point particle and with behavior described by something we also treat as non-real (the wavefunction); it seems unclear to me why we insist this wave function which predicts behavior of physical measurements so well is somehow "non-real."    Put another way, if we have no problem treating EM waves as "Real," then why do we insist on treating the wavefunction that describes the same behavior as "unreal?"  I understand there is recent research (Eric Cavalcanti and his group for one) trying to argue this point, but as every respectable physics professor, I've ever encountered, has treated the wavefunction as an indisputably non-real mathematical tool, I needed to ask this community for an answer. Problem working fontspec, babel and datetime with cyrillic I have discovered that fontspec with russian babel settings doesn't work with datetime package. I tried to compile such code:  \documentclass[a4paper,11pt]{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[main=russian,english]{babel} \usepackage{datetime} \usepackage[cm-default]{fontspec}  \begin{document} \today \end{document}   with a xelatex and got an error: Command \cyri unavailable in encoding EU1.  Is there any way to handle it?  UPDATE: I really bungle with charset in XeLateX. Thanks to egreg. I have removed fontenc and inputenc and used some cyrillic font, so my MWE now looks this way:  \documentclass[a4paper,11pt]{article} \usepackage[main=russian,english]{babel} \usepackage{fontspec} \setromanfont{PT Sans} \usepackage{datetime}  \begin{document} \today \end{document}   and I've got another error, if I used russian as a main language in babel: Undefined control sequence. \\monthnamerussian ...cyrm \cyra \cyrya \or \cyri  \cyryu \cyrn \cyrya \or \c...  Is it still because of XeLaTeX? Sum of Permutations from 0 to n In a question I asked on algorithms with time complexity of $f(x) = n^n$ I was told that enumerating the number of strings that can be formed from a string of length $n$ qualifies.   I.e the sum of all permutations of $n$ from $n$ to $0$ is $n^n$  $\sum ^n_{i=0} nPi$ $= n^n$  Can I please see an easy to understand derivation of that formula.   EDIT The above identity is wrong. I just tested it. Can I get a derivation of the formula for the sum of permutations. Show that $B$ is diagonalizable if If $AB=BA$ and $A$ has distinct real eigenvalues We were asked to prove the following:  Let $ A $ be an $n \times n$ matrix with $n$ distinct real eigenvalues. If $AB=BA$, show that $B$ is diagonalizable.   It was suggested I show that an eigenvector of $A$ is also an eigenvector of $B$. I am both having trouble doing this and failing to see how I would complete the proof after. Any help would be appreciated.  Thanks I am trying to work out how to get the value of table cell for each row using jQuery.  My table looks like this:  &lt;table id="mytable"&gt;   &lt;tr&gt;     &lt;th&gt;Customer Id&lt;/th&gt;     &lt;th&gt;Result&lt;/th&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td&gt;123&lt;/td&gt;     &lt;td&gt;&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td&gt;456&lt;/td&gt;     &lt;td&gt;&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td&gt;789&lt;/td&gt;     &lt;td&gt;&lt;/td&gt;   &lt;/tr&gt; &lt;/table&gt;   I basically want to loop through the table, and get the value of the Customer Id column for each row.  In the code below I have worked out that I need to do this to get it looping through each row, but I'm not sure how to get the value of the first cell in the row.  $('#mytable tr').each(function() {     var cutomerId =  } Mass Uninstalling Just been working on a new laptop today (Acer) and it was pre-installed with all sorts of crapware. Mostly games and "backup utilities" and McAfee. I had to manually uninstall about 30 apps via Vista's Programs and Features  So it got me wondering is there any way of mass uninstalling or queuing an app to be uninstalled? Through Vista/XP you need to wait for Install Shield or whatever to close before beginning to uninstall the next app. Took way more time than it should have.  Just another one of those Windows annoyances! Any help appreciated as I often need to do this when I come across a slow machine that's just been clogged with a bunch of useless apps How to re-enable tray icons for applications in Ubuntu? $\sum x_n^2$ and $\sum y_n^2$ converge, what does $\sum (x_n + y_n)^2$ do? So I know that $\sum x_n^2$ converges, and $\sum y_n^2$ converges. ${x_n}$ and ${y_n}$ are both sequences of real numbers. How can I prove that $$\sum(x_n+y_n)^2$$ converges? So far I have $$\sum(x_n+y_n)^2=\sum(x_n)^2 +\sum (y_n)^2 +\sum(2x_ny_n)$$ so I need to prove that $\sum 2x_ny_n$ converges. Is this the right way to approach it? If it is, I am completely lost as to the next step.  I also need to prove that $$\sqrt{\sum(x_n+y_n)^2}\leq \sqrt{\sum(x_n)^2}+\sqrt{\sum(y_n)^2}$$  I assume this will follow pretty easily from a result in the first proof, but I'm stuck on that now, and perhaps it is easier to start with the second one. I have a lot of work I've done on the first problem, but none of it seemed to go anywhere. Any hints?  Thanks! Bounded operator that does not attain its norm What is a bounded operator on a Hilbert space that does not attain its norm? An example in $L^2$ or $l^2$ would be preferred.  All of the simple examples I have looked at (the identity operator, the shift operator) attain their respective norms. Here is some information we got : We know the value of $n$, with size $1043$. We know the value of $p$ (size $20$) and $q$ (size $1023$) as the factors. $e = 65537.$ $\varphi(n)$ = $(q-1)(p-1)$ When I calculated $\gcd$ and $\text{modinv}$, I got : $\gcd(e,\varphi(n)) = 65537$ $modinv(e,\varphi(n)) = 1 $ So we can tell that they are not relatively prime. So, how to compute the d, and get the value of m? I'm not that good with math, so I cant understanding well the theory. so can anyone please make an example implementation or write a clear formula? The set of integers $n$ expressible as $n=x^2+xy+y^2$ Let $S$ be the set of integers $n$, such there exist integers $x,y$ with $$n=x^2+xy+y^2$$   Is the implication $$a,b\in S\implies ab\in S$$ true? If yes, how can I prove it?  I worked out $$n\in S\iff 4n\in S$$ and $$n\in S\iff 3n\in S$$ I tried two approaches. The first is to express $$(a^2+ab+b^2)(c^2+cd+d^2)$$ in the form $$f^2+fg+g^2$$ with polynomials $f,g$ with integer coefficients. I however could not find suitable $f$ and $g$. The second approach is based on $$x^2+xy+y^2=\frac{(2x+y)^2+3y^2}{4}$$ If we have $n=x^2+xy+y^2$ , we have $u^2+3v^2=4n$ for some integers $u,v$ with equal parity. The main problem of this approach is to consider the equal parity. Any ideas ? How to implement custom icons for my script/addon? Is it possible to use different icons other than the default set and how? Wouldn't the use of WayneTech by Bane fully expose Bruce Wayne's identity as Batman? Fantasy novel with amnesiac witch, impotent soldier and cursed animals The story is set in a vaguely medieval world in which a young woman has been cursed by the evil witch who has enslaved her and caused her to lose her memory. With the aid of her talking animal friends who have also been cursed (toad has a huge stone under his tongue meaning he can't feed and a crow with a gem embedded in its wing and there's a little grey kitten too who never grows up) she sets out on a journey to break the curse for herself and her friends. Along the way she meets an injured unicorn and a horny-but-moral soldier rendered impotent by a curse after refusing the disguised witch's sexual advances.  After adventures there's a 'happy ever after' for all of the heroes and the witch meets a sticky end.    In the UK the book had a deep red cover with an illustration. I read it in either the 1990's or the early 2000's. Cracking book, definitely for adults given some of the situations, language and humour. From this , I now understand the gradient to be the directional derivative that returns the steepest slope at a point. However, reading my textbooks, they all say that the gradient is normal to the tangent plane. In the above SE question, the gradient sounds like it should be parallel to a direction in the $xy$ plane, not actually up on the surface.   My question is therefore do I have a misunderstanding of the tangent plane, gradient or directional derivative?   In addition, I question how the gradient always passes through the origin or the $xy$ plane? If for instance in the graphic, the gradient had been another direction (say horizontal), then it wouldn't pass through the origin! In addition, the gradient of other points in the graphic would satisfy this example. Many thanks! Impact of denied entry to Croatia on trying to enter a Schengen country with a valid visa sed fails to remove newline character I know in TNG that all computer interfaces are now touch-screen, and that got me thinking: when was the first reference to touch-screen computer interfaces in Sci-Fi made? Where do I put item tags on items inside a chest or your inventory? What does it do exactly if I click in the window of cmd? Suppose I run cmd.exe and ping localhost. After that I ping localhost again but I click into the window and the ping stops until I press enter.  What happens exactly when I click into the window? Does it suspend the process or something else? I attached a screenshot to clarify this issue.  Note: I do not actually click but drag using the mouse which creates a white box in the window as you can see on the screenshot.  Edit: further clarification: What I really wish to know is whether dragging the window halts the cmd process or not?  Edit: even more clarification: I know that I'm using Quick Edit and pressing enter copies the contents I selected. What I do not know is what happens in the background.