I’ve been looking for a way to make Functional Programming, Simplified smaller, but haven’t yet found a way to do that while keeping all the essential information in it. But IMHO, it’s still a heck of a lot easier than reading all of these books on the right:
When you look at Functional Programming, Simplified on a dolly, it’s not that big. ;)
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:
This is cool, though I don’t know why people are always picking on Pluto. (It may also need an asterisk stating that Saturn needs to be at an angle like that.)
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.
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
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.)
To specify the rows and columns in a Play Framework 2.1.x form field, use a syntax like this:
@textarea( urlForm("notes"), '_label -> "Notes", 'placeholder -> "Any notes you want to add", 'rows -> 5, 'cols -> 60 )
The textarea documentation shows that you can also specify the textarea size like this:
This photo shows the size of our teeny weeny little Sun compared to a few other stars. From the excellent web page, "The Scala of the Universe 2".
Just a quick note today that if you want to create a mutable Scala array -- particularly an array that can grow in size after you first declare it -- you need to use the Scala ArrayBuffer class instead of the Array class, which can't grow.
Here's a short example of how to instantiate an ArrayBuffer object, then add elements to the array: