# Narendra Vardi > Stay ahead in tech with Narendra Vardi! Explore expert insights on software engineering, Java, Spring Boot, APIs, databases, and the latest industry trends. 🚀 Public Ghost content for AI and LLM tooling. This file includes a bounded export of public pages first, then recent public posts. Append `.md` to any post or page URL to get the content in Markdown (for example, `/example-post.md`). ## Pages ### Welcome aboard! URL: https://www.narendravardi.com/welcome-aboard/ Last updated: 2025-09-23T17:20:34.000Z That could be me!! You never know. Thanks for Signing up! It's an absolute delight to have you on board. Being a valued member of my blog, you'll hear from me once every two weeks by email. If you ever need to get in touch with me, you can always reply to those emails and we can chat. Regards! Narendra V ### About URL: https://www.narendravardi.com/about/ Last updated: 2026-06-01T16:07:53.000Z ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/profile-pic-1.png) Hello World! 👋 ## About the blog Hello friend 👋 In this blog, I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. I write for my future self and reader friends of this blog. So I try my best to give proper context to every article. You can consider [subscribing to me](https://www.narendravardi.com/#/portal/signup/free) to learn how an engineer thinks at Big Tech. Please feel free to [suggest a topic](https://www.narendravardi.com/suggest/) or shoot an [email](mailto:narendravardi1127@gmail.com) to me! 💡 You can stop reading here if you are short on time! :) --- ## About the human behind this blog: My name is *Narendra Vardi*; I consider myself a Software Wizard, and my work involves writing software which I believe is closer to sorcery. I am based out of Bangalore - The Silicon Valley of India. I have authored half a million lines of code that you might have never seen. I wrote code for organisations like Google, Flipkart, Amazon and Cashfree Payments. ### Professional life As of 2026, I work at Omio as an AI Sourcerer, working on applying AI to make travel planning and booking simpler. Prior to that, I was a Senior Software Engineer at Cashfree Payments, revolutionising the international card payment solutions. Before Cashfree, I was working as a software engineer at Google, helping them build a moderation platform for Google Maps. [Software Engineering at Google book](https://abseil.io/resources/swe-book?ref=narendravardi.com) gives a glimpse of what it's like to work at Google. Before Google, I was a core member of the Order management systems team at Flipkart, an Indian e-commerce company which created the Butterfly effect in the Indian Startup Ecosystem. Here, I have built various features that almost all the customers of Flipkart use. I had a great time building software with which millions of people interacted. I did my internship and my first official job at Amazon. I learned a lot about writing high-quality production software while building software for the internal services of Amazon. I *worked hard* and *had fun* while working at these beautiful companies. *Making History* part, let's revisit it later 😄 ### College Life and the interest in building games Before receiving any paycheck, I did my Bachelor's in Information Technology degree at the prestigious VIT University, Vellore campus. During my college time, I was passionate about playing games. One such game I would like to mention is the then-famous 2048 game on mobile. I read about Gabriele Cirulli, the author of the 2048 game. He was a teenager when he developed the game. This inspired me, and I started working on writing the 2048 game. After a week, I built a clone of 2048 using Java Swings. The UI of the game was crappy, but it gave me the confidence to code new games. Following 2048, I have written the following games and Open Sourced everything on GitHub. 1. Guess my number 2. Minesweeper and 3. Double Table game. All the above games are simple ones. Minesweeper is a command prompt version, and it's not even fun to play. But these helped me learn game(software?) development. While writing games, I needed to master data structures and algorithms (DSA) to build games more effectively and quickly. Thanks to these small games, I learned the importance of DSA during my college time. I wanted to join a gaming company after college, but there were a tiny number of companies in that domain. So here I'm now, as a Backend Engineer. Want to know more about my professional life? Check out my [LinkedIn profile](https://www.linkedin.com/in/narendravardi?ref=narendravardi.com). You can find the code for all the games I have written under my [GitHub profile](https://github.com/narendravardi?ref=narendravardi.com). ### Personal Life **Travel** On a personal front, I like to travel. I have - I went on a solo trip to Europe, visiting four different countries. (France, Belgium, The Netherlands and Germany). - Drove bike from Leh to Nubra Valley, passing the famous Khardungla Pass. It was the most exciting, scary, and adventurous trip ever. - Celebrated Christmas in Paris and New Year in Barcelona. - Witnessed the beautiful sunsets of Thailand. - I trekked the valley of flowers in Uttarakhand and a few other places in South India. Depending on the people I was trekking with, I either loved the trek or hated it. Want to become good at trekking? Find the right set of people to trek with. - Drove a car for a good 1700 kilometres covering Southern cities of India, along with a friend. (Sorry if it feels like I'm bragging. I'm trying to notify potential travellers that I'm a traveller they can count on 😅) One of my favourite trips I have in mind for the future is to do a road trip in Italy, covering the places listed below (in no particular order) - Rome - Venice - Milan countryside - Florence - Vatican City - Pisa I want to cover these cities in a car along with some friends. Besides, I don't want to have trouble driving a vehicle alone in a foreign country. Reach out to me if this plan excites you! :) **Photography** I love taking photographs with an interest in Street, Travel and Portraits. I also want to become an expert in street portrait photography, though I am not yet comfortable in this segment. [Brandon Stanton](https://www.humansofnewyork.com/about?ref=narendravardi.com) and his work, [Humans of New York](https://www.humansofnewyork.com/?ref=narendravardi.com), inspired me a lot. Thanks to him, I kept my goal in photography to release photobooks of my work. I am miles away from this goal, but I am taking the initiative to reduce the distance, one step at a time. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/20200112181057_IMG_1732.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/20220804_165112.jpg) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0754.JPG) These are three of my best pictures. The left clicked in Murudeshwar, the Middle in Bruges, and the right in Amsterdam. > If you like the above three images, you can consider checking my Instagram page: [@worthyphotographer](https://www.instagram.com/worthyphotographer?ref=narendravardi.com). **Entertainment** I watch movies, TV Series, and Anime. I also read books. But all of them are in moderation. I recently finished watching *The Office, a* series I've watched entirely without missing a single episode. Thanks to Netflix and Prime Video. I have been following [One Piece](https://en.wikipedia.org/wiki/One%5FPiece?ref=narendravardi.com) anime for over a decade, and it's still going strong. The last thing that I want to do is pick another anime. So I've not started any new anime yet. *Some* of my favourite books include - Becoming by Mitchell Obama - Born a Crime by Trevor Noah - Harry Potter series by J.K. Rowling - Steve Jobs by Walter Issacson - The Catcher in the Rye by J. D. Salinger - The Great Gatsby by F. Scott Fitzgerald - The Kite Runner by Khaled Hosseini I love graphic and photo books. Some books that I think are exceptional in this category are - Humans of New York by Brandon Stanton - Calvin and Hobbes by Bill Watterson If I talk about movies, this article will not end soon; let's discuss them later! :D **Teaching & Mentorship** I like teaching. As a child, I wanted to become a teacher. But my teacher said, "[Teaching is a slow process of becoming everything you hate](https://dynomight.net/teaching/?utm%5Fsource=pocket%5Fmylist)." I thought she feared the competition I would bring to her job. After understanding the operational load involved in teaching, I believe she was right. So, I explore ways of teaching without taking the operational burden. That's when I stumbled upon mentoring. I've mentored many new joiners while working as a Software Engineer, and all of my mentees have become critical contributors to their respective teams. During my free time, I also mentored a handful of freshers at online academies which train Software Engineers. Under my mentorship, students received job opportunities from companies which offered to pay 2x to 3x of their current salaries (Though salaries are a terrible benchmark, I'm sure you all agree that 2x to 3xsalary is far better than 1x salary as a fresher). Some students have made significant progress as software engineers over the last two years. **Talks** As part of teaching, I also deliver guest lectures. Apart from KT sessions in the offices, I've delivered the following guest lectures at my Alma Mater, VIT University. 1. API development using Python Flask 2. Java 8 101 **Stand up comedy** I love listening to stand-up comedy. Initially, I had slight friction accepting it, but I liked it over time. Comics use unique and funny ways to discuss complex topics, which is something I want to learn. Homecoming King by Hasan Minhaj is one of my favourite stand-up comedy specials. **Toastmasters** Finding a community that helps you thrive is very difficult to find. It was hard to meet my friends in Bangalore since they were scattered all over Bangalore, and the infamous Bangalore traffic made it even more difficult. As I was trying to find a wonderful community to hang out with, I found Toastmasters. It has been a great community. Besides, I learnt how to write speeches and deliver them in front of an audience. **Digital Art** If there's anything that I learned during COVID, it is Digital Art. Here's one of my *best* drawings: ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/07/IMG-0742.JPG) **Sports** I watch cricket and occasionally, Badminton and Tennis. The first time I watched an entire football match was the semi-finals of FIFA World Cup 2018, and I believe Croatia's gameplay was mesmerizing. Now, I'm eagerly waiting for the upcoming FIFA World Cup. I play badminton with friends and colleagues. ## Disclaimers Now that you got an overview of what to expect from this website, please read through the disclaimers. - Just to be clear, the information on this website is meant for educational purposes and you should use it at your own risk. Use common sense, do not `rm -rf / --no-preserve-root` as root for example. If you have any questions then do not hesitate to contact me. - This is my personal website, please do note that these articles do not reflect or are based on the work, opinions or policies of any of my (previous) employers. Any resemblance to reality is pure coincidence. --- Good god! That was a long read. Surprisingly, you stuck this far. I think you enjoyed reading about me. If yes, click the button below and Subscribe! :) [Subscribe](https://www.narendravardi.com/#/portal/signup/free) --- ### Connect URL: https://www.narendravardi.com/connect/ Last updated: 2022-10-13T07:27:01.000Z For many, my website name, , might be hard to remember. I want my readers to reach my blog easily, and hence I have listed multiple ways to stay connected with my website. ## Subscribe to my newsletter This method is the easiest way to stay connected with my blog. Click on this [link](https://www.narendravardi.com/#/portal/signup/free) to subscribe. ## RSS Feed If you are someone who enjoys reading on *RSS Reader*, Add RSS of the blog to your reader. Here's the link to my RSS Reader: (add /rss at the end of my website link). ## Short URL If you do not want to use the above approaches, you can visit my website using the short URL [bit.ly/nv-blog](http://bit.ly/nv-blog?ref=narendravardi.com). Remember, there's a hyphen between nv and blog. ## Scan or Save the QR Code How can I miss the use of QR code in order to share links ? ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/05/Screenshot-2022-05-09-152623.png) QR code for my blog. ## Pocket App If you're someone who uses the [Pocket app by Mozilla](https://getpocket.com/?ref=narendravardi.com), save my article in your pocket list! :) ## Instagram If you are someone who loves to use Instagram, you can connect with me by following [@worthyphotographer](https://www.instagram.com/worthyphotographer/?ref=narendravardi.com). --- ### Suggest a Topic URL: https://www.narendravardi.com/suggest/ Last updated: 2022-06-30T07:10:39.000Z If you think there is a topic of your interest that would be beneficial for the readers of this website, I would like to hear from you! Loading… ![The city at night.](https://images.unsplash.com/photo-1517076731070-13c65bcb2e86?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDZ8fHRoYW5rJTIweW91fGVufDB8fHx8MTY1NjU3MzAwMw&ixlib=rb-1.2.1&q=80&w=2000) Photo by [Pete Pedroza](https://unsplash.com/@peet818?utm%5Fsource=ghost&utm%5Fmedium=referral&utm%5Fcampaign=api-credit) / [Unsplash](https://unsplash.com/?utm%5Fsource=ghost&utm%5Fmedium=referral&utm%5Fcampaign=api-credit) ### Art Work URL: https://www.narendravardi.com/art/ Last updated: 2022-11-21T07:22:23.000Z My creativity lies in creating or manipulating digital photos and videos. I enjoy doing that work. Listed below are the links to my artwork categorised by the type of art form. ### Links - **Memes**: Over the years, I have created a lot of Memes and limited them to my close friends. Recently I figured, why not share the work with the world? I have tagged the meme articles as [memes](https://www.narendravardi.com/tag/memes/). - **Instagram**: [The Instagram page which I created recently holds my photography work](https://www.instagram.com/worthyphotographer?ref=narendravardi.com) - **360° photographs:** I have shared some of the 360° photographs I captured on the '[My work on the 360° photographs](https://www.narendravardi.com/360-picture-work/)' page. - **YouTube**: [Few videos uploaded to YouTube](https://www.youtube.com/user/narendravcool?ref=narendravardi.com) - **Digital Art**: I learnt to use Procreate app on iPad and have created some lovely artwork during the COVID-19 lockdown. [Here's where you can check my digital artwork.](https://www.narendravardi.com/digital-artwork) - **DALL-E**:[I have already talked about DALL-E](https://www.narendravardi.com/dall-e/). Big fan of this platform. [Here's where I host the artwork created with the help of DALL-E](https://www.narendravardi.com/dall-e-artwork/). --- Enjoyed this page? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Digital Art Work URL: https://www.narendravardi.com/digital-artwork/ Last updated: 2022-09-28T07:35:17.000Z I like *real* painting but am not a fan of the cleaning activity follows after painting. When I learnt about digital painting, I had to try it. It's such a calming process, especially during the COVID-19 lockdown. I have used an iPad with Procreate app for all my paintings. This page consists of the digital painting that I created during the lockdown. At this point, there are only a few images since I was not very satisfied with the majority of the paintings I did. Hope you like the below paintings! :) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0802-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0817-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0818-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0819-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0820-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0821-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0824-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0829-min-1.JPG) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/IMG_0835-min.JPG) --- Enjoyed this page? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### DALL-E Artwork URL: https://www.narendravardi.com/dall-e-artwork/ Last updated: 2023-11-20T17:27:38.000Z I created the below paintings with the help of DALL-E. If you haven't heard of DALL-E, [see my blog post explaining it.](https://www.narendravardi.com/dall-e/) I wanted to try and analyse the creation of artwork by DALL-E from Indian culture's perspective, and here are some of the results. The initial inputs I gave to DALL-E weren't that satisfactory. I gave many prompts to DALL-E, but only a few were satisfactory. But since this is an AI, I am optimistic that it would evolve to support this segment. Here's some of the artwork I created with the help of DALL-E from Indian culture's perspective. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-28-11.26.49---Digital-Painting-of-an-Indian-child-struggling-to-study--min.jpg) Digital Painting of an Indian child struggling to study ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-28-11.23.23---Oil-painting-of-two-brother-crossing-the-chaotic-Indian-road.--min.jpg) Oil painting of two brothers crossing the chaotic Indian road. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-28-11.25.52---A-young-man-watching-gateway-of-India-in-the-morning-with-sunrise-in-the-background--digital-painting.--min.jpg) A young man watching gateway of India in the morning with sunrise in the background, digital Painting. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-28-11.27.02---An-impressionist-painting-containing-an-Indian-male-adult-in-his-20s-before-standing-before-Eiffel-Tower-with-water-canal-visible-on-a-nice-sunny-day-min.jpg) An impressionist painting containing an Indian male adult in his 20s before standing before Eiffel Tower with water canal visible on a nice sunny day ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-28-11.27.43---Crowded-Indian-roads-at-night.-Puck-art-min.jpg) Crowded Indian roads at night. Puck art ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-28-11.29.59---People-doing-Garba.-Dwarkadhish-Temple-in-the-background.-Digital-art.-min.jpg) People doing the Garba. Dwarkadhish Temple in the background. Digital art. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-28-11.29.03---A-silhouette--of-Brachiosaurus-walking-near-the-Gateway-of-India-during-the-golden-hours.-The-background-is-beautiful-with-shades-of-red-and-orange-wi-min.jpg) A silhouette of a dinosaur walking near the Taj Mahal during the golden hours. The background is beautiful with shades of red and orange with slight blue. --- Enjoyed this page? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Photography Work URL: https://www.narendravardi.com/photography-work/ Last updated: 2022-10-04T17:47:11.000Z To the friends of mine who do not use Instagram. Here's my photography work! :) > [ View this post on Instagram ](https://www.instagram.com/p/CiX5vLGPQEa/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) > > [A post shared by Naren (@worthyphotographer)](https://www.instagram.com/p/CiX5vLGPQEa/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) > [ View this post on Instagram ](https://www.instagram.com/p/CiVTOtvpxIq/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) > > [A post shared by Naren (@worthyphotographer)](https://www.instagram.com/p/CiVTOtvpxIq/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) > [ View this post on Instagram ](https://www.instagram.com/p/CiRSaXBJ1ct/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) > > [A post shared by Naren (@worthyphotographer)](https://www.instagram.com/p/CiRSaXBJ1ct/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) ### YouTube Work URL: https://www.narendravardi.com/youtube-work/ Last updated: 2022-09-26T10:27:26.000Z WIP :D ### My work on 360° picture URL: https://www.narendravardi.com/360-picture-work/ Last updated: 2022-10-24T07:38:11.000Z *Get immersedin the world of* 360° pictures. 💡 Highly recommend you to enter full-screen mode while viewing these images. You can enter full-screen mode by clicking on the square button visible in the right-centre of the picture. I have already talked about my [experience of clicking my first 360° Photograph](https://www.narendravardi.com/360-photo/). It's mesmerising. I share some of the 360° photographs I captured on this page. ### An hour before sunset near Iskcon Temple ### A Calm evening on the highway ### Blue and Purple sky during sunset ### Blue Clouds Evening ### My first ever 360° photograph --- Enjoyed this page? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Hire me as a mentor or coach URL: https://www.narendravardi.com/hire-me/ Last updated: 2024-09-27T01:49:23.000Z If you are someone who aspires to become a Software Engineer at *Big Tech* companies like *Meta(Facebook), Amazon, Apple, Netflix*, and *Alphabet*. You are in the correct place. I am Narendra Vardi, and I have worked with some of the best companies in India, namely **Google, Flipkart** and **Amazon**. I am open to guiding you to become the best version of yourself. I mentored a handful of freshers at online academies which train Software Engineers. Under my mentorship, students received job opportunities from companies which offered to pay 2x to 3x of their current salaries (Though salaries are a terrible benchmark, I'm sure you all agree that 2x to 3xsalary is far better than 1x salary as a fresher). Some students have made significant progress as software engineers over the last two years. I am open to the following services in a 1:1 setting. - Resume reviewing - Mentoring - Software Consultation - Teaching or coaching - Any queries related to C++, Java, and Python - Schengen Visa consultation (I have travelled to Europe twice and know how to gather all the necessary resources to get Schengen Visa approval). [Drop me an email](mailto:narendravardi1127@gmail.com) to know my charges. Based on your situation, I am flexible about changing the fare. If you are a business or have special requirements, please mention that. We can discuss and take it forward. Copy my email id from here: `narendravardi1127@gmail.com` --- If you want to know more about me, check out the below links: - [Resume](https://www.narendravardi.com/resume/) - [LinkedIn](https://www.linkedin.com/in/narendravardi/?ref=narendravardi.com) - [GitHub](https://github.com/narendravardi/?ref=narendravardi.com) - [About me](https://www.narendravardi.com/about) --- If you are not interested in hiring me, consider subscribing! :) [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- ### Resume of Narendra Vardi URL: https://www.narendravardi.com/resume/ Last updated: 2022-10-11T13:09:53.000Z _No content available._ ### Say Thanks URL: https://www.narendravardi.com/say-thanks/ Last updated: 2024-09-27T01:49:15.000Z I love it when people tell me they have learnt something from what I have written or talked about. If you’ve found something helpful, used my work as an example, or learnt something new – please [send me a message](mailto:narendravardi1127@gmail.com) and tell me about it. A friendly email can make my day! If you’re feeling generous, depending on where you are, you can use of the options: 1. If you are an Indian and own a UPI VPA, then use my vpa: **narenaxl@axl** to transfer. 2. You can [send me a coffee](https://www.buymeacoffee.com/narendravardi?ref=narendravardi.com) on buymeacoffee ### All Articles URL: https://www.narendravardi.com/articles-list/ Last updated: 2026-08-05T04:42:31.000Z For the latest articles, refer to the home page. This list will be updated monthly! :) - [✍️Mapping Google Maps' location to Mappls' MapmyIndia location](https://www.narendravardi.com/gmaps-mapmyindia/) - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) - [😔How to prepare for your next layoff in India](https://www.narendravardi.com/next-layoff/) - [How to apply for Schengen Visa to France as an Indian](https://www.narendravardi.com/how-to-apply-for-french-schengen-visa/) - [✍️Does consistency win over quality?](https://www.narendravardi.com/consistency-over-quality/) - [✍️Why DJI Mini3 Pro is the best beginner drone - Part I](https://www.narendravardi.com/part1-djimini3pro/) - [🔒It's Safer Internet Day! Two mechanisms to prevent account hacking](https://www.narendravardi.com/safer-internet/) - [🚲If you have relocated to a new country, visit Expat meetups](https://www.narendravardi.com/expat-meetups/) - [✍️Measures to increase productivity](https://www.narendravardi.com/productivity-measures/) - [🤔What does it mean if we can control an Air Conditioner (AC) using a mobile?](https://www.narendravardi.com/ac-remote/) - [🎨Let's talk about some of the famous paintings of the world](https://www.narendravardi.com/famous-paintings/) - [🤖Automating the boring stuff: How I obtained the titles of all articles on my blog](https://www.narendravardi.com/list-automation/) - [📷Minimalist photographs of farm fields](https://www.narendravardi.com/farm-patterns/) - [✍️Finding the Nth highest salary from an SQL table](https://www.narendravardi.com/nth-salary/) - [🎙️Solo Trip to Europe: Podcast interview](https://www.narendravardi.com/soloeurotrip-interview/) - [🚌Bus Factor in the IT World](https://www.narendravardi.com/bus-factor/) - [If you throw a stone in Bangalore, it will hit a dog or a Software Engineer](https://www.narendravardi.com/engineer-blr/) - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) - [🎉How did knowing different programming languages help me during my college placements?](https://www.narendravardi.com/different-languages/) - [The Imagination vs reality of purchasing a good car](https://www.narendravardi.com/buy-car/) - [Five mistakes people make while building a resume for the first time](https://www.narendravardi.com/resume-mistakes/) - [How to embed your 360s on Ghost](https://www.narendravardi.com/embed-360/) - [Capturing light trails of traffic in Bangalore](https://www.narendravardi.com/light-trails/) - [Travelling to Paris all alone](https://www.narendravardi.com/reaching-alone/) - [Reach your travel destination before the night falls](https://www.narendravardi.com/reaching-destination/) - [Things I wish I had known before my first internship](https://www.narendravardi.com/student-professional/) - [Why I do not purchase Spotify Premium](https://www.narendravardi.com/spotify-premium/) - [🔥 Breath-taking 360° photograph up in the air](https://www.narendravardi.com/360-photo/) - [Podcasts I listen to these days](https://www.narendravardi.com/podcasts-i-listen-to/) - [Log4J Vulnerability](https://www.narendravardi.com/log4j-vulnerability/) - [Inside the mind of a Java Programmer while writing C++ code](https://www.narendravardi.com/java-cpp/) - [Goa trip with college friends](https://www.narendravardi.com/goa-trip/) - [Learning to fly a drone and (three + one) dimensional space](https://www.narendravardi.com/flying-drone/) - [Time-saving tricks for Google Docs](https://www.narendravardi.com/one-click/) - [Save and share highlights like a pro on Android](https://www.narendravardi.com/save-n-share/) - [International purchases and the sweet kick on the butt](https://www.narendravardi.com/international-purchases/) - [Why was I so miserable during my farewell?](https://www.narendravardi.com/miserable-farewell/) - [Do yourself a favour and visit No Sleep Page](https://www.narendravardi.com/sleep-page/) - [Negotiate to keep moving forward](https://www.narendravardi.com/moving-forward/) - [Best way to make running a new habit](https://www.narendravardi.com/running-habit/) - [Avoiding Perfection while blogging](https://www.narendravardi.com/tackling-perfection/) - [Most under-rated Skill to become a Good Programmer](https://www.narendravardi.com/underrated-skill/) - [Use HTML version of Gmail to quickly lookup OTPs](https://www.narendravardi.com/html-gmail/) - [Learnings from two years of Work From Home](https://www.narendravardi.com/wfh-learnings/) - [The forgotten Smart Watch company: Pebble](https://www.narendravardi.com/pebble-watch/) - [What did you like about this book?](https://www.narendravardi.com/bad-book/) - [Why I chose a boring domain name](https://www.narendravardi.com/boring-domain/) - [Please improve the UI/UX of the delete account page](https://www.narendravardi.com/delete-account/) ## Posts ### A Reliable Way to Download Large Google Takeout Files URL: https://www.narendravardi.com/a-reliable-way-to-download-large-google-takeout-files/ Last updated: 2026-08-26T12:11:54.000Z Downloading a large Google Takeout archive through the browser can be frustrating. If the internet connection is interrupted, the download may fail and force you to start again. I found a more convenient approach: export the archive to Google Drive and let the Google Drive desktop app make it available offline. ## 1\. Create the Google Takeout export Open [Google Takeout](https://takeout.google.com/?ref=narendravardi.com) and select the data you want to export. 1. Click **Next step**. 2. Under **Destination**, select **Add to Drive** instead of **Send download link via email**. For the remaining options, use the default values. Click **Create export**. Google will prepare the archive and add it to a Takeout folder in your Google Drive. Depending on the amount of data, this may take anywhere from a few minutes to several days. The exported files count towards your Google Account storage, so make sure your account has enough free space. ![Screenshot 2026-08-05 at 02.04.25.png](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2026/08/Screenshot-2026-08-05-at-02.04.25.png) ## 2\. Install Google Drive for desktop Download and install [Google Drive for desktop](https://www.google.com/drive/download/?ref=narendravardi.com) on your Mac. Open the app and sign in with the same Google Account used to create the Takeout export. After signing in, Google Drive appears as a location in Finder. ## 3\. Make the Takeout folder available offline Once Google finishes creating the export: 1. Open **Finder**. 2. Select **Google Drive** from the sidebar. 3. Open **My Drive** and locate the **Takeout** folder. 4. Right-click the folder, or the individual archive files. 5. Select **Offline access → Available offline**. Google Drive will download the files in the background. You can monitor the progress from the Google Drive icon in the macOS menu bar. The app also lets you pause and resume syncing. Wait until the files show as available offline before disconnecting the internet or moving them elsewhere. Large Takeout archives require the same amount of free local disk space, so check your Mac's available storage first. ## What about Windows? The same approach works on Windows. Install Google Drive for desktop, open **Google Drive** in File Explorer, locate the Takeout folder, and select **Offline access → Available offline** from the right-click menu. ## Why I prefer this approach you ask? ![Screenshot 2026-08-05 at 01.58.17.png](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2026/08/Screenshot-2026-08-05-at-01.58.17.png) ### You kidding me! Worktrees were part of Git since 2015. URL: https://www.narendravardi.com/you-kidding-me-worktrees-were-part-of-git-since-2015/ Last updated: 2026-07-31T10:30:22.000Z I thought of writing an article about how revolutionary Git worktrees are now that agentic coding has become the norm. Worktrees fit so naturally into agentic coding that I assumed the feature was introduced in the AI era, for the AI era. Turns out, I was so wrong. Worktrees have been part of Git since 2015. ![Screenshot 2026-07-28 at 23.36.03.png](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2026/07/Screenshot-2026-07-28-at-23.36.03-1.png) Can you imagine that? The feature existed for nearly ten years before agentic coding brought it into the limelight. Imagine building something that does not get the attention it deserves for almost a decade. If you were working in a corporation, someone might question the adoption numbers, move the feature into maintenance mode, or perhaps even fire you 😄. But the developer behind worktrees should be proud. They built a feature that was far ahead of its time. It simply had to wait for the rest of software development to catch up. Damn, worktrees finally got the limelight they deserve! ### Use caffeinate to keep Claude Code and Codex running on Mac URL: https://www.narendravardi.com/use-caffeinate-to-keep-claude-code-and-codex-running-on-mac/ Last updated: 2026-07-28T17:56:13.000Z AI coding tools are becoming part of my regular terminal workflow. Tools like Claude Code and Codex are useful when I want to explore a codebase, ask for a refactor, run tests, or let an agent work through a task. But there is one very boring problem that can interrupt this flow: The Mac goes to sleep. This becomes more painful when I am connected to an office VPN. Slightly longer-running tasks need the network connection to stay alive. If the laptop sleeps, the VPN can disconnect, and the task may pause, fail, or need manual attention again. Earlier, I had written about [No Sleep Page](https://www.narendravardi.com/sleep-page/), which is a simple webpage that prevents the laptop from sleeping. That works well when you want a browser-based solution. One drawback is that No Sleep Page needs the browser tab to stay in the foreground. The page itself says: > This can only keep your computer awake if this tab is kept in the foreground. But if you are already working inside the terminal, macOS has an even cleaner option. It is called `caffeinate`. ## What is `caffeinate`? `caffeinate` is a macOS command-line tool that prevents your Mac from sleeping. It is already available on macOS, so there is nothing new to install. For this workflow, you only need a few options: - `-i`: prevent idle sleep. This is the one I use most often for terminal commands. - `-d`: prevent the display from sleeping. - `-t `: keep the Mac awake for a fixed number of seconds. - `-w `: keep the Mac awake until a specific process exits. You can combine options. For example, `-di` means keep the display awake and prevent idle sleep. The simplest version is: ```bash caffeinate ``` Run this in Terminal, and your Mac will stay awake until you stop the command using `Ctrl + C`. But the more useful way is to run another command through `caffeinate`. For example: ```bash caffeinate -i npm test ``` In this case, macOS will stay awake while `npm test` is running. Once the command exits, `caffeinate` also stops doing its work. That is the main idea: > Keep the Mac awake only while the important command is running. The Terminal window does not need to stay in the foreground. You can start a long-running command with `caffeinate`, switch to another app, and macOS will still keep the machine awake while that command is active. ## Using `caffeinate` with Claude Code and Codex Claude Code and Codex can take time when the task is non-trivial: reading a large repository, running tests, fixing lint errors, refactoring files, or reviewing a pull request. These are exactly the runs where I do not want idle sleep to interrupt the session. For Claude Code: ```bash caffeinate -i claude ``` For Codex: ```bash caffeinate -i codex ``` For most cases, I would start with `-i`. The display can turn off, but the terminal work continues. If you want to keep the display awake too, use `-di`: ```bash caffeinate -di claude caffeinate -di codex ``` ## Running it for a fixed time Sometimes you do not want to attach `caffeinate` to a command. You just want the Mac to stay awake for some time. I frequently use it for 30 minutes after a plan is generated. That gives the agent a focused window for implementation and execution without the Mac sleeping in the middle. ```bash caffeinate -t 1800 ``` The time is in seconds. For one hour, use: ```bash caffeinate -t 3600 ``` ## Background or already-running tasks If you are starting a background task now, you can background the whole `caffeinate` command: ```bash caffeinate -i ./long-running-task.sh & ``` If the task is already running, find its process ID and use `-w`: ```bash caffeinate -i -w 12345 ``` Here, `12345` is the process ID. `caffeinate` keeps the Mac awake until that process exits. ## Key takeaway If you use Claude Code or Codex on macOS, `caffeinate` is one of those tiny commands worth knowing. You do not need to install a new app. You do not need to change system settings permanently. Just run the important command through `caffeinate`, and let the Mac stay awake until the work is done. Reference: ```bash man caffeinate ``` ### Why I still prefer Markdown over HTML for AI-generated files URL: https://www.narendravardi.com/why-i-still-prefer-markdown-over-html-for-ai-generated-files/ Last updated: 2026-06-06T10:30:44.000Z Recently, I have seen a trend where people ask AI tools to generate HTML pages instead of Markdown files. I understand why. HTML output can look beautiful. You can have nice layouts, colours, diagrams, navigation, collapsible sections, and even small interactive widgets. If you are trying to understand a complicated topic quickly, a well-designed HTML page can be much easier to grasp than a plain Markdown file. Also, with newer models and larger context windows, the token cost of generating HTML does not feel as scary as it used to. There are already a few good links on why HTML is gaining traction: - [Using Claude Code: The unreasonable effectiveness of HTML](https://claude.com/blog/using-claude-code-the-unreasonable-effectiveness-of-html?ref=narendravardi.com) - [Simon Willison's link post on the same idea](https://simonwillison.net/2026/May/8/unreasonable-effectiveness-of-html/?ref=narendravardi.com) - [Thariq Shihipar's X post on HTML output](https://x.com/trq212/status/2052809885763747935?ref=narendravardi.com) The core point is valid: HTML gives the model a richer canvas. But I still prefer Markdown for most work-related AI outputs. ## HTML is great until you have to share it The problem starts after the HTML file is generated. If I am working alone, HTML is probably the best option. I can generate a fancy page, open it in the browser, and enjoy the custom formatting. Diagrams look good. Sections are easier to scan. The whole thing feels polished. But work is rarely solo. The moment I want to share it with a teammate, HTML becomes slightly awkward. What do I send? - The `.html` file? - A zip file with assets? - A downloaded file that they have to open manually? - A screenshot? This is where the experience starts to break. Asking a co-worker to download an HTML file and open it locally does not feel natural. Sending a link that opens directly is much better. Markdown files fit that workflow nicely because GitHub, GitLab, and many internal tools already know how to render them. ## Markdown fits collaboration better Markdown is boring, but it works beautifully for collaboration. You can commit a `.md` file to Git. You can review it in a pull request. You can send a GitHub link to a teammate. You can copy it into Confluence or Google Docs with much less pain. You can version it, diff it, comment on it, and improve it over time. That is a big advantage. With HTML, the first version may look great. But once you need to edit, review, migrate, or publish it somewhere else, it becomes extra work. ## Portability is the real issue This is the biggest pain point for me. AI-generated HTML does not always port cleanly back to Markdown, Confluence, or Google Docs. The layout may depend on CSS. The diagrams may be inline SVG. The content may be mixed with styling. The output may look nice in the browser, but extracting clean text from it later is not always fun. Markdown keeps the content separate from the presentation. That sounds boring, but it is exactly what makes it useful. ## A simple way to think about it Use HTML when: - You are working alone. - You want a rich explanation. - You need diagrams, interactions, or a custom visual layout. - The output is mainly for reading once. Use Markdown when: - You need to share it with a team. - You want to commit it to Git. - You want comments and review. - You may need to move it to Confluence, Google Docs, or a blog. - The document may evolve over time. ## My current preference For me, the default is still Markdown. If I need a quick visual explanation for myself, HTML is excellent. But if the output needs to live longer than one reading session, Markdown is safer. It is easier to share, easier to edit, easier to review, and easier to migrate. HTML gives better presentation. Markdown gives better collaboration. And in most workplace situations, collaboration matters more. ## Final thoughts Organisations can still make HTML sharing work. For example, they can enable GitHub Pages for internal projects. In that case, an AI-generated HTML file can be committed to the repository and shared as a normal link. That solves a big part of the problem. But Confluence is still a hard truth. It does not support HTML rendering in a simple, native way. Confluence also does not seem to be doing a great job with AI, other than Rovo. If Confluence could safely render HTML pages or HTML-style artifacts, it would be a game changer for teams. Until that happens, Markdown remains the safer default for collaborative documents. ### The easiest way to read Markdown files in Chrome URL: https://www.narendravardi.com/the-easiest-way-to-read-markdown-files-in-chrome/ Last updated: 2026-05-30T10:30:34.000Z AI tools create a lot of `.md` files. They are excellent for writing, but not always pleasant to read. These days, I keep seeing files like `README.md`, `PLAN.md`, `NOTES.md`, and draft articles generated in Markdown. Opening them in an IDE feels like overkill. IDEs assume that I want to edit the file, search through code, or make changes. But most of the time, all I want is simple: open the file and read it comfortably. > Open a Markdown file directly in Chrome and read it like a formatted article. The flow is simple: 1. AI tools create `.md` files. 2. Chrome opens the local file. 3. Markdown Viewer renders it like a readable article. ## The solution Install [Markdown Viewer](https://github.com/simov/markdown-viewer?ref=narendravardi.com), a browser extension that renders Markdown files inside Chrome. **Before:** Raw Markdown text with symbols like `#`, `-`, and backticks everywhere. **After:** Headings, lists, code blocks, tables, links, and images rendered like a normal article. ## Setup 1. Install [Markdown Viewer from the Chrome Web Store](https://chromewebstore.google.com/detail/markdown-viewer/ckkdlimhmcjmikdlpkmbgfkaikojcbjk?ref=narendravardi.com). 2. Open `chrome://extensions`. 3. Locate the Markdown Viewer extension and click the `Details` button. ![Open the Details page for the Markdown Viewer extension.](https://i.imgur.com/kzullaI.png) Next, turn on `Allow access to file URLs`. ![Allow access to file URLs setting enabled for Markdown Viewer.](https://i.imgur.com/VVcPv0T.png) ## Open .md files in Chrome by default To make this even smoother, set Chrome as the default app for `.md` files. 1. Right-click any `.md` file. 2. Choose `Get Info` on macOS, or `Open with` on Windows. 3. Select Google Chrome. 4. On macOS, click `Change All...`. On Windows, enable `Always use this app`. Now you can double-click a Markdown file and read it directly in Chrome. ## Small note If the file still opens as raw text, check whether `Allow access to file URLs` is enabled. That is the setting people usually miss. Reference: [Markdown Viewer GitHub repository](https://github.com/simov/markdown-viewer?ref=narendravardi.com) ### The nightmare that is squash merge ft Github URL: https://www.narendravardi.com/the-nightmare-that-is-squash-merge-ft-github/ Last updated: 2026-02-14T10:30:06.000Z # Git Squash Merge Workflow Guide A comprehensive guide to handling merge conflicts when using squash merging in your git workflow. --- ## Table of Contents 1. [The Problem with Squash Merging](#the-problem-with-squash-merging) 2. [The Wrong Approach (Don't Do This)](#the-wrong-approach-dont-do-this) 3. [How to Identify Which Commits Are Already Merged](#how-to-identify-which-commits-are-already-merged) 4. [The Right Approach: Interactive Rebase](#the-right-approach-interactive-rebase) 5. [Automating the Process with a Shell Script](#automating-the-process-with-a-shell-script) 6. [Workflow Summary](#workflow-summary) 7. [Commands Reference](#commands-reference) 8. [Key Takeaway](#key-takeaway) 9. [Disclaimer](#disclaimer) --- ## The Problem with Squash Merging When teams use squash merging for PRs, this creates a common conflict scenario: 1. Create feature branch 2. Make commits C1, C2, C3 3. Raise PR after C2 4. PR gets squash merged to master 5. Continue working on same branch with C4, C5 6. Try to pull origin/master → **CONFLICTS** The conflicts happen because: - Local branch has C1, C2, C3, C4, C5 - Master has \[C1+C2\]\* (squashed commit with different hash) - Git sees C1 and C2 as different from \[C1+C2\]\* --- ## The Wrong Approach (Don't Do This) ```bash # ❌ This causes conflicts git pull origin master ``` This creates merge conflicts even though the code is identical. --- ## How to Identify Which Commits Are Already Merged This is the key question: which commits should you drop (rebase) or skip (cherry-pick)? **The simplest approach: Open your PR on GitHub/GitLab** 1. Open your merged PR in the web browser 2. Go to the "Commits" tab 3. Note ALL commits in the PR (from first to last) 4. During interactive rebase, delete lines for ALL those commits (not just first and last - everything in between too!) **Example:** ``` Open PR #42 on GitHub: Commits tab shows: ✓ aaa111 - Setup auth routes ← First commit in PR ✓ bbb222 - Add middleware ← Middle commit in PR ✓ ccc333 - Add login form ← Last commit in PR You must delete ALL three commits (aaa111, bbb222, ccc333)! During git rebase -i origin/master, the editor shows: pick aaa111 Setup auth routes pick bbb222 Add middleware pick ccc333 Add login form pick ddd444 Fix auth redirect ← NEW (keep) pick eee555 Add session timeout ← NEW (keep) pick fff666 Add logout button ← NEW (keep) Option A - Delete entire lines (easiest): pick ddd444 Fix auth redirect ← Keep pick eee555 Add session timeout ← Keep pick fff666 Add logout button ← Keep Option B - Change "pick" to "drop": drop aaa111 Setup auth routes ← Drop drop bbb222 Add middleware ← Drop drop ccc333 Add login form ← Drop pick ddd444 Fix auth redirect ← Keep pick eee555 Add session timeout ← Keep pick fff666 Add logout button ← Keep Option C - Comment out with #: # pick aaa111 Setup auth routes ← Drop # pick bbb222 Add middleware ← Drop # pick ccc333 Add login form ← Drop pick ddd444 Fix auth redirect ← Keep pick eee555 Add session timeout ← Keep pick fff666 Add logout button ← Keep ``` **All three methods work the same!** Deleting the line is usually fastest. --- ## The Right Approach: Interactive Rebase ```bash # Fetch latest changes git fetch origin # Interactive rebase - drop merged commits git rebase -i origin/master # In editor, drop merged commits by either: # 1. Deleting the entire line (easiest) # 2. Changing "pick" to "drop" # 3. Commenting out with # # Keep (pick) new commits that aren't in master yet ``` **How the commit history looks:** ``` BEFORE interactive rebase: feature branch: A → B → C1 → C2 → C3 → C4 master: A → B → [C1+C2]* (squashed) During rebase editor (before your edits): pick C1 # Already in master pick C2 # Already in master pick C3 # New work pick C4 # New work After your edits (just delete C1 and C2 lines): pick C3 # New work pick C4 # New work AFTER interactive rebase: feature branch: A → B → [C1+C2]* → C3 → C4 master: A → B → [C1+C2]* ``` **Result:** Your feature branch now has the same base as master (including the squashed commit), plus only your new commits (C3, C4). The original C1 and C2 are gone, replaced by the squashed version from master. --- ## Automating the Process with a Shell Script Instead of manually editing the rebase file, you can automate the entire process with a single command. ### How It Works The automation follows these steps: 1. **Fetch the latest changes** from `origin/master` 2. **Get commit hashes from the PR** using `gh pr view` command 3. **Create a temporary editor script** that automatically modifies the rebase todo file 4. **Run interactive rebase** with a custom `GIT_SEQUENCE_EDITOR` that: - Finds all commits from the PR in the rebase todo list - Comments them out (effectively dropping them) - Keeps all other commits unchanged 5. **Clean up temporary files** \- Delete the temporary editor script that was created in step 3 ### Why a Temporary Editor Script? When you run `git rebase -i origin/master`, git creates a todo file with all commits and opens it in your editor (vim, nano, etc.). You manually edit the file, save, and close it. Git then reads your changes and performs the rebase. To automate this: - We can't directly edit the file because git hasn't created it yet - We need to intercept the moment when git opens the editor - We use `GIT_SEQUENCE_EDITOR` to tell git: "Instead of opening vim/nano, run THIS script" - Our script acts as a fake "editor" that: - Receives the todo file path from git - Reads it, modifies it (drops the commits), saves it - Exits immediately (no human interaction needed) - Git continues with the rebase using our modified file The temporary script exists only during the rebase operation, then gets deleted. ### Prerequisites - `gh` CLI must be installed and authenticated - You must be in a git repository - The PR must be accessible (merged or open) ### Option 1: Standalone Shell Script Create a file called `rebase-drop-pr.sh`: ```bash #!/bin/bash # Usage: ./rebase-drop-pr.sh # Example: ./rebase-drop-pr.sh 42 set -e if [ -z "$1" ]; then echo "Usage: $0 " exit 1 fi PR_NUMBER=$1 echo "Fetching commits from PR #$PR_NUMBER..." COMMITS=$(gh pr view "$PR_NUMBER" --json commits --jq '.commits[].oid' | cut -c1-7) if [ -z "$COMMITS" ]; then echo "Error: Could not fetch commits from PR #$PR_NUMBER" exit 1 fi echo "Commits to drop: $COMMITS" EDITOR_SCRIPT=$(mktemp) cat > "$EDITOR_SCRIPT" << 'EDITORSCRIPT' #!/bin/bash while IFS= read -r line; do should_drop=false for commit in $COMMITS_TO_DROP; do if [[ "$line" == pick\ $commit* ]]; then should_drop=true break fi done if [ "$should_drop" = true ]; then echo "# $line # AUTO-DROPPED" else echo "$line" fi done < "$1" > "$1.new" mv "$1.new" "$1" EDITORSCRIPT chmod +x "$EDITOR_SCRIPT" export COMMITS_TO_DROP="$COMMITS" git fetch origin echo "Starting interactive rebase..." GIT_SEQUENCE_EDITOR="$EDITOR_SCRIPT" git rebase -i origin/master rm "$EDITOR_SCRIPT" echo "✅ Done! Commits from PR #$PR_NUMBER have been dropped." ``` **Setup:** ```bash # Save the script and make it executable chmod +x ~/rebase-drop-pr.sh # Use it ~/rebase-drop-pr.sh 42 ``` --- ### Option 2: Git Alias (Recommended) Add it as a git alias to your `~/.gitconfig` for easier access: ```bash git config --global alias.drop-pr '!f() { if [ -z "$1" ]; then echo "Usage: git drop-pr " return 1 fi echo "Fetching commits from PR #$1..." COMMITS=$(gh pr view "$1" --json commits --jq ".commits[].oid" | cut -c1-7) if [ -z "$COMMITS" ]; then echo "Error: Could not fetch commits from PR #$1" return 1 fi echo "Commits to drop: $COMMITS" EDITOR_SCRIPT=$(mktemp) cat > "$EDITOR_SCRIPT" << "EDITORSCRIPT" #!/bin/bash while IFS= read -r line; do should_drop=false for commit in $COMMITS_TO_DROP; do if [[ "$line" == pick\ $commit* ]]; then should_drop=true break fi done if [ "$should_drop" = true ]; then echo "# $line # AUTO-DROPPED" else echo "$line" fi done < "$1" > "$1.new" mv "$1.new" "$1" EDITORSCRIPT chmod +x "$EDITOR_SCRIPT" export COMMITS_TO_DROP="$COMMITS" git fetch origin GIT_SEQUENCE_EDITOR="$EDITOR_SCRIPT" git rebase -i origin/master rm "$EDITOR_SCRIPT" echo "✅ Done! Commits from PR #$1 have been dropped." }; f' ``` This command adds the alias to your global git configuration. You only need to run it once. ### Usage Once the alias is added, simply run: ```bash git drop-pr 42 ``` **Example output:** ```bash $ git drop-pr 42 Fetching commits from PR #42... Commits to drop: aaa111 bbb222 ccc333 Fetching latest changes from origin/master... Starting interactive rebase... Successfully rebased and updated refs/heads/feature-auth. ✅ Done! Commits from PR #42 have been dropped. ``` That's it! One command automatically drops all merged commits from the specified PR. --- ## Commands Reference ```bash # Safe fetch without conflicts git fetch origin # Check what commits are in master but not in your branch git log HEAD..origin/master --oneline # Check what commits are in your branch but not in master git log origin/master..HEAD --oneline # Interactive rebase to clean up git rebase -i origin/master # Create fresh branch from master git checkout -b new-branch origin/master # Abort rebase if needed git rebase --abort ``` --- ## Key Takeaway **Never use `git pull origin master`** when working on a branch that has had a PR squash merged. Instead: 1. `git fetch origin` to get latest changes 2. `git rebase -i origin/master` to interactively handle conflicts 3. Drop commits that were already merged 4. Keep commits that are new **Pro tip:** Use the automation script above to drop commits with a single command! --- ## Acknowledgment 💡 This guide was enhanced with AI assistance to provide thorough documentation and practical solutions for squash merge challenges. ### The Best Voice-to-Text App for Instant Transcription URL: https://www.narendravardi.com/the-best-voice-to-text-app-for-instant-transcription/ Last updated: 2025-12-06T10:31:00.000Z There are certain **nuances** that the default voice-to-text conversion features provided by operating systems on **iPhone, Android, and even Mac** are not solving. The system may struggle with **grammatical errors**, **unfamiliar vocabulary**, or a speaker's **accent**. To improve results, the app should offer an interface that allows the user to **pause and think** before continuing their dictation. Basically, the apps provided by the operating systems are **bare minimum**, only intended to **showcase the functionality**. They **do not work for everyone**, and I believe they are only effective for **less than 1%** of the population. I recently found an app that works exceptionally well for me: [**Wispr Flow**](https://wisprflow.ai/r/NAREN17?ref=narendravardi.com). I've been experimenting with it, and it's performing absolutely fine! The app is currently free for about a month. For anyone whose work is predominantly remote or work from home, I would definitely recommend buying a subscription. > This is the exact app I needed when I was working from home during the COVID-19 period. I'm very glad it is available now! I will certainly be using this tool to **draft and explore my thoughts and ideas**. By the way, this works beautifully on **Mac**, but the experience on **iPhone** hasn't been great. If you are a dedicated Mac user, I definitely recommend checking it out. --- Please note: The wisprflow.ai link is a referral link. If you sign up using it, you are not penalized, and I will receive an extension of my free usage by one month. Your support is appreciated. ### 🎙️How I Use MacBook Dictation to Write Faster (Setup Guide Included) URL: https://www.narendravardi.com/how-i-use-macbook-dictation-to-write-faster-setup-guide-included/ Last updated: 2025-09-27T10:30:14.000Z One of the features that I really like about using a MacBook is its voice-to-text conversion feature called `Dictation`. > You invoke this feature, you talk what you want to type. And the system will take care of typing it for you. I don't see many people using this feature, so I thought it would be a good idea to document the steps on how to enable it. --- ### How to enable Dictation on a MacBook 1. Click the **Apple menu ** (top left) → **System Settings**. 2. In the sidebar, select **Keyboard**. 3. Scroll down to **Dictation** and toggle it **On**. 4. Choose your **preferred language** and **shortcut key** (default is pressing the **fn (Globe) key** twice). 5. If prompted, allow the necessary microphone permissions. After the feature is enabled, invoke, talk, and let the MacBook type everything out. --- Pro tip: 1. I’ve found that speaking slowly increases the accuracy rate. 2. Ensure that you review the text that is typed (before sending😈) There are some bugs within this feature, but I think they're not so frustrating. ### Java Shot #6: Cut Down on Boilerplate with Java Records URL: https://www.narendravardi.com/java-shot-6-say-goodbye-to-boilerplate-let-java-records-do-the-work/ Last updated: 2025-05-30T10:30:59.000Z One of the common complaints of Java is the amount of boilerplate code we have to write for a simple class to work. Let's say we want to write a simple class which stores details of a Person, ideally, we just have to be concerned about the data variables and the functions of the Person class. But in Java, we have to write a lot more. What are those you ask? 1. Constructors 2. Getters 3. Setters 4. equals() 5. hashCode() > You can use [lombak](https://projectlombok.org/?ref=narendravardi.com) to avoid writing these methods but what if you do not want to introduce an additional library into your application, what would you do? > In that case, you can use the IDEs to auto-generate these methods but there's a catch, and that is, adding a new data variables requires us to re-generate these methods, Imagine you forgot to update `equals()` and `hashCode()` method; It's a disaster waiting to happen. --- To solve above mentioned problems, a special type of class is introduced in Java 14 called `Record` An excellent explanation of this new class is provided on the Baeldung website. But here's the gist: ## Person class using `class` keyword ```Java public class Person { private final String name; private final String address; public Person(String name, String address) { this.name = name; this.address = address; } @Override public int hashCode() { return Objects.hash(name, address); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof Person)) { return false; } else { Person other = (Person) obj; return Objects.equals(name, other.name) && Objects.equals(address, other.address); } } @Override public String toString() { return "Person [name=" + name + ", address=" + address + "]"; } // standard getters } ``` Source: [baeldung.com](https://www.baeldung.com/java-record-keyword?ref=narendravardi.com) ## Person class using `record` keyword ```Java public record Person (String name, String address) {} ``` Source: [baeldung.com](https://www.baeldung.com/java-record-keyword?ref=narendravardi.com) Using a Record is as simple as a single-line code. That's awesome, isn't it but there's a catch, read below! 🚧 Record generates final data members and hence setters will not be generated. Just remember `record` keyword when you need `Immutability`. ## Key Usages of Record: Consider using `record` for Requests and Responses in your controller and external calls. (Ensure that `record` is compatible with libraries that are used in your application like Jackson and then only use it in production) ### The Safer Alternative to Beneficiary Addition: Use UPI to Verify Before You Pay URL: https://www.narendravardi.com/the-safer-alternative-to-beneficiary-addition-use-upi-to-verify-before-you-pay/ Last updated: 2025-05-10T18:15:37.000Z **Imagine this**: you received the following message from your friend or a relative and need to transfer money to them. ``` Account ID: 123456789012 IFSC Code: SBIN0005943 Amount: 10000 ``` Bank Account ID and IFSC Code sample Assuming that there's no fraud activity involved, you want to transfer the money. What would you do? The majority of us will [add this account as a Beneficiary](https://www.kotak.com/en/personal-banking/self-help/add-beneficiary.html?ref=narendravardi.com) and proceed to transfer money. This is the age-old approach, and our minds are tuned to follow these instructions if we see `IFSC code` and `Bank Account ID`. One of the major drawbacks of this method is that *we do not know the account holder's name*. There's no way to cross-verify if we are transferring to the right person (What if your friend has sent the wrong account number by mistake?) There's a workaround for this, which is popularly known as the [Penny Test](https://www.moderntreasury.com/learn/what-is-a-penny-test?ref=narendravardi.com). You transfer `1 INR(One Rupee)`to the account holder and verify if the other person received the amount. If received, then you will transfer the whole amount. This is a hassle if the other person is a company or an organisation. Who will you reach out to confirm if the payment is received or not? **How do you solve this problem?** **Hint: UPI**. When we think of UPI, we think only of the phone number and UPI ID. Did you know that we can transfer to a bank account using UPI? > When you enter bank account details for transferring via a UPI app, it will get the account name holder's name and show it to us, which helps us to cross-verify. **Here are the detailed steps for the Google Pay app.** Similar steps are applicable in other apps as well. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2025/05/image-4.png) Click on the "Bank Transfer" button on the front page. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2025/05/image-1-1.png) Enter the bank account details. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2025/05/image-3-1-1.png) The Banking name will be shown by the App itself. [ICICI Bank even charges (as of 2025, 99 INR) for cross-verification of the account](https://www.youtube.com/watch?v=Hx2L2jfX6D4&t=2s&ab%5Fchannel=ICICIBank&ref=narendravardi.com). Clever way to make money, isn't it 😉 ### Java Shot #5: The Hidden Pitfall of Using toString() in Enums URL: https://www.narendravardi.com/java-shot-5-the-misapplication-of-tostring-metho/ Last updated: 2025-03-22T10:30:11.000Z It's a common practice in code to convert String to Enum and vice-versa. ### String to Enum Conversion String to Enum is pretty straight-forward and there's only one way to do it - which is using `valueOf()` method from the Enum class. Let's take an example: ```Java // DayOfWeek.java public enum DayOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY; } // EnumExample.java public class EnumExample { public static void main(String[] args) { String dayString = "WEDNESDAY"; try { DayOfWeek day = DayOfWeek.valueOf(dayString.toUpperCase()); System.out.println("Converted string to enum: " + day); } catch (IllegalArgumentException e) { System.out.println("Invalid day string: " + dayString); } } } ``` For this enum class, `valueOf()` works like a charm. If someone's telling you there's a better way of doing it, it could be over-engineering (If not, comment below, let's discuss) ### Enum to String Conversion Let's try Enum to String Conversion. 1. By overriding `toString()` method. ```Java // DayOfWeek.java @ToString // assuming that toString() is overridden with the help of this annotation. public enum DayOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY; } // EnumExample.java public class EnumExample { public static void main(String[] args) { DayOfWeek monday = DayOfWeek.MONDAY; System.out.println(monday.toString()); // MONDAY } } ``` 1. By using `name()` method. ```Java // DayOfWeek.java @ToString // assuming that toString() is generated with the help of this annotation. public enum DayOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY; } // EnumExample.java public class EnumExample { public static void main(String[] args) { DayOfWeek monday = DayOfWeek.MONDAY; System.out.println(monday.name()); // outputs: MONDAY } } ``` The output of the following two approaches seems to be the same and I have come across code where `toString()` also used for converting an enum into a String. This is not wrong in the above context but let's take another example where using `toString()` is incorrect. ``` public enum DayOfWeek { MONDAY(1, "Mon"), TUESDAY(2, "Tue"), WEDNESDAY(3, "Wed"), THURSDAY(4, "Thu"), FRIDAY(5, "Fri"), SATURDAY(6, "Sat"), SUNDAY(7, "Sun"); private final int dayNumber; private final String shortName; DayOfWeek(int dayNumber, String shortName) { this.dayNumber = dayNumber; this.shortName = shortName; } public int getDayNumber() { return dayNumber; } public String getShortName() { return shortName; } public static DayOfWeek fromNumber(int number) { for (DayOfWeek day : values()) { if (day.dayNumber == number) { return day; } } throw new IllegalArgumentException("Invalid day number: " + number); } // How the tool-generated toString() code looks like. // For Monday, it would output "MONDAY (1, Mon)" and not "MONDAY". // This is invalid enum and hence it's recommended to use name() to get // the exact enum value. @Override public String toString() { return name() + " (" + dayNumber + ", " + shortName + ")"; } } ``` Read the comments above toString() method for more info. If you observe the `toString()` method implementation, you will understand why we should avoid using it for the conversion of an enum into a String. This is a silly mistake but you might end up missing it. I learnt it the hard way ;) ### Redis is No Longer Fully Open Source – Meet Valkey, the True Alternative! 🚀🔥 URL: https://www.narendravardi.com/redis-no-longer-open-source-meet-valkey/ Last updated: 2025-05-09T17:06:26.000Z ‼️ This is no longer true, check out: [Redis is open source again](https://antirez.com/news/151?ref=narendravardi.com) Redis is a key-value database used by many companies worldwide. Although it was created for caching, it has been adopted for multiple use cases, such as distributed locking, rate limiting, and messaging queues to name a few. Due to this, Redis is used in the majority of the services across companies. It's one of the key components of the system. This means the majority of the cloud providers offer Redis as a service. AWS for example provides it in the form of Elasticache. Recently the Redis license has been changed from `BSD-3-Clause license` to `RSAL` . RSAL restricts cloud providers from offering Redis as a managed service without a commercial agreement with Redis Inc. To preserve an open-source alternative, the community, led by the Linux Foundation, forked Redis before the license change. ### Origin of Valkey - [Valkey](https://valkey.io/?ref=narendravardi.com) was forked from Redis OSS 7.2.4. - Maintains the BSD-3-Clause license. - Created to provide a fully open-source alternative to Redis after Redis Inc. switched to RSAL. - Redis 7.2.5+ switched to RSAL (Redis Source Available License). ### Valkey **7.2** Since Valkey is forked from 7.2.4, its version is called Valkey 7.2 (Its versioning doesn't start with 1 or 2) 💡 Redis OSS refers to Redis Open Source Software, which means the Redis version is <= 7.2.4 ### Valkey 8.0 Valkey 8 (the next version of 7.2) is expected to have improved performance over Redis OSS as it introduces a new I/O threading architecture, which improves the parallelism of the system and more efficiently executes commands. Looking at the gains of using Valkey 8.0, it might be tempting to jump and start using Valkey 8.0\. Careful! It's a major change. Redis OSS was always a single-threaded application, now it's becoming parallel, which means there could be potential bugs and issues. Ensure to test it out in non-production environments before you adopt it for your production use case. ### Summary If you ask me the difference between Valkey 7.2 and Redis 7.2.4, I would say nothing. It’s just the name. But their futures diverge. Valkey is essentially Redis OSS in a different universe—Multiverse is so real in Software! ### Best ever feature on Apple Notes URL: https://www.narendravardi.com/best-ever-feature-on-apple-notes/ Last updated: 2025-02-22T10:31:04.000Z **Apple Notes now supports code blocks—an amazing feature I’ve always wanted!** Apple notes serves as a knowledge store for me. In the past, adding a code block and editing them would lead to formatting changes making the process cumbersome and leading to errors. But now, that's no longer the case. Let's see how to activate code blocks on these tools. ### Activating `code blocks` on Apple Notes 1. Press cmd + shift + m `⌘ + ⇧ + m` ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2025/02/Screenshot-2025-02-15-at-9.35.57-PM-1.png) Code block is activate by clicking ⌘ + ⇧ + M. ⌘ + ⇧ + m works too! (no need to turn on Caps lock!) 1. Now, you can enter your code block. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2025/02/Screenshot-2025-02-15-at-9.39.22-PM.png) Earlier, if you try to edit "Hello World!", the quotes will be changed to forward/backward quotes - leading to problems. **Bonus:** You can add code blocks on Google docs as well. The shortcut for this is to enter the `backtick` button three times and press `Enter` (similar to Slack) ``` ``` ``` Three times enter backtick button and Enter. ❗ This feature is not available on all Google accounts for some reason. If this doesn't work, use the Google Doc linked below, where I have already added a code block. Simply copy and paste it into your document as needed, even if the shortcut doesn’t work. [Code block formatter in Google docs](https://docs.google.com/document/d/1O-tEyE%5FiRvdewWEBlzHtRv2LQz5Y1u7SqlOI-sdLFP0/edit?usp=sharing&ref=narendravardi.com) ### Vanishing Tunes: Ten percent of My Liked Songs Disappeared on Spotify URL: https://www.narendravardi.com/vanishing-tunes-ten-percent-of-my-liked-songs-disappeared-on-spotify/ Last updated: 2025-01-12T10:30:05.000Z During Christmas 2024, I noticed that my `Liked Songs` list on the Spotify app contained 985 songs. As the year turns to 2025, 10% of the songs on my list have disappeared. Now, my `Liked Songs` list contains only 900 tracks. This means that some songs and albums have been removed from Spotify. If my guess is correct, then it might be because of license renewals. > The Spotify team might have thought, 'Let's not renew the license for this song or album,' and poof, the songs are gone. I wouldn’t have minded if they had at least notified me about the songs that disappeared. What feels like cheating is Spotify silently removing these songs without prior notice or my consent. After all, `Liked Songs` list is managed by me —it is mine. > Spotify, why not handle it more gracefully next time? ### How to add borders to image in Google docs URL: https://www.narendravardi.com/how-to-add-borders-to-image-in-google-docs/ Last updated: 2025-01-08T04:05:52.000Z One of the frustrations I have as a Software Engineer is seeing worst possible designs continue to exists just because *it worked in the past and it works now also.* Adding borders to an image in Google docs is irritating. It could have been as simple as clicking a single button like you will see in a *Confluence page*. But no, let's keep it difficult for legacy reasons or whatever reasons it is not simple. Anyways, it took me a while before I could understand how, and hence this article. Here's how one can do the additions of borders to an image in Google docs. ### **Steps on Google Docs and Microsoft Word:** 1. Upload the image and select the image. 2. Click on `Format` on the top. 3. Click on `Borders & Lines` 4. Select `Border Weight` and optionally 5. Choose `Border Dash` ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2024/10/Screenshot-2024-10-23-at-1.15.32-AM-1.png) By not make it easy as Confluence did? ### **Steps on Confluence:** It is as simple as clicking one button ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2024/10/Screenshot-2024-10-23-at-1.21.01-AM-1-1.png) Clicking on the `Add border` button is enough to add borders on Confluence. Shouldn't it be that simple? Yeah! it's as simple as that. ### Learnings from presenting our Hackathon project as a Start-up Pitch URL: https://www.narendravardi.com/learnings-from-presenting-our-hackathon-project-as-a-start-up-pitch/ Last updated: 2024-10-21T15:49:36.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/declaring-constant-variables-in-java-part-i/#/portal/signup/free)*.* --- If you’ve ever participated in a hackathon, you would know that the presentation is just as important as the idea and the solution being proposed. We finalized our idea, and the demo was ready. We also worked on the PPT and reached out to our mentor for feedback. He glanced through our PPT and said that we should improve our PPT by a huge margin. Instead of telling each and every aspect of it, he suggested that we watch the Startup Pitch by *Reeju Datta*, the Co-Founder of *Cashfree Payments*. Refer to the bottom of the [ycombinator page](https://www.ycombinator.com/companies/cashfree-payments?ref=narendravardi.com) if the YouTube link is broken: Here are my few take aways after watching this video: 1. **Points:** PPT should have bullet points not bullet paragraphs. 2. **Presenters Introduction:** Keep the introduction of presenters simple. 3. **Impact:** Talk about it objectively. 4. **Confidence:** Present with confidence. We updated our PPT according to the take aways listed above and presented our project, we secured 5th place out of 47 participating teams! 🎉 😅 This is a hackathon internal to Cashfree Payments (where I work now), hence cannot disclose much information about the Hackathon! ### Java Shot #4: Writing readable long numbers in Java URL: https://www.narendravardi.com/java-shot-4-writing-readable-long-numbers-in-java/ Last updated: 2024-12-02T08:42:43.000Z If you are someone who works with Long numbers and BigIntegers, then you can make use of these two tricks to make these Long and BigIntegers more readable. ### Avoid using lower case `l` and use upper case `L` to represent a Long value. ```Java public class LongTest { public static void main(String[] args) { // 'l' resembles '1' in certain fonts, // making this confusing var a = 1000l; // Using 'L' makes the number more readable var b = 1000L; } } ``` Code showing the significance of using 'L' over 'l' ### Did you know that you can use `_` in numbers in Java? ``` public class IntTest { public static void main (String args[]) { // Tell me, is this a one lakh or 10 lakhs var a = 100000; // Now answer the same question. var b = 1_00_000; } } ``` Code showing the significance of using '\_' to enhance readability and avoid errors. ### Switching between previous and next tabs in Sublime Text URL: https://www.narendravardi.com/switching-between-previous-and-next-tabs-in-sublime-text/ Last updated: 2024-12-02T08:44:15.000Z Here're the steps. 1. Open Sublime 2. Click on `Settings` \-> `Key Bindings` 3. This opens a file with `Default (OSX).sublime-keymap` 4. After the first `{` insert the below text ```json { "keys": ["ctrl+tab"], "command": "next_view" }, { "keys": ["ctrl+shift+tab"], "command": "prev_view" }, ``` 1. Save the file. Now, we can freely move between tabs just like any other editor. Reference: `https://stackoverflow.com/a/36020760` ### Java Shot #3: Document Arrange, Act and Assert sections while writing Unit tests URL: https://www.narendravardi.com/arrange-act-and-assert-while-writing-unit-tests/ Last updated: 2024-12-02T08:42:02.000Z A unit test can be broken down into three segments. 1. Arrange 2. Act and 3. Assert In **Arrange** step, you would build the necessary data that is needed for execution of the test case along with that you can also setup Mock functionality. In the **Act** step, you will actually call the method that needs to be tested. In the **Assert** step, you would validate the actual response values with the expected response values. --- Presence of these three segments is something known to majority of the engineers who write test cases frequently - even engineers who wrote test cases once or twice, would have written the test cases following the arrange-act-assert pattern. > As a best practice, I recommend adding a comment at the start of each segment to denote the beginning of that segment. ### Sample Java code without Arrange-Act-Assert documentation 😦 ```Java import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; public class CalculatorTest { @Test public void testAddition() { Calculator calculator = new Calculator(); int a = 5; int b = 3; int expectedSum = 8; int actualSum = calculator.add(a, b); assertEquals(expectedSum, actualSum); } } ``` Sample Java code without Arrange-Act-Assert documentation 😦 If you see in the above code, it's quite complicated to understand where the each section ends. --- ### Sample Java code without Arrange-Act-Assert documentation and newline between sections 🙂 ```Java import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; public class CalculatorTest { @Test public void testAddition() { Calculator calculator = new Calculator(); int a = 5; int b = 3; int expectedSum = 8; int actualSum = calculator.add(a, b); assertEquals(expectedSum, actualSum); } } ``` Sample Java code without Arrange-Act-Assert documentation and newline between sections 🙂 You can add newline to specify the sections but it's not explicitly clear what's the importance of the newline. To be more explicit, you can add a comment and that makes a lot of difference. --- ### Sample Java code with Arrange-Act-Assert documentation😁 ```Java import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; public class CalculatorTest { @Test public void testAddition() { // Arrange Calculator calculator = new Calculator(); int a = 5; int b = 3; int expectedSum = 8; // Act int actualSum = calculator.add(a, b); // Assert assertEquals(expectedSum, actualSum); } } ``` Sample Java code with Arrange-Act-Assert documentation😁 ### Java Shot #2: Prefer using equality operator over equals() method for enums URL: https://www.narendravardi.com/prefer-using-equality-operator-over-equals-method-for-enums/ Last updated: 2024-12-02T08:44:38.000Z Enums are a powerful datatype in Java. There are many instances where you want to compare two enums. Given that a enum class supports `equals()` method, we end up using `equals()` method as it's frequently used for other object comparisons. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2024/06/Screenshot-2024-06-07-at-4.27.13-PM.png) Even IntelliJ's AI recommendation is to use equals() method 🤭 In case of enums, using `==` (equality) operator is a best practice. Why? Let's look at the below code. ```Java class Main { enum NumberType { PRIME, COMPOSITE } // returns NumberType.PRIME if number is prime // returns NumberType.COMPOSITE if the number is composite // else returns null // // This method is buggy since this doesn't have any validations on the numbers. // You can consider this method you are using from an external library. static NumberType getNumberType(Integer number) { // function logic for prime and composite numbers. return null; } public static void main(String[] args) { for (int i = 0; i < 10; i++) { // 0 and 1 and negative numbers cannot be categorised into prime or composite and hence it // leads to // NullPointerException when using equals() method. if (getNumberType(i).equals(NumberType.PRIME)) { System.out.printf("%d is composite", i); } else if (getNumberType(i).equals(NumberType.COMPOSITE)) { System.out.printf("%d is composite", i); } else { System.out.printf("%d is neither prime nor composite", i); } } } } ``` If you execute this program, this will throw NullPointerException (NPE). This can be easily avoided by making use of `==` operator. ```Java class Main { enum NumberType { PRIME, COMPOSITE } // returns NumberType.PRIME if number is prime // returns NumberType.COMPOSITE if the number is composite // else returns null // // This method is buggy since this doesn't have any validations on the numbers. // You can consider this method you are using from an external library. static NumberType getNumberType(Integer number) { // function logic for prime and composite numbers. return null; } public static void main(String[] args) { for (int i = 0; i < 10; i++) { // 0 and 1 and negative numbers cannot be categorised into prime or composite and hence it // leads to // NullPointerException when using equals() method. if (getNumberType(i) == NumberType.PRIME) { System.out.printf("%d is composite\n", i); } else if (getNumberType(i) == NumberType.COMPOSITE) { System.out.printf("%d is composite\n", i); } else { System.out.printf("%d is neither prime nor composite\n", i); } } } } ``` Why this works? For the simple reason that Enum values are singletons and they have a single reference, `==` works for them. There is also a different way you can avoid NPE when using `equals()` method. Can you guess the approach? ### Java Shot #1: The misapplication of equals() method in Java URL: https://www.narendravardi.com/the-misapplication-of-equals-method-in-java/ Last updated: 2024-12-02T08:45:00.000Z One of the major advantages of statically typed language is to identify invalid data type comparisons at compile time. Java is a statically typed language and that's one main reason why I like writing Java code but there are instances where it is not. Today I talk about `equals()` method and how it's so easy to misapply this method. Let's take a look at the `equals()` method signature from the [javadoc](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?ref=narendravardi.com#equals-java.lang.Object-). ```Java public boolean equals(Object obj) ``` If you look at the argument to equals method, `Object` is the argument and this method is inherited from `Object` class which is root class which means you can call equals() method on any class. Now, let's take an example of where this gets misapplied. **Comparing two different data type** ```Java class Main { public static void main(String[] args) { var a = Integer.valueOf(10); var b = Float.valueOf(10.0F); System.out.println(a.equals(b)); // this always returns false. } } ``` From the looks of it, this is a simple program and you can figure out what's wrong with this code. Can you identify this in complex projects? To avoid this problem, Java projects can enable code analyzer tools like [Sonar](https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/languages/java/?ref=narendravardi.com) in their deployment pipeline. ### ✍️ Declaring constants in Java (Part I) URL: https://www.narendravardi.com/declaring-constant-variables-in-java-part-i/ Last updated: 2024-03-23T10:30:05.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/#/portal/signup/free)*.* --- There is a bit of easy code in this article. Don't feel intimidated! :D One of the common indicators that shows you are an experienced Java developer is the effective use of constants. Various programming languages provide a keyword called `const` to represent a constant. But Java doesn't use this keyword. In Java, there are special ways of creating a constant. Before we learn about the way to declare constants, let me tell you when I use constants. ### When it is recommended to use Constants If the below two conditions are satisfied, I prefer using a constant variable. 1. Once a variable is declared, its value shouldn't change and 2. The value of variable remains same if you declare it once or `n` number of times. ### Using final keyword Take for example you are building a program to calculate the area of circle or perimeter of a circle, The number `π` is a well-known constant whose value shouldn't change. So, we can declare `π` as a variable `pi` with the help of `final` keyword as ```Java public class Main { // five digit precision final double pi = 3.14159; public static void main(String[] args) { Main main = new Main(); System.out.println(main.pi); } } ``` Here, `final` keyword indicates that the variable's value cannot be changed. If we try to re-assign some other value to `pi`, it would lead to a compilation error. ``` public class Main { final double pi = 3.14159; public static void main(String[] args) { Main main = new Main(); main.pi = 10.0; // compilation error. System.out.println(main.pi); } } ``` But the problem with using `final` is, that `pi` variable will be created for each instance of `Main` class. But the value of `pi` is constant across all the instances of this class. `pi` is a smaller variable and let's agree we are okay with creating `n` number of times. But what if you want to open and store a config file of 10kb size into a constant? It became an expensive operation isn't it? This is where the next step comes, declaring the variable in such a way that the variable is created only once. ### Using Static keyword This is where we can make use of `static` keyword. Static keyword helps us to avoid creating duplicate copies of same constant. Thus making our application optimised for memory and compute. ```Java public class Main { final static double pi = 3.14159; public static void main(String[] args) { System.out.println(pi); } } ``` Since `static` memory is shared by all the instances of `Main` class, we are creating `pi` variable only once. ### Naming convention To help developers identify that a variable is a constant and shouldn't be modified, in Java, naming convention that is following for declaring constant variables is to use upper snake case. > Upper snake case is a variable naming convention where each word is in upper case, and separated by underscores. It is also known as MACRO\_CASE or CONSTANT\_CASE. Finally our program looks like the following: ```Java public class Main { final static double PI = 3.14159; public static void main(String[] args) { System.out.println(PI); } } ``` Now, that's the basics of declaring constants. ### Declaring int constant ``` public class Main { final static int TEN = 10; public static void main(String[] args) { System.out.println(TEN); } } ``` ### Declaring Integer constant ``` public class Main { final static Integer TEN = 10; public static void main(String[] args) { System.out.println(TEN); } } ``` ### Adding access specifier depending on your use case ``` public class Circle { private final static double PI = 3.14159; // radius variable declaration // area and perimeter functions } ``` In the `Circle` class, we are using private for `PI` since it need not be exposed to outside world as all computations which use it like `area` and `perimeter` functions are inside the class only. ``` public class ApplicationConstants { public final static double PI = 3.14159; // other application constants. } ``` In the `ApplicationConstants` class, we are using public for `PI` since it is declared in a constants class which only has constants and it will be re-used by all the classes within the application. In this article, I have not talked on how to declare `collection` and `complex object` constants. Will talk about them in the later articles. Hope you got an idea on how to use `static` and `final` keywords to declare constants. In case of any queries, please feel free to comment below or shoot an [email](mailto:narendravardi1127@gmail.com). --- **Share this article** Copy and share this article: [narendravardi.com/declaring-constant-variables-in-java/](https://narendravardi.com/declaring-constant-variables-in-java-part-i?ref=narendravardi.com) --- **Recommendations** If you liked this article, you might also enjoy reading the following. - [🤩How to write extensible filter logic in Java code](https://www.narendravardi.com/java-predicate/) - [🤖Automating the boring stuff: How I obtained the titles of all articles on my blog](https://www.narendravardi.com/list-automation/) - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) --- ❤️ **Enjoyed this article?** Forward to a friend and tell them where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### 😃 How to introduce yourself as a new tenant in a small apartment complex URL: https://www.narendravardi.com/how-to-make-a-good-impression-as-a-new-tenant/ Last updated: 2023-12-22T10:30:32.000Z Recently, I met a college friend after several years. He had relocated to a new city, and we discussed many things. While we were catching up on our lives, he discussed what he did in the early days of relocating to this new city to introduce himself to all the tenants in the apartment building. This is a small apartment complex with five to six flats. Hence, it is easy to follow this sweet trick. He was very brief regarding the explanation, but this is what I imagined he would've done! --- After getting rest from all the relocation chores, he went to the supermarket to buy chocolates, decorative items, and A4 sheets. He wrote an A4 sheet, an introductory note with a miniature painting and pasted it to the main hallway. He decorated the area around the hallway and kept all the chocolates on a small stool, with a note saying "help yourself!" near the introductory poster he had posted. --- In my opinion, it is a simple idea, and I felt nice listening to this idea. This gesture from a new tenant makes me at least take the initiative to knock on the door and say, "Welcome!" How would you receive a new tenant if they did something like this? Let me know in the comments below, or [drop me an email](mailto:narendravardi1127@gmail.com). --- [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- **Recommendations** If you liked this article, you might also like reading the following. - [Travelling to Paris all alone](https://www.narendravardi.com/reaching-alone/) - [My work on the 360° photographs](https://www.narendravardi.com/360-picture-work/) - [International purchases and the sweet kick on the butt](https://www.narendravardi.com/international-purchases/) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! --- ### ✍️ Understanding the difference between i++ and++i in Java (and C and C++) URL: https://www.narendravardi.com/pre-post-increment/ Last updated: 2025-01-14T02:59:54.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/#/portal/signup/free)*.* --- 💡 There is a bit of easy code in this article. Don't feel intimidated! :D Before we get into the details of the article, let me ask you a question. ### Can you tell me what will be the output of following program? ```Java class Main { public static void main(String[] args) { int a = 2; int b = 2; a++; b++; System.out.println(a); System.out.println(b); } } ``` Example #1 It's fairly easy one right? The output must be the following, correct? ``` 3 3 ``` Output of Example #1 --- ### Now, let's take one more sample code. What will be the output of following program? ```Java class Main { public static void main(String[] args) { int a = 2; int b = 2; System.out.println(++a); System.out.println(b++); } } ``` Example #2 It's fairly easy but also a tricky one isn't it? So, the output is: ``` 3 2 ``` Output of Example #2 Now if you understood this output, you can stop reading this article! (Having said that you can share some feedback on how the article is provided that you know the concepts 😄) If you didn't understand this output, let me tell you what's happening. When we are taught these operators in colleges or beginner books, the first example they would give is using these operators as a single statement. ``` a++; // single statement ++a; // single statement ``` Because of the way it is used, we only see `++` as a increment operator and we don't really focus on whats the difference between `++a` and `a++` Now when we combine `++a` and `a++` with other operators (or used in methods as Example #2), we will get to know the difference. ### **So, what's the major difference?** Before we get into the differences, lets see what's the increment operator doing. **What's the increment operator?** Increment operator has two functionalities. 1. It increments the value of the variable and 2. It returns a value (What value - we will talk about it) Now talking about `It increments the value of the variable` functionality, this is same for `++a` and `a++` . `a` value will be incremented by `1` in both the usages. The major difference is observed with the second functionality, `It returns a value` - `++a` \-> returns incremented value where as - `a++` \-> returns the value and does the increment later. And that's the reason why `System.out.println(++a);` returned 3 when a was initially 2 but `System.out.println(a++);` remained 2. To clarify even better, I wrote a Java class that helps us visualise the work of Pre and Post Increment Operators. Here's the code for the same. Take a look at it and let me know what you think! ```Java public class PostIncrement { private int x; public PostIncrement(int x) { this.x = x; } // similar to x++; public int increment() { int temp = x; x = x + 1; return temp; } public int getX() { return x; } // add a toString() method. } ``` PostIncrement.java ```Java public class PreIncrement { private int x; public PreIncrement(int x) { this.x = x; } // similar to ++x public int increment() { x = x + 1; return x; } public int getX() { return x; } // add a toString() method. } ``` PreIncrement.java Finally, let's see how the `example #2` looks using the increment class that I have written. ```Java class Main { public static void main(String[] args) { PreIncrement a = new PreIncrement(2); PostIncrement b = new PostIncrement(2); System.out.println(a.increment()); System.out.println(b.increment()); } } ``` Example #2 using PostIncrement and PreIncrement classes. With the provided examples, were you able to identify clearly understand what's the difference between Pre and Post Increment Operators? Can you write the classes for Decrement operators as well? Please feel free to comment below or shoot an [email](mailto:narendravardi1127@gmail.com). --- **Share this article** Copy and share this article: [narendravardi.com/pre-post-increment/](https://www.narendravardi.com/pre-post-increment/) --- **Recommendations** If you liked this article, you might also enjoy reading the following. - [🤩How to write extensible filter logic in Java code](https://www.narendravardi.com/java-predicate/) - [🤖Automating the boring stuff: How I obtained the titles of all articles on my blog](https://www.narendravardi.com/list-automation/) - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) --- ❤️ **Enjoyed this article?** Forward to a friend and tell them where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### 🤩 What's it like to read a Manga Book URL: https://www.narendravardi.com/manga-book/ Last updated: 2023-09-23T10:30:25.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider [subscribing](https://www.narendravardi.com/#/portal/signup/free).* --- If you read my [about me](https://www.narendravardi.com/about/) section, you would know that I like reading graphic novels . Besides graphic novels, you will also know that I follow [One Piece](https://en.wikipedia.org/wiki/One%5FPiece?ref=narendravardi.com) Manga. I have been following it for more than a decade now. Initially I started with watching animated version of it called Anime and now I read their manga. The switch to reading manga helped me to save a lot of time for my work and it also helped me stay up to date with the story (Though I haven't read the manga in the last few years). Recently I came across a bookstore which was selling *unique books.* From my various visits to different bookstores in Bangalore, I can say confidently that majority of the books that *catch your eyes* in the normal b​ookstores are either paid by publishers to be kept visible or the bookstore has a great margin that they chose to keep it clearly visible. One of the common feature of these *visible books* is that they will be in the Amazon's most selling booklist. Being a Kindle user myself, I get bombarded by Amazon with this same list. So, when I visit a bookstore I just find myself seeing the nearly same books and think, "These must be some exceptional books but I have seen these books' covers so many times and it's mostly cheaper on Kindle or Audible, so I will skip purchasing now". At the end, I move on without purchasing these *visible books*. Now when I say *unique books,* I mean the books that are not in this *visible book* list. It was a lot of fun to see so many *unique books* around. As I was looking around, I saw a collection of One Piece Volumes (Books) and I bought the first volume immediately. If you read manga, you would know that we read manga comics from right to left. But American comics are different, you read them from left to right. So, having a book helped me to understand how people actually read manga offline. Here's a video of how the book looks like: How a Manga book looks like ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/08/20230827_093459.jpg) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/08/20230827_093634.jpeg) Back Cover, Front Cover Notice that the bar code is at the front side cover of the book and the title of the book is at the back side cover of the book. The manga books are read from the back. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/08/20230827_093708.jpg) The first page from the front cover page The first page from the front cover page gives a clear idea on how to read manga and the initial failures of using mirror image technique in the US. Coming to my experience of reading this volume, I completed this book in two sittings. 80% of it in the first sitting and the remaining in the second sitting. I loved reading a book over manga online. I think these are few reasons which I felt might lead to this wonderful experience. - Manga is partitioned into chapter (1 chapter \~ 20 pages). What this means is that if you want to revisit something from few chapters back, you need to load all the chapters and then figure out it yourself. - There will be way too many ads while reading online. - Reading manga on mobile is uncomfortable and reading on laptop is distracting (I tend to check for mails or other updates). - Finally and most importantly, I feel guilty reading manga online because of the strain reading via device has on my eyes. Though physical book elevates the experience of reading manga, I would still continue to read it online for a decade or so due to their less availability and high cost. I paid 800 INR for nearly 10 manga online episodes. There are 1000+ episodes, which means I might end up paying 80k 🥲 If more and more people start reading, the availability also increases and cost incurred on transport get less. Hoping for a cost-effective volumes (for an Indian) in future. That's it from my side. Which Anime/Manga are you following now? What's your favourite so far, let me know in the comments below or feel free to shoot an [email](mailto:narendravardi1127@gmail.com). --- **Share this article** Copy and share this article: [narendravardi.com/manga-book](https://www.narendravardi.com/manga-book/) --- **Recommendations** If you liked this article, you might also enjoy reading the following. - [What did you like about this book?](https://www.narendravardi.com/bad-book/) - [Podcasts I listen to these days](https://www.narendravardi.com/podcasts-i-listen-to/) - [🎨Let's talk about some of the famous paintings of the world](https://www.narendravardi.com/famous-paintings/) --- ❤️ **Enjoyed this article?** Forward to a friend and tell them where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### 🤩How to write extensible filter logic in Java code URL: https://www.narendravardi.com/java-predicate/ Last updated: 2023-07-06T07:26:15.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider [subscribing](https://www.narendravardi.com/#/portal/signup/free).* 💡 This is one of those articles in which I really wanted to give an idea of how I think. Hopefully, it doesn't only make sense to you but you would love the way this article is written! :) There is a lot of code in this article. But it is simple code. Don't feel intimidated! :D The below problem is similar to a problem that I encountered in the industry. In this article, the problem is simplified! Now let's dive in. Imagine that you are given a [collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?ref=narendravardi.com) of `Property` objects (class code provided below) and you need to return all the properties whose location is `blr`. ```Java // package and import details public class Property { private String location; private double price; private String id; private String PropertyType; private String ownerId; private boolean isSoldOut; // boilerplate code } ```

Property.java file with no boilerplate code

How will you approach it? If you are new to Java, you might write a for loop and do a check on location. The sample function might look like the below code. ```Java public static List getFilteredProperties(List properties) { List result = new ArrayList<>(); for (Property p: properties) { if (p.getLocation().equals("blr")) { result.add(p); } } return result; } ```

Iterate and search for 'blr' location properties.

The only problem with this code is if we want to get properties with location `hyd` , we will have to write an additional function. Instead of this, we can update the existing function to accept the location that needs to be searched for as a function argument. Let's see how the code evolves. ```Java public static List getFilteredProperties(List properties, String locationToSearch) { // notice locationToSearch is added here List result = new ArrayList<>(); for (Property p: properties) { if (p.getLocation().equals(locationToSearch)) { result.add(p); } } return result; } ``` Now, we want to add a filter on price also. I mean providing a price range filter is awesome for customers isn't it? We learnt already that passing search filter values as function arguments makes code generic enough to accept different values. So, we will accept the lower and higher property thresholds from the function argument itself. Now how does the code evolve? ```Java public static List getFilteredProperties(List properties, String locationToSearch, double lowerPrice, double higherPrice) { // lowerPrice and higherPrice added here List result = new ArrayList<>(); for (Property p: properties) { if (p.getLocation().equals(locationToSearch) && p.getPrice() <= higherPrice && p.getPrice() >= lowerPrice) { // logic to check if the price is within price range is added here. result.add(p); } } return result; } ``` Now the customer wants to filter on `twobhk` `propertyType`. Let's see how the code looks. ```Java public static List getFilteredProperties(List properties, String locationToSearch, double lowerPrice, double higherPrice, String propertyType) { propertyType added here List result = new ArrayList<>(); for (Property p: properties) { if (p.getLocation().equals(locationToSearch) && p.getPrice() <= higherPrice && p.getPrice() >= lowerPrice && propertyType.equals(p.getPropertyType())) { // propertyType check added here result.add(p); } } return result; } ``` Problems with this function include: 1. Increase in the number of arguments for the function as we add `more` filters. 2. The `if` condition keeps getting complicated and the code is getting changed in the code execution path which can directly impact the production flow in case of any bugs. How do we solve this problem? The first problem can be fixed if we use a new class to hold the function arguments. Code after the first fix: ```Java public class FilterParams { private String location; private double lowerPrice; private double upperPrice; private String propertyType; // boilerplate code. } ```

FilterParams.java

```Java public static List getFilteredProperties(List properties, FilterParams filterParams) { // look how filterParams helps here. List result = new ArrayList<>(); for (Property p: properties) { if (p.getLocation().equals(filterParams.getLocation()) && p.getPrice() <= filterParams.getUpperPrice() && p.getPrice() >= filterParams.getLowerPrice() && filterParams.getPropertyType().equals(p.getPropertyType())) { result.add(p); } } return result; } ``` Now let's solve the following: > `The if condition keeps getting complicated and the code is getting changed in the code execution path which can directly impact the production flow in case of any bugs` To fix this problem, we will use [Predicate functional interface](https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html?ref=narendravardi.com) (please read about this interface as I am not explaining it in detail in this article). I will show how to use the Predicate interface by modifying the location-only filter example. How to filter on location using `Predicate` interface? ```Java // getFilteredProperties without using Predicate interface. public static List getFilteredProperties(List properties, String locationToFilter) { List result = new ArrayList<>(); for (Property p: properties) { if (p.getLocation().equals(locationToFilter)) { result.add(p); } } return result; } // The above can be transformed using Predicate in this format. // First create an implementation of Predicate. // Here we are creating one class for LocationFilter. public class LocationFilter implements Predicate { private String location; public LocationFilter(String location) { this.location = location; } @Override public boolean test(Property property) { return property.getLocation().equals(location); } } // The function looks like the following: public static List getFilteredProperties(List properties, String locationToFilter) { List result = new ArrayList<>(); for (Property p: properties) { Predicate locFilter = new LocationFilter(locationToFilter); if (locFilter.test(p)) { result.add(p); } } return result; } ``` If you notice the above code, locFilter has taken up the responsibility of abstracting the location filter logic. Similarly, we can add a new Filter for price and PropertyType. ```Java public class PriceFilter implements Predicate { private double lowerPrice; private double upperPrice; public PriceFilter(double lowerPrice, double upperPrice) { this.lowerPrice = lowerPrice; this.upperPrice = upperPrice; } @Override public boolean test(Property property) { return property.getPrice() >= lowerPrice && property.getPrice() <= upperPrice; } } ```

PriceFilter.java

```Java public class PropertyTypeFilter implements Predicate { private String propertyType; public PropertyTypeFilter(String propertyType) { this.propertyType = propertyType; } @Override public boolean test(Property property) { return propertyType.equals(property.getPropertyType()); } } ```

PropertyTypeFilter.java

We have three implementations of `Predicate` interface and we can use this interface to extend our filter functionality easily in future. We have `PropertyTypeFilter.java`, `LocationFilter.java` and `PriceFilter.java` files. To segregate these three filters, let's use an additional `helper` method as listed below. ```Java public class FilterHelper { public static Predicate getFilters(FilterParams filterParams) { Predicate locationFilter = new LocationFilter(filterParams.getLocation()); Predicate priceFilter = new PriceFilter(filterParams.getLowerPrice(), filterParams.getUpperPrice()); Predicate propertyPredicate = new PropertyTypeFilter(filterParams.getPropertyType()); // If a new filter needs to be added, you can add it here. // To avoid bugs, that new filter's `test` method can use an 'AB testing strategy' to roll out the filter to 100% safely. Predicate compositeFilter = locationFilter.and(priceFilter).and(propertyPredicate); // Using an AND operation here for OR operation, use `.or()` method return compositeFilter; } } ```

FilterHelper.java file

Now the function code becomes, the following: ```Java public static List getFilteredProperties(List properties, FilterParams filterParams) { return properties .stream() .filter(FilterHelper.getFilters(filterParams)) .collect(Collectors.toList()); } ``` If I have seen this code during my college days or right after college, I would have thought, why complicate the code by moving the logic into multiple files? But today, I realise the value of extensibility. The above code is incredible in case of code extensibility and since the Filter logic is independent, we can change the FilterLogic however we want without disturbing the actual function. I have created a Github repo that hosts the final code detailed in this article. Find the Github repo at [github.com/narendravardi/MultiFilters](https://github.com/narendravardi/MultiFilters/?ref=narendravardi.com) How did you feel the code is? Do you have any queries? Please feel free to comment below or shoot an [email](mailto:narendravardi1127@gmail.com). --- **Share this article** Copy and share this article: [narendravardi.com/java-predicate/](https://www.narendravardi.com/java-predicate/) --- **Recommendations** If you liked this article, you might also enjoy reading the following. - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) - [🤖Automating the boring stuff: How I obtained the titles of all articles on my blog](https://www.narendravardi.com/list-automation/) - [✍️Finding the Nth highest salary from an SQL table](https://www.narendravardi.com/nth-salary/) --- ❤️ **Enjoyed this article?** Forward to a friend and tell them where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### ✍️Documenting some Adobe Lightroom tips, tricks, and shortcuts URL: https://www.narendravardi.com/lightroom-tips/ Last updated: 2023-06-16T16:21:06.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider [subscribing](https://www.narendravardi.com/#/portal/signup/free).* --- ## Tip #1: How to rotate an image from landscape to vertical and vice-versa (Windows app) Use the *Photo* button on the top left\-> 'Rotate Left' or 'Rotate Right' (shortcut: **Ctrl + \[** or **Ctrl + \]**) --- ## Tip #2: How to reverse the aspect ratio while cropping (Windows app) First click on Crop window (crop shortcut: R) and on the keyboard, press button X (shortcut: for reversing the crop) --- ## Tip #3: Shortcut to change Grid overlays in crop tool (Windows app) Hit “O” when using crop tool. --- **Share this article** Copy and share this article: [narendravardi.com/lightroom-tips](https://www.narendravardi.com/lightroom-tips/) --- **Recommendations** If you liked this article, you might also enjoy reading the following. - [](https://www.narendravardi.com/part1-djimini3pro/)[Capturing light trails of traffic in Bangalore](https://www.narendravardi.com/light-trails/) - [🔥 Breath-taking 360° photograph up in the air](https://www.narendravardi.com/360-photo/) - [How to embed your 360s on Ghost](https://www.narendravardi.com/embed-360/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### ✍️Mapping Google Maps' location to Mappls' MapmyIndia location URL: https://www.narendravardi.com/gmaps-mapmyindia/ Last updated: 2023-06-12T10:47:01.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider [subscribing](https://www.narendravardi.com/#/portal/signup/free).* --- In this article, I wanted to discuss about how one can map a Google maps location to a MapMyIndia location. > This article is primarily focused on helping drone pilots in India who need to identify if an area falls under Red, Yellow or Green zones. The DGCA's [Airspace Map](https://digitalsky.dgca.gov.in/airspace-map/?ref=narendravardi.com#/app) is an interactive map of India that shows if a location falls under Green or yellow or red zones across the country. Airspace Map uses Mappls' MapmyIndia for showcasing the zones. MapmyIndia works well (only in the context of Airspace Map) when the location is quite famous or historic. But If you are in a remote area where there is no clear landmark, it fails to show the zones and the user will be forced to search visually. Besides this downside, Airspace Map doesn't identify your location also. This could be for security reasons but still, it is not an easy activity if the app forces the users to make unnecessary effort to search the MapmyIndia app *visually* and *manually*. To solve this problem, I have come up with the idea of searching for a remote location (or current location) on Google Maps and then using the coordinates of the same on MapmyIndia. ### **Here are the steps involved:** 1. Search for the location you are interested in on Google Maps. 2. Touch and hold an area of the map that isn’t labelled to drop a red pin. 3. Now copy the coordinates in the search box. 4. Visit the Airspace Map app and near the search box, identify the dropdown and select coordinates. 5. Enter the coordinates copied from Google Maps onto Airspace Map search. ### **Example:** Let's check if [your space Bangalore Koramangala Boys](https://goo.gl/maps/6K2ePEyHdgLPQ3Yn6?ref=narendravardi.com) is a Green Zone or not. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/06/Screenshot_20230608_162537_Chrome-3.jpg) 1\. Searched on MapmyIndia for "your space Bangalore Koramangala Boys" but I couldn't find it. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/06/Screenshot_20230608_162552_Maps-3.jpg) 2\. Searched for the same on Google Maps and found the listing. ## ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/06/Screenshot_20230608_162619_Maps-1.jpg) 3\. Touch and hold an area of the map that isn’t labelled to drop a red pin. Notice that this red pin is just beside the location of our interest. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/06/Screenshot_20230608_162629_Maps-1.jpg) Copy the coordinates of the Dropped Pin ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/06/Screenshot_20230608_162653_Chrome.jpg) Click on the dropdown button to the left of Search bar on Airspace Map. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/06/Screenshot_20230608_162657_Chrome.jpg) Select Coordinates ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/06/Screenshot_20230608_162723_Chrome.jpg) Enter the coordinates copied from Google Maps on to the search bar now. As you can observe, the coordinate fall onto the Red Zone. This is why it is important to do this activity to be sure that you are flying a drone in a safe zone. --- **Share this article** Copy and share this article: [narendravardi.com/gmaps-mapmyindia/](https://www.narendravardi.com/gmaps-mapmyindia/) --- **Recommendations** If you liked this article, you might also enjoy reading the following. - [✍️Why DJI Mini3 Pro is the best beginner drone - Part I](https://www.narendravardi.com/part1-djimini3pro/) - [📷Minimalist photographs of farm fields](https://www.narendravardi.com/farm-patterns/) - [🔥 Breath-taking 360° photograph up in the air](https://www.narendravardi.com/360-photo/) - [Follow @worthyphotographer on Instagram](https://www.instagram.com/worthyphotographer?ref=narendravardi.com) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### 😔How to prepare for your next layoff in India URL: https://www.narendravardi.com/next-layoff/ Last updated: 2025-01-08T04:20:07.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/#/portal/signup/free)*.* --- Since companies like Amazon, Google, Meta and Microsoft are laying off many employees, we should accept that layoffs as a concept will be more common in the IT industry soon, and no company will promise good job security. In this article, I am sharing some measures that, in my opinion, would help an individual to be prepared for the next layoff. Though this is not directed towards freshers and college students, I hope even for them; this article comes in handy. These precautions are primarily intended for Indian programmers, but you can also refer to these precautions and find a similar alternative for your job and country. This is not an exhaustive list, so take it with a pinch of salt. Let's get started! --- ## After the layoff ### Accept that the layoff is beyond your control One of the surprising moments after a layoff is not being able to accept it. We would have worked hard or stayed loyal to the company for a long time despite better outside opportunities, and still, a layoff is an outcome. It hurts. We try to find answers on how things went wrong and how we can fix them. This behaviour only creates unrest in your mind. The best thing would be to accept that it's beyond your control and identify the next step you want to take in your life. ### Take care of your mental health As mentioned in the above point, there’s a lot of scope for unrest in your mind, and because layoffs are considered performance-based and there is a lot of stigma surrounding layoffs in society, you might feel like a failure. Don’t give in to that thought process. If people are mocking you because you got laid off, reduce the interactions with them until things get settled and find a group that can be supportive. You can find such people on LinkedIn. An easier way to meet supportive people is to DM people who got laid. ### Take help from your network. One of the things that gets important as you transition from junior to an experienced engineer is the use of your professional network. Get [LinkedIn recommendations](https://www.linkedin.com/help/linkedin/answer/a541653/recommendations-on-linkedin?lang=en&ref=narendravardi.com) from your managers and team members. Notify your close friends and colleagues that you are actively seeking a job. --- ## During the layoff ### Negotiate the exit terms One of the things employees are not aware of is that you can negotiate your exit terms. You can't negotiate groundbreaking things here, but you can negotiate things to help you become comfortable after the layoff. Here are a few things that I have seen people in my circle negotiate with success - **Negotiate the exit date:** You can negotiate so that your exit date on the *experience letter* is reflected as a few weeks later than your *actual* termination date. This helps you avoid a career break (in case it's taking a lot of time to get a new job) on your resume. - **Negotiate Health Insurance:** It is best to negotiate if a person in the family needs continuous doctor consultation or hospitalisation. Having said that, you can request this to avoid emergencies (explained more in the health insurance section below). - **Negotiate higher severance payment:** This becomes very important if you lack funds to sustain for weeks without a job. Discuss your situation and let your supervisor or HR know why you *need a* higher severance payment. - **Negotiate recommendations or recommendation letters:** If all the negotiations listed above are not accepted, you can ask your supervisor/manager/HR for a recommendation letter (or LinkedIn recommendations). --- ## Before the layoff ### Start maintaining a reserve fund. Once you get a job, you'll have to start saving money to equip yourself for the next layoff better. This is old-school advice, and you may want to stop reading here but listen to me, jobs in IT are not financially secure, and you can be fired anytime. If our older generations worked in Government, which is very safe compared to IT jobs, and still saved money for the future, why can't we do that? Maintain a reserve fund. The reserve fund is something that you can use in case of emergencies. I am not talking about health emergencies but a crisis like job loss. Think of reserve funds as reserve fuel in a motor vehicle. Reserve fuel helps you find a petrol pump nearby. Similarly, a reserve fund helps you sustain your family financially until you find another means of financial stability. Reserve fund value can be calculated in multiple ways. The way I like it is to save the money that covers at least *six months of my expenses*. This is something I read as a best practice from a startup founder during my college days on Quora (I think it's [Jimmy Wales](https://www.quora.com/profile/Jimmy-Wales?ref=narendravardi.com) who talked about it - but I can't find the answer) [Subscribe to receive articles directly to your inbox](https://www.narendravardi.com/#/portal/signup/free) ### Get personal health insurance for yourself and your family This is my favourite recommendation. Even if you are sure you’ll not be laid off, you should get personal health insurance. Personal insurance helps with a lot of things. It can help you to take a break and do that adventure, or it can help you get better medical treatment for yourself or your parents. This can be a huge burden if you do not have a job. If you are content with office insurance, buy one for your parents separately. The premium for your parents might increase every year. The quicker you get insurance for them, the merrier the insurance premium will be. 😃 This insurance also comes in handy when you are in-between jobs. ### Consider layoffs in your loan planning While taking a loan (especially a home loan, OMG! Bangalore is super expensive!), it's better to plan a scenario where you got laid off, and it took a couple of months to find a job. In most cases, the loan planning goes something like this, every year, the average increment is x% basic salary and considering that x% increment, people plan a home loan. This is not a bad idea, but it can be awful if you don't maintain enough reserve funds for loan payments after the layoff. 😃 Properly planned out loans also helps you to switch between companies confidently. I see many people work in unfit positions or teams because they fear being unable to pay for the loan installments. --- ## Finding a job Finding a job is difficult when you get laid off during a financial crisis. Nonetheless, the steps remain the same if you are finding a job during the normal situation. Just remember, it just takes more time, and have patience. ### Prepare your Resume One of the tiresome tasks for me is preparing my resume. Most of the time, I spend weeks without making a single change. I solved this problem by maintaining a slightly relaxed deadline for a resume update. Just remember, your resume need not be perfect. It needs to be *available* for job application. You can make updates to it later on. ### Start practising for the interviews One of the easiest ways to practice interviews is by asking your former colleagues or friends to take your interviews. Most of the time, this is good enough. In case they are busy, consider using platforms like [pramp](https://www.pramp.com/?ref=narendravardi.com) or [mentoring-club](https://www.mentoring-club.com/?ref=narendravardi.com). ### Apply for open positions and reach out to your network for open jobs Update on LinkedIn that you are #OpenToWork and reach out to former colleagues and recruiters on LinkedIn via message and share your interest. You can also use platforms like [teamblind](https://teamblind.com/?ref=narendravardi.com) or [instahyre](https://instahyre.com/?ref=narendravardi.com) to find new opportunities. --- ### Finally, a tip from a Venture capitalist on Personal Finance I follow a venture capitalist from India called [Aviral Bhatnagar](https://www.linkedin.com/in/aviral-bhatnagar-72391044/?ref=narendravardi.com). His tip on personal finance is very thought-provoking and can help you manage your finances well. From [Aviral's personal finance](https://ajuniorvc.com/explainers/personal-finance-wealth-making-money/?ref=narendravardi.com) article. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2025/01/image-1.png) Thought-provoking Personal Finance tip from VC, Aviral Bhatnagar --- **Share this article** Copy and share this article: --- **Recommendations** If you liked this article, you might also enjoy reading the following. - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) - [Five mistakes people make while building a resume for the first time](https://www.narendravardi.com/resume-mistakes/) - Relax by reading [Travelling to Paris all alone](https://www.narendravardi.com/reaching-alone/) --- ❤️ **Enjoyed this article?** Forward to a friend and tell them where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### ✍️Does consistency win over quality? URL: https://www.narendravardi.com/consistency-over-quality/ Last updated: 2023-03-18T10:30:26.000Z **Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [**subscribing*](https://www.narendravardi.com/#/portal/signup/free)**.* --- In my city, there is a fruit bowl seller, let's call him a ***Great fruit bowl seller***, who has an excellent eye for identifying sweet and delicious fruits and selling them cut into bowls to the customers. Not surprisingly, I am one of his customers. This fruit bowl seller is ten minutes from my place, and there are various other fruit bowl sellers during this ten-minute walk. They charge the same, but their fruit quality isn't that great. They are of good quality but compared to the **Great fruit bowl seller**'s fruit bowl, they are not good. I only recently discovered a ***Great fruit bowl seller***, and I visited him frequently whenever I wanted a fruit bowl. Initially, I felt good, but then a problem arose. The problem was his inconsistency. He's not available to sell every day. He doesn't maintain a timetable also. It's as if he went in search of great fruits and disappeared for a few days. Once I asked about his absence, and he just gave a smile - which I felt was a zero-mark answer. Anyways, long story short, I can't trust this ***Great fruit bowl seller*** to be available when I need a fruit bowl the most, and it has become frustrating that I will have to cross all the good enough fruit bowl sellers to reach this great fruit bowl seller and only to find him absent. After observing for a few weeks, I shifted from relying on the ***Great fruit bowl seller*** to good-enough fruit bowl sellers. I always think about visiting the ***Great fruit bowl seller,*** but then the unreliability of his presence bothers me and wastes my time. So, ***Great fruit bowl seller*** thanks for your time! :) What would you pick if you were in my situation? An inconsistent **Great fruit bowl seller** or a consistently available, good enough fruit bowl seller? Let me know your thoughts in the comments below! Do you know of situations where consistency can become a dominating factor? [Subscribe to receive articles directly to your inbox.](https://www.narendravardi.com/#/portal/signup/free) --- ****Share this article** Copy and share this article: --- ****Recommendations** If you liked this article, you might also enjoy reading the following. - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) - [Why was I so miserable during my farewell?](https://www.narendravardi.com/miserable-farewell/) - [Why I chose a boring domain name](https://www.narendravardi.com/boring-domain/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### ✍️Why DJI Mini3 Pro is the best beginner drone - Part I URL: https://www.narendravardi.com/part1-djimini3pro/ Last updated: 2023-03-11T10:30:07.000Z **Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [**subscribing*](https://www.narendravardi.com/#/portal/signup/free)**.* --- On my Instagram photography account: [@worthyphotographer](https://www.instagram.com/worthyphotographer?ref=narendravardi.com), many people ask me to recommend a drone. I haven't used many drones, and only a single-digit number of people have a drone within my close circle. I want to tell them immediately that I am not an expert in this topic, but after some introspection, I thought I could guide people. I am not a professional drone user, but I did a significant amount of research before I purchased the DJI Mini 3 Pro. I also viewed many YouTube videos and Instagram reels on various nitty-gritty details of drone usage. After all these learnings, I still feel that DJI Mini 3 Pro is the best drone I bought. This is Part-I of the series of articles where I discuss why the DJI Mini3 Pro is the best beginner drone. In this article, I discuss the features built into DJI Mini3 Pro that make it one of the safest and most secure drones to drive. ### Tri-Directional Obstacle Sensing One of the significant challenges of beginner drone users is the high possibility of error while driving the drone. As I mentioned in [Learning to fly a drone and (three + one) dimensional space](https://www.narendravardi.com/flying-drone/), flying a drone is not easy and is not a computer game. In computer games, one can make mistakes and rectify them, but while flying a drone, some mistakes cause severe damage to the drone and in some rare cases, to birds, animals, and humans. This is where *Tri-Directional Obstacle Sensing* helps the beginner. If the user moves a drone towards an object by mistake, the drone will sense the obstacle and avoids hitting that object. This is quite helpful for beginners because it eliminates all the tension and risks while starting to fly a drone. 💀 Be cautious; this obstacle sensing doesn't work when the drone moves sideways. [Subscribe to receive articles directly to your inbox](https://www.narendravardi.com/#/portal/signup/free) ### Return to Home (RTH) Another challenge for beginner drone users is difficulty navigating the drone back home. Imagine flying a drone to a faraway place in excitement and struggling to return it. DJI Mini3 Pro makes it easy to return home with the *Return to Home* feature. All you have to do is click on the RTH button when the drone is flying and notice the magic happen. When you select RTH, the drone automatically flies back to the Home Point - the point at which the drone took off. 💀 Ensure that RTH altitude is configured correctly and that someone is at the Home Point location. ### Low Battery Alerts Whenever the drone has less than a few minutes of flight time left, the drone controller (the device which is in the hands of the drone user) alerts the user to land immediately, and after one point, it will force the user to land the drone. This is very important, as tracking the battery left while filming drone videos is pretty tricky. 💀 You can force the controller to stop and not land the drone during low battery time. Why would you do that anyway? Now I am sure you understand why DJI Mini3 Pro is one of the safest drones to fly. In the upcoming articles, I will talk about the video capabilities and advanced features provided by it. --- ****Share this article** Copy and share this article: [www.narendravardi.com/part1-djimini3pro/](https://www.narendravardi.com/part1-djimini3pro/) --- ****Recommendations** If you liked this article, you might also enjoy reading the following. - [🔥 Breath-taking 360° photograph up in the air](https://www.narendravardi.com/360-photo/) - [📷Minimalist photographs of farm fields](https://www.narendravardi.com/farm-patterns/) - [Follow @worthyphotographer on Instagram](https://www.instagram.com/worthyphotographer?ref=narendravardi.com) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com?ref=narendra-vardi)! ### 🚲If you have relocated to a new country, visit Expat meetups URL: https://www.narendravardi.com/expat-meetups/ Last updated: 2023-03-10T08:04:34.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/#/portal/signup/free)*.* --- If you have been following me for some time now, you will know I went on a solo trip to Europe. I have talked about my [initial experience of visiting Paris](https://www.narendravardi.com/reaching-alone/) already. In this article, I thought of talking about a meetup that I visited in Amsterdam. If you are new to the word, *ex-pat*, do not worry. I have written down the definition for you. > Ex-pat is an individual living and/or working in a country other than their country of citizenship, often temporarily and for work reasons. For example, Indians will be considered ex-pats if they work outside India, from the other country point of view. Now, let me talk about the [meetups](https://www.meetup.com/?ref=narendravardi.com). I have visited meetups since my first job as an intern at Amazon. That was back in 2016\. It was a way for me to meet new people with similar interests. Like in Hyderabad, I used to visit technical meetups centred around Java and Scala, and once I was back in Bangalore, I became a member of the Toastmasters club. Though these meetups sound dull, they were worth a try. You never know which club will match your energy. Coming to my Amsterdam visit, I stayed at my friend's place in Amsterdam, and he talked me into going for a meetup where ex-pats met. All the guests at the meetup were from different parts of the world and were very inviting. Though I was not going to stay in Amsterdam for long, it was interesting to know the best experiences and challenges of the people who were present. During one of the discussions, they talked about how mad St Patrick's day celebration will be. They were talking about going to movies and restaurants. Experienced ex-pats were guiding new ex-pats to accommodate well into the new country. It felt wonderful. I never thought such kind of support system existed. Most of my NRI friends who are in different countries never talk about meetups, and there is a reason for it. They all relocated to a different country to do their higher studies. If you are studying, you already have students to support you. But, if you are an employee in India and have to relocate to a new country for a temporary purpose or a prolonged duration, these ex-pat meetups, in my opinion, are a great support system. This is especially useful for folks who relocate alone. Having a support system is crucial for understanding and adjusting to the new country. --- ****Share this article** Copy and share this article: [https://narendravardi.com/expat-meetups](https://narendravardi.com/expat-meetups?ref=narendravardi.com) --- ****Recommendations** If you liked this article, you might also enjoy reading the following. - [Travelling to Paris all alone](https://www.narendravardi.com/reaching-alone/) - [🎙️Solo Trip to Europe: Podcast interview](https://www.narendravardi.com/soloeurotrip-interview/) - [How to apply for Schengen Visa to France as an Indian](https://www.narendravardi.com/how-to-apply-for-french-schengen-visa/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! --- ### 🤔What does it mean if we can control an Air Conditioner (AC) using a mobile? URL: https://www.narendravardi.com/ac-remote/ Last updated: 2023-02-18T10:30:14.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/#/portal/signup/free)*.* --- I went to a restaurant in Bangalore a few years ago with two friends. We sat near the empty table, started chit-chatting, and finished ordering the food. I could sense something was off while we were waiting at the table. After a few minutes, one of my friends complained that the temperature was too cold. Yeah! It was bone-biting cold. A single air conditioner was in the hall, pushing cold air on our table. We requested the waiter to increase the temperature, but they grudgingly increased only a single point because it helped other tables stay comfortably cool. After a few minutes, it was clear that we should switch tables, but none were empty. I understood why our table was open when we arrived, but it was too late. We had already placed our order, and the waiter was not very helpful with increasing the temperature. We thought of leaving the place, but we loved their food. So, we stayed back. As we were getting drained in discomfort, arrived, our fourth friend for whom we were waiting. Looking at our faces, he knew something was off and asked about it. [Receive the articles delivered directly to your inbox ](https://www.narendravardi.com/#/portal/signup/free) After listening to the problem, he gave a proud and cynical smile, opened his cell phone, told us to show normal behaviour and increased the air conditioner's temperature with his mobile phone's help. We were shocked but happy about the situation. We had our food and left the restaurant. Later I learnt that his phone could control most of the TVs and ACs in the market. From our point of view, it was a boon and a lot of fun. But if we look from the restaurant's point of view. Someone who they don't know manipulated the AC is scary. What happens if someone can use the mobile to switch on the AC at night and keep the minimum temperature possible when no one is around? What if someone can control your TV to have the maximum volume possible? As more and more technological advancements happen, what should we keep in mind while building or using these new technologies? --- ****Share this article** Copy and share this article: --- ****Recommendations** If you liked this article, you might also enjoy reading the following. - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) - [Why was I so miserable during my farewell?](https://www.narendravardi.com/miserable-farewell/) - [Why I chose a boring domain name](https://www.narendravardi.com/boring-domain/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! --- ### 🎨Let's talk about some of the famous paintings of the world URL: https://www.narendravardi.com/famous-paintings/ Last updated: 2023-02-11T10:30:58.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/#/portal/signup/free)*.* --- I have been learning a lot about the world's most famous paintings. This new hobby stemmed from my visit to [Rijksmuseum](https://en.wikipedia.org/wiki/Rijksmuseum?ref=narendravardi.com), Amsterdam. > Rijksmuseum is the museum of the Netherlands in Amsterdam. 800 years of Dutch history, with the great Dutch masters as **Rembrandt**, **Vermeer** and **Van Gogh**. **Rembrandt**, **Vermeer** and **Van Gogh** are some of the most famous Dutch painters. There is a high possibility that you might have seen one of their paintings. I didn't know about Rembrandt's and Vermeer's paintings until I visited Rijksmuseum. But I did know Van Gogh's *The Starry Night* painting. It was an incredible sensation a few years back on social media, and I believe it remains the same even today. Below is image of how it looks: ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg) The Starry Night by Vincent van Gogh Unfortunately, I couldn't see the actual painting of 'The Starry Night' since it's not available in the museums of Amsterdam. This painting is located in *The Museum of Modern Art*, an Art museum in New York City. --- But I did see various paintings by Dutch artists. Here are *five* paintings from Rijksmuseum which fascinated me. ### Paintings which are part of Rijksmusuem **Portrait of Pompejus Occo by Dirck Jacobsz** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/608px-Dirck_Jacobsz_-_Pompeius_Occo.jpg) Portrait with a skull that too in the 1500s? **The Milkmaid by Johannes Vermeer** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/642px-Johannes_Vermeer_-_Het_melkmeisje_-_Google_Art_Project.jpg) Gold and Blue, what a clever use of colour. There is a calmness to this painting. **The Little Street by Johannes Vermeer** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/512px-Johannes_Vermeer_-_Gezicht_op_huizen_in_Delft-_bekend_als_-Het_straatje-_-_Google_Art_Project-1.jpg) Observe the details of the building. Is that a photograph? **Still Life with a Silver Jug and a Porcelain Bowl by Willem Kalf** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/644px-Willem_Kalf_-_Stilleven_met_zilveren_schenkkan_-_Google_Art_Project.jpg) Details, details, details! **The Night Watch by Rembrandt** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/859px-The_Night_Watch_-_HD.jpg) This is quite a large painting. 12 by 14+1⁄2 feet --- Now that I have talked about some favourite paintings located in Rijksmuseum let me also talk about some paintings which are not part of Rijksmusuem. [Receive the articles delivered directly to your inbox ](https://www.narendravardi.com/#/portal/signup/free) ### Paintings which are not part of Rijksmusuem **The Starry Night by Vincent van Gogh** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/Van_Gogh_-_Starry_Night_-_Google_Art_Project-1.jpg) My personal favourite. Imagine asking people to see this painting after they are drunk :P **The Scream by Edvard Munch** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/580px-Edvard_Munch-_1893-_The_Scream-_oil-_tempera_and_pastel_on_cardboard-_91_x_73_cm-_National_Gallery_of_Norway.jpg) Notice the anxiety of the person screaming. **Girl with a Pearl Earring by Johannes Vermeer** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/608px-1665_Girl_with_a_Pearl_Earring.jpg) I like this image because I like 'The Milkmaid'. I love three of Johannes Vermeer's paintings. **The Great Wave off Kanagawa by Katsushika Hokusai** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/Tsunami_by_hokusai_19th_century.jpg) The wave is mysterious. Did you notice boats in the ocean and claws to the wave? **Nighthawks by Edward Hopper** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/1280px-Nighthawks_by_Edward_Hopper_1942.jpg) I am not yet able to tell why I like this image. Is it because of the excellent use of light to bring your focus to the right side of the canvas? > I am still a noob in understanding paintings. I felt 'Mona Lisa' painting needs more time for me to understand. Hence, it's not on the list. --- **Understanding Paintings** Some of these paintings are pretty hard to interpret without knowing the history of why the artwork was created in the first place. I came across the YouTube channel, which helped me understand many things about paintings. If you also found the paintings interesting, I would suggest you check out the YouTube channel at the link: [GreatArtExplained](https://www.youtube.com/@GreatArtExplained?ref=narendravardi.com) --- ****Share this article** Copy and share this article: [https://www.narendravardi.com/famous-paintings](https://www.narendravardi.com/famous-paintings/) --- ****Recommendations** If you liked this article, you might also like reading the following. - [My Digital Art Work](https://www.narendravardi.com/digital-artwork/) - [Capturing light trails of traffic in Bangalore](https://www.narendravardi.com/light-trails/) - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! ### 🔒It's Safer Internet Day! Two mechanisms to prevent account hacking URL: https://www.narendravardi.com/safer-internet/ Last updated: 2023-03-10T08:10:54.000Z **Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [**subscribing*](https://www.narendravardi.com/#/portal/signup/free)**.* --- Recently a friend of mine called me. He mentioned that their Instagram account had been hacked and was being misused. He asked me if there was a way to retrieve the account. Unfortunately, I didn't have any helpful answers. On the occasion of `Safer Internet Day`, I thought of discussing how you can prevent this situation on most websites. Some of you might have already used it knowingly or unknowingly. This is a two-step process. 1. Using Password Manager. 2. Using Two-factor authentication. ### Using Password Manager One of the simplest prevention forms is using a different password for different websites. Besides this, avoid using the most commonly used passwords. It should be difficult for hackers to guess the password. This is common sense; I am sure you are already aware of this. But why do we not use different passwords? Because our memory has limitations. That's where Password Managers help us. They help us to generate a unique password for each website, and they also help us to fill in the password onto that website without memorising the password. **Bonus:** One of the bizarre passwords I have seen people with password manager use is `` 4PMf?,^t(Nr+V3tww9pn8&uB'zHsg=KFud/~/`E"j&tcP"_y:`bhE5Wn9X+&PuCnY*Ee.aaJ `` 😂 The only problem is, if a password is compromised, which based on my password manager usage experience, is very rare, it can create a problem. In this case, we make use of two-factor authentication. ### Enabling Two-factor authentication Have you ever received a text message like `Your security code to login is: XXXXXX` This mechanism is called two-factor (or sometimes multi-factor) authentication. > Multi-factor authentication (MFA), sometimes called two-factor authentication (2FA), is a security enhancement that requires you to present two pieces of evidence when logging in to an account. Your credentials must come from two different categories to enhance security. The first category is your password, and the second category will be the code from two-factor authentication. Here's the list of two-factor authentication mechanisms available: - **Knowledge factors:** Something you know; like a password, PIN, or security questions - **Ownership factors:** Something you have; like a mobile device (text message), email account, or a USB security key (e.g., [YubiKey](https://www.amazon.com/Yubico-YubiKey-USB-Authentication-Security/dp/B07HBD71HL?ref=narendravardi.com)) - **Inherence factors:** Something you are; biometrics; like your fingerprint, iris pattern, or facial features (The above list is taken from [Danny Sheridan](https://substack.com/profile/219237-danny-sheridan?ref=narendravardi.com)'s [November 30: Types of Multi-factor Authentication](https://www.factoftheday1.com/p/november-30-types-of-multi-factor?ref=narendravardi.com) substack article) **Best practice:** Always enable more than one type of two-factor authentication mechanism and save the security codes or QR codes provided by the website while enabling the two-factor authentication. --- ****Share this article** Copy and share this article: --- ****Recommendations** If you liked this article, you might also like reading the following. - [Time-saving tricks for Google Docs](https://www.narendravardi.com/one-click/) - [Do yourself a favour and visit No Sleep Page](https://www.narendravardi.com/sleep-page/) - [Use HTML version of Gmail to quickly lookup OTPs](https://www.narendravardi.com/html-gmail/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! ### 🤖Automating the boring stuff: How I obtained the titles of all articles on my blog URL: https://www.narendravardi.com/list-automation/ Last updated: 2023-02-04T10:30:44.000Z *Hi! My name is Narendra Vardi, and I write about my learnings, observations and trends in the Software world. Besides software, I also talk about photography, travel stories, books and movies. If that's something that interests you, consider* [*subscribing*](https://www.narendravardi.com/#/portal/signup/free)*.* --- I follow a lot of bloggers, and on their websites, most of them have an all-article list. It's a place on the website where the user can see all article titles on the website in the form of bullet points. I love that idea, and I wanted to maintain a similar page. But it needed some coding. After tweaking for a couple of hours, the page is live. Check out the [articles-list](https://www.narendravardi.com/articles-list/) page now. In this article, I talk about how I automated the generation of an all-article list with the help of python programming language. The format of the articles list looks like below: ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/Screenshot-2023-02-03-224631.jpg) The text of the link is the 'Title' of the article, and it is linked to the article. To create the list, I would need the following: 1. Links to all articles are present on my website. 2. Title of each article Here's some dummy skeleton code for the same. ```Python # Dummy skeleton code. def get_all_post_links(): url_links = [] # do the processing and get the append the links to `url_links` return url_links def get_title_from_url_link(url): title = None # do the processing and set `title` field. return title if __name__ == '__main__': all_links = get_all_post_links() for link in all_links: # Printing as a markdown link. print('* [{}]({})'.format(get_title_from_url_link(link), link)) ``` Dummy skeleton code in Python Now to populate the two methods, I can follow two approaches. **Approach #1: Using APIs provided by [Ghost Pro](https://ghost.org/?via=narendravardi&ref=narendravardi.com) (which I use for hosting my website)** This is the easiest one. Tweaking out some API responses from [Ghost Content API Documentation](https://ghost.org/docs/content-api/?ref=narendravardi.com) would have been good enough. To test API responses, I tried to create [API Key](https://ghost.org/docs/content-api/?ref=narendravardi.com#key). I was utterly disappointed that this API key generation capability was unavailable for my account plan. I need to upgrade my account to a different premium plan to support that feature. Because of this, I was left with only Approach #2, web scraping. **Approach #2: Do some Web Scraping on my very own blog.** Initially, I thought of web scraping by visiting the home page of my account, which is [https://www.narendravardi.com](https://www.narendravardi.com/). But before that, I researched about the technical aspects of blogs and web scraping. During this research, I learnt about *sitemaps*. **Sitemaps** According to Google Search Central: > A sitemap is a file where you provide information about the pages, videos, and other files on your site, and the relationships between them. Search engines like Google read this file to crawl your site more efficiently. A sitemap tells Google which pages and files you think are important in your site, and also provides valuable information about these files. For example, when the page was last updated and any alternate language versions of the page. The sitemap for my blog is an XML file available at the following location: ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/02/Screenshot-2023-02-03-235733.jpg) XML Sitemap in a viewable format. This root sitemap has separate XML mappings for pages, posts, authors and tags. **Fetching all post links** Since we need to get the links of posts, we can visit the sitemap only for [sitemap-posts](https://www.narendravardi.com/sitemap-posts.xml). If we inspect the source of sitemap-posts, we will know that it's an XML file. Since it's an XML file, we can use python to extract the post links from that XML file. Now we can make the following changes to the `get_all_post_links` function: 1. Accept the URL path for sitemap-posts. 2. Get the XML 3. Parse XML 4. Append the links to `url_links`. ```Python import requests from bs4 import BeautifulSoup # read about how to parse XML file! :) ghost_sitemap_posts_url = 'https://www.narendravardi.com/sitemap-posts.xml' def get_all_post_links(sitemap_posts_url): # 2. Get the XML xml_data = requests.get(sitemap_posts_url).content # 3. Parse XML soup = BeautifulSoup(xml_data, 'xml') url_sets = soup.find_all('loc') url_links = [] # 4. Append the links for url_set in url_sets: url_set_text = url_set.text # site-posts also consists of image links. Ignoring them. if not 'image' in url_set_text: url_links.append(url_set_text) return url_links def get_title_from_url_link(url): title = None # do the processing and set `title` field. return title if __name__ == '__main__': # 1. Accept the URL path for sitemap-posts. all_links = get_all_post_links(ghost_sitemap_posts_url) for link in all_links: print('* [{}]({})'.format(get_title_from_url_link(link), link)) ``` Python code with fully functional 'get\_all\_post\_links' method **Getting the title from the article link** Now it's time to get the title from each post. This involves the following steps. 1. Get the HTML page of the post. 2. Extract the title of the page and 3. Return the title. ```Python import requests from bs4 import BeautifulSoup # read about how to parse XML file! :) ghost_sitemap_posts_url = 'https://www.narendravardi.com/sitemap-posts.xml' def get_all_post_links(sitemap_posts_url): # 2. Get the XML xml_data = requests.get(sitemap_posts_url).content # 3. Parse XML soup = BeautifulSoup(xml_data, 'xml') url_sets = soup.find_all('loc') url_links = [] # 4. Append the links for url_set in url_sets: url_set_text = url_set.text # site-posts also consists of image links. Ignoring them. if not 'image' in url_set_text: url_links.append(url_set_text) return url_links def get_title_from_url_link(url): # 1. Get the HTML page of the post. reqs = requests.get(url) # 2. Extract the title of the page and soup = BeautifulSoup(reqs.text, 'html.parser') # 3. Return the title. for title in soup.find_all('title'): # why use a for loop for title? return title.get_text() if __name__ == '__main__': # 1. Accept the URL path for sitemap-posts. all_links = get_all_post_links(ghost_sitemap_posts_url) for link in all_links: print('* [{}]({})'.format(get_title_from_url_link(link), link)) ``` Fully functional Python code 💀 For this code to function, you must install lxml, requests, beautifulsoup4 packages. The output of the script looks as follows: ```Markdown * [📷Minimalist photographs of farm fields](https://www.narendravardi.com/farm-patterns/) * [✍️Finding the Nth highest salary from an SQL table](https://www.narendravardi.com/nth-salary/) * [🎙️Solo Trip to Europe: Podcast interview](https://www.narendravardi.com/soloeurotrip-interview/) ``` I can directly paste the above output into Ghost using the markdown feature. Don't forget to visit the [All Articles](https://www.narendravardi.com/articles-list/) page. That's all for today! :) --- ****Share this article** Copy and share this article: [https://www.narendravardi.com/list-automation](https://www.narendravardi.com/list-automation/) --- ****Recommendations** If you liked this article, you might also like reading the following. - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/). - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) - [🚌Bus Factor in the IT World](https://www.narendravardi.com/bus-factor/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! ### 📷Minimalist photographs of farm fields URL: https://www.narendravardi.com/farm-patterns/ Last updated: 2023-02-03T07:52:54.000Z Hello All👋 I’m working on a couple of articles which I’ve not finished writing yet. Meanwhile, I thought of sharing multiple photographs I’ve captured with the help of drone. These are clearly some of my favourite photographs I’ve taken and I’m really happy that my photography perspective is getting better. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/01/65952224-4B94-4DE9-8960-A1320E1579D1.jpeg) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/01/7BAAF392-78A4-42C6-99F7-E04703A7950B.jpeg) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/01/147E250B-B4F1-4B20-8AE4-9971A166A96D.jpeg) ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2023/01/18A1A709-950E-49FC-BE1F-E70F8B8EBCB8.jpeg) Which is your favourite photograph from the above? Do you have any suggestions on what I should capture next on my drone? Let me know that in comments! :) --- ****Share this article** Copy and share this article: [https://www.narendravardi.com/farm-patterns](https://www.narendravardi.com/farm-patterns/) --- ****Recommendations** If you liked this article, you might also like reading the following. - [Capturing light trails of traffic in Bangalore](https://www.narendravardi.com/light-trails/) - [Breath-taking 360° photograph up in the air](https://www.narendravardi.com/360-photo/) - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! ### ✍️Finding the Nth highest salary from an SQL table URL: https://www.narendravardi.com/nth-salary/ Last updated: 2023-07-22T16:20:22.000Z Recently I came across an interesting problem in SQL. This is an interesting problem, even in Data Structures and Algorithms. Let's not waste time and jump ahead. So, here's the problem statement: > Finding the Nth highest salary from an SQL table I wanted the documentation of the solution to be interactive. This can be achieved with the help of using an online SQL compiler. Use the online compiler to test out the code: [https://www.programiz.com/sql/online-compiler/](https://www.programiz.com/sql/online-compiler/?ref=narendravardi.com) Here are the steps we will take to solve this problem. 1. Create an employee table with `salary` and `name` as fields. 2. Insert data into the table to find the nth largest salary. 3. Write the query for finding the nth largest salary. ## First, we need to create the table. *Here's the create table query* ``` CREATE TABLE Employees ( Salary int, Name varchar(255) ); ``` ## Insert data into the table to find the nth largest salary. *Insert values into Table* ``` Insert into Employees (Salary, Name) values (500, 'E'); Insert into Employees (Salary, Name) values (200, 'B'); Insert into Employees (Salary, Name) values (400, 'D'); Insert into Employees (Salary, Name) values (600, 'F'); Insert into Employees (Salary, Name) values (700, 'G'); Insert into Employees (Salary, Name) values (800, 'H'); Insert into Employees (Salary, Name) values (300, 'C'); Insert into Employees (Salary, Name) values (100, 'A'); ``` ## Writing the query for finding the nth largest salary. Before we write the query for the nth largest salary, let's write the query for the maximum salary. ### Find the maximum salary. ``` select max(salary) from employees; ``` Now, let's write the query to find the second maximum salary. ### Find the second max salary. ``` select max(salary) from employees where salary < (select max(salary) from employees); ``` One major difference between the queries of maximum and second maximum salaries is the addition of the where clause in the second maximum salary query. In the second maximum salary query, we are making use of what is called a `subquery` to find the salary that is less than the maximum salary but greater than other salaries. Now the idea to find the Nth maximum is to find the maximum salary less than the maximum N-1 elements. We will make sure of the subquery again to get to the nth maximum. But first, let's write the query for the top N-1 salaries. ``` select salary from employees order by salary desc limit N-1; ``` Now that we have top N-1 salaries, we can make use of `not in` operator to find the nth max salary ``` select max(salary) from employees where salary not in (select salary from employees order by salary desc limit N-1); ``` This gives us the nth maximum salary. Can you think of any edge cases we missed while proposing this solution? Take some time to think! What we missed was handling the duplicate salaries. Can you think of ways to use a subquery to make it get the nth maximum salary? Hint: see if you can use `ORDER BY DESC` an `ORDER BY ASC` --- ## Use of Offset keyword: Finally, one easiest way to solve this problem is to use the OFFSET keyword. > OFFSET dictates the number of rows to skip from the beginning of the returned data before presenting the results. So, what it means is > If we provide offset as 0, zero rows are skipped from the start. > If we provide offset as 1, one row is skipped, and results start from the 2nd row. > If we provide offset as n-1, n-1 rows are skipped, and results start from the nth row. Can you think of a keyword that could help us here? If you haven't guessed already, that's `limit` the keyword. We will limit the results to return only one row. Here's the query for your reference: ``` select * from employees order by salary desc limit 1 offset N-1; ``` How would you solve this problem? Let me know that in the comments! --- ****Share this article** Copy and share this article: [https://www.narendravardi.com/nth-salary](https://www.narendravardi.com/nth-salary/) --- ****Recommendations** - [Future Software Engineers, read this article before and during your placements.](https://www.narendravardi.com/interview-prep/) - [Things I wish I had known before my first internship](https://www.narendravardi.com/student-professional/) - [Learnings from two years of Work From Home](https://www.narendravardi.com/wfh-learnings/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! --- ### 🎙️Solo Trip to Europe: Podcast interview URL: https://www.narendravardi.com/soloeurotrip-interview/ Last updated: 2022-12-10T10:30:55.000Z Hello All! I wanted to let you know that I had the opportunity to sit with the fun and humourous host of [Candid Convos](https://youtu.be/9dal3APrXbI?list=PL0aYeNvQD0hoRyoZ7Lbx--GV93IOT7GTg&ref=narendravardi.com), [Kavita Joshi](https://www.youtube.com/@64kavita?ref=narendravardi.com), a dear friend of mine, to discuss my travel, food, and experiences from my Europe trip. I am a big fan of podcast interviews, and being in one of them feels so amazing! :) 🤩 This podcast is quite fun. Don't miss out on it! :) Solo Trip to Europe - Part I --- If you want to get my blog articles directly to your inbox, Subscribe below! :) [Subscribe for FREE](https://www.narendravardi.com/#/portal/signup/free) --- Solo Trip to Europe - Part II ****Share this article** Copy and share this article: [](https://www.narendravardi.com/soloeurotrip-interview/)[https://www.narendravardi.com/](https://www.narendravardi.com/soloeurotrip-interview/)soloeurotrip-interview --- ****Recommendations** If you liked this article, you might also like reading the following. - [Travelling to Paris all alone](https://www.narendravardi.com/reaching-alone/) - [How to apply for Schengen Visa to France as an Indian](https://www.narendravardi.com/how-to-apply-for-french-schengen-visa/) - [Goa trip with college friends](https://www.narendravardi.com/goa-trip/) --- ****❤️ Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! --- ### ✍️Measures to increase productivity URL: https://www.narendravardi.com/productivity-measures/ Last updated: 2023-03-10T08:01:13.000Z Hello everyone, Lately, I have been working on some changes to my lifestyle to increase my productivity. There are a bunch of tips already listed on the internet on how to increase productivity, but all of them might not work for everyone, and that is true for me as well. In this article, I list the activities that I feel are helping me become more productive. This would be an in-progress article as I would keep updating my learnings. Let's jump in! --- If you want to get my blog articles directly to your inbox, Subscribe below! :) [Subscribe for FREE](https://www.narendravardi.com/#/portal/signup/free) --- ## Reducing my mobile usage while working If mobile phones are productivity killers, we might have a temptation to keep them far away. This is a good thing to do. But that's not a possibility for me most of the time. I will need my mobile phone to use apps that generate OTP passwords, like the Authenticator app, Mobile phone SMS etc., And because of WFH, at times, I will need to monitor Whatsapp as well to get updates about family events. So, keeping my mobile phone far away is not an option. So, I used to keep my mobile nearby, and because of it, I frequently grab my phone and check for updates even though there won't be much. I wanted to fix this problem, and the solution worked. > The solution is to keep my mobile phone at the back side of my chair. It shouldn't be visible to me and I will have to rotate or move my chair to even see my mobile. This short friction to use my mobile helped me reduce the habit of frequently checking my phone; thus, I could dedicate more time to the things that matter more. --- ## Reducing my social media usage while using a laptop I have started using [Blocksite](https://blocksite.co/?ref=narendravardi.com) chrome extension to block my visits to social media websites on laptop. Not just social media, I have a habit of checking my emails and chats quite frequently, because of which I context switch a lot. Even this habit got reduced considerably. Using this extension helped me take control of my laptop usage. Blocksite team also has an Android application, but the android operating system terminates this app, so it's unpredictable how it works on mobile. There are two modes to this extension: - Disabled and - Enabled > In case of disable mode, you *can* access all the blocked websites. In the case of enabled mode, you *cannot* access the blocked websites. What I wish this app supported, though, was an X-minute timer to switch to enable mode from a disabled mode. I have requested the Blocksite team for the same and will wait for their revert to see if there is a workaround for achieving this capability. --- ****Share this article** Copy and share this article: [https://www.narendravardi.com/productivity-measures](https://www.narendravardi.com/productivity-measures/) --- ****Recommendations** If you liked this article, you might also like reading the following. - [Resume Mistakes](https://www.narendravardi.com/resume-mistakes/) - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) - [Articles tagged as 'learnings'](https://www.narendravardi.com/tag/learnings/) --- **❤️ Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! ### 🚌Bus Factor in the IT World URL: https://www.narendravardi.com/bus-factor/ Last updated: 2022-11-26T10:30:29.000Z Recently, I came across a thought-provoking sketch from sketchplanations. Quoting from the sketch: > The risk you're taking if key people were hit by a bus. The sketch is funny. It is. I kid you not, this is also one of the darkest sketches I have ever seen. Let me give you an example of how dark this sketch can be in real life. I have been in the IT industry for six years and have heard bizarre stories from the IT world. It could be from the news articles, from my friends, colleagues or witnessed some of them myself. One thing that I can recall right away that's linked to the *Bus Factor* problem was the 'I was at my friend's home with mobile phone switch-off problem'. [Subscribe for FREE](https://www.narendravardi.com/#/portal/signup/free) ## I was at my friend's place with my mobile phone switched off problem So here's the incident in *highly* simplified terms: 1. Engineers did a hardware upgrade for a very small section of servers in the warehouse. 2. They monitored the upgraded hardware for a few days and discussed it with service owners. 3. After receiving good feedback from service owners, they slowly upgraded all the hardware. 4. Everything worked for a week, and then suddenly, at once, services stopped working. No one knew anything, and only engineers who had access to the warehouse could identify what was wrong; the only problem was that the warehouse's key was with an engineer who was unreachable due to personal commitments. 5. Once the engineer who had the key returned to the office, engineers entered the warehouse and identified the issue. Fix didn't take major time but accessing the warehouse took a lot of time. There was a *great* business loss to the company. 6. After this incident, what would have happened to the engineer with the key? We never know! After reading this, you might think this is a lame scenario. As lame as it sounds, this has happened. Maybe it's not the key to the warehouse, it might be a pin to enter a warehouse section or a password to access a server. This is a major risk and fixing this risk is very important for keeping the business running. Not just company-wide, identifying and fixing the Bus Factor problem is especially important for the Engineering Manager or Tech Lead since they are held responsible for such risks in case of any outages within a team. Do you know of any stories where Bus Factor created a lot of problems? Let me know in the comments below or drop an [email](mailto:narendravardi1127@gmail.com). ****Share this article** Copy and share this article: ****Recommendations** If you liked this article, you might also like reading the following. - [Future Software Engineers, read this article before and during your placements.](https://www.narendravardi.com/interview-prep/) - [Five mistakes people make while building a resume for the first time](https://www.narendravardi.com/resume-mistakes/) - [Learnings from two years of Work From Home](https://www.narendravardi.com/wfh-learnings/) [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! ### If you throw a stone in Bangalore, it will hit a dog or a Software Engineer URL: https://www.narendravardi.com/engineer-blr/ Last updated: 2022-11-23T10:41:02.000Z When I was about to relocate to Bangalore, one of the common sayings I used to hear about Bangalore was > If you throw a stone in Bangalore, it will hit a dog or a Software Engineer. I know it was an exaggeration but looking at the moment I captured above, I felt there was some truth to it! :) If you liked the picture, consider following my work on Instagram: [@worthyphotographer](https://www.instagram.com/worthyphotographer?ref=narendravardi.com) --- **Share this article** Copy and share this article: --- **Recommendations** - [Capturing light trails of traffic in Bangalore](https://www.narendravardi.com/light-trails/) - [Breath-taking 360° photograph up in the air](https://www.narendravardi.com/360-photo/) - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) --- ❤️ **Enjoyed this article?** Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello, or drop an [email](mailto:narendravardi1127@gmail.com)! ### 🎉How did knowing different programming languages help me during my college placements? URL: https://www.narendravardi.com/different-languages/ Last updated: 2022-11-19T10:30:14.000Z I wanted to let you know that I had the opportunity to write a guest blog post on the scientyficworld website on how knowing multiple programming languages helped me during my placements. It was fun to recollect and write about why I learnt so many programming languages. I can also assure you, you will enjoy reading the article. You don't have to know the programming languages to read the article. Happy reading! :) [How Did Knowing Different Programming Languages Help Me During My College Placements? • Scientyfic WorldI was excited about learning a new programming language during my college days.![](https://scientyficworld.org/wp-content/uploads/2022/10/siteicon.svg)Scientyfic WorldNarendra Vardi![](https://scientyficworld.org/wp-content/uploads/2022/11/programming-language-1024x576.jpg)](https://scientyficworld.org/help-knowing-different-programming-languages/?ref=narendravardi.com) Link to the article! ****Share this article** Copy and share this article: ****Recommendations** If you liked this article, you might also like reading the following. - [Resume Mistakes](https://www.narendravardi.com/resume-mistakes/) - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) - [Articles tagged as 'learnings'](https://www.narendravardi.com/tag/learnings/) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! ### The Imagination vs reality of purchasing a good car URL: https://www.narendravardi.com/buy-car/ Last updated: 2022-11-12T10:30:47.000Z I write about the IT industry, photography and stories from my life. Please consider subscribing! :) Back in 2015, I was in the final year of my undergraduate degree. Though we had classes, the focus was entirely on getting a job. During this time, every one of us suffered from a type of fever, and we lovingly called it 'placements fever'. Wearing a formal dress, being tensed all day, not showing resumes to each other, crying, and partying were some symptoms of this disease. This fever would only come to those who wanted to get a job. You might want to counter me and say, "Many would want a job?". But that's not the case, not at least in my college. Many people had completely different goals. Some wanted to pursue higher education, some wanted to become an artist (Did I ever mention that [@theabhishekkumar](https://www.instagram.com/theabishekkumar/?hl=en&ref=narendravardi.com) was my chemistry lab teammate?), and some wanted to manage their family businesses. I was also suffering from placements fever. I wanted to get a job. Another reason why getting a job was tempting was that 2016 noticed a significant demand for employees; hence, the salaries offered during that period were very competitive. Let me give an idea of available company categories while I was going through placements. | Company Category | Price Range (in INR) | | ---------------- | -------------------- | | Super Dream | salary >= 10 L | | Dream | 4L <= salary < 10L | | Consultancy | Salary <= 4L | There were at least ten companies in the super dream category; to my knowledge, at least fifty students would have received a Super dream offer. *Super dream* category companies were the first to visit, and after a month of tense period, many *Super Dream* companies rolled out the job offers. Unfortunately, I didn't get placed. There were moments when unplaced people got jealous, but it was only for a moment. We loved to notice that at least someone was succeeding, and that provided some *hope* for us. Being a fan of *Andy Dufresne* means there's always room for hope, not jealousy. > Hope is a good thing, maybe the best of things, and no good thing ever dies.” - Andy Dufresne, The Shawshank Redemption One common question asked to placed people by the unplaced was, "What do you want to do with your salary?" Or, to be more specific, "You got a salary of 12LPA (let's say), which means you will be making 1L per month. How are you planning to spend that 1L?" The answers were very predictable. Most of the placed candidates were of the same age group (we are in college, remember?) and have similar financial backgrounds (and hence we opted for a job), so almost all the answers were the same, and one of high budget expense that was common among everyone was to purchase a good car. Even people who didn't get a job visualised the future. Maybe one day, we will get to ride in that car or maybe we will go on a road trip like the movie [Zindagi Na Milegi Dobara](https://www.imdb.com/title/tt1562872/?ref=narendravardi.com). Those were the days of imagination. After suffering from *placements fever* for almost five months, I finally got an offer from Amazon (I already had some job offers, but they weren't what I was expecting). The following month, I left my college and relocated to Hyderabad to do my internship. My internship salary only helped me to meet ends. I was waiting for my first full-time paycheck, and that's when I would think about what I should spend my money on. [Subcribe for Free](https://www.narendravardi.com/#/portal/signup/free) Fast forward to my first full-time paycheck, I was battling the expenses. There were many necessary expenses like house rent, food, clothing, and parties burning money like a supercar consuming petrol. Besides this, one that knocked me down by surprise was the *Income Tax.* In college, I lacked awareness of Income Tax (IT). When news and professionals talked about *IT returns*, I used to think of it as an advanced concept in Information Technology (IT). During my internship, I learnt that income tax was essential, but I didn't think it would be crucial. No wonder I was surprised when I saw the first full-time payslip. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/Screenshot-2022-10-13-113520.png) For a salary of 12LPA, \~ 2L per annum was the income tax. Besides this, there are [EPF](https://en.wikipedia.org/wiki/Employees'%5FProvident%5FFund%5FOrganisation?ref=narendravardi.com) and [EPS](https://en.wikipedia.org/wiki/Employees'%5FProvident%5FFund%5FOrganisation?ref=narendravardi.com#Employees'%5FPension%5FScheme) cuttings. As we tried to save up money for a car, Uber and Ola took a more significant chunk of our salary since there was no easy transport from our house to the office. Staying in well-connected areas means we have to spend a lot on rent. Finally, I decided it was better to get a bike to cut costs on transportation and save a lot of time and get some headspace from Uber/Ola driver cancellations. I bought a cruiser bike, Avenger 220 street in Hyderabad, as it's very comfortable for long rides. [Financial District in Hyderabad](https://en.wikipedia.org/wiki/Nanakramguda?ref=narendravardi.com) has some of the best roads I have ever seen, so riding a bike was very enjoyable. But then I relocated to Bangalore to join Flipkart. Minute by minute, all my excitement for riding a bike evaporated. I strongly wished I had bought a scooter. Over time, I got habituated to using walking and public transport, leaving all the traffic frustrations to the bus drivers. But then there is a problem. Many friends who are not in Bangalore, unaware of Bangalore traffic, encourage (or should I say push) me to purchase a car. I tried to talk about Bangalore's infamous traffic, but they did not understand. These days, I smile and do not provide them with an explanation because they won't understand it. But what happened one weekend, they were in Bangalore for a short trip, I gave them the rented car steering for a couple of hours. They acted like [Rahul Dravid in the CRED advertisement](https://www.youtube.com/watch?v=j8KpV-4%5FmRg&ab%5Fchannel=CRED&ref=narendravardi.com) (They do not agree when I say that they behaved like Rahul Dravid in the CRED advertisement). Before you pity my situation, let me assure you it's not as bad as I made it look. I did fulfil the dreams of driving a car and making road trips, all thanks to rented cars. I do not own a car. A few discussions are happening around buying a good car within my close circle. Stay connected as I will share those discussions in future, which, in my opinion, are very insightful! :) **Share this article** Copy and share this article: `https://www.narendravardi.com/buy-car/` ****Recommendations** If you liked this article, you might also like reading the following. - [Articles tagged as 'memes'](https://www.narendravardi.com/tag/memes/) - [Avoiding Perfection while blogging](https://www.narendravardi.com/tackling-perfection/) - [Future Software Engineers, read this article before and during your placements](https://www.narendravardi.com/interview-prep/) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! ### Five mistakes people make while building a resume for the first time URL: https://www.narendravardi.com/resume-mistakes/ Last updated: 2022-11-05T10:30:39.000Z This article discusses everyday mistakes people make while building a resume for the first time. I also justify why a particular mistake needs to be fixed. Let's jump in! --- ## Sharing a (.doc) file as a resume I come across people who share their resumes in (.doc) format. Do not make this mistake. Share a pdf resume. ### Why fix this? In the world of laptops and mobile phones, there are various software using which you can open a (.doc) file. - On a mac laptop, it would be *Pages* software. - On a windows laptop, it could be Microsoft Office. And not to forget, the use of online office services has skyrocketed. All these apps are not *fully* compatible with each other. Font, size and, at times, formatting could be broken. Because of this, when you share a resume, it looks unprofessional. The pdf file format, on the other hand, is standardised. Hence, the resume you send is what the recruiter sees. --- ## Creating a Resume Template Unless you are into designing, I highly recommend using resume templates online. It's boring, I agree, but it's for the best. The latest trend is to use Latex based resumes. A quick [Google search](https://www.google.com/search?q=latex+resume+templates&rlz=1C1OPNX%5FenIN969IN969&oq=latex+resume+templates&aqs=chrome..69i57.3898j0j7&sourceid=chrome&ie=UTF-8&ref=narendravardi.com) gets you numerous templates. ### Why fix this? From Wikipedia, > a resume is a document created and used by a person to present their background, skills, and accomplishments. Your goal should be to present your background, skills, and accomplishments and not work on coming up with a resume template. Some professionals create a resume template. Your job is to use that template and quickly build your resume. --- ## Providing Tier-2 or Tier-3 cities as the location Unless you don't want to relocate, mention your location as the closest Tier-1 city. This is not a significant problem anymore, given that we got habituated to a remote environment. It's not wrong to make this change, though. The problem with this approach is the recruiter might not entertain a relocation bonus. Having a conversation with the recruiter might help. Make this change when you need a job badly. This could help. ### Why fix this? If you provide a city the recruiter has never heard of, the recruiter might think you are unwilling to relocate and hence may not contact you or Other candidates who are already in the city would be provided preference first. Why risk contacting a person who might not be willing to relocate? --- ## Creating two-pager or more-pager resumes, thereby diluting your best stuff If you recently graduated, stick to a single-page resume. You can use a second page if you have three-plus years of experience. I have seen a resume with more pages get shortlisted, but only if your portfolio is too good to discard or the job role is not that exciting but needs to fill immediately. ### Why fix this? Quoting from the [Career cup website](https://www.careercup.com/resume?ref=narendravardi.com): > Recruiters do not *read* your resume; they do a 15 - 30 second "spot check" of your resume. When your resume is too long, it just takes your best stuff - the stuff that would have made the "one page cut" - and dilutes it with more mediocre content. --- ## Not providing proof for personal projects. One of the common mistakes that people make is to list a personal project and not provide proof. I get it, you don't have proof because you changed your laptop or do not have access to the code or project. Change that from now on, and have proof. You can either save your work on GitHub or record a video and upload your work on YouTube. Once a link is generated, provided that link on your resume. Caution: Do not host your office-related work on your personal GitHub account. This might get you in trouble! ;) ### Why fix this? People who provide proof are generally considered authentic and have higher chances of getting their resumes shortlisted. --- 💡 If you want to get your resume reviewed or need guidance while building one, you can [hire me](https://www.narendravardi.com/hire-me/)! :) According to you, what is the mistake people make while building a resume for the first time? Let me know in the comments, or [drop me an email](mailto:narendravardi1127@gmail.com). ****Recommendations** If you liked this article, you might also like reading the following. - [Future Software Engineers, read this article before and during your placements.](https://www.narendravardi.com/interview-prep/) - [Things I wish I had known before my first internship](https://www.narendravardi.com/student-professional/) - [Learnings from two years of Work From Home](https://www.narendravardi.com/wfh-learnings/) - [This Is What A GOOD Resume Should Look Like](https://www.careercup.com/resume?ref=narendravardi.com) [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! --- ### How to apply for Schengen Visa to France as an Indian URL: https://www.narendravardi.com/how-to-apply-for-french-schengen-visa/ Last updated: 2026-03-25T11:36:43.000Z First of all, let's learn about the Schengen visa. ## What is a Schengen Visa? From the [Schengen Visa information website](https://www.schengenvisainfo.com/?ref=narendravardi.com), > A Schengen visa is a short-stay visa that allows a person to travel to any members of the [Schengen Area](https://en.wikipedia.org/wiki/Schengen%5FArea?ref=narendravardi.com), per stays up to 90 days for tourism or business purposes. Now I will have to discuss what's Schengen Area, right? Here's the info about it from the [Schengen Visa information website](https://www.schengenvisainfo.com/?ref=narendravardi.com). > **Schengen Area** signifies a zone where 26 European countries, abolished their internal borders, for the free and unrestricted movement of people, in harmony with common rules for controlling external borders and fighting criminality by strengthening the common judicial system and police cooperation. In layman's terms, the Schengen area consists of 26 European countries you can visit if you have a Schengen Visa. If you received a Schengen Visa permit from one country, you could visit all 26 countries without requesting another visa. This type of visa is not common in most other parts of the world, which is also one reason why Europe is one of the best destinations to travel to. 💡 This article is written from my experience and should not be used as a source of truth. Here's the [Visa application process from the France visa govt](https://france-visas.gouv.fr/en/web/france-visas/visa-application-guidelines?ref=narendravardi.com). This article is a way to make the visa application process more manageable and smooth. ## When should you apply for a Schengen visa from France This is detailed more on the [schengenvisainfo](https://www.schengenvisainfo.com/where-to-submit-the-visa-application/?ref=narendravardi.com) website. For the lazy ones, here's the gist: ### Visiting France only? In this case, you must request a Schengen visa from France. ### Visiting more than one country (may or may not include France)? If you are planning to visit more than one country – then from which country you need to request a visa depends on the number of days you will be spending in each country. - When spending **an equal number** of days in each, you must request a Schengen visa from the country where you will first arrive. - When spending **unequal amounts of days in each**, you must apply for the country where you will spend more time. ## Hmm, is this article not helpful in applying to other Schengen Visa Countries? It is also helpful even if you apply to other Schengen countries. The process is almost similar for all the Schengen countries, but I haven't requested from other countries, so my experience in this article is mainly from France's application process. ## Process The process involves four steps. 1. Fill out an online application form with [The official visa website for France](https://france-visas.gouv.fr/en/web/france-visas/visa-application-guidelines?ref=narendravardi.com). 2. Book an appointment with the [France VFS website](https://visa.vfsglobal.com/ind/en/fra/?ref=narendravardi.com). Before this step, we need to gather all the necessary documents, which I have listed in the checklist. 3. Submit the necessary documents. 4. Wait for the response. ## Checklist ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/VISACheckList.jpeg) A checklist we created as we prepared for our visa appointments in 2018 ### Itinerary One of the essential steps not part of the process but crucial is to finalise the itinerary. I cannot guide you on the countries you can visit as it's a personal choice. But I do have some pointers here. - Finalise places which you would like to visit. - Plan in such a way that you spend a minimum of 2 days in a smaller city/town and four days in a bigger city. It might feel a lot, but that creates a deeper connection with the place. - Do not get into the temptation of visiting all the countries. - Avoid retracing the path. If you want to visit Paris, Amsterdam and Barcelona, you might end up retracting if you reach Paris first, as Paris is between Amsterdam and Barcelona. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/Screenshot-2022-10-19-114005.png) Visiting Paris first can lead to retracing the path as Paris is in between Barcelona and Amsterdam ### Visa Various conditions must be satisfied to receive the Schengen visa from France. A couple of things which I wanted to list here are: - Apply to France if you are staying in France for a longer duration than any other country on your trip or - Apply to France if you enter the Schengen area via France and plan to stay for couple of days. ### Hotel Bookings You can use any online platform to book your hotels but make sure your booking doesn't have a cancellation fee. I have booked either used Airbnb or Hostelsworld to book accommodation. You might also need the email id of the accommodation to be filled in the application form. Hence, book a booking which has an email id and phone number. If they are not available, do not worry. Book the accommodation and drop a message using the accommodation app. ### Flight Bookings Back in the pre-covid days, I purchased no cancellation fee flight tickets. But now, I couldn't find any zero cancellation fee flight tickets. So, I used the flight ticket reservation platform called [schengenflightreservationvisa](https://schengenflightreservationvisa.com/?ref=narendravardi.com). This platform reserves a flight ticket in your name for two weeks, after which the reservation is expired. Hence, purchase the reservation a couple of days before your appointment. 💡 Many people think this reservation platform is shady and shouldn't be used. That's not true. It worked, and a few others recommended it to me. So, it works! :) ### Visa Application Form Create an account on [The official visa website for France](https://france-visas.gouv.fr/en/web/france-visas/?ref=narendravardi.com) and finish the application form. You will be able to download the pdf of the Visa Application form. Download it and note the Visa Application form ID. ### VFS Appointment letter 💡 I wanted to mention the role of VFS here. VFS is an intermediary between us, the visa requester and the France Visa office. We will have to submit all the documents to VFS Global. VFS Global will send out the documents to France Visa Office. After finishing the Visa Application form, log in to the [France VFS website](https://visa.vfsglobal.com/ind/en/fra/?ref=narendravardi.com) and book an appointment. You will be requested to enter Visa Application Form Id. You will be able to find it in the Visa Application form. There are two different types of appointments. - Premium and - Normal Go for Premium if you are applying for the first time, as VFS staff guides you. Once you are experienced, you can book a Normal appointment. ### Financial Statements Along with the visa application, you need to provide acceptable proof of funds that shows your financial ability to travel and bear expenditures during your stay in the Schengen area. Here's what you would need to provide: - Personal bank statements for the last three months. - Salary slips for the last six months - ITR for the last two months 💡 Check out the [France Visa website](https://france-visas.gouv.fr/en/web/france-visas/?ref=narendravardi.com) if you do business or do not hold a job. ### Travel and Health Insurance French authorities mandated that travellers obtain travel insurance before their trip. This is to make it easier to access medical care as Europe healthcare can be very expensive for travellers from other countries. I generally take insurance to cover +5 days before and +5 days after the trip. ### Cover Letter quoting from schengenvisainfo: > Explain clearly and truthfully in this letter why you wish to enter France, what you will be doing here during your permitted stay and other details regarding your trip. You can also enclose a cover letter providing more details that might help you get visa approval. If your documents are all correct, this letter can just contain the itinerary. Refer to this [article on schengenvisainfo](schengenvisainfo) for various ways to use a cover letter. [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) ### NOC from the employer If you are an employee working in India, as per the rules and regulations, it is expected that you do not work in the Schengen area. Hence, you need to request [NOC from the Employer](https://www.schengenvisainfo.com/obtain-free-no-objection-letter-template-visa-application/?ref=narendravardi.com). It is a letter which acts as an official leave of absence from work. The printout of this copy needs to be provided to the authorities. ### Misc As mentioned in the checklist image, you would also need the following - Passport that isn't expired or closer to expiration. - Front and Back passport Xerox - Two passport size photos (check the [photograph requirements & specifications](https://www.schengenvisainfo.com/photo-requirements/?ref=narendravardi.com)) If you are on a gap year or break, you need to [Prove Intent to Return Home country](https://visasassociation.com/proving-intent-to-return-home/?ref=narendravardi.com). Definitely talk about gap year in the cover letter and provide a valid explanation. ### Submitting the documents Once you have collected all the documents, take a printout and visit the VFS center during the scheduled appointment time and submit them. VFS Staff will take your biometrics and passport. You might receive the passport with Visa Sticker pasted in your passport page via courier. You can talk to VFS authorities to understand when it will be delivered. ### Rejection Letter If you are applying for the first time, there is higher chance of visa getting rejected compared to a person who already got visa. When the visa is rejected, you will be provided with a generic reason. Do some research around the reason and fix the issues. Most of the times rejection happens if your proofs are not trustworthy or there is some gap. Giving a print out of hotel booking and cancelling that booking while visa in under process could surely lead to a rejection. So, once the documents are submitted, do not make any chances to your itinerary. If you have any doubts, let me know in the comments below or [drop an email](mailto:narendravardi1127@gmail.com). --- **Recommendations** If you liked this article, you might also like reading the following. - [Travelling to Paris all alone](https://www.narendravardi.com/reaching-alone/) - [My work on the 360° photographs](https://www.narendravardi.com/360-picture-work/) - [International purchases and the sweet kick on the butt](https://www.narendravardi.com/international-purchases/) [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! --- ### How to embed your 360s on Ghost URL: https://www.narendravardi.com/embed-360/ Last updated: 2022-10-26T10:29:59.000Z **Don’t show an image — immerse your viewers in it.* How do you immerse them? There are various ways. One of the approaches I have come across recently is to use a 360° photo. With 360° photos, users can view the entire location by clicking on a laptop or turning around on a mobile device. Here's a small demo of a 360° photograph: 💡 You can check out the "[My work on 360° picture](https://www.narendravardi.com/360-picture-work/)" page, where I have embedded the 360° picture I have captured. 360° pictures use the latest jpg format and don't need specialised apps. But these apps must be updated to support 360° pictures. ## Here are the steps involved in embedding a 360° picture with the Ghost blog 1. Transfer 360° pictures from the device to your laptop. 2. Create an account on the [momento360 website](https://www.momento360.com/?ref=narendravardi.com). 3. Upload your 360° pictures to the momento360 website. 4. Copy the embed link from the momento360 website. 5. Integrate with the Ghost website. ### 1\. Transfer 360° pictures from the 360 camera to your laptop. Transfer the photos from the 360 cameras onto your laptop. The latest 360 cameras support transfer via Bluetooth and Wifi. But wired transfers or direct SD Card transfers are faster. So, choose between wireless and wired based on the number of 360° pictures you want to transfer. ### 2\. Create an account on the [momento360 website](https://www.momento360.com/?ref=narendravardi.com) [Momento360](https://www.momento360.com/?utm%5Fsource=medium&utm%5Fmedium=blog&utm%5Fcontent=embed%5F360s) is a free, easy, and private way to upload, view, and share your 360 photos and videos in one place (all from your browser). I am using their service to embed 360 photos on my ghost website. The creation of the account is straightforward. Enter your email and password to create an account, and remember those credentials to login back. 💡 Momento360 uses freemium pricing. They offer a free service to store a hundred of 360 photos or 750MB of data, whichever reaches first. Post that quota, you would have to buy their premium subscription. ### 3\. Upload your 360° pictures to the momento360 website. Sign in to the momento360 website, click on the camera icon in the top right corner, and you’ll be automatically prompted to choose the photos you want to upload. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/Upload.jpg) Click on the camera icon highlighted by the red box to upload your 360 photos. ### 4\. Copy the embed link from the momento360 website. Once the image is uploaded, click on the SHARE OR EMBED A LINK... button, which gets visible when you click on the *share* icon. ## ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/EmbedLink.jpg) Once you click on the 'SHARE OR EMBED A LINK' button, you will be prompted to create a link. Create the link, copy and save the link from the text box. ### Integrate with the Ghost website. In the [ghost](https://ghost.org/?via=narendravardi&ref=narendravardi.com) text editor, insert the HTML card. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/htmlcard.jpg) Type '/ht' and get the recommendation to use the HTML card in the ghost editor. In the HTML card, copy-paste the following. Make sure that you change the `src=` field to the link that you have saved. ``` ``` Here's a sample ``` ``` Once you have embedded, your ghost text editor will show the HTML card as below. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/embed.jpg) HTML card is visible as an 'Embedded iFrame'. Do not be confused if the HTML card says *Embedded iFrame*. When you preview your ghost article, the 360 images can be viewed. 💡 While using the freemium tier of moment0360 to embed your 360 pictures, the embedded 360 images will have a watermark of momento360\. It's not a deal breaker for me, but if you want to remove that, you may have to buy the premium version of their service. I have tested momento36o embedding on mobile and laptop, and it worked seamlessly. I am very impressed by their service, so I thought of giving a small shout-out to them with this article. To many more 360 images, we can embed on your blog posts!🎉🎉🎉 --- Have you already taken any 360 photographs? If yes, share them with me in the comments or [drop an email](mailto:narendravardi1127@gmail.com). ****Recommendations** If you liked this article, you might also like reading the following. - [My work on 360° picture](https://www.narendravardi.com/360-picture-work/) - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) - [Articles tagged as 'memes.'](https://www.narendravardi.com/tag/memes/) [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! --- ### Capturing light trails of traffic in Bangalore URL: https://www.narendravardi.com/light-trails/ Last updated: 2022-10-22T02:30:39.000Z Recently I published an image which captured traffic light trails in Bangalore, and many of my friends asked me how I got such light trails. Below is the image of the light trails embedded in Instagram. > [ View this post on Instagram ](https://www.instagram.com/p/CizbX4uPKxn/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) > > [A post shared by Naren | Software Engineer n Photographer (@worthyphotographer)](https://www.instagram.com/p/CizbX4uPKxn/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) There are two things which are unique about this photo 1. The light trails and 2. The (traffic) lights look like the sun. Let me tell you how to achieve these two things. 💀 In this article, I assume you know basic photography concepts like Shutter Speed, aperture, ISO and long exposure shots. ### How to make lights look like the sun - Reduce the aperture of the camera to the minimum possible. Highly recommend using a DSLR camera for this purpose, as not many modern-day mobiles provide the capability to change the aperture. The above image was taken at F22\. If your device doesn't support lower than F16, there is a greater chance of *not* getting lights that look like the sun. - Reduce the ISO to the minimum possible - this helps to generate a good-quality image. The above image was taken at ISO100. ### How to capture light trails To achieve the light trails, we need the following. - Sturdy tripod - ND filter and - A camera which allows you to change the Shutter speed. **Sturdy tripod** ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/Lighttrails-unstable-tripod.jpg) The above image is taken without a Sturdy Tripod, because of which you will notice that the red lines look like waves. We need a Sturdy tripod since we will be taking images with long shutter speeds. Having a sturdy tripod ensures that the camera is not shaking. We can also add weight to the tripod to make it sturdy. Most of the light trail pictures I have taken in Bangalore were from foot over bridges which generally shake because of the wind. Hence, it is very important to carry a sturdy camera to avoid bad photographs. **ND Filter** The *secret ingredient,* in my opinion, to make light trail photographs look great is to use ND Filter. Many do not mention using an ND Filter unless you are paying a photographer to learn. I have taken many photos without an ND Filter, which weren't that impressive. I discovered ND Filters accidentally while reading about a DSLR camera's filter lenses. ND Filter is a lens cap that can be considered sunglasses for cameras. If you have an ND filter, you can reduce the light that goes into the camera even further, thus increasing the shutter speed. There are various types of ND filters. You can do some research about them. I own a Tiffen 67mm Neutral Density 0.9 Filter, which works well for night photography. ![](https://images.unsplash.com/photo-1629394944986-df86f22b715f?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDIwfHxuZCUyMGZpbHRlcnxlbnwwfHx8fDE2NjU0Njc5Njg&ixlib=rb-1.2.1&q=80&w=2000) Imagine the unique perspective this lens filter brings to your photographs. ND Filter can be mounted onto your lens. Every lens has a diameter. Make sure that you get a lens filter that matches your lens size. **Shutter Speed** Two things need to be present to achieve light trails. - Movement of light and - Exposing your camera to the movement of the light for a long time - This is also called a long exposure shot. 💡 Long-exposure shots look great if taken in low-light conditions. Most of the shots of this type I have taken during the night. We need to experiment using a shutter speed. Pick one duration between the maximum supported shutter speed and one second and capture images. There is no correct number for the shutter speed. You will have to keep experimenting until you get a good image. You can also do a binary search to find the best settings for shutter speed in a short amount of time (Software Engineer Joke😜) ### One last thing Besides the equipment, you will also need the courage to install your tripod and camera on the road while people are watching you. People take notice of you with all the equipment. Going with friends or other photographers helps reduce anxiety while taking long exposure shots as people pass by. --- Have you already taken any long-exposure photographs? If yes, share them with me in the comments or [drop an email](mailto:narendravardi1127@gmail.com). ****Recommendations** If you liked this article, you might also like reading the following. - [Breath-taking 360° photograph up in the air](https://www.narendravardi.com/360-photo/) - [The magician who creates digital images from the text: DALL-E](https://www.narendravardi.com/dall-e/) - [My Art page](https://www.narendravardi.com/art) [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! --- ### Travelling to Paris all alone URL: https://www.narendravardi.com/reaching-alone/ Last updated: 2022-10-19T09:24:17.000Z **Introduction** Since the COVID-19 lockdown, I have wanted to go on a long trip. If my friends agree to join me, I want to visit Australia or New Zealand. But then none of them could join. Few wanted to tag along if I went to South Asian countries like Thailand or Vietnam, but then at the last minute, they slipped from the idea silently. I was left to decide if I should travel solo or not. As I was thinking about it, it was clear that I didn't want to visit a new place alone. South Asian countries have a language barrier, and Australia/New Zealand have a visa that is not open for tourists yet. So, I decided to visit European countries as I saw those places already in 2018, and I know European countries were approving travel visas. But there are a few problems; these were real-life incidents. And what are those? - My friend got mugged in a western city in Europe. - I experienced firsthand a person stealing my luggage in 2018 in Barcelona. Thankfully, the police nearby caught the person and thus got our bag back. - A friend of mine lost his passport and wallet. How he got out of this challenging situation, I never knew. - My friend who stayed in Europe advised me to be careful as mugging is expected in Paris. Listening to all these stories, I was very nervous about going on a European solo trip. But I did. What made me go? Maybe the frustration endured during the lockdown? I don't know. I visited four different countries. It has been a fantastic experience for me, and with this article (and a few more to come), I want to give a glimpse of what it was like to go on a solo trip. All the articles related to my Eurotrip will be tagged [Eurotrip2022](https://www.narendravardi.com/tag/Eurotrip2022). > All the articles related to my Eurotrip will be tagged 'Eurotrip2022'. In this first article, I narrate my experience as I reach Paris, the first city of my solo trip. I will also talk about the thoughts I had in my mind when I was making certain decisions during the journey. Besides, I'm a photography fan, so I'll include some photographs and videos. I hope you'll have a great time reading about my solo trip experience 🙂 **How to read these articles** This series is in progress. There will be multiple articles in the series, most of which are independent. Some context you might miss, but you should be able to jump on to any article that interests you! :) **Background** I want to keep boring stuff away from this article. So, here's some background. By the time I boarded the flight to Paris, I had the following. - Return flight ticket back to India. - Schengen Visa and - Hostel bookings at the following locations, in the same order I'll be visiting. Paris, Amsterdam and Berlin. - Mobile with international roaming enabled. - Euro currency notes and a forex card loaded with Euro. **Flight** I had booked an Air Asia flight on Booking.com, which cost around 32T (thousands) INR. There was a single stop in Delhi, and I reserved a *window seat* for the flight from *Bangalore to Delhi* and an *Aisle seat* in the centre of the flight from *Delhi to Paris*. Previously, I had a terrible experience travelling on a long-distance flight in the window seat, so I chose the Aisle seat for my Delhi - Paris flight. The aisle is a comfortable seat, and I slept, ate food and then walked comfortably on the flight, all thanks to the aisle seat. Besides, my right seat was empty, so I dumped my jacket whenever I had food. My flight journey was going very smoothly until the captain announced the flight's landing in Paris. I know I was all alone, but I didn't realise the gravity of the situation until that point. My mind started acting weird and childish when my flight landed, and I stepped into the airport. My monkey brain's main problem was, how would I go to the hostel? The problem was tiny, but given that I was alone and far away in a strange land, my brain didn't know what to do but create pressure. I calmed it down by saying we'll take an Uber in the worst case. But my mind doesn't listen and then bothers me by saying things like, "I'm making a big mistake by coming alone. What if something happens?" I started talking to the person before me to divert my mind. The person was an Indian, too, so my brain felt slightly comfortable. The person in the line was here to do a master's and had a student visa. He completed his immigration, and then it was my turn. **Immigration** The immigration officer looked at me as if I were going to rob her house that night if I got into Paris. She wouldn't stamp my passport. She held the stamp up in the air but didn't use it. After some thinking, she asked me if I had a return flight ticket. I had, but then my monkey mind started worrying. So I was nervous and couldn't focus. What felt like a long minute later, I opened my phone and clicked on the ticket available in my mail. It was not offline. Thanks to international roaming, I could download and show it to the officer. I felt like the officer stamped my passport with a heavy heart. I didn't mind, though. I was good to go. My queue friend was waiting for me, and he changed his SIM card to use the local network and called the cab. As we were walking toward the baggage carousel, I saw a restroom. **Visiting Restroom** In Europe, you don't find a free restroom. Using a restroom costs 50 cents to 2 euros. I am okay with it, but they expect cash/coins, which I didn't have ( I had 100 euro notes). So, I told my friend to wait for another minute. I went in and came back only to see him missing. Maybe his cab had arrived, or he was standing somewhere I couldn't find. It doesn't matter because I'm alone again. There was a massive crowd near the baggage carousel. After jumping around suitcases on the floor, I grabbed mine. I wanted to hurry and reach my hostel. I was hungry but also wanted to calm down. So, before heading out, I sat in a nearby chair. I think I sat for at least 15 minutes. I looked at children playing with trolleys and people rushing in and out, and finally, I visualised something good waiting for me outside. I think my monkey mind slept after this visualisation. I stood up, opened Google Maps and searched for *The People - Paris Nation* hostel. **Reaching the hostel** Instructions on Google Maps were simple. I'll have to walk for a kilometre within the airport, reach the Airport metro station and catch a metro to the city. The below image is the Google Maps view. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/Screenshot-2022-09-30-153146.jpg) Paris Airport (Walk) -> Airport Terminal 1 -> Châtelet Metro -> Nation Metro While collecting luggage, I was in an enclosed chamber where natural light wasn't available. I came out of the luggage area and saw a glimpse of Paris for the first time through the transparent glass. It was bright, like an afternoon in Bangalore. But my watch read it was around 9 pm. That's weird, I thought. I thought that maybe my band hadn't synced with my phone yet. I checked my phone, and my phone read the same. I remember enabling sync with the network clock on my phone. My first thought was that this sync wasn't working. I need to fix it. I reached the airport metro station and was shocked to notice the crowd. It resembled an Indian market. It felt intimidating initially, but then I was concerned about my valuables. After zipping my pockets with all my valuables, I went out to get a ticket from the automatic ticket dispenser. I didn't understand much, even though the terminal was in English. There were various ticket types, and I was unsure which one to purchase. I tried asking for help, but no one knew English. Suddenly, I had a brilliant idea. I'll watch all the terminals for the people who use English as their language and ask them for help. It worked! A person who looked like a cosmopolitan fashion model helped me to purchase a ticket and guided me to the train. I had to get down near Châtelet, a metro station, and catch another metro to reach Nation. As the journey to Châtelet was 30 mins, I posted the photo of my landing in Paris on Instagram. Within a few minutes, I got many replies suggesting that I be cautious as Paris is known to be notorious to travellers. These suggestions made my dance monkey wake up. I securely kept my phone, passport and purse inside my jacket pockets and felt calm. The idea was simple: I could reach India safely even if I lost others. After a few minutes, I got down in Châtelet, pushing the people in the metro and struggling to pull my trolley bag. The train was very crowded. At one point, I thought I'd lose my trolley bag in the crowd and only get down from the metro with my laptop bag. Thankfully, that didn't happen. Once I got down near Châtelet, I was confused about the metro I should take to reach The Nation metro station. Châtelet is a big metro train station, after all. I asked people, got help, boarded the metro, and came to The Nation. In the Nation metro, I faced the biggest challenge, carrying my trolley bag without an escalator or a lift. It was an underground metro station. So, I had to drag my trolley bag along the stairs for two floors. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/20220801_211314.jpg) Stairs I had to climb with my huge luggage! :( I was exhausted by the time I reached the road. But I felt like I had achieved something remarkable. Not because of carrying the luggage, no, but because it was officially the first step on the roads of Paris. The Nation is a beautiful neighbourhood, and I instantly liked the place. It was sunset time, and my watch read around 10 pm, and I recalled that my watch was not in sync with time zone differences and ignored the timing. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/20220801_211633.jpg) This is the first thing I saw of Paris city. **Inside Hostel** Pulling the trolley along the zebra crossing, I entered the hostel. The receptionist greeted me with a warm welcome and asked for my passport for verification. After that, he told me he was planning a trip to India, and I felt cheerful about that idea and encouraged him to do so. I got my key card for room number 4 and bed number A. I took a four bedded mixed sharing hostel room, and only four of us had access to open the room. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/20220802_012552-min.jpg) View from my hostel room. I entered the room, but it was dark. The room has 2x2 bunker beds with curtains for each bed. All the curtains were open and empty except for one. All I could see was the rounded hat near the pillow. It was as if the round cap was covering a woman's head. So, I thought someone was in bed and silently unloaded my luggage. I locked my laptop bag in a locker and went out for dinner. **How can it be 11 pm already?** As I was heading outside for dinner, I noticed that night had fallen. Near the reception, the clock read 11 pm, and my watch read the same. But only a few minutes ago, there was a sunset. How can it be 11 pm already? That's when I realised that few countries would have *long* days. I planned my entire trip without considering the long days. Now, I will have to change my plan. While my mind was going through all this drama of changing the plan, my stomach reminded me to get food quickly. Since it was already late, my brain also started to focus. If it gets late, I might end up not eating anything (obviously, that was not the truth, I could get some food, it is Paris). **Feeling bizarre while having my first meal in Paris** As I turned around the corner, There was Burger King (BK) and local restaurants. I wanted to try the local restaurants but didn't have so much patience to look up which food to eat. I went to BK many times in India, so I went in. They had computer kiosks for placing orders. But it was not beginner-friendly, so I spied on other terminals and finally placed an order, with little help from local people. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/20220802_021051.jpg) Initially, I thought of having my dinner at this location, but I went to Burger King as I was tired. My forex card with Euro currency didn't work since I didn't enable international payments on the card. Allowing for international payments was a separate step. So I used my credit card as a mode of payment. If the payment value is small, there is no need to enter a pin. Though it was less secure, it was very convenient. I tapped and paid. After grabbing my burger, I sat at a small table in the restaurant. Families, couples and groups were having dinner, and I was the only person sitting all alone in the restaurant, and I felt bizarre. I felt that everyone was looking at me and laughing that I was alone (though that was not the case). Because of this reason, I completed my dinner and left the restaurant quickly. After my dinner, I walked within a 100-meter radius and took photographs of this beautiful street. **Drinking Water** Later, I went back to my room only to realise that there was no drinking water in the room. I came down (rooms on the second or third floor) to the reception to inquire about free drinking water, but the receptionist suggested I buy it from the supermarket next door. (Later on, I learned I could fill the tap water from the sink, the same sink I used to wash my face and hands. Most of the tap water is safe to drink in Paris.) The water bottle in this supermarket was the cheapest product I purchased during my whole Eurotrip, and it was 0.66 cents for a 1.5 L bottle. To give a comparison, a 500 ml water bottle at Arc De Triomphe is 3 euros. I bought two water bottles and got my forex card activated using WiFi in the hostel. In all the supermarkets I've visited, billing is self-service. The customer scans and pays at the payment terminals. I also did that here, and I went back to my room. **Meeting a future Software Engineer from London** When I opened the door of my room, I saw a stranger adjusting his luggage. He could speak English fluently, and we talked about where we were from and what we did. I learnt he was from London, but his family's roots were in Pakistan. We talked a lot in Hindi, and it felt so good to speak in Hindi, in a foreign language country, like Paris. While talking, we were also concerned that we would wake the person with the rounded hat. So, we spoke to each other in whispers and learnt that he had just completed his exchange year at a University in Switzerland and was travelling around Europe before he joined the corporate. Interestingly, he's also a Software Engineer. So, we discussed common interests like the IT industry, CS education and other computer stuff. Finally, our conversation was interrupted when he realised that he hadn't had dinner yet. So, he went out for dinner. Meanwhile, I went to take a shower. The showers were in the common area. So, it was nice because you didn't have to queue near them. After a relaxing hot water shower, I went to bed thinking about the guts I should have had to reach this place, all alone and anxiously thinking about what the next two weeks had in store for me. Along with these adventurous thoughts, I was also thinking about how I should be drying my wet clothes. I don't remember anything else. I was asleep. What is it that you want to know about my solo Europe trip? Let me know in the comments, or [drop me an email](mailto:narendravardi1127@gmail.com). --- ****Recommendations** If you liked this article, you might also like reading the following. - [My work on the 360° photographs](https://www.narendravardi.com/360-picture-work/) - [The Instagram page which I created recently holds my photography work](https://www.instagram.com/worthyphotographer?ref=narendravardi.com) - [Reach your travel destination before the night falls](https://www.narendravardi.com/reaching-destination/) [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! ### Why I do not purchase Spotify Premium URL: https://www.narendravardi.com/spotify-premium/ Last updated: 2022-10-07T10:30:47.000Z A few years ago, I prepared a few posters explaining why I did not purchase Spotify Premium. Even today, this holds. I am an Amazon Prime member, and yet Spotify is my favourite app to listen to music. I often thought the reason for not purchasing Spotify was to avoid unnecessary expenses. Frankly, it is not. I do not purchase Spotify Premium because advertisements put me in check! :) Do check out the poster to learn how! :D ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/1.jpg) Part I ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/2.jpg) Part II ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/3.jpg) Part III ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/10/4.jpg) Part IV What is your reason for purchasing or not purchasing Spotify? Let me know in the comments. **Recommendations** If you liked this article, you might also like reading the following. - [Podcasts I listen to these days](https://www.narendravardi.com/podcasts-i-listen-to/). - [Articles tagged as 'memes'](https://www.narendravardi.com/tag/memes/). - [The magician who creates digital images from text: DALL-E](https://www.narendravardi.com/dall-e/). [Subscribe for Free](https://www.narendravardi.com/#/portal/signup/free) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello! --- ### 🔥 Breath-taking 360° photograph up in the air URL: https://www.narendravardi.com/360-photo/ Last updated: 2022-09-30T08:01:21.000Z When I saw the first episode of [Tales by Light](https://en.wikipedia.org/wiki/Tales%5Fby%5FLight?ref=narendravardi.com)'s Season 1 on Netflix, I was captivated by how [Darren Jew](https://www.instagram.com/darrenjew/?ref=narendravardi.com) showcased his process of taking pictures as he captured mating humpback whales in Tonga, a 70-year-old biplane wreck and an active New Guinea volcano. One scene that stuck with me was where Darren sends out a drone to capture the volcano with a fisheye lens attached to his camera. > 'Darren's unique fish eye photograph of the Tavurvur Volcano' was magical to me. The below photograph showcases how a fish eye photograph looks. 💡 The image below is embedded from Instagram and would not work using RSS. Please consider opening the website on your browser. **Sample photograph of Fisheye lens** > [ View this post on Instagram ](https://www.instagram.com/p/BfDIP86grn4/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) > > [A post shared by Darren Jew Photography (@darrenjew)](https://www.instagram.com/p/BfDIP86grn4/?utm%5Fsource=ig%5Fembed&utm%5Fcampaign=loading) After a long wait, I also took a similar photograph. I do not have a fish eye lens, but I could capture a 360° picture with the help of my drone. Viewing 360° photographs felt magical! I have included the image below so that you can also experience it. **View the 360° photograph** I captured this image with the help of DJI Mini 3 Pro, and I plan to take many more such photographs! 💡 Don't miss out on checking my photography work on IG: [@worthyphotographer](https://www.instagram.com/worthyphotographer?ref=narendravardi.com) :) I also created a video explaining the way a 360° photograph looks. If the above image is not loading correctly, please look at it in the video below! :) **Explanation of 360° photograph** **Recommendations** If you liked this article, you might also like reading the following pages. - [My work on 360° picture](https://www.narendravardi.com/360-picture-work/). - [My art page](https://www.narendravardi.com/art). - [Learning to fly a drone and (three + one) dimensional space](https://www.narendravardi.com/flying-drone/). [Subscribe](https://www.narendravardi.com/#/portal/signup/free) --- ❤️ Enjoyed this article? Forward to a friend and let them know where they can subscribe (hint: it's [here](https://www.narendravardi.com/#/portal/signup/free)). Anything else? Comment below to say hello. --- ### Podcasts I listen to these days URL: https://www.narendravardi.com/podcasts-i-listen-to/ Last updated: 2022-09-26T10:30:49.000Z These podcasts are not limited to technology but include psychology, business and entertainment. Here's the list. The list is in no particular order! :) --- ### 22 yarns with Gaurav Kapur ***Content Category:*** Cricket **Type:** Conversational/Interview --- ### The Ranveer Show ***Content Category:*** Depends on the guest. **Type:** Conversational/Interview --- ### The Colin and Samir Show ***Content Category:*** Creator Economy and Business **Type:** Conversational/Interview and Monologue --- ### Lex Fridman Podcast ***Content Category:*** Depends on the guest **Type:** Conversational/Interview --- 💡 Unless specified, the language of the podcast is English. --- ### Just being Telugu *Content Category*:** Thoughts, Movies and Entertainment. *Type*: Monologue *Language*: Telugu --- ### Purijagannadh *Content Category:* Psychology *Type*: Monologue *Language*: Telugu --- ### Stevey's Tech Talk *Content Category*:** Software Industry *Type*: Monologue --- ### The Joe Rogan experience *Content Category*:** Depends on the guest *Type*: Conversational/Interview --- ### Soft Skills Engineering Podcast *Content Category*:** Soft skills for Software Engineers *Type*: Conversational --- ### Office Ladies *Content Category*:Behind the scenes of The Office Series *Type*: Conversational --- I am looking for new podcast recommendations. Let me know your favourite podcasts in the comments below. Do you listen to podcasts? Tell me your favourite podcasts in the comments at the end of the page. ### The magician who creates digital images from the text: DALL-E URL: https://www.narendravardi.com/dall-e/ Last updated: 2022-11-23T10:31:25.000Z Recently, I have received an invitation to create with [DALL-E](https://en.wikipedia.org/wiki/DALL-E?ref=narendravardi.com). > In simple terms, DALL-E is a platform which generates digital images from the text provided to it. I had a lot of fun experimenting with this platform. Here are the few images which I created with DALL-E. The text I have entered to DALL-E is under the caption. --- ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-04-14.06.32---An-impressionist-painting-containing-an-Indian-male-adult-in-his-20s-before-standing-before-Eiffel-Tower-with-water-canal-visible-on-a-nice-sunny-day-1.png) An impressionist painting containing an Indian male adult in his 20s before standing before Eiffel Tower with water canal visible on a nice sunny day **My thoughts about the image:** The description is quite complex, with so many elements, and DALL-E created this image with all the details. Besides, there is a spelling mistake in the text based on the outcome of the image. I am sure DALL-E corrected the text before creating the image. Besides describing the text form, I can also specify the type of painting I want to create. The above image is an [impressionist painting](https://en.wikipedia.org/wiki/Impressionism?ref=narendravardi.com). --- ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-04-14.06.19---Mid-20s-male-Indian-enjoying-life-having-Belgium-waffles.-Face-not-clearly-visible-and-he-s-in-peace-with-life--gouche-painting_-1.png) Mid 20s male Indian enjoying life having Belgium waffles. Face not clearly visible and he's in peace with life, gouche painting **My thoughts about the image:** The text provided to DALL-E is quite simple, and the image reached my expectations. Besides the description, there are a few elements, like the person wearing a smartwatch and the way the person is eating the Waffles, which I thought was terrific. *he's in peace with life* is a text I intentionally added to identify if DALL-E understood or not. Based on the way the person is eating, I think it has understood. I didn't understand why tomato sauce was on the bottom left of the table. I mean, do people have tomato sauce with Belgium Waffles? 😅😜 The input for this image was to create a Gouache Painting. There was a spelling mistake, but I think DALL-E figured it out. --- [Subscribe](https://www.narendravardi.com/#/portal/signup/free) --- ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-04-14.06.45---A-goutche-painting-containing-an-Indian-male-adult-in-his-mid-20s-before-cycling-in-the-most-scenic-place-of-Amsterdam--1.png) A goutche painting containing an Indian male adult in his mid 20s before cycling in the most scenic place of Amsterdam **My thoughts about the image:** This painting is a simple text yet a complex creation. Why? Because I have asked DALL-E to paint the subject in *the most scenic place of Amsterdam.* DALL-E did the job nicely here as well. DALL-E knew that canals are the most scenic places in Amsterdam and painted the subject precisely near a canal. --- ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DALL-E-2022-09-04-14.05.38---Mid-20s-male-Indian-standing-and-in-the-background-landmarks-of-Berlin-city.-Face-not-clearly-visible-and-he-s-in-peace-with-life--gouche-painting_-1.png) Mid 20s male Indian standing and in the background landmarks of Berlin city. Face not clearly visible and he's in peace with life, gouche painting **My thoughts about the image:** There are two famous landmarks of Berlin in this picture. One is Brandenburg Gate, and the other is Berliner Fernsehturm (the tower to the right in the centre). The instructions for this creation were simple, yet they were complex for DALL-E. Only thing which I felt was missing in this photo was *he's in peace with life.* There's not much information available to identify that the person in the subject is at peace with life. --- ### 💭Final Thoughts I would say I am having a blast using DALL-E. But there are still a lot of things I have not tested. Mainly, I want to try and analyse the elements from Indian culture's perspective. From an Indian cultural perspective, the initial inputs I gave to DALL-E weren't that satisfactory. But since this is an AI, I am optimistic that it would also evolve to support this segment. --- ### 🎉How to get access to DALL-E In case you would like to get access to DALL-E and try it out, you can [sign up on openai website](https://labs.openai.com/waitlist?ref=narendravardi.com). It's pretty straight forward. I signed up for it and got the invitation to access in 10 days time. But this was during it's early days. Now, it *might* take some time. [Subscribe](https://www.narendravardi.com/#/portal/signup/free) --- ### Learning to fly a drone and (three + one) dimensional space URL: https://www.narendravardi.com/flying-drone/ Last updated: 2022-09-03T02:30:20.000Z Learning to cycle felt challenging as a child because balancing on two thin tires wasn't easy. After that, I learned to drive a motorcycle and a car, both of which have challenges. I had to understand the concept of gear for motorcycles, and for vehicles, I had to figure out if the car could fit in the place I drove. But they were straightforward. Currently, I am learning to pilot a drone (to be more specific, a nano drone which is DJI Mini 3 Pro). Learning to drive a drone feels like learning to cycle, but with great excitement. Every time I fly a drone, I think, "wow! this tiny thing is flying!". Before flying a drone, I thought flying a drone would be like playing a Super Mario game. Now I assure you, it is similar to that game; only the game starts at the eighth level. > Flying a drone is tricky because the pilot has to learn to navigate in the three-dimensional (3D) space. There's a rare chance that one would have gotten trained to navigate in three-dimensional space. Besides that, If we need to manage the camera on the drone, that is one additional dimension to take care of (movement of the camera is in one line. So, one-dimensional only). I'll have to keep flying the drone consistently to increase my muscle memory in navigating the drone. One good news, though, is that if I can learn one drone, I should be able to drive another drone in a short amount of time. Here's a photo I have taken while I was learning to fly drone. I really liked the lines in the bottom half of the photo. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/09/DJI_0090_2.JPG) Photo taken by me with the help of my drone - Camera is pointing to down completely. I will post drone photos and videos, bringing many unique perspectives. Do you like driving a drone? Let me know which place you would photograph in the comments below. ### Future Software Engineers, read this article before and during your placements URL: https://www.narendravardi.com/interview-prep/ Last updated: 2025-06-04T07:36:47.000Z At this time of the year, there will be job placement fever in most colleges, and students will go through a lot of tension and pressure. If you are a student who's feeling unbearable pressure, let me assure you that things will change, and this isn't the end. Don't be [miserable as I was](https://www.narendravardi.com/miserable-farewell/); at least be happy during your farewell and convocation. Now that I have discussed the mindset you shouldn't carry, let me give some guidelines on how I prepared for my interview season during college. My goal during the placement season was to get a job at a technology product-based company which pays decently. If you are looking for guidelines on getting a job at banks, financial institutions, service-based companies, or job roles not related to Software Engineering, this article will not be of much help! :( I received a lot of help from my brother, a Software Engineer, who shared guidelines on preparing for interviews. The advice I've shared below is an enriched version of my brother's advice. > These are the same guidelines I've used during my final year job placement, during which I got an internship and pre-placement offer from Amazon Hyderabad and then used it in 2017, which got me an offer from Flipkart Bangalore. These guidelines might also work for the current final year college students, but there could be attributes that might be outdated. So, read and follow these guidelines with care. In short, enrich my guidelines to meet the needs of you! 😉 ### General Suggestions: - Read the interview experiences of other freshers to understand the questions asked. - Keep your resume as a *pdf* in Dropbox, Google Drive, or any cloud storage service so you can get it whenever needed. Even better would be to create a short URL and memorise it. Here's my resume link: [bit.ly/narenv-resume](https://bit.ly/narenv-resume?ref=narendravardi.com). Isn't it easy to remember? - Create a GitHub account and upload all your projects to it. If you do not have projects, at least upload the problems you solve. This process will give you an understanding of what Git is. ### Programming Language - Choose a programming language and stick to it. *Don't forget* other programming languages if you know any. - My choice of programming language was C++. Java has lengthy and verbose syntax and is tough to remember. (Java is my favourite language of choice, but I didn't use it) - Even if you choose Java, pointers are frequently asked questions in the first round of placements, meaning you must study C or C++. So, go with C++ and not even C. - Don't do development in Windows compilers like Dev C++. Use HackerRank compiler or repl.it, or Ubuntu for compiling C++ code. - Learn C++ STL (for C++ developers) or Java Collections (for Java developers). ### Sources for learning Data structures and Algorithms (DSA) : - Algorithms course by [Robert Sedgewick in Coursera](https://www.coursera.org/learn/algorithms-part1?ref=narendravardi.com). - YouTube channel: [mycodeschool](https://www.youtube.com/user/mycodeschool?ref=narendravardi.com) (Deep respects to the creator). - Excellent articles by fellow engineers. Visit [hackerearth.com/notes](https://www.hackerearth.com/practice/notes/?ref=narendravardi.com) **Problem-Solving Practice:** Get comfortable with coding the questions in the below links in the language of your choice. Solve all the easy ones first. - [https://www.hackerrank.com/domains/algorithms/warmup](https://www.hackerrank.com/domains/algorithms/warmup?ref=narendravardi.com) - [https://www.hackerrank.com/domains/algorithms/implementation](https://www.hackerrank.com/domains/algorithms/implementation?ref=narendravardi.com) **Time Complexity** Time complexity analysis is critical. Learn to calculate and remember the best and worst case scenarios of time complexity scenarios of all algorithms listed. - [Time complexity cheat sheet](https://www.bigocheatsheet.com/?ref=narendravardi.com) ### Practice and implement the following DSA - Binary Search - Bubble sort - Insertion Sort - Selection Sort - Merge Sort - Quick Sort - Heap Sort - Counting Sort [Reading resource](https://www.hackerearth.com/notes/sorting-code-monk/?ref=narendravardi.com) [Practice resources](https://www.hackerrank.com/domains/algorithms/arrays-and-sorting?ref=narendravardi.com) ### Data Structures - Stack - Queues - LinkedList - Priority Queues & Heaps - Binary search trees - Balanced Binary Search Trees (Studying these trees will be very advantageous) - Binary Trees - Hash Tables ### Graphs - Adjacency matrix representation of Graphs - Adjacency LinkedList Representation of Graphs - BFS - DFS [Best reading resource for graphs](https://www.hackerearth.com/notes/graph-theory-part-i/?ref=narendravardi.com) ### Object Oriented Concepts Many people neglect Object Oriented Concepts, which are equally crucial in interviews. Know the below topics for sure. - Classes and Objects - Data abstraction - Encapsulation - Inheritance - Overloading - Polymorphism - Access Control(private, protected and public) I read the Mastering C++ book by K Venugopal. ### Database - Simple queries - Joins ([Reading Resource](http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/?ref=narendravardi.com)) - Normalisation (1NF, 2NF, 3NF and BCNF) - Difference between 3NF and BCNF - Taking a course on this topic helps. ### Operating Systems - Semaphores - Deadlocks - Memory Management - Context Switching - Caching algorithms - Taking a course on this topic helps. ### Computer Networks I'm not an expert on this topic. - One of my friends, an expert in networks, told me to read all interview experiences in geeksforgeeks, jot down the networking questions, and search for their answers. - Another friend told me to read all networking questions from previous GATE exams. I'll leave it to you how you prepare for computer networks. ### General Computer Knowledge Questions (2016) - What happens when you enter a link in the browser and press enter? - What happens when you turn the power on button in Unix operating systems? - What is the difference between white box testing and black box testing? - What is the difference between TCP and UDP? - What is the Singleton Design Pattern (not quite often)? ### Puzzles Some companies ask for puzzles in interviews!!! I suggest visiting geeksforgeeks (geeksforgeeks.org) and searching for fresher interview experiences. Jot down the puzzles asked in the interviews. Allot 30 minutes to solve those problems. If you cannot solve that problem, start reading the solution (which you can quickly get by Googling). ### Power of forming teams When I started learning to program, I was terrified of submitting solutions to online judges, and I couldn't even solve the most straightforward question. But, I got help from others who are good at programming. So, I would suggest forming groups to solve problems on HackerRank (or any other, for that matter). ### Advanced **Dynamic Programming (DP):** - Try to implement a Fibonacci series using the DP concept. - Understand the difference between DP vs Recursion using Memorisation. - Solve [SUMTRIAN](https://www.codechef.com/problems/SUMTRIAN?ref=narendravardi.com) problem on leetcode. This problem will help you understand DP and double recursion calls in a single statement. If you have solved them, you will have a more significant advantage over others. **Implementing advanced algorithms or Data Structures** - LRU cache - Implementation of HashMap and LinkedHashMap ### Closing Thoughts This is an article from 2016 with very minimal modifications. HackerRank and HackerEarth might feel outdated in the Leetcode era, but I assure you, the foundation will be strong in both ways. I didn't talk anything about Python programming language because it's risky. Around 2016, many companies didn't even include Python in their machine coding rounds. If you are a Python programmer, let me know the situation by commenting below. Finally, if you feel overwhelmed after reading this article, take a short walk and revisit this later. Allot manageable time for each section and keep making progress steadily. Have any queries? Comment below! :) All the best! --- --- ### Reach your travel destination before the night falls URL: https://www.narendravardi.com/reaching-destination/ Last updated: 2022-10-19T09:23:16.000Z I advise anyone travelling to a new destination to reach it before night falls. Why is this important? Here are a few reasons: **Lack of resources and help** I recently went on a trip to Goa with some of my friends. We reached Goa Airport by 9 PM, and by the time we got to the hotel, it was 10 PM. When we tried to check in to the hotel, we learnt that there was some misunderstanding with the bookings and we will have to pay an additional 50%. This additional payment shocked us. We tried negotiating with the hotel staff, but they were noticeably hostile toward us. This hotel is a highly reputable hotel chain, and we were livid. Besides, we were hungry, tired and sleepy. We thought of paying the extra, but their attitude made us rethink. We stormed out of the hotel and sat in a restaurant as we were hungry. Two hours later, we were on the roads searching for a place to stay. In that dire state, we took the first accommodation we got, and it was terrible. If we had access to Scooty that night, we would have quickly searched for decent accommodation. Since it was night, no bike rental answered our phone calls. Besides, this was late at night, and we couldn't book new accommodation using online platforms. **Gloomy first impression** Many poets admire darkness but let's face it, it is scary to visit places which are pitch black. Even if it's the world's safest place, as a stranger to that place, dark streets feel dangerous. This first impression would generally be harmful, which might stop you from exploring the area better. **Costly** Unlike Software Engineers who love to call themselves Night Owls, other professionals do not enjoy it and expect more payment for doing service at night. **Risky** In the situation mentioned above, what if we didn't find accommodation? Isn't it too risky to stay outside with our luggage? Even if not robbed, we still have to face the wrath of an unapologetic climate. Learn from my mistakes! --- --- ### Time-saving tricks for Google Docs URL: https://www.narendravardi.com/one-click/ Last updated: 2022-08-28T15:27:05.000Z I have been using web-based MS Office alternatives from Google for the past five years, like Google Docs, Google Sheets, and Google Slides. Occasionally, I use Google Forms and Google Diagrams. Today, many users create a *new* *document* in the above apps by following these two steps: 1. Visit the Home page of Google docs (limiting to Google docs for brevity) and 2. Click on the new document icon. Many do not know a better way to create a new document. > Google uses the \`.new\` domain to provide this one-click time-saving trick to create a new document. [docs.new](http://docs.new/?ref=narendravardi.com) creates a new file in the Google docs. Going on, try it out! --- Google docs team took to twitter to announce this trick in 2018. > Introducing a ✨ .new ✨ time-saving trick for users. Type any of these .new domains to instantly create Docs, Sheets, Slides, Sites or Forms ↓ [pic.twitter.com/erMTHOsdyH](https://t.co/erMTHOsdyH?ref=narendravardi.com) > > — Google Docs (@googledocs) [October 25, 2018](https://twitter.com/googledocs/status/1055490445088903168?ref%5Fsrc=twsrc%5Etfw&ref=narendravardi.com) --- Listed below are the domains that act as a shortcut to creating a new file in the corresponding app. Docs: [doc.new](http://doc.new/?ref=narendravardi.com), [docs.new](http://docs.new/?ref=narendravardi.com), [document.new](http://document.new/?ref=narendravardi.com) Forms: [form.new](http://form.new/?ref=narendravardi.com), [forms.new](http://forms.new/?ref=narendravardi.com) Sheets: [sheet.new](http://sheet.new/?ref=narendravardi.com), [sheets.new](http://sheets.new/?ref=narendravardi.com), [spreadsheet.new](http://spreadsheet.new/?ref=narendravardi.com) Diagrams: [drawing.new](http://drawing.new/?ref=narendravardi.com), [drawings.new](http://drawings.new/?ref=narendravardi.com) Slides: [slides.new](http://slides.new/?ref=narendravardi.com), [deck.new](http://deck.new/?ref=narendravardi.com), [presentation.new](http://presentation.new/?ref=narendravardi.com) --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### International purchases and the sweet kick on the butt URL: https://www.narendravardi.com/international-purchases/ Last updated: 2022-08-26T08:46:17.000Z Imagine that you are following an artist on Instagram. They do fantastic work, and you plan to learn from them. You visit the artist's profile and find a probable link to the course he authored. When you clicked on that link, it took you to the course's landing page. The price of the course is on the higher side. The artist is from the USA, and they are charging a small amount as per their standards. But sitting in India, it's not a tiny amount. For the same price, you could get almost all OTT subscriptions available in India for a whole month, yet you purchased their course. It asked for a credit card. You enter the card details and OTP. You get a notification saying X $ are deducted from your card. You weren't expecting the charge to be in dollars since the price shown on the website was in rupees. You finally feel good that you made your first international purchase. After a few days, your credit card statement is generated, with an additional charges section you haven't seen before. A quick Google search reveals that it's incurred when making an international purchase. You call up the card's customer service agent to request if the additional charge can be waived off since it's your first time, but the agent says it's common sense and gives you some unexpected Gyan(knowledge) That's when you realise that you got cheated. But who cheated you is not clear. But you know it was your sole mistake. With this experience, you are very careful about your purchases on new websites, even if artists endorse them. Making a single transaction itself is a pain now. So you avoid subscriptions to avoid recurring transactions. You see my point, right? This story is essentially an incident from my life. I plan to purchase courses online and support my favourite artists on Patreon and GitHub. But to my disappointment, things are not that easy. ### Why is it costly to make international transactions It's because for two reasons 1. Purchasing Power Parity and 2. Foreign Exchange charges. I'll not go too deep into Purchasing Power Parity, but here's a small example. From Numbeo, Water (0.33-litre bottle) costs 14.52 rupees in India. But the same thing costs 128.73 rupees in the USA, and that's nearly ten times more than what we spend in India. Most artists in the USA provide their courses keeping their standards in mind, creating an unnecessary burden on customers in other countries. Finally, coming to the forex markup charges, it's nearly 3% of your actual amount. Though it looks small, the forex markup costs pile up if you make multiple purchases or have an active subscription payment. ### Suggestions to Artists If there are any suggestions I can give to the artists who offer these courses, they would be: 1. Think about purchasing power parity. Charge your user based on the country, not by your standards. 2. Educate your users about forex markup costs. Many students will be on a tight budget. Understand what they have to go through because of unexpected foreign exchange charges. I have written this article considering that the user is from India, but the suggestions I proposed in this article can also apply to other countries.‌‌‌‌ ### Save and share highlights like a pro on Android URL: https://www.narendravardi.com/save-n-share/ Last updated: 2022-08-26T09:08:14.000Z Recently I came across a beautiful feature provided by the Chrome browser on Android. Let me show the outcome before I talk about the feature. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/05/chrome_image_17-May-2022-13_00_18-GMT-05_30.png) Card created by Chrome browser on Android. The above image is a '**card**' created by Chrome from a text I highlighted on my blog. This feature is pretty cool and can be used to store details that we want to revisit repeatedly to memorize. Here’s how you do it: > 1\. Visit the website on Chrome and select the text you want to save and click on the **Share** button. > > 2\. Click on **‘create card’**. > > 3\. You’ll get an option to select the theme. The above card uses the '**Groovy**' theme. Select the theme of your choice. > > 4\. Click on '**Save to Device**'. This feature is only available in Android as of now. It would fun to have this across all platforms! --- Enjoyed this post? If so, you might like to subscribe to my blog to get new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Things I wish I had known before my first internship URL: https://www.narendravardi.com/student-professional/ Last updated: 2022-10-12T09:47:26.000Z In July 2016, I completed my internship at Amazon. By the end of my internship, I had a full-time offer. I cannot describe the amount of relief it was. It's already been six years since that day. Time is running fast as a working professional. I can't reduce the speed, but I can spend some time recollecting things I wish I know before starting my internship. Here’s some of them. **Day one is boring** In college, I was one of those personalities who thought I could change the world through code and I should not waste my time. There are reasons for it. - At that time, the startup ecosystem in India had a positive outlook. - A lot of companies were actively hiring. - I was watching the 'Silicon Valley' series. - Most importantly, I was reading Steve Jobs book by Walter Isaacson. Because of this, I was under the impression that I would start writing code as soon as I joined. But to my surprise, it was full of presentations on the company and legal stuff. I don't recall if the presenters used PPT or not. My team had a (strict?) no PPT policy for project presentations but Day one presentations, I'm not sure. A few hours before the evening, representatives from various banks visited the conference hall. They were pressuring us to use their bank to create the salary account. They were not interested in helping us with our questions but took all the signatures they wanted and left for the day. I think bank account opening was the final tedious task of the day. After that, a manager of my neighbouring team introduced us to my new team. My manager was on leave, and it was a fun experience to interact with my first team on the first day. Recently I learnt from a friend who joined a startup about their day one experience; not surprisingly, it was similar to mine **People move on** Coming from a college, I was surprised to see when people were celebrating farewells almost every month (and sometimes every week) in the Office. In college, a student you meet will continue to stay for four years unless an external force is applied (Newton's Law :P). Farewell happens only once a year, and it's pretty emotional. But in Office, that's not the case. Only some farewells are emotional, and most of them, in my opinion, fall into the category of uncomfortable interviews or regular neutral events. In summary, people move on quickly(compared to college). (This is true for many companies I have known so far) One of the odd moments was, when I learnt that the person who took my interview was leaving two weeks into my internship. I was like, mister, you brought me in here; why are you leaving? You shouldn't go. Stay back! But I didn't dare to say so. Later, I learned that he changed teams, and I was happy to hear that. **Clothing Brands can bankrupt you if you are not careful** During my college days, I visited local stores to purchase pretty comfortable clothes, but deep down, I wanted to shop in big shopping malls. When my first month's salary was credited, I went to a store in a big shopping mall to purchase but only to return empty-handed as they were costly for my salary. I thought purchasing clothes would be cheaper if I made money, but then I realised that there's always an expensive brand at every stage of your life, and that's the brand you would like to purchase, secretly. That's true even today. I recently visited a shopping mall store, and they quoted a t-shirt price as six thousand INR, the quality of t-shirt suggested that it might not last six months; I thanked them and came out empty handed. **Saving Money** I learnt about the value of saving money the hard way. My internship salary was not excellent, but I spent money like a full-time employee. I was giving, taking parties, and visiting movie theatres and events that burned money. By the end of the month, I almost had no money. I only had Sodexo coupons for morning lemon tea and lunch at the Office for a few days. (As an intern, I had a free cab facility and I was staying in a PG which provided breakfast and dinner. It was difficult to manage when there’s no money. One day I faced a challenging situation. When I reached the Office, my habit was to stand in a queue near the cafeteria to get my favourite lemon tea (They made the best lemon tea). One day, I was standing in line, browsing my phone, when my teammate saw me and asked me to get a lemon tea for them; then they disappeared to get their breakfast, and I only had enough to buy one tea. It was so awkward I didn't know what to do. This incident took play before online transactions were a thing. No familiar face nearby to help me. So, I purchased the tea for my teammate alone and went and sat along with my team, offering the only available tea to my teammate. They inquired about my tea, to which I responded, I'm waiting for my friend, and I'll have it later. My teammates thought I was waiting for my girlfriend. Such a terrible situation I was in, I thought. During this challenging time, some friends helped me out. But asking for money felt so bad, and it felt terrible to know that I could not manage my expenses. After a couple of such incidents, I started working on managing money in a better way. Today, I'm far away from the credit card debt hell. All thanks to my internship. **Making friends is so difficult** One of the things people don't tell you about getting a job in a new city is it's tough to make new friends. In software engineering roles, you hardly meet people. Most probably, you’ll interact with your team and nearby teams. Hence, I felt like my team was my friends. I'll leave it up to you whether it's good or bad thing to have your teammates as friends. I worked on weekdays, but what to do on weekends? Initially, I visited both technical and non-technical Meet-ups. For some reason, technical Meet-ups, I felt, were structured around fame. Everyone will talk to you if you are an experienced person working in a famous company. Otherwise, you'll have to push yourself to speak to everyone and not get the same amicable response. After visiting many meetings over a couple of months, I finally decided it was not for me. Talking about the non-technical Meet-ups I have visited, they were in a remote location, deep inside streets, very difficult to access as I didn't have my vehicle yet. So, I stopped going to all the meet-ups. I don't exactly remember what I did afterwards over the weekends. Mostly it's exploring city or window shopping. I must say, window shopping saved me from boredom. I think we have deviated from the topic slightly; let's conclude. Making friends is hard after your college **Conclusion** Why am I saying all these? I don't know. I hope it will help future interns. I also hope you had fun reading through the article. I know I didn't talk much about the technical side of things. I also learned a lot on that segment, but the non-technical side is fun to discuss. --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Why was I so miserable during my farewell? URL: https://www.narendravardi.com/miserable-farewell/ Last updated: 2022-07-20T20:01:12.000Z Recently I visited my cousin's pre-convocation dinner. A brilliant evening with a lot of happy and energetic faces, and I was glad that I didn't miss the opportunity. Besides the happy faces, there was a lot of good food. I'll visit convocation parties more often if students invite me 😝 Almost every student from my cousin's class attended the event as it was organised right after their exams. This is in contrast to what happened during my convocation. Many of my classmates didn't participate in our convocation as it was organised months after the last exam, and hence most people were busy either with their jobs or were busy pursuing their higher education. Though many missed out on Convocation, we did celebrate our farewell. This event was organised when we were in our final year. Since everyone was still in college, it was easy to find all my friends. When I was at my cousin's convocation, the only thought that was running through my mind was, "Why was I so miserable during my farewell?" I can recall the reason. I was miserable because I didn't hold a decent job at the time. Society expects college students to get an excellent job by the end of college; otherwise, they are a failure. I felt that I showcased one of the most inexperienced attitudes during that time. Frankly, I was ignorant. Having crossed that path, I recommend people to pat themselves on the back and enjoy the farewell and convocation days, regardless of their situation. You don't know what life has in store for you. Not getting a job feels terrible, but what hurts you is the bitter feeling you go through while re-visiting your memories. Even if you become highly successful, these memories stay with you. Work towards making them wonderful. --- Enjoyed this post? If so, you might like to subscribe to the weekly email newsletter that I send out every Wednesday. [Subscribe](https://www.narendravardi.com/#/portal/signup/free) Click the above button to subscribe :) --- ### Do yourself a favour and visit No Sleep Page URL: https://www.narendravardi.com/sleep-page/ Last updated: 2025-11-06T04:30:03.000Z We have been there, worrying about our laptop automatically sleeping, which might put you offline on your office chat application or instead cancel the in-progress uploads and downloads. In the remote set-up, this concern took a front seat. Two minutes to complete a chore, laptop will be in sleep mode. These are a couple of things people did to mitigate this issue: 1\. Place a weight on the space bar after keeping the cursor in the notepad (My approach). 2\. Tie the mouse to a rotating fan and since mouse is continuously moving, laptop doesn't sleep. Recently, I came across a simple and easy solution for this problem. Just open [nosleep.page](https://nosleep.page/?ref=narendravardi.com) when you are about to leave the laptop aside and that webpage would stop your laptop from sleeping. --- *Enjoyed this post? If so, you might like to subscribe to the weekly email newsletter that I send out every Wednesday.* [Subscribe](https://www.narendravardi.com/#/portal/signup/free) *Click the above button to subscribe :)* --- ### Negotiate to keep moving forward URL: https://www.narendravardi.com/moving-forward/ Last updated: 2022-07-06T02:30:00.000Z Inspired by [Martin Luther King Jr.](https://en.wikipedia.org/wiki/Martin%5FLuther%5FKing%5FJr.?ref=narendravardi.com)'s [moving forward quote](https://www.goodreads.com/quotes/26963-if-you-can-t-fly-then-run-if-you-can-t-run?ref=narendravardi.com), I wrote the below quote on negotiation. Hope you like it! :) > If you can't negotiate face to face, then use a video call, if you can't negotiate over a video call, then use a phone call, if you can't negotiate over a phone call, then use an e-mail; but whatever you do, you have to negotiate to keep moving forward. This is a something every Software Engineer should do when they are changing companies. --- *Enjoyed this post? If so, you might like to subscribe to the weekly email newsletter that I send out every Wednesday.* [Subscribe](https://www.narendravardi.com/#/portal/signup/free) *Click the above button to subscribe :)* --- ### Best way to make running a new habit URL: https://www.narendravardi.com/running-habit/ Last updated: 2022-07-02T16:55:38.000Z I recently purchased a gym membership to make running a new habit, but my mind keeps telling me I should run outdoors. I thought I would list why a gym with a good treadmill is also the best place to run. **Climate** The climate in a city keeps changing every day. It could rain one day, or it could be unbearably sunny, or it could be cold, or it could be perfect. Because of the climate changes, there's a high chance of missing out on the running habit. If you miss one day, it's hard to go the next day. We must start over again if you miss two days because of the lousy climate. The temperature in the gym is controlled and remains the same daily. So every day is the same day, and no need to make your mind get used to a new one. **Insects** Depending on the place and time of the run, we tend to attract a lot of insects. If you are running in the evenings (which I do), you might end up attracting mosquitoes which can carry all the stupid diseases in the world. I've not come across gyms with mosquitoes till now. So, they are safe. **Cleanliness** One of the best running practices includes warm-up and cool-down sessions. These activities require you to sit on the floor or lie down, which leads to soiled clothes. In the gym, there’s no way your clothes get soiled. **Flexibility** When I ran outdoors, the only possible time I could run in my hometown was between 5 to 6 pm. Before this slot, it's too sunny; after this slot, it's full of mosquitoes. The gym allowed me to visit anytime between 4 and 9 pm which increased my consistency. **Security** While running, I want to listen to music without keeping my phone (or any additional weight) on me. Storing mobile outdoors is risky. In the gym, I use Bluetooth earphones to listen to music while my mobile rests in the bag near the storage counter. Besides, you can carry other things like water bottles or laptops (coming directly from Office) and store them securely. **Tracking the workout** I do interval running sometimes, so I need to monitor my workout continuously. In the case of outdoor running, I need to check my mobile phone to track progress, but it distracts me from my training. On a treadmill, the treadmill itself has a duration which helps me track my progress effortlessly. --- The major drawback of using gyms is that - We need to pay money for the service. - It would be slightly difficult to find a decent gym that’s closer to your place. If you can manage both, I recommend enrolling in a gym even if you are not planning to use other weightlifting equipment. 💡 Gyms can increase the risk of transmission of air borne diseases like COVID. But that’s an outlier. In such cases, gyms will be closed for good. --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Avoiding Perfection while blogging URL: https://www.narendravardi.com/tackling-perfection/ Last updated: 2022-07-02T11:27:31.000Z *In this short article, I will tell you the strategy that helped me to avoid the need to write perfect blog articles.* Professional Software engineers work with very high standards when writing code and documentation. Over time, they become friends with perfection. As a Professional Software engineer, I feel the need to execute things flawlessly, which pushes me to avoid starting personal projects. If I had started one, I would not finish it. 💡 Perfection takes time. This was not the case when I was in college. In college, I experimented a lot and would work on personal projects even if they were imperfect. Because of this perfection problem, I have avoided blogging, which I was very much passionate about, for quite some time. Recently, I have come across a [comment](http://antirez.com/news/135?ref=narendravardi.com#comment-5383725883) by [antitez](http://antirez.com/latest/0?ref=narendravardi.com) (original author of [Redis](https://en.wikipedia.org/wiki/Redis?ref=narendravardi.com)), which gave me some clarity on how to approach blogging. > I don't re-read a lot of times my blog posts, because otherwise if this would turn into a lot of work, I could decide to don't blog. I just make sure they are somewhat readable. After reading this comment, one takeaway for me was to be write articles *that are somewhat readable.* This is how I solved the perfection problem: ##### Workflow to reduce the perfection while blogging: 1. Finalise the topic. 2. Write an initial version of the draft. (It can be two lines) 3. Schedule the post to auto-publish at a future date. (Mostly with a two weeks buffer time) 4. Read and make edits and enhancements. 5. Let the post get published. I believe, this workflow works because I have a hard deadline to finish the article. --- *Enjoyed this post? If so, you might like to subscribe to the weekly email newsletter that I send out every Wednesday.* [Subscribe](https://www.narendravardi.com/#/portal/signup/free) *Click the above button to subscribe :)* --- ### Most under-rated Skill to become a Good Programmer URL: https://www.narendravardi.com/underrated-skill/ Last updated: 2022-06-22T02:29:59.000Z Recently, a first year undergrad student reached out to me asking if there is any advice I can give, that would help them to become a good programmer. Giving advice to first year undergrad student is difficult. They need to explore the college, identify their passions, understand what they like and what they dislike. Besides, they need to enjoy their college life! :) So, I didn't want to give them any advice that could be a bad influence. I slept over the weekend on that question and I'm back with some advice. Before I talk about that advice, let's take a look at the "Hello World!" programs in five different programming languages. 💡 In this article, understanding the code is not required. **HelloWorld.java** ``` // Langugage: Java // File: HelloWorld.java import java.io.*; class HelloWorld { public static void main(String args[]) { System.out.println("Hello World!"); } } ``` **hello.rs** ``` // Langugage: Rust // File: hello.rs fn main() { println!("Hello World!"); } ``` **hello\_world.py** ``` # Langugage: Python # File: hello_world.py def main(): print("Hello World!") if __name__ == "__main__": main() ``` **hello\_world.rkt** ``` #| Langugage: Racket File: hello_world.rkt |# #lang racket/base (print "Hello, World!) ``` **hello\_world.html** ```
Hello World ``` Did you notice that every example mentioned above requires the need to understand and most importantly, *type* [special characters](https://www.computerhope.com/jargon/s/specchar.htm?ref=narendravardi.com) ? Unlike other professions, programming requires you to type special characters as if they are Alphabets and Numbers. Take any programming language, this holds true. Hence, my advice to anyone who is interested in becoming a programmer is to learn the most under-rated skill of a programmer which is the ability to type faster. You don't have to type like [Ali Abdaal, who types 156 words per minute](https://www.youtube.com/watch?v=1ArVtCQqQRE&ref=narendravardi.com). You can type 50 words per minute comfortably and that is good enough, in my opinion. If you can type without looking at the keyboard almost 90% percent of the time and still reach 40+ words in a minute, with subtle mistakes every now and then, then you can consider that you are good at typing. As you code more and more, you will eventually get great at it. For people who do not know how to type, my advice might feel discouraging. Don't be. You can become a programmer too, but it takes lot more time and practice. What I would rather suggest is to invest far less time in visiting a Typing Institute and master how to type. If that doesn't excite you, [at least get your basics correct.](https://www.typing.academy/10-finger-typing?ref=narendravardi.com#:~:text=The%20basic%20concept%20of%20fast,are%20on%20the%20space%20bar.) --- *Enjoyed this post? If so, you might like to subscribe to the weekly email newsletter that I send out every Wednesday.* [Subscribe](https://www.narendravardi.com/#/portal/signup/free) *Click the above button to subscribe :)* --- ### Goa trip with college friends URL: https://www.narendravardi.com/goa-trip/ Last updated: 2022-09-26T06:43:31.000Z *Context*: Every college group will have a favourite destination that they want to visit as a group. For my friends group, it is Goa. Ironically, we haven't visited it as a group, yet. --- Enjoyed this post? If so, you might like to subscribe to the weekly email newsletter that I send out every Wednesday. [Subscribe](https://www.narendravardi.com/#/portal/signup/free) Click the above button to subscribe :) --- ### The forgotten Smart Watch company: Pebble URL: https://www.narendravardi.com/pebble-watch/ Last updated: 2022-06-08T02:29:59.000Z Back in 2015 or 2016, I, along with my college friends attended Hackathons. Hackathons were picking up pace and since we were about to graduate, it made perfect sense for us to attend these Hackathons from a learning point of view. Besides, they also provided Pizza and RedBull which were very attractive. So, we loved to attend Hackathons. In one of the Hackathons, there were three themes that we could build upon. I don't recall all the three, but one of them indeed attracted me. We had to build apps for a watch called 'Pebble'. This company was quite famous in the smartwatch market at that time. The opportunity to work on such an incredible and new technology felt magical. My excitement lasted only for a few minutes. We couldn't pursue it due to the lack of Pebble Watch and the Hackathon organisers didn't provide one (or they were pretty limited). We solved a different problem during that Hackathon but were unsuccessful in coming up with a functional prototype. We didn’t do our presentation, left food and drinks at the venue and came out feeling like losers. I felt even more disappointed because we couldn't work on the Pebble watch. I thought of getting a Pebble watch and building applications for it but since there were a lot of changes happening in my life, like leaving college, joining an internship etc., I got busy and that thought slipped my mind. Over time, I completely forgot about the company. Fast forward to this year, almost six years later, in April 2022, I learnt that company is no more. Founder of Pebble, [Eric Migicovsky](https://twitter.com/ericmigi?ref=narendravardi.com), wrote an insightful blog post on the [Success and Failure at Pebble](https://medium.com/@ericmigi/why-pebble-failed-d7be937c6232?ref=narendravardi.com). That's sad to know. On the other hand, I am also glad that Eric is working on a new product called [Beeper](https://t.co/pIS7Zf1ZLF?ref=narendravardi.com). On a high level, this looks something like [WUPHF.com](https://en.wikipedia.org/wiki/WUPHF.com?ref=narendravardi.com), which Ryan had built in [The Office TV series](https://en.wikipedia.org/wiki/The%5FOffice%5F%28American%5FTV%5Fseries%29?ref=narendravardi.com). It was really fun project for [Ryan](https://en.wikipedia.org/wiki/Ryan%5FHoward%5F%28The%5FOffice%29?ref=narendravardi.com) but the project fails in the series. Can Eric bootstrap this product successfully? Given his experience with Pebble, I hope so. Only time can answer this question. --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Use HTML version of Gmail to quickly lookup OTPs URL: https://www.narendravardi.com/html-gmail/ Last updated: 2022-06-09T10:17:39.000Z These days, many websites (One such example is [medium.com](https://medium.com/?ref=narendravardi.com)) ask the user to provide OTP sent to their email address or SMS to log in to their website. Looking up the OTP from SMS is pretty convenient. But if you want to read OTP from Gmail, it is not. Reading from the Gmail app is good, but the web app will be *loading* for a good few seconds, on a laptop, thanks to various integrations like Google Chats, Google meet, Google Calendar and Google Tasks. These integrations are beneficial while collaborating, but it's an overkill for looking up an OTP. ### Here's the solution *Use the HTML version of Gmail* to look up OTPs quickly. The HTML version of Gmail doesn't have integrations and hence loads at lightening speed. Here's how you can open the HTML version of Gmail. Just bookmark this link: [https://mail.google.com/mail/u/0/?ui=html](https://mail.google.com/mail/u/0/?ui=html&ref=narendravardi.com) **Note:** If you have logged into multiple Gmail accounts on your browser, then you can change the number after `/u/` in the link above. See below for examples. \[0\] = [https://mail.google.com/mail/u/0/?ui=html](https://mail.google.com/mail/u/0/?ui=html&ref=narendravardi.com) \[1\] = [https://mail.google.com/mail/u/1/?ui=html](https://mail.google.com/mail/u/0/?ui=html&ref=narendravardi.com) \[2\] = [https://mail.google.com/mail/u/2/?ui=html](https://mail.google.com/mail/u/0/?ui=html&ref=narendravardi.com) --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Learnings from two years of Work From Home URL: https://www.narendravardi.com/wfh-learnings/ Last updated: 2022-06-09T06:02:11.000Z As more and more companies are inviting the employees back to the office, I felt it would be worthwhile to note down the things that helped me while working remotely. I'll keep this brief and to the point. **Things that made a huge difference:** 1. Having a dedicated room for working, namely *the working room* and *avoiding* sleeping in the working room. 2. Identifying and fixing the *echo problem* in the working room. 3. Using very good to *great ergonomics* while using laptops all day long. 4. *Blocking* an hour or two for physical activity and following the exact timelines across days. 5. *Tracking* the time spent doing office work almost *everyday*. I know this is a laborious process, but it has helped me understand if I was working overtime or less time. 6. *Intentionally* put off checking work-related apps during the free time. 7. Creating *slight friction* for opening office devices. 8. Using the [BlockSite extension](https://blocksite.co/?ref=narendravardi.com) and scheduling it to turn on during office times. 9. Maintaining secondary Wi-Fi in case of power cuts. **Things I have invested in but wasn't mandatory** 1. Earphones or headphones with a *great* mic. **Things I didn't do but would have helped** 1. Having a friend who is also working fully remote in the next room. (co-working space would have been a great thing). 2. Hiring professionals to transform the working room with boring walls into a creative space. 3. Professional lighting setup as YouTubers have. With these learnings well documented, I'm sure I'll be able to move back to complete WFH setup if a need arises! :) --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Why I chose a boring domain name URL: https://www.narendravardi.com/boring-domain/ Last updated: 2022-06-01T07:31:17.000Z In order to spin up this website, I had to make various decisions. One among such decisions is deciding the domain name. In this article, I’m going to provide insights into why I choose *[narendravardi.com](https://www.narendravardi.com/)* but not any of the following domain names: ``` nvri.com navi.com vnri.com narendravardi.me codingseagull.com ChoosingDomainNameIsHard.com StopTheEndlessPursuit.com ``` ## Existing patterns in domain names: The first thing I did before finalising my domain name was to do some research and understand the blogs which I already follow. As I analysed more and more blogs (though not many), I have come to the conclusion that most of the domain names of the blogs which I followed can be categorised into one of three of the following categories. 1. No PII Domain Name. 2. Semi-PII Domain Name and 3. PII Domain Name. Some of you might be wondering what I mean by PII. PII is a term which I heard for the first time when I was working at Flipkart. Overtime I learnt that it’s a common word used in the software industry, which stands for Personal Identifiable Information (PII). As per [Investopedia](https://www.investopedia.com/terms/p/personally-identifiable-information-pii.asp?ref=narendravardi.com), PII is the information that, when used alone or with other relevant data, can identify an individual. In this article, when I say, PII, I refer to the information that can identify the owner of the blog. Most often, it is the name of the author. Now that I’ve clarified what PII stands for, let’s jump into understanding different types of domain names. 💡 In this article, when I say, PII, I refer to the information that can identify the owner of the blog. Most often, it is the name of the author. ### No PII Domain Name: A *No PII Domain Name* doesn’t contain any information that reveals the details of the author. Author details are completely anonymous. Finalising the domain name requires a lot of work or ironically few seconds (though this is rare). These kinds of domain names feel creative and cool. Eg: [codinghorror.com](https://www.codinghorror.com/?ref=narendravardi.com) **Pros:** - Cool and creative - Communicates to readers of the blog on what to expect from the website. - Quite famous among the hacker communities. **Cons:** - A lot of time needs to be invested in order to come up with a cool and creative name that makes sense. - Creative domains are already taken which creates friction even after coming up with a clever and creative name. - There are also high chances of violating copyright policies because a different company might be registered with the selected domain name but didn’t purchase the domain. ### Semi PII Domain Name: These kinds of blogs provide some insights about the author of the blog but do not identify the author. These names are creative as well. **Eg:** [jvns.ca](https://www.jvns.ca/?ref=narendravardi.com) , [joelonsoftware.com](https://www.joelonsoftware.com/?ref=narendravardi.com) From the examples above, we see two different types of domain names. - [jvns.ca](https://www.jvns.ca/?ref=narendravardi.com) has a short form representation of the author's full name - [joelonsoftware.com](https://www.joelonsoftware.com/?ref=narendravardi.com) contains the purpose/theme of the blog coupled with the first or last name of the author. **Pros:** - These are domain names which look personalised as well as professional. - Deemed to be creative. **Cons:** - Lot of effort needs to be put in this also in order to come up with a good domain name. - Theme/Purpose of the blog is hard to finalise early, especially for folks who have no blogging experience. ### PII Domain Name: As you would have already guessed, these are domain names which clearly identify the author. This is one of the easier ways to come up with a domain name. Because of its ease, we see a lot of such websites. As they are common (though unique), these kinds of domain names are often considered boring. Eg: [paulgraham.com](https://www.paulgraham.com/?ref=narendravardi.com) **Pros:** - One of the major advantages of using this kind of domain name is its ease of naming. If someone is interested in coming up with a blog, this is straightforward. - Professional looking. - If the author puts in great work in their blog, they might even build their name as a brand. **Cons:** - One of the major cons, in my opinion, is the lack of creativity in the domain name. It’s not shiny enough for most of the people to look into. These domain names does not attract new audiences. - Exposing PII in the domain name feels like a bad thing from the privacy stand point. But since there are profiles already on social media, the name feels like it’s far from PII. --- ## Now, why I choose boring Domain name? For this to understand, you have to understand why I didn’t choose others. ### Why I didn't choose No PII Domain Name: I didn’t want to invest a lot of time coming up with a name. My primary goal for maintaining a blog is to share my knowledge and ideas on the blog. At the start, I didn’t want to invest time to come up with creative names for my blog. 1. A lot of creative domains are already taken which created a lot of friction even after coming up with clever and creative names. I’ve come up with like 25 creative domain names and most of them were taken or were quite lengthy. ### Why I didn't choose Semi PII Domain Name: 1. I didn’t want to restrict my blog to just talk about programming, though that would be the majority content of this blog. Because of this reason, I didn’t want to finalise on a theme/purpose for the blog. 2. Short form of my full names was something I wanted to explore but didn’t proceed since I haven’t used short names in my life till now. Since I could not go ahead with *No PII* or *Semi PII* approaches, I chose the last best option, which is to use the *PII approach*. --- ## Finally, why choose a `.com` extension? I don’t have a strong reason here. Most of the blogs I follow used a `.com` extension and hence I thought of using the same extension. --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Please improve the UI/UX of the delete account page URL: https://www.narendravardi.com/delete-account/ Last updated: 2022-05-18T16:59:09.000Z Recently, I learnt that I owned two [Medium](https://www.medium.com/?ref=narendravardi.com) accounts. #### Medium account usernames 1. [@narendravardi](https://medium.com/@narendravardi?ref=narendravardi.com) 2. [@nvblog](https://medium.com/@nvblog?ref=narendravardi.com) I haven't used *Medium* for quite some time, so having two accounts didn't make much sense. I thought of deleting the second account, whose username is @nvblog. As per *Medium*, the following are the steps required for [deleting an account](https://help.medium.com/hc/en-us/articles/115004914748-Delete-or-deactivate-your-account?ref=narendravardi.com) on Desktop: > 1. On your homepage, click on your profile picture in the top-right corner and click Settings. > 2. Click Delete account at the bottom of the page. > 3. Confirm the action by entering your **username**. Now, take a look at the 3rd point of the instructions above, > Confirm the action by entering your '**username**'. I logged into the @nvblog account and clicked on **Delete Account**. Here's the screenshot of the pop-up that I received. ![](https://storage.ghost.io/c/d9/fa/d9faef57-e1a8-4faa-a907-40713e9d52a6/content/images/2022/05/Screenshot-2022-05-08-130616-1.png) Confirm account deletion pop-up on *medium* Did you notice the *yellow* highlighted section in the image? > To confirm deletion, type **“delete”** below: Did you notice 'username' in the image above? **No.** From the instructions, it looks like the *Medium* team knows better UI/UX behavior, yet they chose not to build such experience. Humans tend to multi-task and there is a lot of room for manual errors while deleting an account. A good example is clearly narrated in the [stardust article ](https://httpie.io/blog/stardust?ref=narendravardi.com)by [Jakub Roztočil](https://twitter.com/jakubroztocil?ref=narendravardi.com) (Though this is about making the repo private). Jakub might need a lot of work to re-gain the 54k stars they have lost because of a single manual error. If *Github* had provided a good UI/UX, as suggested by Jakub in the article, manual error could have been prevented. Platforms should clearly clarify which account the user is being deleted. It's important for the user to know if they are deleting *the* account or deleting *an* account. Hopefully, this gets fixed by the *Medium* team. --- Enjoyed this post? Receive new blog posts directly to your inbox. [Click to subscribe :)](https://www.narendravardi.com/#/portal/signup/free) --- ### Inside the mind of a Java Programmer while writing C++ code URL: https://www.narendravardi.com/java-cpp/ Last updated: 2022-09-26T06:44:37.000Z ### Context: For a year now, I have been writing C++. In the previous two months, I merged several Pull Requests, yet I feel there's something wrong with my code. > C++ is hiding power, *magic and unpredictability* under its sleeve. I accept that it's a dangerous combination! :) --- Enjoyed this post? If so, you might like to subscribe to my weekly email newsletter every Wednesday. [Subscribe](https://www.narendravardi.com/#/portal/signup/free) Click the above button to subscribe :) --- ### What did you like about this book? URL: https://www.narendravardi.com/bad-book/ Last updated: 2022-06-01T07:34:33.000Z When I was studying in the first year of my undergrad studies, one of the frequent suggestions I received was to read ['The C Programming Language (K&R)'](https://en.wikipedia.org/wiki/The%5FC%5FProgramming%5FLanguage?ref=narendravardi.com) book by the creators of the C programming language, [Brian Kernighan](https://en.wikipedia.org/wiki/Brian%5FKernighan?ref=narendravardi.com) and [Dennis Richie](https://en.wikipedia.org/wiki/Dennis%5FRitchie?ref=narendravardi.com). It was not just famous among the seniors and my mentors. It was famous even online. It stood in 4th place among [the single most influential book every programmer should read](https://stackoverflow.com/questions/1711/what-is-the-single-most-influential-book-every-programmer-should-read?ref=narendravardi.com). It was also one of the books that I could find very easily in my college library. Because of all these reasons, it was natural for a student like me, who knew nothing about programming to pick it. I borrowed the book from the library, came to my room and started reading it. After reading for five minutes, I was confused. I looked at the book's cover page to ensure that I didn't borrow a foreign language book because that's how it made me feel. I could not understand even small things. After confirming that I was holding the correct book, I realised the bitterness of my situation and still chose to continue. [![The C Programming Language, First Edition Cover](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/The_C_Programming_Language%2C_First_Edition_Cover.svg/256px-The_C_Programming_Language%2C_First_Edition_Cover.svg.png)](https://commons.wikimedia.org/wiki/File:The%5FC%5FProgramming%5FLanguage,%5FFirst%5FEdition%5FCover.svg?ref=narendravardi.com "Julesmazur, Public domain, via Wikimedia Commons") Cover Page of K&R, first edition. Things fell apart when I came to Section 1.2 of the book. This section had the Fahrenheit to Celsius conversion code. After reading that code, I felt I had made a terrible mistake by choosing *Information Technology* as my branch of my studies. The code was intimidating, and that scared me to an extent. I was horrified looking at the naming convention of the variables. That's such a high standard, no way I would make it. Immediately, I started to make alternative plans to spend the next four years getting a job in a different stream. This activity, however, was futile. So after some time, I gave up and went out for a walk, hoping it was too early to finalise anything (or maybe I didn't have many options left). Thankfully for me, things changed over time. I read various other books and thus I didn't had to choose an alternative plan. Overtime, Ilearned thatK&R was not a beginner-friendly book. I wondered how people could recommend that book. Did they even read it? I do not know, but I can bet most of them did not. Maybe next time, if someone recommends a book, I will ask them. "What did you like about this book?" At least with this question, I can find out if the recommendation is genuine. --- *Enjoyed this post? If so, you might like to subscribe to the weekly email newsletter that I send out every Wednesday.* [Subscribe](https://www.narendravardi.com/#/portal/signup/free) *Click the above button to subscribe :)* --- ### Log4J Vulnerability URL: https://www.narendravardi.com/log4j-vulnerability/ Last updated: 2022-09-26T06:45:33.000Z ***Context:*** Log4Shell was a zero-day vulnerability in Log4j, a popular Java logging framework, involving arbitrary code execution. The vulnerability has existed unnoticed since 2013 and was privately disclosed to the Apache Software Foundation, of which Log4j is a project, by Chen Zhaojun of Alibaba Cloud's security team on 24 November 2021, and was publicly disclosed on 9 December 2021\. Apache gave Log4Shell a **CVSS severity rating of 10, the highest available score.** The exploit is simple to execute and is estimated to affect hundreds of millions of devices. More at [Log4Shell Wikipedia Page](https://en.wikipedia.org/wiki/Log4Shell?ref=narendravardi.com).