Below you will find pages that utilize the taxonomy term “Perl”
A few thoughts on Programming languages
Just a few thoughts on programming languages that have been rattling around in my head this week, but which don’t each merit a full blog post. The main theme is that the culture behind each programming language leads to some interesting choices, as is the case with spoken languages.
This week I started learning how to program in Rust. Even though I’m using the project-based Command-Line Rust to learn, the author still went with the traditional “Hello, world!” project for the first intro to the language. I was also working on a Go project last week and so it immediately stood out to me that (at least as taught by this author) Rust has the print! macro that allows you to succinctly print to the command line. By contrast, Go requires importing fmt before you can print. This was the first topic that was swirling around in my head this week. What makes language designers choose whether printing output (one of the most basic things a program can do) is built-in or requires an import. I even remember back when I was learning Java in undergrad (I think it was Java 1.8, but I don’t remember) we had to use the savitch library just to get program input (another very basic computer program concept). As I thought about it, I wondered if it has to do with thoughts around compilation and whether the language designers think you’re mostly making user-interactive programs or libraries? It makes sense to me that scripting languages like Python, Ruby, and Perl would have print built-in since you always have to have the interpreter along with you, so all the basics should be there. (The original Batteries Included Python promise, for example) But perhaps the Go developers thought you wouldn’t always be printing to the command line so a more efficient binary could be compiled by forcing you to import the functionality? I’m not entirely sure.
Programming Update: November/December 2021
In these last two months of the year I only worked on Advent of Code.
November
In November I worked through part of the 2016 problem set. I didn’t get too far because of how many languages I was doing at this point. Eventually I decided to allow myself to get a bit further in Python and then catch up with the other languages. Whenever I’d get stuck I’d go back to the other languages. Overall, once I’d figured out Python - Ruby, Perl, and Golang would be pretty easy. Haskell would still be hard, but I started getting the hang of it near the end of the month.
Programming Update: September / October 2021
Across both September and October I got a decent amount of programming done. I just about finished the Learn You Haskell for Great Good book (got up to just before Monads) and started Head First Go. Once I had enough Go language to get started on AoC, I knew I’d be ready for the 2016 problem set. Let’s get into the nitty gritty!
Python (not Advent of Code)
Impractical Python
I finished chapter 11 which contained my old friend the Monty Hall Paradox. I’ve had a version up on my site for a very long time based on a PHP tutorial in Linux Format Magazine. This time I was able to code it in Python as well as creating a GUI version. Chapter 11 also touched upon The Birthday Paradox.
Completing Advent of Code 2015 with 3 Programming languages
Throughout the spring and summer of 2021 a few of the times that I mentioned on the Advent of Code subreddit that I was doing the 2015 problem set in all 3 languages, some folks said they’d be interested in a writeup on the experience. Now that I’ve finally finished 2015 (my first set of 50 stars!) it’s time for that writeup. Before I continue, I’d like to thank everyone on the subreddit who has helped me. I have a README.md for each day’s problem and you’ll find my thanks to those who helped me within those READMEs here in my repo.
Programming Update for July and August 2021
I didn’t do much coding in July, so I decided to combine the July and August wrap-ups.
Python
Dreamhost Dynamic DNS
I decided to clean up and update some code that uses the Dreamhost API to allow for Dynamic DNS. I cleaned up the logging output so that I could figure out why it was sometimes deleting one of my domains rather than just updating the IP. The original programmer had it printing out to the terminal. I used the logging package to send logs out to a file. While I was improving the logging, I also decided to use f-strings to make it more obvious what was going into the output string.
Programming Update for April 2021
I had a lot less variety in my programming month, but still had a lot of fun doing it. In fact, Programming consumed most of my leisure thoughts. More about why I was doing it below, but I’ve been reading Programming Perl as well as skimming through Introducing Go and Learn You A Haskell for Great Good!. Ever since some folks used Haskell during last year’s Advent of Code and this guy’s videos that I mentioned in an early 2021 blog post, I’ve been very curious about the language. In fact, at this point I’ve decided that Go and Haskell will be the next two languages I learn.
Strange Dream
Last night I had a dream that combined Games of Thrones and Perl programming. Like it was in the GoT world, but we had to do some Perl programming to defeat the Lannisters.
My Latest Procedural Art
More math-based art, but I really like how this came out a LOT better than my experiment with Fibonacci. Check them out!
Tight Cornell Archemedean Spiral by DJOtaku, on Flickr A really tight Archemedean Spiral featuring my photos tagged with Cornell
Portrait Archemedean Spiral by DJOtaku, on Flickr An Archemedean Spiral based on my Portrait Photos
My latest Procedural Art Experiment
I think that nearly everyone who has ever learned about the Fibonacci Sequence is fascinated by how quickly it grows. I wanted to illustrate that, so I created this collage with some modifications to J im’s makeCollage.pl script. The rules were that each picture takes the place of a number on the Fibonacci Sequence and is displayed that many times. Of course, I skipped Fibonacci number 1, which is 0. No point in having a picture show up 0 times. So the first picture is shown once, as is the second. Then two times, then three, then…..
Procedural Art
edited to add the tags I used
That collage was created by a program. I certainly don’t have the patience to arrange all of those photos one-by-one!I told the program to download all of my pictures tagged with Eric Danny David and Danielle and create this collage.
But does that make this any less of a work of art? I think the answer is no. The artwork was just created procedurally instead of visually. To argue that this is less artful is to say that the The Lion King isn’t art because the wildebeast scene was created procedurally. Of course, in this situation I don’t see myself as the artist, but the guy who wrote the program is the collage artist. It’s his procedures which created the art. His name is Jim Bumgardner and he’s a really nice guy who helped me fix up the script. I copied it from his book, Flickr Hacks, but unfortunately, as the code he relied on has changed, it didn’t work as posted. In fact, here is the fix you need in his program, makeCollage.pl :