How large can a Java BigInteger be?

Java FAQ: How large can a Java BigInteger be?

Answer: The Java BigInteger Scaladoc states the following:

“BigInteger must support values in the range -2Integer.MAX_VALUE (exclusive) to +2Integer.MAX_VALUE (exclusive) and may support values outside of that range.”

The Scala BigInt wraps Java’s BigInteger, so it will also have the same data range.

How to show the largest files under a directory on Mac OS X (Unix)

Here’s an example that shows how to find the largest files under a directory on MacOS and Linux/Unix systems.

A du/sort command to show the largest files under a directory on Mac OS X

The Unix/Linux command that worked for me on my MacOS system is this:

$ du -a * | sort -r -n | head -10

du is the disk usage command, and the -a flag says, “Display an entry for each file in a file hierarchy.” Then I use the sort command to sort the du output numerically and in reverse. After that, head -10 shows only the first ten lines of output. In the Music folder on my Mac the command and output look like this:

How to create an Array whose size can change (ArrayBuffer)

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is one the shortest recipes in the book, Recipe 11.8, “How to Create an Array Whose Size Can Change (ArrayBuffer)”


You want to create an array whose size can change, i.e., a completely mutable array.


An Array is mutable in that its elements can change, but its size can’t change. To create a mutable, indexed sequence whose size can change, use the ArrayBuffer class.

Mac OS X mouse cursor/pointer size

I haven’t figured out the exact issue yet, but ever since I (a) switched to Mac OS X 10.9 and (b) added a second monitor to my old iMac, the mouse pointer/cursor seems to disappear from time to time. Actually, I can’t tell what it’s doing, so I move the mouse around frantically until it reappears.

To help resolve this problem, I just made my mouse cursor larger. You do this on your Mac by going to System Preferences, then Accessibility, then Display, and then adjust the “Cursor Size” slider until you get the mouse pointer size that you want. You can see in the image shown here that I’ve made mine a little larger than normal. (I was surprised that this is under “Display” and not under “Mouse”, but there it is.)