iPhone constantly dropping connection via USB to my MacBook Pro I have a MB Pro Mid 2015 (15'') and an iPhone SE 128GB and every now and then when I connect the phone to the laptop it drops the connection after few seconds, then connects again, drops etc... Resetting USB ports or NVRAm seems to do the trick for a while, but it is only a matter of time, before the same thing happens again. Is there any permanent solution to this, or should I just live with it?  I am not completely sure if it the problem is mac or iPhone related. All other peripherals connect without problems (although sometimes a standard usb for example is not recognised right away, so I have to unplug it and plug it back in to work).  Thank you in advance for your help,  cheers
iPhone 6s with iOS 12.4 not connecting to MacBook Pro mid2015 with macOS 10.14.6 I am using an iPhone 6s with iOS 12.4 and a MacBook Pro mid2015 with macOS 10.14.6. Since recently (I am not exactly sure when it started), I cannot charge the phone with my computer anymore. As soon as I plug the phone in, it will play the charging sound repeatedly. The right-hand side port sometimes works, the lefthand side port never works. When I connect my old iPhone 5 (using the same cable), it charges without any issues. My iPad mini 4 shows the same issue.  Sometimes the "Do you trust this computer" setting flashes on the phone and disappears before I can click anything.   How can I fix this?  Update 1  Sometimes I get the Software Update dialogue in macOS. After approx. 2 minutes it shows the following:     Update 2  For some reason the issue disappeared for a while but is back now. Disabling "Settings" > "Touch ID &amp; Passcode" > "USB Accessoires" seems like it makes the problem a bit less bad, but not go away.  Update 3  This is driving me crazy. I upgraded to Mojave 10.14.3 mostly to get rid of the issue. It persists. Some more random information: Before logging in (Filevault pre-boot authentication), the phone will charge fine. Only when a user account is loaded, the issue appears. The likelihood of a successful connection increases with the battery state of the iPhone. Workaround 2 in my answer below suggest that this a "Trust issue" from the iPhone's side. I suppose the solution will have to be hidden somewhere there...    What I tried so far (will update):   Reset Privacy settings on iPhone Different (original, almost new Apple) lightning cables   Remove and add "iPhone USB" in Network Settings  SMC reset (), PRAM reset Upgrade to latest iOS 12.4 and MacOS 10.14.6
Script for modifying file content in specified files I tried searching previous questions but none worked, or I couldn't adapt them to my needs.  I want to write a script that asks for:   folder criteria old string new string   And replace every file in the specified folder and subfolders (and force user to type one) with specific criteria (for example, it must be a ".cue" file), and:   If the file is read-only, disable it. Search for specified old string in the file content and replace it with new string , and save changes in same file. If the file was read-only, enable it again.   I have this code so far, but I don't know what to do in the do part:  @echo off   setLocal enableDELAYedexpansion  :START set "var2=" set /P var2="type folder "  if "%var2%"=="" goto ERROR  set /p old="old string ? " set /p new="new string ? " set /p files="what criteria ? " echo modifying files...  for /r "%var2%" %%v in (%%files) do (  ???  ) pause  goto START  :ERROR echo type something!! goto START What are some typical LuaTeX gotchas? Override a method via ObjC Category and call the default implementation? Light "diode" and 2nd law of thermodynamics If I had a light "diode" - an object that only allowed light (at least for a range of frequencies) to travel through it in one direction, would this necessarily allow violations of the 2nd Law of Thermodynamics?  Or would it be possible to restrict other properties of the device such that it could be okay.  Why I think it should violate 2nd law:   I can place such devices at temperature T in a bath of thermal radiation at temperature T, such that it forms a box which only lets the light in or out.  This would appear to always allow one to create a thermal gradient.  Once a thermal gradient is formed, useful energy can be extracted.  This seems to allow useful energy to always be extracted from a thermal bath and thus give perpetual motion. Release one such device at temperature T in a bath of thermal radiation at temperature T.  Since the photons are absorbed or reflected in one direction, and undisturbed in the other, the device will start moving.  It can use a thermal bath to directly generate useful motion.   Why I think I'm missing something and such a device could potentially co-exist with the 2nd Law:   The above arguments seem valid if the diode was only 'partially' rectifying as well.  However there exist sunglasses which largely reflect on one side, but not from the other side. Researchers have succeeded in using meta-materials to create a "blackhole" for microwaves.   Can anyone help sort this out? This question is in response to . The original post mentioned that they wish to retract their paper from a "fake" journal. I don't know what a fake journal is but better safe than sorry so I want to make sure what defines a fake journal. In the comments, other people also mentioned "shady" journals and "predatory" journals. This is the first time I encounter these descriptions so I would like to know more about what they entail. I would be interested in hearing about your experience with such journals as well, if any. We know that $2^4 = 4^2$ and $(-2)^{-4} = (-4)^{-2}$. Is there another pair of integers $x, y$ ($x\neq y$) which satisfies the equality $x^y = y^x$? reversing plot axis for Plot, LogPlot, LogLogPlot Is it possible to access a static resource of a managed package in your local environment?  Thanks Number of non-isomorphic groups of order 21 Proving $\frac{\sin x}{x} =\left(1-\frac{x^2}{\pi^2}\right)\left(1-\frac{x^2}{2^2\pi^2}\right) \left(1-\frac{x^2}{3^2\pi^2}\right)\cdots$ How to prove the following product? $$\frac{\sin(x)}{x}= \left(1+\frac{x}{\pi}\right) \left(1-\frac{x}{\pi}\right) \left(1+\frac{x}{2\pi}\right) \left(1-\frac{x}{2\pi}\right) \left(1+\frac{x}{3\pi}\right) \left(1-\frac{x}{3\pi}\right)\cdots$$ How to find image coordinates of the rendered vertex? I have a simple mesh of a cube.  I would like to know what are the coordinates of each vertex in the rendered image (i.e. for each 3d vertex I'd like to know it's pixel coordinates).  Is there a way to do this?  Clarification:  I'm experimenting with a pose estimation algorithm (i.e. finding out the 3d pose of the object) from a (set of) 2d image(s).  Instead of taking an image of a real object with a real camera I synthetically render the image of a cube using blender.  In this way I know the pose of the object and the intrinsics of the camera, so I can easily validate the results of the pose estimation algorithm. Pose estimation algorithms usually require to provide them with world points on the object and the corresponding image points.  So what I'm looking for is a way to produce a dump of correspondences of the 3d point &lt;--> image point as a byproduct of the rendering procedure. Thanks, Alex How to prove $x^a-1\mid x^b-1 \iff a \mid b$, where $x \ge 2$ and $a,b,x \in \Bbb Z$.  I've tried the following in attempting to solve this:  $$a\mid b \Rightarrow aq=b \Rightarrow x^{aq}=x^b \Rightarrow x^ax^q=x^b$$  Because $x^q \in \Bbb Z$, it follows that $x^a\mid x^b$.  This is as far as I have gotten; any help getting further is appreciated.  Note: It may be that this identity is not true at all? The Earth is spinning, so why don't we jump and land on a different location? I know there are similar questions on StackExchange but I think it is different and detailed.  The earth is spinning 465 meters/second so why don't we jump and land on a different location?  I googled about this question and I got some answers:   When we jump, we (and the atmosphere itself) also spin along with the earth so we don't land at a different location. (But why we are also spinning along with earth ?) The earth is so big and we are very small relative to earth so the tiny jump won't make any difference.   But according to answer 1, We are also spinning with the earth. But the question is, "why are we also spinning along with earth" ??  Regarding the answer 2, it won't make any difference but logically it doesn't make sense or I just don't understand it.  Here is the followup question,   "When we jump why don't we thrown out of earth due to centrifugal force of the spinning earth ??"  Please provide some detailed answer to these questions. With logic if possible.   This phenomenon is not possible I know, but even if it exists, then traveling will be so easy, we just have to hang on space (with help of helicopter etc.. ) and we can travel the whole world in 24 hours :D Outline around text on CMYK black background in Photoshop I'm trying to make a document with one color black  (c:0,m:0,y:0,k:100) background with red text on it. However in CMYK the text has this weird grey white-ish edge. In RGB it doesn't show but in CMYK it shows. I'm wondering will this show when printing or do I need to use different methods? ie. using rich black etc.  Here's the RGB and CMYK comparison "error: XDG_RUNTIME_DIR not set in the environment." when attempting to run nautilus as root I am attempting to run nautilus as root but when I run "sudo nautilus" from the terminal, I get the following error:     error: XDG_RUNTIME_DIR not set in the environment.      (nautilus:9341): Gtk-WARNING **: cannot open display:   The issue does not occur when I attempt to run nautilus as non-root. I am using ubuntu 14.04. Does anyone know how I can fix this? Counting integer partitions of n into exactly k distinct parts size at most M How can I find the number of partitions of $n$ into exactly $k$ distinct parts, where each part is at most $M$?  The number of partitions $p_k(\leq M,n)$ of $n$ into at most $k$ parts, each of size at most $M$, is given by the generating function: $$  \binom{M+k}{k}_{x} = \prod_{j=1}^{k}\frac{1-x^{M+k-j+1}}{1-x^j}= \sum_{n=0}^{kM} p_{k}(\leq M,n) x^n $$  For the number of the partitions $p_k(\mathcal{D},n)$ of $n$ into at most $k$ parts there is the recurrence relationship: $$   p_{k}(\mathcal{D},n) = p_{k}(\mathcal{D},n-k) + p_{k-1}(\mathcal{D},n) $$  But what, if I want to count only the partitions with distinct parts and restricted number of parts and restricted part size?  Update: Now I know the generating function for the number of distinct restricted partitions $p_k(\leq M, \mathcal{D},n)$ of $n$ into exactly $k$ distinct parts, all at most $M$ is $$    \prod_{j=1}^{M} (1+xq^{j}) = \sum_{k,n=0}^{\infty}p_k(\leq M, \mathcal{D},n)x^{k}q^{n} $$ and there is also a recurrence relation $$    p_k(\leq M, \mathcal{D},n) =         p_{k-1}(\leq M-1, \mathcal{D},n-k) +         p_k(\leq M-1, \mathcal{D},n-k) $$ How can I prove this? Could you recommend a book, where I could read about this? I have a bibliography in which a particular author wrote two papers in the same year. Bibtex is sorting them alphabetically by title, but I want them listed chronologically. (So in the example below 'universal grammar' should precede 'English as a formal language'.) What's the appropriate way to flip the order?  MWE:  \documentclass{article} \usepackage{natbib} \begin{document}  ... formal semantics in the  Montagovian tradition \citep{montague1970aug,montague1970befl,montague1973ptq}.   \bibliographystyle{harvard} \bibliography{test} \end{document}   This generates the text 'formal semantics in the Montagovian tradition (Montague, 1970b,a, 1973)' whereas I actually want '1970a,b,1973'.  test.bib file for MWE:  @incollection{montague1973ptq,   title={The proper treatment of quantification in ordinary {English}},   author={Montague, Richard},   booktitle={Approaches to natural language},   editor={Hintikka, K. Jaakko J. and Moravcsik, Julius M.E. and Suppes, Patrick},   pages={221--242},   year={1973},   publisher={Dordrecht} }  @article{montague1970aug,   title={Universal grammar},   author={Montague, Richard},   journal={Theoria},   volume={36},   number={3},   pages={373--398},   year={1970},   publisher={Blackwell Synergy} }  @incollection{montague1970befl,   title={English as a formal language},   author={Montague, Richard},   booktitle={Linguaggi nella Societa e nella Tecnica},   editor={Visentini, Bruno and others},   publisher={Edizioni di Comunità},   pages={189--224},   year={1970} } change environment of a running process How might it be possible to alter some variable in the env of an already running process, for example through /proc/PID/environ? That "file" is read-only.  Need to change or unset the DISPLAY variable of a long-running batch job without killing it. Why are there holes in the icing? How to use mysql JOIN without ON condition?