OutputStream to InputputStream
Easy way to write contents of a Java InputStream to an OutputStream
Is 3+1 spacetime as privileged as is claimed? I've often heard the argument that having 3 spatial dimensions is very special. Such arguments are invariably based on certain assumptions that do not appear to be justifiable at all, at least to me. There is a  on Wikipedia.  For example, a common argument for why >3 dimensions is too many is that the gravitational law cannot result in stable orbital motion. A common argument for &lt;3 dimensions being too few is that one cannot have a gastrointestinal tract, or more generally, a hole that doesn't split an organism into two.  Am I being overly skeptical in thinking that while the force of gravity may not be able to hold objects in stable orbits, there most certainly exist sets of physical laws in higher dimensions which result in formation of stable structures at all scales? It may be utterly different to our universe, but who said a 4D universe must be the same as ours with one extra dimension?  Similarly, isn't it very easy to conceive of a 2D universe in which organisms can feed despite not having any holes, or not falling apart despite having them? For example, being held together by attractive forces, or allowing certain fundamental objects of a universe to interpenetrate, and thus enter a region of the body in which they become utilized. Or, conceive of a universe so incomprehensibly different to ours that feeding is unnecessary, and self-aware structures form through completely different processes.  While I realise that this is sort of a metaphysical question, is 3+1 dimensions really widely acknowledged to be particularly privileged by respected physicists? Trying to open a http website on any web browser (event telnet) gives a ‘ERR_CONNECTION_REFUSED’ or ‘connection timed out’.  However, the same sites can be opened using https. I tried doing a traceroute and it works fine.  I am new to OS X but have experience with Linux. How do I go about troubleshooting this issue?  Update  I think I've tracked down the culprit to a rule in pf (firewall).  The result of sudo pfctl -s nat is:  No ALTQ support in kernel ALTQ related functions disabled rdr pass inet proto tcp from 192.168.0.101 to any port = 80 -&gt; 127.0.0.1 port 9882   192.168.0.101 is the current ip address of the computer.  I tried to remove the rule with sudo pfctl -F all, but it is back after a few seconds. I didn't find the rule in the default configurations (/etc/pf.conf). And disabling pf with sudo pfctl -d has no effect on it.  Is this a malware issue? How can I Remove .DS_Store files from a Git repository? I have a shape (rounded rectangle) in PowerPoint 2007 of which I would like to increase the vertical size only (to illustrate de-bottlenecking). So, the width will stay the same but the height will grow (both from the top and bottom, so the centre will remain in the same location).  Custom Animation -> Emphasis only appears to change the whole shape.  Is it possible to increase only the vertical size (stretch the shape)?  This is during animation of the shape. Disclaimer Yes, I am fully aware that what I am asking about is totally stupid and that anyone who would wish to try such a thing in production code should be fired and/or shot.  I'm mainly looking to see if can be done. Now that that's out of the way, is there any way to access private class members in C++ from outside the class?  For example, is there any way to do this with pointer offsets? (Naive and otherwise non-production-ready techniques welcome) Update As noted in the comments, I asked this question because I wanted to write a blog post on over-encapsulation (and how it affects TDD).  I wanted to see if there was a way to say &quot;using private variables isn't a 100% reliable way to enforce encapsulation, even in C++.&quot;  At the end, I decided to focus more on how to solve the problem rather than why it's a problem, so I didn't feature some of the stuff brought up here as prominently as I had planned, but I still left a link. At any rate, if anyone's interested in how it came out, here it is:   (I suggest reading it before you decide that I'm crazy). Help with a proof. Countable sets. When did our universe and the Star Trek universe diverge? Note that my question assumes as a given that Star Trek is in an alternate universe which diverged from ours at some point in history.  That seems really, really obvious and undeniable to me.  So the question then becomes: at what point in time did the two universes diverge and have different histories? If $A\subseteq\mathbb N$ and $\sum\limits_{a\in A}\frac1a$ converges then $A$ has natural density $0$ In this  to a question about a series, a theorem was stated:     If $A= \{a_i \}$ is a set such that $\sum_{i = 1}^{\infty} \frac{1}{a_i}$ converges, then $d(A) = 0$, where $d(A)$ is the  of the set.   My background in number theory is basically zero and all my attempts to prove this have been utterly unseccessful; would anyone please help me, or at least provide me with a hint to prove it? Elsarticle - Abstract two columns wide I am currently trying to create an article in elsarticle style, twocolumn. The title and text end up in two columns, the abstract however is made two columns wide. Any ideas what I am doing wrong? Obviously I want my abstract to also be only in the first column.  \documentclass[a4paper,10pt,twocolumn,preprint]{elsarticle}  \usepackage{lipsum}  \journal{TexExchange}   \begin{document}     \begin{frontmatter}       \title{Two-column abstract}       \begin{abstract}         \lipsum[1]      \end{abstract}       \begin{keyword}        abstract      \end{keyword}    \end{frontmatter}   \section{Outline}    \lipsum[2-3]  \end{document} Is there a list of error codes for Minecraft? Similar to  on the bugs in Minecraft, I would like a complete list of what error codes exist in Minecraft and how they occur, as well as how they can be resolved. Find and replace text within a file using commands How can I find and replace specific words in a text file using command line? I use multiple displays, and the available options for Spaces that I am aware of allow surprise Space-switching, even when working in a completely different space.  Ideally, interacting with the Dock will only affect the same Space on the same display on which I used the Dock. This means:   If app clicked in Dock, and no copy of app is running on any space, then start the app and confine it to the current Space. If app clicked in Dock, and the program is already running in another Space, then either 1) open a new window if the program allows this, or 2) silently move the app to the current Space without disturbing or changing any other Space or display. If app clicked in Dock, and the program is already running in the current Space, then change focus to the app.   Specifically: - Clicking an icon in the Dock should rarely affect any other Space. - Clicking an icon in the Dock must never affect which Space is displayed on which display  OS X Yosemite 10.10.2, MacBook Pro 2012. (Dock set to auto-hide, and pops up at the bottom of any screen when I put the mouse there.) How can I repair grub? (How to get Ubuntu back after installing Windows?) It is possible to press ⎇ Backspace on macOS in order to delete the previous word (left of the cursor), and ⌘ Backspace to delete the previous line (left of the cursor). If you have an external keyboard with a "delete" key (or the "forward delete key"), or are able to emulate the delete key via software, it is possible to press ⎇ Delete to delete the word to the right of the cursor. However, perhaps surprisingly, it is not possible to press ⌘ Delete in order to delete the line to the right of the cursor.  Now, I have only been able to make this possible by emulating a ⌘⇧→ and then a Backspace with BetterTouchTool. However, I want to avoid doing something like this because BTT does not work at a "low enough level" for me – that is to say, the action is not entirely reliable.  Is there any official macOS way to delete the line to the right of the cursor? For every $c\in [0;2]$ determine whether the sequence $\{a_n\}_{n\geq 1}$ which is defined as follows:  $a_1=c$, $a_{n+1}=1+\frac{(a_n-1)^2}{17}$ for $n\geq 1$  is monotonic for sufficiently large $n$, and determine whether its limit exits and if it exists, give its value.  I have no idea what to do with this problem. I was able to see that $a_{n+1}-a_n$ is a quadratic function and I also found ot that limit, if exists, is equal to either $1$ or $18$ (that's beacause if $a_n$ id convergent to $g$ then every subsequence is also convergent to $g$). So how to determine the limit for every $c\in [0;2]$? Finder search doesn't work properly after Yosemite update Ever since I upgraded to Yosemite, search no longer works properly in Finder. Spotlight works fine but Finder search just gives me a blank window with a spinning ball.  I've tried reindexing and I've also tried deleting Spotlight's .plist file. I restart my MacBook Pro after doing either. Finder search will work for one or two queries and stop again. I don't know what else I can do. Pivot rows into multiple columns Probability of the union of $3$ events? I need some clarification for why the probability of the union of three events is equal to the right side in the following:  $$P(E\cup F\cup G)=P(E)+P(F)+P(G)-P(E\cap F)-P(E\cap G)-P(F\cap G)+P(E\cap F\cap G)$$  What I don't understand is, why is the last term(intersection of all) added back just once, when it was subtracted three times as it appears from a Venn Diagram?  Here on page 3, this is explained but not in enough details that I can understand it: There are n letters addressed to n eople at different addresses. The n addresses are typed on n envelopes.  A disgruntled secretary shuffles the letters and puts them in the envelopes in random order, one letter per envelope.  Find the probability that at least one letter is put in a correctly addressed envelope. [Hint: use the inclusion-exclusion formula.] What is the probability approximately, for large n ?    My attempt at a solution:  P(all correct) = $\frac{1}{n!}$  P(n-1 correct) = ${n \choose n-1} \frac{1}{n!} = \frac{1}{1!(n-1)!}$  ${n \choose n-1}$ ways of selecting n-1 correct letters.  P(n-2 correct) = ${n \choose n-2} \frac{1}{n!} = \frac{1}{2!(n-2)!}$  ...  P(n-n correct) = ${n \choose n-n} \frac{1}{n!} = \frac{1}{n!(n-n)!} = \frac{1}{n!}$  This all looks ok to me, but I tested this for a case of 4 people, (I think the theoretical value should be $\frac{9}{24}$ but obviously that is not what I got. Can someone correct my logic please? Also, with regards to the hint about inclusion/exclusion - where would that come in?  I read about derangements on Wikipedia but it did not make total sense to me (the derivation).  I would appreciate any advice whatsoever including references to other material. Activate Field Service Lightning feature in a Salesforce DX scratch org? I am struggling to figure out how to -- or if it's even possible to -- create a DX scratch org with the "Field Service Lightning" (FSL) feature installed. Based on the feature list  I'm guessing the answer is no and I'll just have to wait. But I'm not sure I'm interpreting that source correctly or missing something entirely since I'm just wrapping my head around DX.   Background: we have a production org with FSL installed and active, along with it's accompanying managed packages. I can create sandboxes from it and do development using standard Metadata API tools, but I was hoping to start a new project using DX. But I'm stuck configuring a scratch org with the proper features.