-
AoC: Day 02
The Problem This was more of a string matching exercise followed by a bit of arithmetic on the extracted data. Part 2 involves a bit of logic. My Solution The first thing that came to mind was regular expressions with named fields. Its been a while, so I had to go back to the (excellent) […]
-
100 Best-Loved Poems, Philip Smith
-
AoC: Day 01
The Problem An extremely simple problem to kick things off, and one that shows up on many beginners programming tests: find two numbers from a list that add up to a specified number. Part 2 asks for three numbers that add up to the specified number. The list is not sorted. My Solution My solution […]
-
The Joy of x, Steven Strogatz
What a wonderful little book, and how effortlessly the author describes the intuition behind some pretty deep maths concepts!
-
Advent of Code
I recommend Advent of Code to everyone I meet. It is a wonderful way to develop your programming skills, since you’re completely on your own (other sites babysit you quite a bit, methinks). However, while doing the implementation is a great exercise, it is much more useful (especially if learning a new language) to look at what […]
-
Tiamat’s Wrath, James S. A. Corey
-
Toycathon 2021 – A Few Thoughts
I had the opportunity to contribute to (the terribly named) Toycathon – a competition to promote “AtmaNirbhar Bharat” and “challenge India’s innovative minds to conceptualize novel Toy and Games based on Bharatiya civilization, history, culture, mythology and ethos” A few observations (of course my own!) and learnings follow: I’m against the entire AtmaNirbhar philosophy — […]
-
Mindset: Changing the Way You Think to Fulfil Your Potential, Carol Dweck
Another great recommendation from Rupali, and something that put a framework around some of my thinking. Very timely and related to what I’m working on now, and highly recommended. A bit of criticism: I did find the writing a bit superficial, and some of the examples could have focused on the discussion, rather than on […]
-
The Word for World is Forest, Ursula K. Le Guin
What a wonderful, thought-provoking book. And depressing, since we immediately recognize the ‘yumen’ behavior. Even today, all the problems I see around us can be traced back to stubborn, monomaniacal extremists who have such deep faith in their beliefs that they cannot admit other perspectives. Great comparison with Mindset and WEIRD people (to be linked […]
-
Persepolis Rising, James S. A. Corey
-
Fractals
It is surprisingly easy to generate a fractal image. A schematic of the Mandelbrot Set is as follows. Start with the equation $z_{n+1} = z_n^2 + c$, where $c$ is a complex number. Your “image” is a 2d array whose rows and columns correspond to the real and imaginary parts of $c$. Set $z_0 = […]
-
Walt Whitman’s America: A Cultural Biography, David S. Reynolds
I’ve been struggling with Whitman for a long, long time. There are a few lines that capture the imagination, starting with some of the titles: “Leaves of Grass,” “Song of Myself” and “I Sing the Body Electric,” but when I read the poems themselves, I was left scratching my head. I’m fine with prose poetry, […]
-
Searching
Input Array size, data type, search algorithm, key. The key can specified as an index or as a non-existent value Output index, if key is in the array, -1 otherwise. Running time Program Generate the array of the given data type and size. Populate with random numbers in sorted order (duh!) Implement the usual suspects: Linear […]
-
Sorting
This is so fundamental that you’re probably wondering why I even bother to put it here. Read on… Input Array size, data type, algorithm, sort order Output Running time of different parts of the code Program Create an array of the given data type and size, and populate it with random values Implement multiple sorting […]
-
Command-Line and Options
Your programs should be parameterized and should take inputs at the command line (not prompt the user for inputs!) The command line can be used to control the behavior of the program: Specify the sort order Specify the algorithm Provide debug/progress information Specify output formats and destination To specify inputs: From a file v. generate […]
-
Edsger W. Dijkstra: a Commemoration, Krzysztof R. Apt and Tony Hoare, eds
Memories of many men about EWD. He’s well known, of course, for his eponymous algorithm (and was worried that that is all he will be remembered for!), but was so much more. There are many threads that I want to follow up on, and a few things that jumped out at me The importance of […]
-
Focus on Performance
Colleges don’t talk about program performance; I find this strange since they focus so much on student performance! Develop the habit of instrumenting your code by default — figure out the correct timer to use for your platform, and measure, measure, measure. Understand the interplay between the code you write, what the compiler does to […]
-
Debug & Test
Learn how to debug your code. This is not just about the tools (research and get familiar with the appropriate tools for your language and platform) but also about writing code that is easy to debug and your mental model for how you approach debugging. Think about how you can test the code that you’ve […]
-
Babylon’s Ashes, James S. A. Corey
-
Version Control
git is the flavor of the day; so learn how to git. Force yourself to use the command line, this will help you understand the philosophy of version control in general, and git in particular. Create a github account and start using it. Use it to showcase your improving maturity as a programmer and developer, […]