Book Review: Parallel Worlds by Michio Kaku

Posted on Leave a comment

Cross-posted from Goodreads: https://www.goodreads.com/review/show/2068893278

Michio Kaku’s Parallel Worlds is a book about the science behind the multiverse and parallel universes. And no, it’s not a bunch of mathematical equations and theoretical derivations. Rather everything is explained in classical Michio Kaku style, in layman speak.

I bought it 6 years ago as research material for my sci-fi novella project. When I first came across the multi worlds interpretation (or MWI) I was enthralled. I instantly knew that I wanted to write a story based on the concept.

Anyone who has read about quantum mechanics is familiar with the uncertainty principle, which states that it is impossible to accurately predict the position/momentum of a subatomic particle without directly observing it. Stated differently, a particle such as an electron exists in all possible positions at the same time! It’s as spooky as it sounds. Applied in Schrodinger’s Cat experiment it leads to the cat being dead AND alive at the same time. How’s that possible? According to the Copenhagen interpretation of quantum mechanics, it’s not. Rather the cat’s dead state and alive state are both “virtual” (temporary) until the box is opened to look at the cat, at which point the cat’s wave function collapses to one and only one state – dead OR alive.

MWI is one of the several interpretations of quantum theory that says all possible quantum states of an object or action actually exist/occur but in different ‘parallel’ universes. So our beloved Schrodinger’s cat can be both dead AND alive but in different universes. There’s no need for the wave function to collapse based on observation. If you found all of this confusing, don’t worry: it *is* confusing.

Anyway, the concept of parallel universes fit in well with an idea for a sci-fi work I had in mind at the time. So I wanted to learn about it in depth. On googling a bit, I stumbled upon Dr. Kaku’s book. (I haven’t been able to finish the novella, in case you’re wondering)

Although MWI is only briefly discussed in the book, it mentions a lot of similar theories and explains them in extraordinarily simple terms with vivid analogies and intriguing historical accounts. Dr. Kaku neatly weaves together science and philosophy to help his ‘unscientific’ readers make sense of bitterly complex physics behind the beginning and end of our cosmos.

The material gets difficult to comprehend at times, but that’s perhaps only because the physics of the very small and very large is excruciatingly complicated. It’s beyond common sense. Though I wish Dr. Kaku had spent a few extra lines to try to explain some difficult bits further.

Overall, I found the book to be immensely thought-provoking. It whets your curiosity and answers some of the most daunting questions.

Book Review: The Finkler Question by Howard Jacobson

Posted on Leave a comment

Cross-posted from Goodreads: https://www.goodreads.com/review/show/3510632331

I was excited about this book for a very long time. 10 years to be precise. I bought it pretty much the day it won the Booker Prize. But for one reason or another, I couldn’t start it all these years. Until 20 days ago. Did it turn out worth the wait? Most certainly not.

While I purchased the book when I was not aware of Goodreads, I started reading it with an active Goodreads profile. So I knew the risks: a rating of 2.79 was never encouraging. I read it anyway, only to end up confirming some common negative reviews floating around.

To be fair, the book has its moment. The subject, for one, has noble connotations. The author has tried – in this own whackily funny style – hard to bring to the notice of non-Jews the physical and (especially) mental harm Jews have to face through both conscious and unconscious anti-Semitism. The author has his mastery of words all right: some difficult to imagine scenes described so well and effortlessly. The goods end there, though.

The over-arching problem is, Jews are the only thing the book talks about. Every page literally has at least one reference to Jews (or “Finklers”, as the protagonist calls them). The protagonist – a middle-aged half-wit Brit with no ambition – doesn’t come across as reliable with his thoughts. Although he attaches himself with Judaism sympathetically, he’s ever confused which makes it even difficult to feel the same way as he does. Plus, the author contrives to be funny with sentences that add no humor. Or perhaps the problem is my own lack of comprehension of British humor in general (P.G. Wodehouse is an exception).

Read this if you want some modern for-against arguments around Jews, Holocaust, Israel, Palestine, and Zionism. Skip it, otherwise.

P.S. This is my first 2-star review!

Clean Code

Posted on Leave a comment

There’s a bunch of technical books sitting in my Amazon wishlist for quite some time. Poor books! They could not end up in my shopping cart for a myriad of reasons, laziness to read being chief amongst them.

The importance of reading technical books simply cannot be overstated. Or reading articles, for that matter. Reading is what helps you to improve your craft, keeps you up to speed with the topics you care about, makes you a better version of yourself in your desired skill. Personally, I’ve found books to be more useful than online courses. I have nothing against online learning, I’m all for it. I have end-to-end finished a tonne of courses on Udemy, Pluralsight, Coursera, etc. The things that go for me with books are that I can take them anywhere (even where there’s no Internet), highlight important parts, scribble my own thoughts and most importantly learn without distractions. The thing about books being little portable time machines is true.

Recently when I was casually digging my Twitter timeline, I came across this book called “Clean Code”. Someone had written life-changing praises about it. Out of nowhere, I decided to order. Out I went to Amazon.in, found the book, read a few reviews, noticed that there was no discount, and hit the Buy Now button.

Clean Code is a book about software craftsmanship. It’s a must-read for anyone who cares about their craft.

I am a little more than halfway through the book, and boy, it is life-changing. It’s written in an authoritative tone by a bunch of regarded software engineers with decades of development experience. The experience clearly shows! Chief among the authors of the book is Robert C. Martin, who is one of the founders and foremost popularizers of SOLID principles and Agile methodology. I have thoroughly enjoyed the book so far, and am looking forward to finishing it. It’s safe to say that this book has reignited my craving for technical books. Next up I’ll probably pick up a Martin Fowler.

Using the learned clean code principles, I was able to transform this ugly chunk of code at work in a beautiful verse below it. The code is customization on top of Sitecore‘s JSS Node Proxy open source program.

Which code snippet is easier to read?

Object.keys(tenants).forEach((key) => {
  const tenantName = tenants[key];
  const proxyConfig = config.initConfig(tenantName);

  server.post(
    `/:lang((${routesLangs}))/${tenantName}:paymentRoute((${intermediatePaymentRoutes}))`,
    bodyParser.urlencoded(),
    (req, res) => {
      handlePaymentIntermediateRoute({
        paymentData: req.body,
        path: req.params.paymentRoute,
        lang: req.params.lang || DEFAULT_LANG,
      }).then((svcData) => {
        proxyConfig.serverBundle.renderView(
          (param, html) => {
            res.send(html.html);
          },
          req.path,
          svcData,
          { userAgent: req.headers['user-agent'] }
        );
      });
    }
  );

  server.use(
    `/:lang((${routesLangs}))/${tenantName}([/].*)?`, // eg. /((en|ar))/yasisland/wishlist
    (req, res, next) => {
      if (req.originalUrl.indexOf('/-/media') === -1) {
        let originalUrl = req.originalUrl.replace(tenantName, '');
        originalUrl = originalUrl.replace('//', '/');
        req.originalUrl = originalUrl;
      }
      next();
    },
    scProxy(
      proxyConfig.serverBundle.renderView,
      proxyConfig,
      proxyConfig.serverBundle.parseRouteUrl
    )
  );
});
server.use(
  '*',
  (req, res, next) => {
    setPaymentRoutePreReqs(req, res, next);
  },
  (req, res, next) => {
    const envType = getEnvironmentType(req);
    const tenantName = getTenantName(envType, req);

    const paymentRoute = req.paymentRoute;
    if (paymentRoute) {
      handlePaymentRoute(req, res, tenantName, paymentRoute);
    } else {
      handleApplicationRoute(req, res, next, envType, tenantName);
    }
  }
);

Fixing headphone jack in Ubuntu 20.04

Posted on 2 Comments

As weird and funny as it may sound, Ubuntu isn’t able to play sounds on my laptop‘s 3.5mm headphone jack. Yes, the gentle, innocuous, innocent headphone jack that we all love and use. And mine’s not even a super-fancy laptop with uncommon hardware. It’s a Dell Inspiron 7000 series laptop with an Intel chipset. How more commonplace can things get than this?

After fiddling around for quite a bit, I was finally able to get it to work. I guess the issue has something to do with (the notorious?) PulseAudio.

Anyway, the trick for me was to use a little utility called hdajackretask. It’s part of the alsa-tools-gui package and helps you retask (remap or whatever) your PC’s audio ports (including internal speakers and HDMI). Read the documentation here (simple and fun): https://fossies.org/linux/alsa-tools/hdajackretask/README

Install it using this command:

sudo apt install alsa-tools-gui

Next, open the app from either command line (hdajackretask) or menu. Here’s my overriden configuration for reference (headphone, right side):

Hit Apply Now, and boom! Headphones are finally working. It’s important to note that this is not a silver bullet that will fix all jack-related sound issues. It just so happened in my case that retasking was necessary. I have to do it every time I plug in my headphones (even with the boot override installed). Weirdo, I know, but at least it works.

You may receive this error when you apply the overrides. I guess it’s totally fine to ignore it. It’s probably because of a restart of pulseaudio system. Things work despite the error.

Feels to weird that it’s 2020 and such retasking has to be done manually!

Note that getting my Bluetooth audio devices to work – especially my AirPods – remains a pain in the you-know-what.

Made the switch back from Mac to Linux

Posted on 2 Comments

After serving me dutifully for more than 4 years, my MacBook Pro 13″ (early 2015)’s battery died. It was a terrible sight. I was in the mid of a programming spree when that happened. There was a powercut and, whoosh, everything disappeared from the screen. It was puzzling at first. I thought my laptop had shutdown under the strain of my app’s build process. On powering it on again, my Mac appeared to behaved normally. That was until I noticed the battery health icon in system tray. All of a sudden, it was asking me to service the battery and power source was set to power adapter.

CreditMake Tech Easier

I was stunned, to say the least. I immediately googled around and found a few things to try and fix the situation, like tips mentioned in this article (reset SMC and all). Unfortunately, nothing worked for me. I was left with no option but to accept that my MacBook was not going to be the same.

During the next few days, I continued to use my Mac with adapter as power source. With frequent power cuts, it was annoying to see the laptop shutdown suddenly and then waste precious time restore everything. For a while, I considered getting a new battery. What held me back was its prohibitive cost (Rs. 10-12k) and lockdown due to COVID-19. To make matters worse, my MacBook strangely got slow and sluggish. I could feel a noticeable 20-30% reduction in speed and power. Software builds took more time, browsing and scrolling web pages were janky, etc.

For the next couple of weeks, I resorted to using my wife’s old, insanely under-powered laptop. It was hard at first, but when I had set it up with Ubuntu Linux things got a lot better. I could run VS Code, Docker, Firefox, all at once. It took some time and patience to get used to the new speed standards, but at least this thing was presently more reliable than my no battery MacBook.

Days passed by. I continued to do my daily work on the oldie, and found myself not touching my MacBook for days at a stretch. It was a weird feeling – I had never not opened my Mac at least once a day in all of its four years.

In the following days, I started feeling like getting a new laptop. For a professional programmer like me, a laptop was his “tool of the trade”, and it was not wise to keep using an old tool on the cost of productivity. After a couple of days research I settled on Dell Inspiron 7591. It was a far cry from the premium world of Apple laptops, but it was respectably ahead in terms of sheer performance.

I’m typing this post from my new laptop, running Ubuntu side-by-side with Windows. Linux is my primary OS once again, and I’m happy to be back. Although, to be honest, I will certainly miss my Mac’s convenience and premium feel. But the new thing has a lot of good stuff to offset that:

  • way more power*
  • larger screen
  • decently lightweight
  • a nice keyboard
  • I can finally play games again 😎

Intel Core i5-9300H
16 GB DDR4 2666 MHz RAM
512 GB SSD
NVIDIA GeForce 1050 GTX

* My Dell Inspiron 7591’s configuration

Here’s the customary desktop screenshot:

Ubuntu 20.04 running on my new Dell Inspiron 7591