Posts

Principles and Tactics for Working with Language Models (like ChatGPT)

Image
Recently I went through https://learn.deeplearning.ai/, and below is my notes I optimised using chatGPT API :) Introduction: Language models like ChatGPT have become increasingly powerful and versatile tools for various applications. To maximize their effectiveness, it's crucial to understand and implement certain principles and tactics. In this blog post, we will explore the key strategies for working with language models to achieve better results. We will also discuss their limitations and offer best practices for prompting, as well as explore exciting use cases and applications. Principle 1: Clear and Specific Instructions When interacting with a language model, clarity is paramount. To obtain accurate and relevant results, follow these guidelines: Provide longer prompts: Detailed prompts offer better context and understanding to the model. Use delimiters: Separate different sections of input...

Mocking with Spring

Hi folks, Been diving deep into Spring Testing lately, and today I'm sharing my learnings about mocking in Spring. I've noticed many developers struggle with this, so let's break it down in a simple way. What is Mocking? Mocking is our way of creating objects that simulate the behaviour of real objects during testing. Rather brilliant, eh? When testing complex systems, we don't want to call actual databases or external services - that's where mocking comes in handy. A typical Spring test setup with mocking involves two main components: Mockito - the brilliant mocking framework that Spring plays nicely with Spring Test context - Spring's testing support that lets us write integration tests Terminology: What is @Mock? @Mock creates a mock implementation for the interfaces or classes. It's like having a stunt double for you...

My learnings from remote work for 2 years

As I reflect on two years of remote work, I had many challenges and turned out it gave me many perks too. Here are the key takeaways that have shaped my perspective: Building Strong Connections: Remote work demands a deliberate effort in making one-on-one relationships. in absence of casual office interactions, I always tries to have casual chats(Slack/MSteams) with my team members Strategic Meeting Approach: We had team members from different time zones, so we had to move some of our meetings to times to suit everyone - like we had our daily standup in 2.30 PM in my local time Clear and Concise Communication: Mastering the art of concise written communication is paramount. “Communicate well, communicate often” - is a saying my CEO repeats a lot which helped me to over communicate. Over-communication becomes a guiding principle in remote work. Providing comprehensive updates, regular check-ins, and seeking clarifications foster collaboration a...

Learn more about GPT or AI

Hey everyone! Have you been hearing the whispers? The buzz? About something called "AI" or "GPT"? If you haven't, you need to pay attention, because it feels like something really, really big is happening right now with computers and writing. Just a few months ago, in late 2019, folks were talking about a new kind of computer program called "GPT-2". And wow, what it can do is kinda mind-blowing! I was reading some super cool blogs and articles, and they were all showing off how this GPT-2 could *write*! Like, real sentences, real paragraphs. It wasn't perfect, but it was so much better than anything we've seen before. One blog I saw, from Bitvore, showed how it could make up news stories. Can you imagine a computer writing news? Another amazing one was "The Illustrated GPT-2" by Jay Alammar. He showed pictures to help explain how this "Transformer" brain works. It made me feel like I could almost unde...

Deploying Spring Boot application to Google Cloud App Engine

Image
If you have worked with AWS and GCP, you should have understood that AWS' Elastic Beanstalk and Google's App Engine(GAE) enable deploying our applications without the need to understand how to build or scale the underlying infrastructure. Their promise is great, and for most use cases as there are no servers to maintain. We simply upload our applications and they are ready to go. If everything works as promised Beanstalk or the Google App engine will take care of scaling, load balancing, traffic splitting, logging, versioning, roll out and roll backs, and security scanning etc. Pretty simple , ah? Today I am going to share simple steps to deploy your first Spring boot (with Java and Maven)  application to  Google Cloud App Engine. So let's create s simple create a Spring Boot Java API on Google App Engine. I asume you have set up Google Cloud SDK in your local. (https://cloud.google.com/sdk/gcloud). Alternatively you can use Cloud Shell. $ gcloud auth list $ ...

com.google.appengine vs com.google.cloud.tools appengine-maven-plugin

I was working on a Spring boot application which I needed to deploy in Google Cloud Appengine, in the same time one of my colleague made a pull request for a similar code. Then I noticed that we two have used 2 different Maven plugins from Google appengine with same artifactId. they are: <plugin> <groupId> com.google.appengine</groupId> <artifactId> appengine-maven-plugin</artifactId> <version> 1.9.64</version> </plugin> and <plugin> <groupId> com.google.cloud.tools</groupId> <artifactId> appengine-maven-plugin</artifactId> <version> 1.3.2</version> </plugin> at the time of writing followings are the 2 articles I could find in Googledocs for 2 plugins  https://cloud.google.com/appengine/docs/standard/java/tools/maven  https://cloud.google.com/appengine/docs/standard/java/tools/using-maven  So as the name suggests they are "App Engine SDK-based" and "...

My Docker learning short notes

I had this note from long time in my Evernotes, I thought I should have post it here, so someone might find it useful. This is just Docker basics and commonly used commands that I've collected over time. Why Docker? Docker enables containerization - running applications in containers instead of virtual machines. Important notes: Containers are not VMs - they have different benefits Provides standardization across environments Enables continuous deployment from development to production Ensures consistency using the same container image throughout the deployment process Key Benefits: Self-contained environments Isolated from other applications Runs almost everywhere (especially in the Cloud) Small and lightweight Highly scalable Fast deployment Core Concepts Images An image is an executable package containing everything needed to run an application: ...