04

Fractal Dimension and Crossover Scale

What Do the Himalayas and the JFK Airport Have In Common?

Reading through [1] as a novice, a lot of the concepts discussed were completely new to me. I was doing what I normally do when reading something full of concepts I’m unfamiliar with. I kept on reading. Banking on the fact that I would soon get some context and could then go back and flush it all out. I placed fractal dimensions and crossover scales accordingly on the back burner until I got to the following passage:

It is interesting to note that experience indicates that modulation of crossover scale is more effective than modulation of fractal dimension for modelling realistic looking terrain. That changing crossover scale alone should have such a dramatic effect is not surprising, for as B. B. Mandelbrot has pointed out, the fractal dimension of the Himalayas is approximately the same as that of the runway at the JFK airport; what is true is simply that the crossover scale of the latter is on the order of millimeters while that of the former is on the order of kilometers. [1]

This was towards the end of a section about generating fractal height fields and is a response to some preliminary results gotten by modulating either the fractal dimension or crossover scale. For the uninitiated, let’s start with some definitions.

03

Downloading All of the Videos in a RSS Feed Using the Command Line

An Exercise in Futility

For some reason I decided that the best possible approach to downloading all of the videos from a RSS feed was to use the command line. What I came up with is below:

1 wget -O - '$FEED'
2     | grep -o '"https://[^"]*\.mp4"' 
3     | awk '{gsub(/"/, "", $0); print $1 "\t-O\tVideo" FNR ".mp4"}' 
4     | xargs -n 3 wget

It’s not very complicated but I’ll walk through each line.

  1. Download the XML and send it to the standard output.
  2. Pipe the XML into grep and pull out all of the video URLs. Leading and trailing quotes were added to the pattern because the feed I was using had the same URL twice per item. Once as an attribute and once as a value.
  3. Pipe the matched URLs from grep into awk, remove the quotes, and define a name for the file. Here I simply numbered the videos “Video1.mp4”, “Video2.mp4”, …
  4. Pipe the output from awk to xargs to use each set of URL, “-O”, and name as arguments for a wget call.