Skip to main content

Posts

How to Read a Research Paper?

I fully agree with S. Keshav's paper titled " How to Read a Paper " and have no further insights to offer.
Recent posts

Comments in a Code v/s Code Readability

Recently, I earned Readability (a Google certification for language expertise) in Java and JavaScript. Over the past few months, I have been a Readability reviewer for most of the code that is typically checked in by my team to Google's codebase. I am an exhaustive code reviewer. I only accept code that adheres to the highest standards and best practices. (Okay, enough of blowing my own trumpet!) One of the most popular questions that I usually receive is, "Shall I add a comment here to make things clear?" Most of the time, my answer is a clear " No !" I am writing this small write-up to explain the reason. I truly believe that writing code is very similar to writing a very simple story without any twists. The variables are the characters. Expressions provide a characteristic feature to a character. Each function narrates a conversation between variables, much like an act in a play. While reading a novel, the reader's mind tries to guess what could be coming...

Taking Notes

Over the last 100 days, my learning curve has been incredibly steep. Note-taking has always been a habit of mine, dating back to my first year of college. I've always enjoyed writing down what I've learned. Jotting down notes provides me with a sense of finality and reinforces my understanding. It also helps me quickly revisit and refresh concepts when needed. I have amassed over 50 notebooks filled with notes on computer science and other areas of interest. I meticulously preserve these notebooks and carry them with me wherever I go, hoping to revisit them someday. However, upon reflection, I've realized that many of my notes suffer from some significant shortcomings: Outdated Information : The field of computer science is constantly evolving. Consequently, many of my notes are now outdated. While notes on fundamental topics like C++, Java, Algorithms, and Design Patterns remain relevant, others, such as those on Hyperledger, Git, Networking, JavaScript, TensorFlow, Num...

Calling C++ Native Code from Java

Recently, I encountered significant trouble finding a good article that completely explains the process of calling a C++ native function from Java. I conducted some experiments and finally succeeded. I will be sharing the instructions step-by-step. In this article, I will present a very basic example of taking an array of numbers as input in Java, computing their sum using a native C++ code, and then printing the output back to the console using Java. I will keep the article concise and encourage you to explore the official documentation if you encounter any issues. I will be using Windows and GCC compilers for this demonstration. A 32-bit C++ compiler is compatible with a 32-bit Java compiler, and a 64-bit C++ compiler is compatible with a 64-bit Java compiler. MinGW does not publish x64 versions of GCC compilers for Windows (it is only available for Linux). Therefore, if you are using Windows, ensure that you install the 32-bit Java version. I am also assuming that you are using JDK ...

Rendering Performance Evaluation - Android SDK vs React Native

UI rendering speed has always been a key factor in evaluating a new technology. The lower the rendering time, the more preferable the technology. In recent times, React Native has become very popular for developing native apps. Such apps are truly native and significantly different from other similar technologies like Xamarin and Cordova. I recently had some time to evaluate how React Native compares to the Android SDK. TLDR : As you might expect, the Android SDK outperforms React Native by a significant margin. However, React Native technology is slowly catching up (most of the credit goes to the amazing diff rendering technology, which forms the core of React). React Native is efficient enough for apps with a small number of UI components that can be rendered within a reasonable time. Performance Comparison Emulator Model - Google Pixel 2 API Level - 24 Resolution - 1080 x 1920 (420 dpi) CPU - x86 Target - Android 7.0 RAM - 1536 MB Evaluation Criteria We will be creating a large numb...

The Switch-Case Fall-through

So, I am a Software Engineer at a reputed firm and still fell for the trap of the fall-through feature of the switch-case statement. Rule of Thumb: Starting from the matched case, all statements within the switch block are executed, unless a break statement is encountered. After the break statement, or if no break is encountered within the matched case, control is transferred to the statement following the entire switch block. Examples: Here are some examples to test your understanding of switch-case: The output of the example is AB. This is because there is no break statement, and therefore all the statements are executed after the first match of case 0. The output of the example is BCD. This is because there is no break statement, and therefore all the statements are executed after the first match of case 1. The output of the example is AB. This is because there is a break statement at the end of case 1. Therefore, after the first match at case 0, all the statements are executed unti...

Setting up DC Hub on Raspberry Pi

Aditya Pal came to my room to check out a Raspberry Pi that I had recently received as a gift. I told him it was a small, credit-card-sized computer. It powers on as soon as you plug it in and boots up quickly. I was already using it as a server for other purposes (hosting BitTorrent). Our hostel at college had a strange network issue. The intra-hostel network worked smoothly. However, we faced a lot of issues outside of the hostel (especially at Hostel 7, which was disconnected from the external network for a month). The college's official Domain Controller (DC) was on the external network and was inaccessible for quite some time whenever we faced network issues. Aditya suggested the idea of setting up a DC on a Raspberry Pi for the students of the hostel. We worked together for a few days to finally set up a DC on a Raspberry Pi running Raspbian. It remained active for over a year until the college administration finally decided to shut it down due to network congestion. There we...