download

First draft of my Scala/FP book, coming soon

Health (and other things) permitting, I hope to have a first draft of my book on Scala and functional programming (now titled, Learning Functional Programming in Scala) completed by the end of May.

It may only be in an alpha or beta state by then, but I’m debating about making it available as an Amazon ebook for a low cost at that time. I’ll be going back to work almost immediately after that, so if I don’t release it now, it may be another year before I can really finish it.

Update: The first 600 pages of my book, Learning Functional Programming in Scala, are now available as a free PDF download.

Scala: How to download and process XML data (such as an RSS feed) alvin September 13, 2016 - 8:58pm

I was looking for a good way to access XML resources (like RSS feeds) in Scala, and I currently like the idea of using ScalaJ-HTTP to access the URL and download the XML content, and then using the Scala XML library to process the XML string I download from the URL.

This example Scala program shows my current approach:

Scala - How to download URL contents to a String or file

Scala URL FAQ: How do I download the contents of a URL to a String or file in Scala?

I ran a few tests last night in the Scala REPL to see if I could think of different ways to download the contents of a URL to a String or file in Scala, and came up with a couple of different solutions, which I'll share here.

Download URL contents to a String in Scala

The best way I could think of to download the contents of a URL to a String looks like this:

A shell script to download a URL (and test website speed) alvin June 4, 2011 - 4:15pm

I've been having a problem with a GoDaddy website lately (see my GoDaddy 4GH performance problems page, and in an effort to get a better handle on both (a) GoDaddy website downtime and (b) GoDaddy 4GH performance, I wrote a Unix shell script to download a sample web page from my website.

To that end, I created the following shell script, and then ran it from my Mac every two minutes:

How to download iPhone photos to Windows XP

iPhone photos and Windows XP tip: How to download iPhone photos to a Windows XP computer.

Okay, this was surprisingly hard. I just went to download all my iPhone photos to my Windows XP computer, and assuming this worked with the normal iTunes sync process, I started the 'sync', waited a very long time, and then at the end, all my photos were ... wait ... none of my photos were downloaded from my iPhone to my Windows XP system. What the heck?