I was trying to reverse the order of an array and print it. I did this by moving each element into an ArrayList using a for loop decremented from the (array.length-1). Then I tried to use the 'arrayList.toArray(array)'method. I know it returns 'object [ ]' so i changed my 'int [ ]' to 'Integer [ ]' and it worked.   My question is what is the difference between an array 'Integer []' and 'int [ ]'  public static void main(String[] args) {     //here i changed int [] to Integer []     Integer[] arr ={ 4,3,5,7,8,2,9,1};     System.out.println("array list \t :"+ Arrays.toString(arr)+"\n");     System.out.println(" pos 1:   " + arr[1]);     System.out.println("pos last: " + arr[arr.length-1]);     System.out.println("*********************************");     swapElements(arr);     System.out.println("array list after  :"+ Arrays.toString(arr)+"\n");     System.out.println("pos 1 after swap is:\t" + arr[1]);     System.out.println("pos last after swap is: " + arr[arr.length-1]);  } public static void  swapElements(Integer []array) {      ArrayList&lt;Integer&gt; array2 = new ArrayList&lt;Integer&gt;();     for(int i =array.length -1;i&gt;=0; i--)     {          array2.add(array[i]);      }     array2.toArray(array); }
I was reading  when I came across  saying something about a particular type of programmer knowing the difference between an int and an Integer in Java/C# (Object-Oriented Programming Languages).  So, what is the difference?
If $d(x,y)$ is a metric, then $\frac{d(x,y)}{1 + d(x,y)}$ is also a metric Let $(X,d)$ be a metric space and for $x,y \in X$ define $$d_b(x,y) = \dfrac{d(x,y)}{1 + d(x,y)}$$ a) show that $d_b$ is a metric on $X$  Hint: consider the derivative of $f(t)$ = $\dfrac{t}{1+t}$  b) show that $ d$ and $ d_b $ are equivalent metrics. c) let $(X,d) $ be $(\mathbb{R}, |\cdot|)$ Show that there exists no $ M&gt;0$ such that $ |x-y| $ $\leq$ $Md_b$ $(x,y)$ for all $ x,y$ $\in$ $\mathbb{R}$  I have calculated $f(t)$ and $f'(t)$ and from this I know $f(t)$ is an increasing function as $f'(t)$ is strictly positive. But I don't know where to go from here or how to do parts b) and c) How to set custom keyboard shortcuts from terminal? Rep graph overview thing™ is white (only in latest Chrome) As you can see, if you go to the reputation graph on your profile on Stack Overflow, the bars in the bottom overview will be white. This makes them invisible unless they are selected.  Eeek!  This does not happen on meta or any other site. Also, I cannot seem to reproduce it on others' profile. Possibly a bug only on your own profile? EDIT: I think I've existed for too long. If I change the CSS on one of the bars to stroke: none, then it becomes green. I think the outline is covering the fill because the bars are too skinny. EDIT2: Confirmed hypothesis by reproducing on Jon Skeet's graph. Proposed solution: enforce minimum bar width and add horizontal scrollbar. EDIT3: Can only repro on Chrome 29.0.1547.57 (Official Build 217859) m (the latest version). Norepro on older versions of Chrome, IE9 (winces), all versions of FF, and all versions of Safari. EDIT4: Can be fixed simply by running the JavaScript $('rect').css('stroke-width', '0') or a userstyle rect { stroke: none }. I may make a user[style|script] to fix this. Why is Euler's Totient function always even? How can I draw a horizontal line spanning only some of the table cells? In a table, how can I draw a horizontal line that goes only through some of the cells? I mean a line like the one in the Foo and in the Bar area of this table:  +----+-----+ |Foo |1 |2 | |    |1 |2 | |    +--+--+ |    |1 |2 | |    |1 |2 | +----+-----+ |Bar |1 |2 | |    |1 |2 | |    +--+--+ |    |1 |2 | |    |1 |2 | +----+--+--+ How to find the reduced density matrix of a four-qubit system? I have the state vector $|p\rangle$ made up of 4 qubits. Say system A is made up of the first and second qubits while system B is made up of qubits 3 and 4. I want to find the reduced density matrix of system A.   I know I could separately extract qubits 1,2 and 3,4 into their own state vectors then find their density matrices and compute the reduced density matrix for system A.  I want to figure out how to do this without having to extract and separate the systems. First I would find the density matrix of $|p\rangle$ and then do a partial trace with respect to system B. I am not sure how to do the partial trace of system B since the system contains 2 qubits.  Can anyone help me figure this out? I am using Python and NumPy for reference. This is a homework question. But I am completely stuck.  My only intuition was to go about it inductively from a "greedy algorithm" maybe know as the deletion-contraction algorithm. And to somehow use the information about the jth cycle to solve the j+1th. But I'm not sure how I'd do it. Thank you very much for looking this over. How do I tell if ACR will work with my camera and how do I get the correct version for Photoshop? I am a beginner photographer with a Canon 7d and MacBook Pro. I'm not sure if Adobe camera Raw is compatible with either and really need advice on how to go about downloading the correct version. jQuery - Is it okay to use $('#ElementId') everytime? Tentative definitions in C and linking Is there an official rule that the minimum damage can't be negative? Solving trigonometric equations of the form $a\sin x + b\cos x = c$ Suppose that there is a trigonometric equation of the form $a\sin x + b\cos x = c$, where $a,b,c$ are real and $0 &lt; x &lt; 2\pi$. An example equation would go the following: $\sqrt{3}\sin x + \cos x = 2$ where $0&lt;x&lt;2\pi$.  How do you solve this equation without using the method that moves $b\cos x$ to the right side and squaring left and right sides of the equation?  And how does solving $\sqrt{3}\sin x + \cos x = 2$ equal to solving $\sin (x+ \frac{\pi}{6}) = 1$ Insert a paragraph into a list that uses the whole text width How to show $\lim_{x \to 1} \frac{x + x^2 + \dots + x^n - n}{x - 1} = \frac{n(n + 1)}{2}$? I am able to evaluate the limit $$\lim_{x \to 1} \frac{x + x^2 + \dots + x^n - n}{x - 1} = \frac{n(n + 1)}{2}$$ for a given $n$ using l'Hôspital's (Bernoulli's) rule.  The problem is I don't quite like the solution, as it depends on such a heavy weaponry. A limit this simple, should easily be evaluable using some clever idea. Here is a list of what I tried:   Substitute $y = x - 1$. This leads nowhere, I think. Find the Taylor polynomial. Makes no sense, it is a polynomial. Divide by major term. Dividing by $x$ got me nowhere. Find the value $f(x)$ at $x = 1$ directly. I cannot as the function is not defined at $x = 1$. Simplify the expression. I do not see how I could. Using l'Hôspital's (Bernoulli's) rule. Works, but I do not quite like it.   If somebody sees a simple way, please do let me know.    Added later: The approach proposed by Sami Ben Romdhane is universal as asmeurer pointed out. Examples of another limits that can be easily solved this way:   $\lim_{x \to 0} \frac{\sqrt[m]{1 + ax} - \sqrt[n]{1 + bx}}{x}$ where $m, n \in \mathbb{N}$ and $a, b \in \mathbb{R}$ are given, or $\lim_{x \to 0} \frac{\arctan(1 + x) - \arctan(1 - x)}{x}$.   It sems that all limits in the form $\lim_{x \to a} \frac{f(x)}{x - a}$ where $a \in \mathbb{R}$, $f(a) = 0$ and for which $\exists f'(a)$, can be evaluated this way, which is as fast as finding $f'$ and calculating $f'(a)$.  This adds a very useful tool into my calculus toolbox: Some limits can be evaluated easily using derivatives if one looks for $f(a) = 0$, without the l'Hôspital's rule. I have not seen this in widespread use; I propose we call this Sami's rule :). Each time I open any application, it zooms to fill-up the entire desktop and so I am always forced to use "Unmaximize" using Alt+Space menu. I have just discovered that my local bank, Nordea, has decided to remove the only good thing about their entire operation: the so-called "simplified login" feature on their website, which allows (soon allowed) the customer to log in to a kind of very limited "read-only" mode which basically just allowed you to see your current balance, the last few transactions (limited descriptions) and see whether or not there are any new "customer support messages", but not read those messages, not make any kind of payments, edit accounts, etc.  Now, they will only allow "full" logins, which 100% prevents any kind of automation and requires you to sit with a hardware device and enter numbers into it and then into the webpage before it allows you to see as much as your account balance. Other than being very obnoxious for every customer, it also blocks me and other "advanced" users out from our custom-programmed bots which have always regularly logged in with that "simplified" login method just to regexp out the current balance/new messages and then notify us via whatever mechanism we use privately.  I have previously asked them if they have any kind of JSON/RSS API of any kind, but no. They don't even have as much as e-mail notifications! Nothing except their spyware "smartphone app" which I would never install, nor would I ever allow such a surveillance device to track me 24/7 in the first place. Only by being a registered corporation with special, way more costly account types do you get any kind of "API" access from them, even to do this most basic imaginable task.  Before you tell me to switch banks, the others are at least just as bad (even worse from what I can tell, and for a longer time), and the act of switching banks is practically impossible for me personally.  What I'm asking is if maybe somebody knows of some sort of "hidden standard" or something which all banks in the world support, but don't have documented, for people like me to automate basic things such as knowing my account balance. Needless to say, I have looked for this countless times on their website, asked them about it, and asked other people about it. Nobody seems to know anything, or, if they do, won't tell me.  I know that there are a bunch of "Nordea-supporting" PHP libraries and whatnot on Github, but they are all ancient and even if they were up to date, they were most likely using the same method as I have been using: automating the login process through their "simplified login" mechanism, which is "soon" to be gone. (Probably at new year; they didn't even mention any dates or time frames.)  And yes, I have a Bitcoin wallet and have that fully automated. The problem is that virtually nobody else in the world cares about my Bitcoin, so "switching to Bitcoin" remains a pipe dream which I would be ready to do, but the world clearly isn't. How can I achieve more clarity in my photos of the moon? I took this photo of the blood moon this morning and I am finding many of my photos, especially landscape photos, have a significant lack of clarity. I'm not looking for a photo critique because I know this particular photo is crap. I'm looking to identify my source of failure to nail a significantly clear photo.     Setup  Canon EOS 70D with a 100-300 telephoto lens (I'm sorry I don't know the exact model. It's from Canon but not one of their professional quality lenses.)   Aperture: f/5.6 Shutter: 1 sec. ISO: 1000 Focal Length: 300mm Metering mode: Spot White Balance: I manually set the WB to 5500 kelvin, it looked fine in live view. Focus Mode: Manual Drive: 2 sec timer delay   Mounted on a decently stable tripod  Process  I turn on live view, and square up the target in the display. I then set my focal length, focus in using live view, adjust the focus as sharp as possible and take the pic. I've noticed that in this case, the picture was incredibly grainy, which doesn't translate to the final photo, but wonder if it has anything to do with it.  This particular shoot I found it difficult to balance out the variables with a dark sky and a moving moon that starts blurring after 1-2 seconds of exposure, which is why I had the aperture wide open and the ISO cranked up.  I can't tell where I'm failing:  Equipment:  The 70d takes great photos but the telephoto is not great when it's totally zoomed in. My wallet doesn't hold enough cash for a motorized mount to track objects in the sky.  Circumstance: I've seen great photos of the moon with the use of a camera and a tripod, so I know this is possible. Although, I keep seeing pictures of this big gorgeous moon over the landscape, and when I use my wide-angle, the moon shows up as a dot. What the hell are people doing to get the moon so big?  Beginner skill level: I know this is the biggest culprit, but being the beginner, I'm unable to know where to adjust. Why do objects move when you apply a force that's equal in magnitude to the friction? If the friction on an object is 200 N and you apply 200 N, it seems, the forces should immediately cancel each other out since the friction and your applied force go in opposite directions, leaving you with an object that is motionless. Yet, from what I've read, that's not the case. I feel like I'm misunderstanding something. Could it be I'm wrong about needing to apply 200 N initially? Might the amount of force I actually need be greater, but instantaneously decrease to 200 N? Intel HD Graphics 620: Does my display adapter support HDMI 2.0 necessary for a 4k display? I want to connect my laptop (Inspiron 15 5000 Series) to a 4k display. When I read online about this it seems that HDMI 2.0 is a necessaity to handle the large resolutions / refresh rates involved to get full benefits of a 4k display.  Use case: I'm not going to use this to play games. Most of my use-case is editing documents, emails, spreadsheets and some engineering drawings and video (watching not editing).   The goal behind going 4k is to boost productivity by having more things open at once to read side by side.   I looked into the Dell specs and they only mention an HDMI without going into the details of what type or whether it will support HDMI 2.0 / 4K TV.     How do I tell whether my Dell Inspiron Laptop (i7 7500 U processor) supports this?  I looked under the Display Adapters and can see that I have an "Intel HD Graphics 620"  listed.   Will this suffice to tell me if this display adapter will support HDMI 2.0 / 4k display?   Or should I be checking out some other settings?  Thanks! How can I initialise a static Map? How would you initialise a static Map in Java?  Method one: static initialiser  Method two: instance initialiser (anonymous subclass) or some other method?  What are the pros and cons of each?  Here is an example illustrating the two methods:  import java.util.HashMap; import java.util.Map;  public class Test {     private static final Map&lt;Integer, String&gt; myMap = new HashMap&lt;&gt;();     static {         myMap.put(1, "one");         myMap.put(2, "two");     }      private static final Map&lt;Integer, String&gt; myMap2 = new HashMap&lt;&gt;(){         {             put(1, "one");             put(2, "two");         }     }; }