This is a page from my book, Functional Programming, Simplified
“The owls are not what they seem.”
The goal of this lesson is to review at a high level how
for loops work in Scala. This is necessary because Scala/FP developers take advantage of advanced Scala
for loop features.
As an example of what I mean, the goal of the next few lessons is to explain what’s happening in this
As an Android developer, you can normally use the
adb push command to copy files from your computer’s hard drive to an Android device. However, I just ran into a problem where I couldn’t copy files to my Android emulator’s “data” directory, i.e., the /data/data filesystem. When I tried to copy a file using this command:
$ adb push foo.jpg /data/data/com.alvinalexander.myapp/files
I got this Android error:
If you attempt to do a normal
git push origin master after adding a tag, you’ll get an “Everything up-to-date” message from Git. In short, this is because you have to push a tag to the origin just like you push a branch.
In my case I just created a tag named
v0.1, so I pushed it like this:
git push origin v0.1
The output from the
git push command looks like this:
Summary: This is a Git cheat sheet (Git command summary) I've created, featuring many Git command examples.
As I've begun to set up my own private Git hosting repository (see Private Git hosting services, and My A2 Hosting Git repository using SSH), it's time to cram all these Git commands back into my head again.
Perl hash "add" FAQ: How do I add a new element to a Perl hash? (Or, How do I push a new element onto a Perl hash?)
The Perl hash is a cool programming construct, and was very unique when I was learning programming languages in the late 1980s. A Perl hash is basically an array, but the keys of the array are strings instead of numbers.
Basic Perl hash "add element" syntax
To add a new element to a Perl hash, you use the following general syntax:
Perl array push pop FAQ: How do I push elements onto a Perl array, and how do I pop element off a Perl array? (Or, What is the Perl push and pop syntax?)
I really like the Perl push (and Perl pop) syntax. The push function makes adding elements to a Perl array very easy, and the pop function also makes a Perl array work a lot like a stack.